* [PATCH 0/2] net/hns3: add FDIR VLAN match mode runtime config @ 2023-06-26 12:43 Dongdong Liu 2023-06-26 12:43 ` [PATCH 1/2] net/hns3: delete duplicate macro definition Dongdong Liu ` (3 more replies) 0 siblings, 4 replies; 17+ messages in thread From: Dongdong Liu @ 2023-06-26 12:43 UTC (permalink / raw) To: dev, ferruh.yigit, thomas, andrew.rybchenko; +Cc: stable, lihuisong This patchset contains two patches: The first one is to delete duplicate macro definition for hns3. The second one is to add FDIR VLAN match mode runtime config for hns3. Huisong Li (2): net/hns3: delete duplicate macro definition net/hns3: add FDIR VLAN match mode runtime config doc/guides/nics/hns3.rst | 20 +++++++++++++++++++ drivers/net/hns3/hns3_common.c | 35 ++++++++++++++++++++++++++++++++++ drivers/net/hns3/hns3_common.h | 2 ++ drivers/net/hns3/hns3_ethdev.h | 7 ------- drivers/net/hns3/hns3_fdir.c | 10 +++++++--- drivers/net/hns3/hns3_fdir.h | 8 ++++++++ 6 files changed, 72 insertions(+), 10 deletions(-) -- 2.22.0 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/2] net/hns3: delete duplicate macro definition 2023-06-26 12:43 [PATCH 0/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu @ 2023-06-26 12:43 ` Dongdong Liu 2023-06-26 12:43 ` [PATCH 2/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu ` (2 subsequent siblings) 3 siblings, 0 replies; 17+ messages in thread From: Dongdong Liu @ 2023-06-26 12:43 UTC (permalink / raw) To: dev, ferruh.yigit, thomas, andrew.rybchenko; +Cc: stable, lihuisong From: Huisong Li <lihuisong@huawei.com> This patch delete some duplicate macro definitions. Fixes: a4c7152d0581 ("net/hns3: extract common code to its own file") Cc: stable@dpdk.org Signed-off-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- drivers/net/hns3/hns3_ethdev.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index c58094d87b..c85a6912ad 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -873,13 +873,6 @@ struct hns3_adapter { struct hns3_ptype_table ptype_tbl __rte_cache_aligned; }; -#define HNS3_DEVARG_RX_FUNC_HINT "rx_func_hint" -#define HNS3_DEVARG_TX_FUNC_HINT "tx_func_hint" - -#define HNS3_DEVARG_DEV_CAPS_MASK "dev_caps_mask" - -#define HNS3_DEVARG_MBX_TIME_LIMIT_MS "mbx_time_limit_ms" - enum hns3_dev_cap { HNS3_DEV_SUPPORT_DCB_B, HNS3_DEV_SUPPORT_COPPER_B, -- 2.22.0 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 2/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-26 12:43 [PATCH 0/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu 2023-06-26 12:43 ` [PATCH 1/2] net/hns3: delete duplicate macro definition Dongdong Liu @ 2023-06-26 12:43 ` Dongdong Liu 2023-06-27 7:11 ` [PATCH v2 0/2] " Dongdong Liu 2023-06-29 13:21 ` [PATCH v3 " Dongdong Liu 3 siblings, 0 replies; 17+ messages in thread From: Dongdong Liu @ 2023-06-26 12:43 UTC (permalink / raw) To: dev, ferruh.yigit, thomas, andrew.rybchenko; +Cc: stable, lihuisong From: Huisong Li <lihuisong@huawei.com> The VLAN number in FDIR meta data is used to enable that hardware bases on VLAN number to strictly match the input flow. And it is enabled by default. For the following two rules: rule0: pattern: eth type is 0x0806 actions: queue index 3 rule1: pattern: eth type is 0x0806 / vlan vid is 20 actions: queue index 4 If enable VLAN number, only the ARP packets with VLAN 20 are directed to queue 4, and the ARP packets with other VLAN ID cannot be directed to the specified queue. If app want to all ARP (VLAN or no VLAN) packets to be directed to the specified queue, app has to set many rules for VLAN packet. In this case, if driver doesn't enable VLAN number, app just need to set one rule (rule0). So this patch adds a "fdir_vlan_match_mode" runtime config which only can be 'strict' or 'nostrict'. And driver still uses 'strict' mode as the default mode. Please select 'nostrict' mode if you request all same ethertype packets with and without VLAN to a specified queue. Signed-off-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- doc/guides/nics/hns3.rst | 20 +++++++++++++++++++ drivers/net/hns3/hns3_common.c | 35 ++++++++++++++++++++++++++++++++++ drivers/net/hns3/hns3_common.h | 2 ++ drivers/net/hns3/hns3_fdir.c | 10 +++++++--- drivers/net/hns3/hns3_fdir.h | 8 ++++++++ 5 files changed, 72 insertions(+), 3 deletions(-) diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst index 5373ec5a8f..af7265ae51 100644 --- a/doc/guides/nics/hns3.rst +++ b/doc/guides/nics/hns3.rst @@ -140,6 +140,26 @@ Runtime Configuration For example:: -a 0000:7d:00.0,mbx_time_limit_ms=600 +- ``fdir_vlan_match_mode`` (default `strict`) + Used to select VLAN match mode. This runtime config can be `strict` + or `nostrict` and is only valid for PF drives. + If driver works on `strict` mode (default mode), hardware does strictly + match the input flow base on VLAN number. + For the following scenarios with two rules: + rule0: + pattern: eth type is 0x0806 + actions: queue index 3 + rule1: + pattern: eth type is 0x0806 / vlan vid is 20 + actions: queue index 4 + If application select `strict` mode, only the ARP packets with VLAN + 20 are directed to queue 4, and the ARP packets with other VLAN ID + cannot be directed to the specified queue. If application want to all + ARP packets with or without VLAN to be directed to the specified queue, + application can select `nostrict` mode and just need to set rule0. + + For example:: + -a 0000:7d:00.0,fdir_vlan_match_mode=nostrict Driver compilation and testing ------------------------------ diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c index f077ef5057..a11ea686fd 100644 --- a/drivers/net/hns3/hns3_common.c +++ b/drivers/net/hns3/hns3_common.c @@ -238,6 +238,34 @@ hns3_parse_mbx_time_limit(const char *key, const char *value, void *extra_args) return 0; } +static int +hns3_parse_vlan_match_mode(const char *key, const char *value, void *args) +{ + uint8_t mode; + + RTE_SET_USED(key); + + if (value == NULL) { + PMD_INIT_LOG(WARNING, "no value for key:\"%s\"", key); + return -1; + } + + if (strcmp(value, "strict") == 0) { + mode = HNS3_FDIR_VLAN_STRICT_MATCH; + } else if (strcmp(value, "nostrict") == 0) { + mode = HNS3_FDIR_VLAN_NOSTRICT_MATCH; + } else { + PMD_INIT_LOG(WARNING, "invalid value:\"%s\" for key:\"%s\", " + "value must be 'strict' or 'nostrict'", + value, key); + return -1; + } + + *(uint8_t *)args = mode; + + return 0; +} + void hns3_parse_devargs(struct rte_eth_dev *dev) { @@ -254,6 +282,8 @@ hns3_parse_devargs(struct rte_eth_dev *dev) hns->tx_func_hint = HNS3_IO_FUNC_HINT_NONE; hns->dev_caps_mask = 0; hns->mbx_time_limit_ms = HNS3_MBX_DEF_TIME_LIMIT_MS; + if (!hns->is_vf) + hns->pf.fdir.vlan_match_mode = HNS3_FDIR_VLAN_STRICT_MATCH; if (dev->device->devargs == NULL) return; @@ -270,6 +300,11 @@ hns3_parse_devargs(struct rte_eth_dev *dev) &hns3_parse_dev_caps_mask, &dev_caps_mask); (void)rte_kvargs_process(kvlist, HNS3_DEVARG_MBX_TIME_LIMIT_MS, &hns3_parse_mbx_time_limit, &mbx_time_limit_ms); + if (!hns->is_vf) + (void)rte_kvargs_process(kvlist, + HNS3_DEVARG_FDIR_VALN_MATCH_MODE, + &hns3_parse_vlan_match_mode, + &hns->pf.fdir.vlan_match_mode); rte_kvargs_free(kvlist); diff --git a/drivers/net/hns3/hns3_common.h b/drivers/net/hns3/hns3_common.h index 8eaeda26e7..cf9593bd0c 100644 --- a/drivers/net/hns3/hns3_common.h +++ b/drivers/net/hns3/hns3_common.h @@ -27,6 +27,8 @@ enum { #define HNS3_DEVARG_MBX_TIME_LIMIT_MS "mbx_time_limit_ms" +#define HNS3_DEVARG_FDIR_VALN_MATCH_MODE "fdir_vlan_match_mode" + #define MSEC_PER_SEC 1000L #define USEC_PER_MSEC 1000L diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c index 48a91fb517..c80fa59e63 100644 --- a/drivers/net/hns3/hns3_fdir.c +++ b/drivers/net/hns3/hns3_fdir.c @@ -355,9 +355,13 @@ int hns3_init_fd_config(struct hns3_adapter *hns) /* roce_type is used to filter roce frames * dst_vport is used to specify the rule */ - key_cfg->meta_data_active = BIT(DST_VPORT) | BIT(TUNNEL_PACKET) | - BIT(VLAN_NUMBER); - hns3_dbg(hw, "fdir meta data: dst_vport tunnel_packet vlan_number"); + key_cfg->meta_data_active = BIT(DST_VPORT) | BIT(TUNNEL_PACKET); + if (pf->fdir.vlan_match_mode) + key_cfg->meta_data_active |= BIT(VLAN_NUMBER); + + hns3_dbg(hw, "fdir meta data: dst_vport tunnel_packet %s", + (pf->fdir.vlan_match_mode == HNS3_FDIR_VLAN_STRICT_MATCH) ? + "vlan_number" : ""); ret = hns3_get_fd_allocation(hw, &pf->fdir.fd_cfg.rule_num[HNS3_FD_STAGE_1], diff --git a/drivers/net/hns3/hns3_fdir.h b/drivers/net/hns3/hns3_fdir.h index ce70a534dc..308cfbe56f 100644 --- a/drivers/net/hns3/hns3_fdir.h +++ b/drivers/net/hns3/hns3_fdir.h @@ -170,6 +170,13 @@ struct hns3_fdir_rule_ele { TAILQ_HEAD(hns3_fdir_rule_list, hns3_fdir_rule_ele); +/* + * On 'strict' mode, hardware bases on VLAN number to exactly match the + * input flow. + */ +#define HNS3_FDIR_VLAN_STRICT_MATCH 1 +#define HNS3_FDIR_VLAN_NOSTRICT_MATCH 0 + /* * A structure used to define fields of a FDIR related info. */ @@ -178,6 +185,7 @@ struct hns3_fdir_info { struct hns3_fdir_rule_ele **hash_map; struct rte_hash *hash_handle; struct hns3_fd_cfg fd_cfg; + uint8_t vlan_match_mode; }; struct hns3_adapter; -- 2.22.0 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 0/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-26 12:43 [PATCH 0/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu 2023-06-26 12:43 ` [PATCH 1/2] net/hns3: delete duplicate macro definition Dongdong Liu 2023-06-26 12:43 ` [PATCH 2/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu @ 2023-06-27 7:11 ` Dongdong Liu 2023-06-27 7:11 ` [PATCH v2 1/2] net/hns3: delete duplicate macro definition Dongdong Liu ` (2 more replies) 2023-06-29 13:21 ` [PATCH v3 " Dongdong Liu 3 siblings, 3 replies; 17+ messages in thread From: Dongdong Liu @ 2023-06-27 7:11 UTC (permalink / raw) To: dev, ferruh.yigit, thomas, andrew.rybchenko; +Cc: stable, lihuisong This patchset contains two patches: The first one is to delete duplicate macro definition for hns3. The second one is to add FDIR VLAN match mode runtime config for hns3 v1->v2: - Fix the hns3.rst doc build warining. Huisong Li (2): net/hns3: delete duplicate macro definition net/hns3: add FDIR VLAN match mode runtime config doc/guides/nics/hns3.rst | 26 +++++++++++++++++++++++++ drivers/net/hns3/hns3_common.c | 35 ++++++++++++++++++++++++++++++++++ drivers/net/hns3/hns3_common.h | 2 ++ drivers/net/hns3/hns3_ethdev.h | 7 ------- drivers/net/hns3/hns3_fdir.c | 10 +++++++--- drivers/net/hns3/hns3_fdir.h | 8 ++++++++ 6 files changed, 78 insertions(+), 10 deletions(-) -- 2.22.0 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 1/2] net/hns3: delete duplicate macro definition 2023-06-27 7:11 ` [PATCH v2 0/2] " Dongdong Liu @ 2023-06-27 7:11 ` Dongdong Liu 2023-06-27 7:11 ` [PATCH v2 2/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu 2023-06-27 12:00 ` [PATCH v2 0/2] " Ferruh Yigit 2 siblings, 0 replies; 17+ messages in thread From: Dongdong Liu @ 2023-06-27 7:11 UTC (permalink / raw) To: dev, ferruh.yigit, thomas, andrew.rybchenko; +Cc: stable, lihuisong From: Huisong Li <lihuisong@huawei.com> This patch delete some duplicate macro definitions. Fixes: a4c7152d0581 ("net/hns3: extract common code to its own file") Cc: stable@dpdk.org Signed-off-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- drivers/net/hns3/hns3_ethdev.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index c58094d87b..c85a6912ad 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -873,13 +873,6 @@ struct hns3_adapter { struct hns3_ptype_table ptype_tbl __rte_cache_aligned; }; -#define HNS3_DEVARG_RX_FUNC_HINT "rx_func_hint" -#define HNS3_DEVARG_TX_FUNC_HINT "tx_func_hint" - -#define HNS3_DEVARG_DEV_CAPS_MASK "dev_caps_mask" - -#define HNS3_DEVARG_MBX_TIME_LIMIT_MS "mbx_time_limit_ms" - enum hns3_dev_cap { HNS3_DEV_SUPPORT_DCB_B, HNS3_DEV_SUPPORT_COPPER_B, -- 2.22.0 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 2/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-27 7:11 ` [PATCH v2 0/2] " Dongdong Liu 2023-06-27 7:11 ` [PATCH v2 1/2] net/hns3: delete duplicate macro definition Dongdong Liu @ 2023-06-27 7:11 ` Dongdong Liu 2023-06-27 23:12 ` Thomas Monjalon 2023-06-27 12:00 ` [PATCH v2 0/2] " Ferruh Yigit 2 siblings, 1 reply; 17+ messages in thread From: Dongdong Liu @ 2023-06-27 7:11 UTC (permalink / raw) To: dev, ferruh.yigit, thomas, andrew.rybchenko; +Cc: stable, lihuisong From: Huisong Li <lihuisong@huawei.com> The VLAN number in FDIR meta data is used to enable that hardware bases on VLAN number to strictly match the input flow. And it is enabled by default. For the following two rules: rule0: pattern: eth type is 0x0806 actions: queue index 3 rule1: pattern: eth type is 0x0806 / vlan vid is 20 actions: queue index 4 If enable VLAN number, only the ARP packets with VLAN 20 are directed to queue 4, and the ARP packets with other VLAN ID cannot be directed to the specified queue. If app want to all ARP (VLAN or no VLAN) packets to be directed to the specified queue, app has to set many rules for VLAN packet. In this case, if driver doesn't enable VLAN number, app just need to set one rule (rule0). So this patch adds a "fdir_vlan_match_mode" runtime config which only can be 'strict' or 'nostrict'. And driver still uses 'strict' mode as the default mode. Please select 'nostrict' mode if you request all same ethertype packets with and without VLAN to a specified queue. Signed-off-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- doc/guides/nics/hns3.rst | 26 +++++++++++++++++++++++++ drivers/net/hns3/hns3_common.c | 35 ++++++++++++++++++++++++++++++++++ drivers/net/hns3/hns3_common.h | 2 ++ drivers/net/hns3/hns3_fdir.c | 10 +++++++--- drivers/net/hns3/hns3_fdir.h | 8 ++++++++ 5 files changed, 78 insertions(+), 3 deletions(-) diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst index 5373ec5a8f..0d546f0a05 100644 --- a/doc/guides/nics/hns3.rst +++ b/doc/guides/nics/hns3.rst @@ -140,6 +140,32 @@ Runtime Configuration For example:: -a 0000:7d:00.0,mbx_time_limit_ms=600 +- ``fdir_vlan_match_mode`` (default `strict`) + + Used to select VLAN match mode. This runtime config can be `strict` + or `nostrict` and is only valid for PF drives. + If driver works on `strict` mode (default mode), hardware does strictly + match the input flow base on VLAN number. + + For the following scenarios with two rules: + + .. code-block:: console + + rule0: + pattern: eth type is 0x0806 + actions: queue index 3 + rule1: + pattern: eth type is 0x0806 / vlan vid is 20 + actions: queue index 4 + + If application select `strict` mode, only the ARP packets with VLAN + 20 are directed to queue 4, and the ARP packets with other VLAN ID + cannot be directed to the specified queue. If application want to all + ARP packets with or without VLAN to be directed to the specified queue, + application can select `nostrict` mode and just need to set rule0. + + For example:: + -a 0000:7d:00.0,fdir_vlan_match_mode=nostrict Driver compilation and testing ------------------------------ diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c index f077ef5057..a11ea686fd 100644 --- a/drivers/net/hns3/hns3_common.c +++ b/drivers/net/hns3/hns3_common.c @@ -238,6 +238,34 @@ hns3_parse_mbx_time_limit(const char *key, const char *value, void *extra_args) return 0; } +static int +hns3_parse_vlan_match_mode(const char *key, const char *value, void *args) +{ + uint8_t mode; + + RTE_SET_USED(key); + + if (value == NULL) { + PMD_INIT_LOG(WARNING, "no value for key:\"%s\"", key); + return -1; + } + + if (strcmp(value, "strict") == 0) { + mode = HNS3_FDIR_VLAN_STRICT_MATCH; + } else if (strcmp(value, "nostrict") == 0) { + mode = HNS3_FDIR_VLAN_NOSTRICT_MATCH; + } else { + PMD_INIT_LOG(WARNING, "invalid value:\"%s\" for key:\"%s\", " + "value must be 'strict' or 'nostrict'", + value, key); + return -1; + } + + *(uint8_t *)args = mode; + + return 0; +} + void hns3_parse_devargs(struct rte_eth_dev *dev) { @@ -254,6 +282,8 @@ hns3_parse_devargs(struct rte_eth_dev *dev) hns->tx_func_hint = HNS3_IO_FUNC_HINT_NONE; hns->dev_caps_mask = 0; hns->mbx_time_limit_ms = HNS3_MBX_DEF_TIME_LIMIT_MS; + if (!hns->is_vf) + hns->pf.fdir.vlan_match_mode = HNS3_FDIR_VLAN_STRICT_MATCH; if (dev->device->devargs == NULL) return; @@ -270,6 +300,11 @@ hns3_parse_devargs(struct rte_eth_dev *dev) &hns3_parse_dev_caps_mask, &dev_caps_mask); (void)rte_kvargs_process(kvlist, HNS3_DEVARG_MBX_TIME_LIMIT_MS, &hns3_parse_mbx_time_limit, &mbx_time_limit_ms); + if (!hns->is_vf) + (void)rte_kvargs_process(kvlist, + HNS3_DEVARG_FDIR_VALN_MATCH_MODE, + &hns3_parse_vlan_match_mode, + &hns->pf.fdir.vlan_match_mode); rte_kvargs_free(kvlist); diff --git a/drivers/net/hns3/hns3_common.h b/drivers/net/hns3/hns3_common.h index 8eaeda26e7..cf9593bd0c 100644 --- a/drivers/net/hns3/hns3_common.h +++ b/drivers/net/hns3/hns3_common.h @@ -27,6 +27,8 @@ enum { #define HNS3_DEVARG_MBX_TIME_LIMIT_MS "mbx_time_limit_ms" +#define HNS3_DEVARG_FDIR_VALN_MATCH_MODE "fdir_vlan_match_mode" + #define MSEC_PER_SEC 1000L #define USEC_PER_MSEC 1000L diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c index 48a91fb517..c80fa59e63 100644 --- a/drivers/net/hns3/hns3_fdir.c +++ b/drivers/net/hns3/hns3_fdir.c @@ -355,9 +355,13 @@ int hns3_init_fd_config(struct hns3_adapter *hns) /* roce_type is used to filter roce frames * dst_vport is used to specify the rule */ - key_cfg->meta_data_active = BIT(DST_VPORT) | BIT(TUNNEL_PACKET) | - BIT(VLAN_NUMBER); - hns3_dbg(hw, "fdir meta data: dst_vport tunnel_packet vlan_number"); + key_cfg->meta_data_active = BIT(DST_VPORT) | BIT(TUNNEL_PACKET); + if (pf->fdir.vlan_match_mode) + key_cfg->meta_data_active |= BIT(VLAN_NUMBER); + + hns3_dbg(hw, "fdir meta data: dst_vport tunnel_packet %s", + (pf->fdir.vlan_match_mode == HNS3_FDIR_VLAN_STRICT_MATCH) ? + "vlan_number" : ""); ret = hns3_get_fd_allocation(hw, &pf->fdir.fd_cfg.rule_num[HNS3_FD_STAGE_1], diff --git a/drivers/net/hns3/hns3_fdir.h b/drivers/net/hns3/hns3_fdir.h index ce70a534dc..308cfbe56f 100644 --- a/drivers/net/hns3/hns3_fdir.h +++ b/drivers/net/hns3/hns3_fdir.h @@ -170,6 +170,13 @@ struct hns3_fdir_rule_ele { TAILQ_HEAD(hns3_fdir_rule_list, hns3_fdir_rule_ele); +/* + * On 'strict' mode, hardware bases on VLAN number to exactly match the + * input flow. + */ +#define HNS3_FDIR_VLAN_STRICT_MATCH 1 +#define HNS3_FDIR_VLAN_NOSTRICT_MATCH 0 + /* * A structure used to define fields of a FDIR related info. */ @@ -178,6 +185,7 @@ struct hns3_fdir_info { struct hns3_fdir_rule_ele **hash_map; struct rte_hash *hash_handle; struct hns3_fd_cfg fd_cfg; + uint8_t vlan_match_mode; }; struct hns3_adapter; -- 2.22.0 ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 2/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-27 7:11 ` [PATCH v2 2/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu @ 2023-06-27 23:12 ` Thomas Monjalon 2023-06-28 2:59 ` Dongdong Liu 0 siblings, 1 reply; 17+ messages in thread From: Thomas Monjalon @ 2023-06-27 23:12 UTC (permalink / raw) To: ferruh.yigit, lihuisong, Dongdong Liu; +Cc: dev, andrew.rybchenko 27/06/2023 09:11, Dongdong Liu: > +- ``fdir_vlan_match_mode`` (default `strict`) > + > + Used to select VLAN match mode. This runtime config can be `strict` > + or `nostrict` and is only valid for PF drives. drives? Do you mean devices? > + If driver works on `strict` mode (default mode), hardware does strictly > + match the input flow base on VLAN number. > + > + For the following scenarios with two rules: > + > + .. code-block:: console > + > + rule0: > + pattern: eth type is 0x0806 > + actions: queue index 3 > + rule1: > + pattern: eth type is 0x0806 / vlan vid is 20 > + actions: queue index 4 > + > + If application select `strict` mode, only the ARP packets with VLAN > + 20 are directed to queue 4, and the ARP packets with other VLAN ID > + cannot be directed to the specified queue. If application want to all > + ARP packets with or without VLAN to be directed to the specified queue, > + application can select `nostrict` mode and just need to set rule0. As it is done in the rest of the document, you should use double backquotes for values of the devargs. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 2/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-27 23:12 ` Thomas Monjalon @ 2023-06-28 2:59 ` Dongdong Liu 2023-06-29 11:08 ` Ferruh Yigit 0 siblings, 1 reply; 17+ messages in thread From: Dongdong Liu @ 2023-06-28 2:59 UTC (permalink / raw) To: Thomas Monjalon, ferruh.yigit, lihuisong; +Cc: dev, andrew.rybchenko Hi Thomas Many thanks for your review. On 2023/6/28 7:12, Thomas Monjalon wrote: > 27/06/2023 09:11, Dongdong Liu: >> +- ``fdir_vlan_match_mode`` (default `strict`) >> + >> + Used to select VLAN match mode. This runtime config can be `strict` >> + or `nostrict` and is only valid for PF drives. > > drives? Do you mean devices? for PF devices, will fix. > >> + If driver works on `strict` mode (default mode), hardware does strictly >> + match the input flow base on VLAN number. >> + >> + For the following scenarios with two rules: >> + >> + .. code-block:: console >> + >> + rule0: >> + pattern: eth type is 0x0806 >> + actions: queue index 3 >> + rule1: >> + pattern: eth type is 0x0806 / vlan vid is 20 >> + actions: queue index 4 >> + >> + If application select `strict` mode, only the ARP packets with VLAN >> + 20 are directed to queue 4, and the ARP packets with other VLAN ID >> + cannot be directed to the specified queue. If application want to all >> + ARP packets with or without VLAN to be directed to the specified queue, >> + application can select `nostrict` mode and just need to set rule0. > > As it is done in the rest of the document, you should use double backquotes > for values of the devargs. Good point, will fix. Thanks, Dongdong. > > > > . > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 2/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-28 2:59 ` Dongdong Liu @ 2023-06-29 11:08 ` Ferruh Yigit 2023-06-29 13:51 ` Dongdong Liu 0 siblings, 1 reply; 17+ messages in thread From: Ferruh Yigit @ 2023-06-29 11:08 UTC (permalink / raw) To: Dongdong Liu, Thomas Monjalon, lihuisong; +Cc: dev, andrew.rybchenko On 6/28/2023 3:59 AM, Dongdong Liu wrote: > Hi Thomas > > Many thanks for your review. > > On 2023/6/28 7:12, Thomas Monjalon wrote: >> 27/06/2023 09:11, Dongdong Liu: >>> +- ``fdir_vlan_match_mode`` (default `strict`) >>> + >>> + Used to select VLAN match mode. This runtime config can be `strict` >>> + or `nostrict` and is only valid for PF drives. >> >> drives? Do you mean devices? > for PF devices, will fix. >> >>> + If driver works on `strict` mode (default mode), hardware does >>> strictly >>> + match the input flow base on VLAN number. >>> + >>> + For the following scenarios with two rules: >>> + >>> + .. code-block:: console >>> + >>> + rule0: >>> + pattern: eth type is 0x0806 >>> + actions: queue index 3 >>> + rule1: >>> + pattern: eth type is 0x0806 / vlan vid is 20 >>> + actions: queue index 4 >>> + >>> + If application select `strict` mode, only the ARP packets with VLAN >>> + 20 are directed to queue 4, and the ARP packets with other VLAN ID >>> + cannot be directed to the specified queue. If application want to all >>> + ARP packets with or without VLAN to be directed to the specified >>> queue, >>> + application can select `nostrict` mode and just need to set rule0. >> >> As it is done in the rest of the document, you should use double >> backquotes >> for values of the devargs. > Good point, will fix. > I dropped set from next-net, please send a new version with fix. Updating patchwork status as "Change Requested". ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 2/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-29 11:08 ` Ferruh Yigit @ 2023-06-29 13:51 ` Dongdong Liu 0 siblings, 0 replies; 17+ messages in thread From: Dongdong Liu @ 2023-06-29 13:51 UTC (permalink / raw) To: Ferruh Yigit, Thomas Monjalon, lihuisong; +Cc: dev, andrew.rybchenko On 2023/6/29 19:08, Ferruh Yigit wrote: > On 6/28/2023 3:59 AM, Dongdong Liu wrote: >> Hi Thomas >> >> Many thanks for your review. >> >> On 2023/6/28 7:12, Thomas Monjalon wrote: >>> 27/06/2023 09:11, Dongdong Liu: >>>> +- ``fdir_vlan_match_mode`` (default `strict`) >>>> + >>>> + Used to select VLAN match mode. This runtime config can be `strict` >>>> + or `nostrict` and is only valid for PF drives. >>> >>> drives? Do you mean devices? >> for PF devices, will fix. >>> >>>> + If driver works on `strict` mode (default mode), hardware does >>>> strictly >>>> + match the input flow base on VLAN number. >>>> + >>>> + For the following scenarios with two rules: >>>> + >>>> + .. code-block:: console >>>> + >>>> + rule0: >>>> + pattern: eth type is 0x0806 >>>> + actions: queue index 3 >>>> + rule1: >>>> + pattern: eth type is 0x0806 / vlan vid is 20 >>>> + actions: queue index 4 >>>> + >>>> + If application select `strict` mode, only the ARP packets with VLAN >>>> + 20 are directed to queue 4, and the ARP packets with other VLAN ID >>>> + cannot be directed to the specified queue. If application want to all >>>> + ARP packets with or without VLAN to be directed to the specified >>>> queue, >>>> + application can select `nostrict` mode and just need to set rule0. >>> >>> As it is done in the rest of the document, you should use double >>> backquotes >>> for values of the devargs. >> Good point, will fix. >> > > I dropped set from next-net, please send a new version with fix. > Updating patchwork status as "Change Requested". PATCH V3 has been sent out, thanks for doing this. Thanks, Dongdong. > > . > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 0/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-27 7:11 ` [PATCH v2 0/2] " Dongdong Liu 2023-06-27 7:11 ` [PATCH v2 1/2] net/hns3: delete duplicate macro definition Dongdong Liu 2023-06-27 7:11 ` [PATCH v2 2/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu @ 2023-06-27 12:00 ` Ferruh Yigit 2 siblings, 0 replies; 17+ messages in thread From: Ferruh Yigit @ 2023-06-27 12:00 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, andrew.rybchenko; +Cc: stable, lihuisong On 6/27/2023 8:11 AM, Dongdong Liu wrote: > This patchset contains two patches: > The first one is to delete duplicate macro definition for hns3. > The second one is to add FDIR VLAN match mode runtime config for hns3 > > v1->v2: > - Fix the hns3.rst doc build warining. > > Huisong Li (2): > net/hns3: delete duplicate macro definition > net/hns3: add FDIR VLAN match mode runtime config > Series applied to dpdk-next-net/main, thanks. ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 0/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-26 12:43 [PATCH 0/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu ` (2 preceding siblings ...) 2023-06-27 7:11 ` [PATCH v2 0/2] " Dongdong Liu @ 2023-06-29 13:21 ` Dongdong Liu 2023-06-29 13:21 ` [PATCH v3 1/2] net/hns3: delete duplicate macro definition Dongdong Liu ` (2 more replies) 3 siblings, 3 replies; 17+ messages in thread From: Dongdong Liu @ 2023-06-29 13:21 UTC (permalink / raw) To: dev, ferruh.yigit, thomas, andrew.rybchenko; +Cc: stable, lihuisong This patchset contains two patches: The first one is to delete duplicate macro definition for hns3. The second one is to add FDIR VLAN match mode runtime config for hns3 v2->v3: - Use double backquotes for values of the devargs and fix spelling errors. v1->v2: - Fix the hns3.rst doc build warining. Huisong Li (2): net/hns3: delete duplicate macro definition net/hns3: add FDIR VLAN match mode runtime config doc/guides/nics/hns3.rst | 26 +++++++++++++++++++++++++ drivers/net/hns3/hns3_common.c | 35 ++++++++++++++++++++++++++++++++++ drivers/net/hns3/hns3_common.h | 2 ++ drivers/net/hns3/hns3_ethdev.h | 7 ------- drivers/net/hns3/hns3_fdir.c | 10 +++++++--- drivers/net/hns3/hns3_fdir.h | 8 ++++++++ 6 files changed, 78 insertions(+), 10 deletions(-) -- 2.22.0 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 1/2] net/hns3: delete duplicate macro definition 2023-06-29 13:21 ` [PATCH v3 " Dongdong Liu @ 2023-06-29 13:21 ` Dongdong Liu 2023-06-29 13:21 ` [PATCH v3 2/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu 2023-06-29 15:53 ` [PATCH v3 0/2] " Ferruh Yigit 2 siblings, 0 replies; 17+ messages in thread From: Dongdong Liu @ 2023-06-29 13:21 UTC (permalink / raw) To: dev, ferruh.yigit, thomas, andrew.rybchenko; +Cc: stable, lihuisong From: Huisong Li <lihuisong@huawei.com> This patch delete some duplicate macro definitions. Fixes: a4c7152d0581 ("net/hns3: extract common code to its own file") Cc: stable@dpdk.org Signed-off-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- drivers/net/hns3/hns3_ethdev.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index c58094d87b..c85a6912ad 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -873,13 +873,6 @@ struct hns3_adapter { struct hns3_ptype_table ptype_tbl __rte_cache_aligned; }; -#define HNS3_DEVARG_RX_FUNC_HINT "rx_func_hint" -#define HNS3_DEVARG_TX_FUNC_HINT "tx_func_hint" - -#define HNS3_DEVARG_DEV_CAPS_MASK "dev_caps_mask" - -#define HNS3_DEVARG_MBX_TIME_LIMIT_MS "mbx_time_limit_ms" - enum hns3_dev_cap { HNS3_DEV_SUPPORT_DCB_B, HNS3_DEV_SUPPORT_COPPER_B, -- 2.22.0 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 2/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-29 13:21 ` [PATCH v3 " Dongdong Liu 2023-06-29 13:21 ` [PATCH v3 1/2] net/hns3: delete duplicate macro definition Dongdong Liu @ 2023-06-29 13:21 ` Dongdong Liu 2023-06-29 15:52 ` Ferruh Yigit 2023-06-29 15:53 ` [PATCH v3 0/2] " Ferruh Yigit 2 siblings, 1 reply; 17+ messages in thread From: Dongdong Liu @ 2023-06-29 13:21 UTC (permalink / raw) To: dev, ferruh.yigit, thomas, andrew.rybchenko; +Cc: stable, lihuisong From: Huisong Li <lihuisong@huawei.com> The VLAN number in FDIR meta data is used to enable that hardware bases on VLAN number to strictly match the input flow. And it is enabled by default. For the following two rules: rule0: pattern: eth type is 0x0806 actions: queue index 3 rule1: pattern: eth type is 0x0806 / vlan vid is 20 actions: queue index 4 If enable VLAN number, only the ARP packets with VLAN 20 are directed to queue 4, and the ARP packets with other VLAN ID cannot be directed to the specified queue. If app want to all ARP (VLAN or no VLAN) packets to be directed to the specified queue, app has to set many rules for VLAN packet. In this case, if driver doesn't enable VLAN number, app just need to set one rule (rule0). So this patch adds a "fdir_vlan_match_mode" runtime config which only can be 'strict' or 'nostrict'. And driver still uses 'strict' mode as the default mode. Please select 'nostrict' mode if you request all same ethertype packets with and without VLAN to a specified queue. Signed-off-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- doc/guides/nics/hns3.rst | 26 +++++++++++++++++++++++++ drivers/net/hns3/hns3_common.c | 35 ++++++++++++++++++++++++++++++++++ drivers/net/hns3/hns3_common.h | 2 ++ drivers/net/hns3/hns3_fdir.c | 10 +++++++--- drivers/net/hns3/hns3_fdir.h | 8 ++++++++ 5 files changed, 78 insertions(+), 3 deletions(-) diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst index 5373ec5a8f..001ccbdb62 100644 --- a/doc/guides/nics/hns3.rst +++ b/doc/guides/nics/hns3.rst @@ -140,6 +140,32 @@ Runtime Configuration For example:: -a 0000:7d:00.0,mbx_time_limit_ms=600 +- ``fdir_vlan_match_mode`` (default ``strict``) + + Used to select VLAN match mode. This runtime config can be ``strict`` + or ``nostrict`` and is only valid for PF devices. + If driver works on ``strict`` mode (default mode), hardware does strictly + match the input flow base on VLAN number. + + For the following scenarios with two rules: + + .. code-block:: console + + rule0: + pattern: eth type is 0x0806 + actions: queue index 3 + rule1: + pattern: eth type is 0x0806 / vlan vid is 20 + actions: queue index 4 + + If application select ``strict`` mode, only the ARP packets with VLAN + 20 are directed to queue 4, and the ARP packets with other VLAN ID + cannot be directed to the specified queue. If application want to all + ARP packets with or without VLAN to be directed to the specified queue, + application can select ``nostrict`` mode and just need to set rule0. + + For example:: + -a 0000:7d:00.0,fdir_vlan_match_mode=nostrict Driver compilation and testing ------------------------------ diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c index f077ef5057..a11ea686fd 100644 --- a/drivers/net/hns3/hns3_common.c +++ b/drivers/net/hns3/hns3_common.c @@ -238,6 +238,34 @@ hns3_parse_mbx_time_limit(const char *key, const char *value, void *extra_args) return 0; } +static int +hns3_parse_vlan_match_mode(const char *key, const char *value, void *args) +{ + uint8_t mode; + + RTE_SET_USED(key); + + if (value == NULL) { + PMD_INIT_LOG(WARNING, "no value for key:\"%s\"", key); + return -1; + } + + if (strcmp(value, "strict") == 0) { + mode = HNS3_FDIR_VLAN_STRICT_MATCH; + } else if (strcmp(value, "nostrict") == 0) { + mode = HNS3_FDIR_VLAN_NOSTRICT_MATCH; + } else { + PMD_INIT_LOG(WARNING, "invalid value:\"%s\" for key:\"%s\", " + "value must be 'strict' or 'nostrict'", + value, key); + return -1; + } + + *(uint8_t *)args = mode; + + return 0; +} + void hns3_parse_devargs(struct rte_eth_dev *dev) { @@ -254,6 +282,8 @@ hns3_parse_devargs(struct rte_eth_dev *dev) hns->tx_func_hint = HNS3_IO_FUNC_HINT_NONE; hns->dev_caps_mask = 0; hns->mbx_time_limit_ms = HNS3_MBX_DEF_TIME_LIMIT_MS; + if (!hns->is_vf) + hns->pf.fdir.vlan_match_mode = HNS3_FDIR_VLAN_STRICT_MATCH; if (dev->device->devargs == NULL) return; @@ -270,6 +300,11 @@ hns3_parse_devargs(struct rte_eth_dev *dev) &hns3_parse_dev_caps_mask, &dev_caps_mask); (void)rte_kvargs_process(kvlist, HNS3_DEVARG_MBX_TIME_LIMIT_MS, &hns3_parse_mbx_time_limit, &mbx_time_limit_ms); + if (!hns->is_vf) + (void)rte_kvargs_process(kvlist, + HNS3_DEVARG_FDIR_VALN_MATCH_MODE, + &hns3_parse_vlan_match_mode, + &hns->pf.fdir.vlan_match_mode); rte_kvargs_free(kvlist); diff --git a/drivers/net/hns3/hns3_common.h b/drivers/net/hns3/hns3_common.h index 8eaeda26e7..cf9593bd0c 100644 --- a/drivers/net/hns3/hns3_common.h +++ b/drivers/net/hns3/hns3_common.h @@ -27,6 +27,8 @@ enum { #define HNS3_DEVARG_MBX_TIME_LIMIT_MS "mbx_time_limit_ms" +#define HNS3_DEVARG_FDIR_VALN_MATCH_MODE "fdir_vlan_match_mode" + #define MSEC_PER_SEC 1000L #define USEC_PER_MSEC 1000L diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c index 48a91fb517..c80fa59e63 100644 --- a/drivers/net/hns3/hns3_fdir.c +++ b/drivers/net/hns3/hns3_fdir.c @@ -355,9 +355,13 @@ int hns3_init_fd_config(struct hns3_adapter *hns) /* roce_type is used to filter roce frames * dst_vport is used to specify the rule */ - key_cfg->meta_data_active = BIT(DST_VPORT) | BIT(TUNNEL_PACKET) | - BIT(VLAN_NUMBER); - hns3_dbg(hw, "fdir meta data: dst_vport tunnel_packet vlan_number"); + key_cfg->meta_data_active = BIT(DST_VPORT) | BIT(TUNNEL_PACKET); + if (pf->fdir.vlan_match_mode) + key_cfg->meta_data_active |= BIT(VLAN_NUMBER); + + hns3_dbg(hw, "fdir meta data: dst_vport tunnel_packet %s", + (pf->fdir.vlan_match_mode == HNS3_FDIR_VLAN_STRICT_MATCH) ? + "vlan_number" : ""); ret = hns3_get_fd_allocation(hw, &pf->fdir.fd_cfg.rule_num[HNS3_FD_STAGE_1], diff --git a/drivers/net/hns3/hns3_fdir.h b/drivers/net/hns3/hns3_fdir.h index ce70a534dc..308cfbe56f 100644 --- a/drivers/net/hns3/hns3_fdir.h +++ b/drivers/net/hns3/hns3_fdir.h @@ -170,6 +170,13 @@ struct hns3_fdir_rule_ele { TAILQ_HEAD(hns3_fdir_rule_list, hns3_fdir_rule_ele); +/* + * On 'strict' mode, hardware bases on VLAN number to exactly match the + * input flow. + */ +#define HNS3_FDIR_VLAN_STRICT_MATCH 1 +#define HNS3_FDIR_VLAN_NOSTRICT_MATCH 0 + /* * A structure used to define fields of a FDIR related info. */ @@ -178,6 +185,7 @@ struct hns3_fdir_info { struct hns3_fdir_rule_ele **hash_map; struct rte_hash *hash_handle; struct hns3_fd_cfg fd_cfg; + uint8_t vlan_match_mode; }; struct hns3_adapter; -- 2.22.0 ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 2/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-29 13:21 ` [PATCH v3 2/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu @ 2023-06-29 15:52 ` Ferruh Yigit 2023-06-30 1:05 ` Dongdong Liu 0 siblings, 1 reply; 17+ messages in thread From: Ferruh Yigit @ 2023-06-29 15:52 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, andrew.rybchenko; +Cc: stable, lihuisong On 6/29/2023 2:21 PM, Dongdong Liu wrote: > diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst > index 5373ec5a8f..001ccbdb62 100644 > --- a/doc/guides/nics/hns3.rst > +++ b/doc/guides/nics/hns3.rst > @@ -140,6 +140,32 @@ Runtime Configuration > For example:: > -a 0000:7d:00.0,mbx_time_limit_ms=600 > > +- ``fdir_vlan_match_mode`` (default ``strict``) > + > + Used to select VLAN match mode. This runtime config can be ``strict`` > + or ``nostrict`` and is only valid for PF devices. > + If driver works on ``strict`` mode (default mode), hardware does strictly > + match the input flow base on VLAN number. > + > + For the following scenarios with two rules: > + > + .. code-block:: console > + > + rule0: > + pattern: eth type is 0x0806 > + actions: queue index 3 > + rule1: > + pattern: eth type is 0x0806 / vlan vid is 20 > + actions: queue index 4 > + > + If application select ``strict`` mode, only the ARP packets with VLAN > + 20 are directed to queue 4, and the ARP packets with other VLAN ID > + cannot be directed to the specified queue. If application want to all > + ARP packets with or without VLAN to be directed to the specified queue, > + application can select ``nostrict`` mode and just need to set rule0. > + > + For example:: > + -a 0000:7d:00.0,fdir_vlan_match_mode=nostrict> '::' doesn't provide pre-formatted text without an empty line after it, I will fix this while merging, but other device argument documentations have same problem, can you please send a patch to fix it? ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 2/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-29 15:52 ` Ferruh Yigit @ 2023-06-30 1:05 ` Dongdong Liu 0 siblings, 0 replies; 17+ messages in thread From: Dongdong Liu @ 2023-06-30 1:05 UTC (permalink / raw) To: Ferruh Yigit, dev, thomas, andrew.rybchenko; +Cc: stable, lihuisong Hi Ferruh On 2023/6/29 23:52, Ferruh Yigit wrote: > On 6/29/2023 2:21 PM, Dongdong Liu wrote: >> diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst >> index 5373ec5a8f..001ccbdb62 100644 >> --- a/doc/guides/nics/hns3.rst >> +++ b/doc/guides/nics/hns3.rst >> @@ -140,6 +140,32 @@ Runtime Configuration >> For example:: >> -a 0000:7d:00.0,mbx_time_limit_ms=600 >> >> +- ``fdir_vlan_match_mode`` (default ``strict``) >> + >> + Used to select VLAN match mode. This runtime config can be ``strict`` >> + or ``nostrict`` and is only valid for PF devices. >> + If driver works on ``strict`` mode (default mode), hardware does strictly >> + match the input flow base on VLAN number. >> + >> + For the following scenarios with two rules: >> + >> + .. code-block:: console >> + >> + rule0: >> + pattern: eth type is 0x0806 >> + actions: queue index 3 >> + rule1: >> + pattern: eth type is 0x0806 / vlan vid is 20 >> + actions: queue index 4 >> + >> + If application select ``strict`` mode, only the ARP packets with VLAN >> + 20 are directed to queue 4, and the ARP packets with other VLAN ID >> + cannot be directed to the specified queue. If application want to all >> + ARP packets with or without VLAN to be directed to the specified queue, >> + application can select ``nostrict`` mode and just need to set rule0. >> + >> + For example:: >> + -a 0000:7d:00.0,fdir_vlan_match_mode=nostrict> > > '::' doesn't provide pre-formatted text without an empty line after it, > I will fix this while merging, but other device argument documentations > have same problem, can you please send a patch to fix it? Thanks for pointing this and helping fix it. I will send a patch to fix the remain issue. Thanks, Dongdong. > > . > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 0/2] net/hns3: add FDIR VLAN match mode runtime config 2023-06-29 13:21 ` [PATCH v3 " Dongdong Liu 2023-06-29 13:21 ` [PATCH v3 1/2] net/hns3: delete duplicate macro definition Dongdong Liu 2023-06-29 13:21 ` [PATCH v3 2/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu @ 2023-06-29 15:53 ` Ferruh Yigit 2 siblings, 0 replies; 17+ messages in thread From: Ferruh Yigit @ 2023-06-29 15:53 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, andrew.rybchenko; +Cc: stable, lihuisong On 6/29/2023 2:21 PM, Dongdong Liu wrote: > This patchset contains two patches: > The first one is to delete duplicate macro definition for hns3. > The second one is to add FDIR VLAN match mode runtime config for hns3 > > v2->v3: > - Use double backquotes for values of the devargs and fix spelling errors. > > v1->v2: > - Fix the hns3.rst doc build warining. > > Huisong Li (2): > net/hns3: delete duplicate macro definition > net/hns3: add FDIR VLAN match mode runtime config > Series applied to dpdk-next-net/main, thanks. ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2023-06-30 1:05 UTC | newest] Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-06-26 12:43 [PATCH 0/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu 2023-06-26 12:43 ` [PATCH 1/2] net/hns3: delete duplicate macro definition Dongdong Liu 2023-06-26 12:43 ` [PATCH 2/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu 2023-06-27 7:11 ` [PATCH v2 0/2] " Dongdong Liu 2023-06-27 7:11 ` [PATCH v2 1/2] net/hns3: delete duplicate macro definition Dongdong Liu 2023-06-27 7:11 ` [PATCH v2 2/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu 2023-06-27 23:12 ` Thomas Monjalon 2023-06-28 2:59 ` Dongdong Liu 2023-06-29 11:08 ` Ferruh Yigit 2023-06-29 13:51 ` Dongdong Liu 2023-06-27 12:00 ` [PATCH v2 0/2] " Ferruh Yigit 2023-06-29 13:21 ` [PATCH v3 " Dongdong Liu 2023-06-29 13:21 ` [PATCH v3 1/2] net/hns3: delete duplicate macro definition Dongdong Liu 2023-06-29 13:21 ` [PATCH v3 2/2] net/hns3: add FDIR VLAN match mode runtime config Dongdong Liu 2023-06-29 15:52 ` Ferruh Yigit 2023-06-30 1:05 ` Dongdong Liu 2023-06-29 15:53 ` [PATCH v3 0/2] " Ferruh Yigit
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).