Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions ecosystem/gstreamer_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ In MTL GStreamer plugins there are general arguments that apply to every plugin.
| payload-type | uint | SMPTE ST 2110 payload type. | 0 to G_MAXUINT |
| port | string | Session DPDK device port. If not specified it will be taken from the dev-port argument. | N/A |
| port-red | string | Redundant session DPDK device port if left open taken from dev-port-red argument if specified. | N/A |
| lcore-list | string | Map lcore set to physical cpu set. The argument format is: <lcores[@cpus]>[<,lcores[@cpus]>...] | N/A |

These are also general parameters accepted by plugins, but the functionality they provide to the user is not yet supported in plugins.
| Property Name | Type | Description | Range |
Expand Down
25 changes: 25 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,13 @@ 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_LIST,
g_param_spec_string(
"lcore-list", "dpdk core list",
"List or range of cores to run on for DPDK (e.g., '1,2,3' or '1-3').", 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 +357,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_LIST:
strncpy(general_args->lcore_map, 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 +389,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 +413,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_LIST:
g_value_set_string(value, general_args->lcore_map);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
Expand Down Expand Up @@ -556,6 +575,12 @@ 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_map)) {
mtl_init_params->lcores = general_args->lcore_map;
}

strncpy(mtl_init_params->lcores, "1,3,5,7", MTL_PORT_MAX_LEN);

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_LIST,
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_map[MTL_CORE_LIST_MAX_SIZE];
} GeneralArgs;

typedef struct SessionPortArgs {
Expand Down
5 changes: 5 additions & 0 deletions include/mtl_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ extern "C" {
*/
#define MTL_DMA_DEV_MAX (8)

/**
* Max core list size
*/
#define MTL_CORE_LIST_MAX_SIZE (128)

/**
* Max length of a pcap dump filename
*/
Expand Down
23 changes: 14 additions & 9 deletions lib/src/dev/mt_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,20 +417,25 @@ static int dev_eal_init(struct mtl_init_params* p, struct mt_kport_info* kport_i

/* --main-lcore */
char main_lcore[64];
argv[argc] = "--main-lcore";
argc++;
info("%s, main_lcore: %u\n", __func__, p->main_lcore);
snprintf(main_lcore, sizeof(main_lcore), "%u", p->main_lcore);
argv[argc] = main_lcore;
argc++;
char lcores[MTL_CORE_LIST_MAX_SIZE];

if (p->main_lcore) {
argv[argc] = "--main-lcore";
argc++;
snprintf(main_lcore, sizeof(main_lcore), "%u", p->main_lcore);
argv[argc] = main_lcore;

info("%s, main_lcore: %s\n", __func__, argv[argc]);
argc++;
}

char lcores[128];
if (p->lcores) {
argv[argc] = "-l";
argc++;
info("%s, lcores: %s\n", __func__, p->lcores);
snprintf(lcores, sizeof(lcores), "%u,%s", p->main_lcore, p->lcores);
snprintf(lcores, sizeof(lcores), "%s", p->lcores);
argv[argc] = lcores;

info("%s, lcores: %s\n", __func__, argv[argc]);
argc++;
}

Expand Down
Loading