From: Dana Vardi Date: Wed, 27 Jan 2021 16:09:45 +0000 (+0200) Subject: net/mvpp2: support custom header in config file X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=21aa25e0337c47f40da9b8ecc43bc0045e25c1ce;p=dpdk.git net/mvpp2: support custom header in config file Extend 'start_hdr' options with custom header. Signed-off-by: Dana Vardi Reviewed-by: Liron Himi --- diff --git a/doc/guides/nics/mvpp2.rst b/doc/guides/nics/mvpp2.rst index f72e251969..354a2016c7 100644 --- a/doc/guides/nics/mvpp2.rst +++ b/doc/guides/nics/mvpp2.rst @@ -261,7 +261,7 @@ Where: - ````: DPDK Port number (0..n). -- ````: Indicate what is the start header mode (`none` (eth), `dsa`, or `ext_dsa`). +- ````: Indicate what is the start header mode (`none` (eth), `dsa`, `ext_dsa` or `custom`). - ````: Default traffic class (e.g. 0) diff --git a/drivers/net/mvpp2/mrvl_qos.c b/drivers/net/mvpp2/mrvl_qos.c index e420c0cbc5..9fec3c1566 100644 --- a/drivers/net/mvpp2/mrvl_qos.c +++ b/drivers/net/mvpp2/mrvl_qos.c @@ -23,6 +23,7 @@ #define MRVL_TOK_START_HDR "start_hdr" #define MRVL_TOK_START_HDR_NONE "none" #define MRVL_TOK_START_HDR_DSA "dsa" +#define MRVL_TOK_START_HDR_CUSTOM "custom" #define MRVL_TOK_START_HDR_EXT_DSA "ext_dsa" #define MRVL_TOK_DEFAULT_TC "default_tc" #define MRVL_TOK_DSCP "dscp" @@ -742,6 +743,10 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args) sizeof(MRVL_TOK_START_HDR_DSA))) (*cfg)->port[n].eth_start_hdr = PP2_PPIO_HDR_ETH_DSA; + else if (!strncmp(entry, MRVL_TOK_START_HDR_CUSTOM, + sizeof(MRVL_TOK_START_HDR_CUSTOM))) + (*cfg)->port[n].eth_start_hdr = + PP2_PPIO_HDR_ETH_CUSTOM; else if (!strncmp(entry, MRVL_TOK_START_HDR_EXT_DSA, sizeof(MRVL_TOK_START_HDR_EXT_DSA))) { (*cfg)->port[n].eth_start_hdr =