Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ mtl_system_status_*
*.mp4
*.pcm
*.wav
logs_*

#Generated documentation
doc/_build
Expand Down
22 changes: 22 additions & 0 deletions ecosystem/gstreamer_plugin/gst_mtl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ void gst_mtl_common_init_general_arguments(GObjectClass* gobject_class) {
g_param_spec_boolean("enable-ptp", "Enable onboard PTP",
"Enable onboard PTP client", FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

g_object_class_install_property(
gobject_class, PROP_GENERAL_LCORE_MASK,
g_param_spec_string("lcore-mask", "dpdk core mask",
Copy link
Collaborator

@Sakoram Sakoram Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming this "mask" suggests that it should be used like --lcore-mask 00101 or even with single number like --lcore-mask 20 (representing binary mask as single number), but it should be used like --lcore-list 2,4. Consider renaming it.

"List of cores to run on for dpdk.", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

void gst_mtl_common_set_general_arguments(GObject* object, guint prop_id,
Expand Down Expand Up @@ -350,6 +356,9 @@ void gst_mtl_common_set_general_arguments(GObject* object, guint prop_id,
case PROP_GENERAL_ENABLE_ONBOARD_PTP:
general_args->enable_onboard_ptp = g_value_get_boolean(value);
break;
case PROP_GENERAL_LCORE_MASK:
strncpy(general_args->lcore_mask, g_value_get_string(value), MTL_PORT_MAX_LEN);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
Expand Down Expand Up @@ -379,6 +388,9 @@ void gst_mtl_common_get_general_arguments(GObject* object, guint prop_id,
case PROP_GENERAL_DEV_ARGS_DMA_DEV:
g_value_set_string(value, general_args->dma_dev);
break;
case PROP_GENERAL_SESSION_PORT:
g_value_set_string(value, portArgs->port[MTL_PORT_P]);
break;
case PROP_GENERAL_PORT_IP:
g_value_set_string(value, portArgs->session_ip_string[MTL_PORT_P]);
break;
Expand All @@ -400,6 +412,12 @@ void gst_mtl_common_get_general_arguments(GObject* object, guint prop_id,
case PROP_GENERAL_PORT_TX_QUEUES:
g_value_set_uint(value, general_args->tx_queues_cnt[MTL_PORT_P]);
break;
case PROP_GENERAL_ENABLE_ONBOARD_PTP:
g_value_set_boolean(value, general_args->enable_onboard_ptp);
break;
case PROP_GENERAL_LCORE_MASK:
g_value_set_string(value, general_args->lcore_mask);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
Expand Down Expand Up @@ -556,6 +574,10 @@ gboolean gst_mtl_common_parse_general_arguments(struct mtl_init_params* mtl_init
GST_INFO("Using MTL library's onboard PTP");
}

if (strlen(general_args->lcore_mask)) {
mtl_init_params->lcores = general_args->lcore_mask;
}

while (mtl_port_idx <= MTL_PORT_R && strlen(general_args->port[mtl_port_idx]) != 0) {
strncpy(mtl_init_params->port[mtl_port_idx], general_args->port[mtl_port_idx],
MTL_PORT_MAX_LEN);
Expand Down
2 changes: 2 additions & 0 deletions ecosystem/gstreamer_plugin/gst_mtl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ enum {
PROP_GENERAL_PORT_RX_QUEUES,
PROP_GENERAL_PORT_TX_QUEUES,
PROP_GENERAL_ENABLE_ONBOARD_PTP,
PROP_GENERAL_LCORE_MASK,
PROP_GENERAL_MAX
};

Expand All @@ -64,6 +65,7 @@ typedef struct GeneralArgs {
gchar dma_dev[MTL_PORT_MAX_LEN];
gint log_level;
gboolean enable_onboard_ptp;
gchar lcore_mask[MTL_PORT_MAX_LEN];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we set all the arrays length to MTL_PORT_MAX_LEN? It is very confusing.

} GeneralArgs;

typedef struct SessionPortArgs {
Expand Down