ethdev: remove legacy filter API
cover ethdev: remove legacy filter API
Removal is aggressive and tries to cleanup all dead code from drivers.
tep_termination example still uses TUNNEL filters. Functionality is broken when TUNNEL filter is removed and finally even build of the example is broken when API is removed. What to do with it?
Andrew Rybchenko (14):
ethdev: remove legacy MACVLAN filter type support
ethdev: move MAC filter type to i40e driver
ethdev: remove legacy EtherType filter type support
ethdev: remove legacy flexible filter type support
ethdev: move flexible filter type to e1000 driver
ethdev: remove legacy SYN filter type support
ethdev: remove legacy N-tuple filter type support
ethdev: remove legacy TUNNEL filter type support
ethdev: remove legacy HASH filter type support
ethdev: remove legacy L2_TUNNEL filter type support
ethdev: remove legacy global filter configuration support
ethdev: remove legacy FDIR filter type support app/testpmd: remove flow_director_flex_mask command
ethdev: remove legacy filter API functions
app/test-pmd/cmdline.c | 2823 ++-------------------- app/test-pmd/config.c | 15 +- app/test-pmd/testpmd.h | 2 + doc/guides/rel_notes/deprecation.rst | 7 - doc/guides/rel_notes/release_20_11.rst | 3 + drivers/net/bnxt/bnxt_ethdev.c | 802 ------ drivers/net/dpaa2/dpaa2_ethdev.c | 4 - drivers/net/e1000/e1000_ethdev.h | 22 +- drivers/net/e1000/igb_ethdev.c | 391 +-- drivers/net/e1000/igb_flow.c | 36 +- drivers/net/enic/enic.h | 7 - drivers/net/enic/enic_clsf.c | 168 -- drivers/net/enic/enic_ethdev.c | 48 - drivers/net/hinic/hinic_pmd_ethdev.h | 1 + drivers/net/i40e/i40e_ethdev.c | 828 +------ drivers/net/i40e/i40e_ethdev.h | 26 +- drivers/net/i40e/i40e_fdir.c | 539 ----- drivers/net/i40e/i40e_pf.c | 2 +- drivers/net/i40e/rte_pmd_i40e.c | 30 +- drivers/net/ixgbe/ixgbe_ethdev.c | 305 +-- drivers/net/ixgbe/ixgbe_ethdev.h | 2 - drivers/net/ixgbe/ixgbe_fdir.c | 220 -- drivers/net/mlx5/mlx5.h | 1 - drivers/net/mlx5/mlx5_flow.c | 516 ---- drivers/net/mlx5/mlx5_flow.h | 8 - drivers/net/qede/qede_ethdev.h | 5 - drivers/net/qede/qede_filter.c | 497 ---- drivers/net/sfc/sfc_ethdev.c | 27 - lib/librte_ethdev/rte_eth_ctrl.h | 170 +- lib/librte_ethdev/rte_ethdev.c | 28 - lib/librte_ethdev/rte_ethdev.h | 41 - lib/librte_ethdev/rte_ethdev_driver.h | 33 + lib/librte_ethdev/rte_ethdev_version.map | 2 - 33 files changed, 287 insertions(+), 7322 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/14 ethdev: remove legacy MACVLAN filter type support
RTE flow API should be used for filtering.
--- app/test-pmd/cmdline.c | 110 ------------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/i40e/i40e_ethdev.c | 116 --------------------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 11 --- 6 files changed, 1 insertion(+), 242 deletions(-)
app/test-pmd/cmdline.c +0 -110
@@ -559,11 +559,6 @@ static void cmd_help_long_parsed(void *parsed_result,"set port (port_id) vf (vf_id) rx|tx on|off\n" " Enable/Disable a VF receive/tranmit from a port\n\n" -"set port (port_id) vf (vf_id) (mac_addr)" -" (exact-mac#exact-mac-vlan#hashmac|hashmac-vlan) on|off\n" -" Add/Remove unicast or multicast MAC addr filter" -" for a VF.\n\n" -"set port (port_id) vf (vf_id) rxmode (AUPE|ROPE|BAM" "|MPE) (on|off)\n" " AUPE:accepts untagged VLAN;"
@@ -8757,110 +8752,6 @@ cmdline_parse_inst_t cmd_set_uc_all_hash_filter = { }, }; -/* *** CONFIGURE MACVLAN FILTER FOR VF(s) *** */ -struct cmd_set_vf_macvlan_filter { -cmdline_fixed_string_t set; -cmdline_fixed_string_t port; -portid_t port_id; -cmdline_fixed_string_t vf; -uint8_t vf_id; -struct rte_ether_addr address; -cmdline_fixed_string_t filter_type; -cmdline_fixed_string_t mode; -}; - -static void -cmd_set_vf_macvlan_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -int is_on, ret =0 ; -struct cmd_set_vf_macvlan_filter *res = parsed_result; -struct rte_eth_mac_filter filter; - -memset (&filter,0 ,sizeof (struct rte_eth_mac_filter )); - -rte_memcpy (&filter.mac_addr, &res->address,RTE_ETHER_ADDR_LEN ); - -/* set VF MAC filter */ - filter.is_vf =1 ; - -/* set VF ID */ - filter.dst_id = res->vf_id; - -if (!strcmp (res->filter_type,"exact-mac" )) - filter.filter_type =RTE_MAC_PERFECT_MATCH ; -else if (!strcmp (res->filter_type,"exact-mac-vlan" )) - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; -else if (!strcmp (res->filter_type,"hashmac" )) - filter.filter_type =RTE_MAC_HASH_MATCH ; -else if (!strcmp (res->filter_type,"hashmac-vlan" )) - filter.filter_type =RTE_MACVLAN_HASH_MATCH ; - - is_on = (strcmp (res->mode,"on" ) ==0 ) ?1 :0 ; - -if (is_on) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_MACVLAN , -RTE_ETH_FILTER_ADD , - &filter); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_MACVLAN , -RTE_ETH_FILTER_DELETE , - &filter); - -if (ret <0 ) -printf ("bad set MAC hash parameter, return code = %d\n" , ret); - -} - -cmdline_parse_token_string_t cmd_set_vf_macvlan_set = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - set,"set" ); -cmdline_parse_token_string_t cmd_set_vf_macvlan_port = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - port,"port" ); -cmdline_parse_token_num_t cmd_set_vf_macvlan_portid = - TOKEN_NUM_INITIALIZER(struct cmd_set_vf_macvlan_filter, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_set_vf_macvlan_vf = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - vf,"vf" ); -cmdline_parse_token_num_t cmd_set_vf_macvlan_vf_id = - TOKEN_NUM_INITIALIZER(struct cmd_set_vf_macvlan_filter, - vf_id,UINT8 ); -cmdline_parse_token_etheraddr_t cmd_set_vf_macvlan_mac = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_vf_macvlan_filter, - address); -cmdline_parse_token_string_t cmd_set_vf_macvlan_filter_type = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - filter_type,"exact-mac#exact-mac-vlan" -"#hashmac#hashmac-vlan" ); -cmdline_parse_token_string_t cmd_set_vf_macvlan_mode = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - mode,"on#off" ); - -cmdline_parse_inst_t cmd_set_vf_macvlan_filter = { - .f = cmd_set_vf_macvlan_parsed, - .data =NULL , - .help_str ="set port <port_id> vf <vf_id> <mac_addr> " -"exact-mac|exact-mac-vlan|hashmac|hashmac-vlan on|off: " -"Exact match rule: exact match of MAC or MAC and VLAN; " -"hash match rule: hash match of MAC and exact match of VLAN" , - .tokens = { - (void *)&cmd_set_vf_macvlan_set, - (void *)&cmd_set_vf_macvlan_port, - (void *)&cmd_set_vf_macvlan_portid, - (void *)&cmd_set_vf_macvlan_vf, - (void *)&cmd_set_vf_macvlan_vf_id, - (void *)&cmd_set_vf_macvlan_mac, - (void *)&cmd_set_vf_macvlan_filter_type, - (void *)&cmd_set_vf_macvlan_mode, -NULL , - }, -}; -/* *** CONFIGURE VF TRAFFIC CONTROL *** */ struct cmd_set_vf_traffic {cmdline_fixed_string_t set;
@@ -20041,7 +19932,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_set_uc_hash_filter, (cmdline_parse_inst_t *)&cmd_set_uc_all_hash_filter, (cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter, - (cmdline_parse_inst_t *)&cmd_set_vf_macvlan_filter, (cmdline_parse_inst_t *)&cmd_queue_rate_limit, (cmdline_parse_inst_t *)&cmd_tunnel_filter, (cmdline_parse_inst_t *)&cmd_tunnel_udp_config,
doc/guides/rel_notes/deprecation.rst +1 -1
@@ -108,7 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types MACVLAN, ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, + as filter types ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.
drivers/net/i40e/i40e_ethdev.c +0 -116
128 lines not on this page · raw message
drivers/net/qede/qede_filter.c +0 -1
@@ -1561,7 +1561,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops;return 0 ; -case RTE_ETH_FILTER_MACVLAN :case RTE_ETH_FILTER_ETHERTYPE :case RTE_ETH_FILTER_FLEXIBLE :case RTE_ETH_FILTER_SYN :
drivers/net/sfc/sfc_ethdev.c +0 -3
@@ -1748,9 +1748,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,case RTE_ETH_FILTER_NONE :sfc_err (sa,"Global filters configuration not supported" );break ; -case RTE_ETH_FILTER_MACVLAN : -sfc_err (sa,"MACVLAN filters not supported" ); -break ;case RTE_ETH_FILTER_ETHERTYPE :sfc_err (sa,"EtherType filters not supported" );break ;
lib/librte_ethdev/rte_eth_ctrl.h +0 -11
@@ -27,7 +27,6 @@ extern "C" {*/ enum rte_filter_type {RTE_ETH_FILTER_NONE =0 , -RTE_ETH_FILTER_MACVLAN ,RTE_ETH_FILTER_ETHERTYPE ,RTE_ETH_FILTER_FLEXIBLE ,RTE_ETH_FILTER_SYN ,
@@ -68,16 +67,6 @@ enum rte_mac_filter_type { RTE_MACVLAN_HASH_MATCH, }; -/** -* MAC filter info -*/ -struct rte_eth_mac_filter { -uint8_t is_vf;/**< 1 for VF, 0 for port dev */ -uint16_t dst_id;/**< VF ID, available when is_vf is 1*/ -enum rte_mac_filter_type filter_type;/**< MAC filter type */ -struct rte_ether_addr mac_addr; -}; -/** * Define all structures for Ethertype Filter type. */
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support
Quoted 2 lines · Andrew Rybchenko
RTE flow API should be used for filtering.
- We still have some trace in testpmd documentation.
$ git grep set.port.*vf.*mac doc/guides/testpmd_app_ug/testpmd_funcs.rst: testpmd> set port (port_id) vf (vf_id) (mac_addr) \
- Do we have some documentation describing how to do the same with rte_flow + testpmd?
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support
Quoted 7 lines · David Marchand
Quoted 1 line · Andrew Rybchenko
RTE flow API should be used for filtering.
- We still have some trace in testpmd documentation.
$ git grep set.port.*vf.*mac doc/guides/testpmd_app_ug/testpmd_funcs.rst: testpmd> set port (port_id) vf (vf_id) (mac_addr) \
Thanks a lot for catching it. Will cleanup in v2.
Quoted 2 lines
- Do we have some documentation describing how to do the same with
rte_flow+ testpmd?
I don't think so. I guess just generic rte_flow documentation in testpmd.
Re: [dpdk-dev] [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support
In reply to Andrew RybchenkoQuoted 14 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Guo, Jia <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support
Quoted 1 line
RTE flow API should be used for filtering.
Look like each patch in the patch set remove one specific legacy filter, so I think the removing filter info is need to show in the commit log to make it more clear, please add in the next version.
Quoted 367 lines
Signed-off-by Andrew Rybchenko <[email protected]>--- app/test-pmd/cmdline.c | 110 ------------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/i40e/i40e_ethdev.c | 116 --------------------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 11 --- 6 files changed, 1 insertion(+), 242 deletions(-)app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0
-0
07ee4e4e13..bb0be8cf42100644app/test-pmd/cmdline.c +0
-0@@ -559,11 +559,6 @@ static void cmd_help_long_parsed(void *parsed_result,"set port (port_id) vf (vf_id) rx|tx on|off\n" " Enable/Disable a VF receive/tranmit from aport\n\n"
app/test-pmd/cmdline.c +0
-2-"set port (port_id) vf (vf_id) (mac_addr)" - " (exact-mac#exact-mac-vlan#hashmac|hashmac-vlan) on|off\n"
app/test-pmd/cmdline.c +0
-3-" Add/Remove unicast or multicast MAC addr filter" -" for a VF.\n\n" - "set port (port_id) vf (vf_id) rxmode(AUPE|ROPE|BAM"
app/test-pmd/cmdline.c +0
-54"|MPE) (on|off)\n" " AUPE:accepts untagged VLAN;" @@ -8757,110 +8752,6 @@ cmdline_parse_inst_t cmd_set_uc_all_hash_filter = { }, }; -/* *** CONFIGURE MACVLAN FILTER FOR VF(s) *** */ -struct cmd_set_vf_macvlan_filter { -cmdline_fixed_string_t set; -cmdline_fixed_string_t port; -portid_t port_id; -cmdline_fixed_string_t vf; -uint8_t vf_id; -struct rte_ether_addr address; -cmdline_fixed_string_t filter_type; -cmdline_fixed_string_t mode; -}; - -static void -cmd_set_vf_macvlan_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -int is_on, ret =0 ; -struct cmd_set_vf_macvlan_filter *res = parsed_result; -struct rte_eth_mac_filter filter; - -memset (&filter,0 ,sizeof (struct rte_eth_mac_filter )); - -rte_memcpy (&filter.mac_addr, &res->address, RTE_ETHER_ADDR_LEN); - -/* set VF MAC filter */ - filter.is_vf =1 ; - -/* set VF ID */ - filter.dst_id = res->vf_id; - -if (!strcmp (res->filter_type,"exact-mac" )) - filter.filter_type =RTE_MAC_PERFECT_MATCH ; -else if (!strcmp (res->filter_type,"exact-mac-vlan" )) - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; -else if (!strcmp (res->filter_type,"hashmac" )) - filter.filter_type =RTE_MAC_HASH_MATCH ; -else if (!strcmp (res->filter_type,"hashmac-vlan" )) - filter.filter_type =RTE_MACVLAN_HASH_MATCH ; - - is_on = (strcmp (res->mode,"on" ) ==0 ) ?1 :0 ; - -if (is_on) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_MACVLAN , -RTE_ETH_FILTER_ADD , - &filter); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_MACVLAN , -RTE_ETH_FILTER_DELETE , - &filter); - -if (ret <0 ) - printf("bad set MAC hash parameter, return code = %d\n",ret);
app/test-pmd/cmdline.c +0
-34- -} - -cmdline_parse_token_string_t cmd_set_vf_macvlan_set = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - set,"set" ); -cmdline_parse_token_string_t cmd_set_vf_macvlan_port = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - port,"port" ); -cmdline_parse_token_num_t cmd_set_vf_macvlan_portid = - TOKEN_NUM_INITIALIZER(struct cmd_set_vf_macvlan_filter, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_set_vf_macvlan_vf = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - vf,"vf" ); -cmdline_parse_token_num_t cmd_set_vf_macvlan_vf_id = - TOKEN_NUM_INITIALIZER(struct cmd_set_vf_macvlan_filter, - vf_id,UINT8 ); -cmdline_parse_token_etheraddr_t cmd_set_vf_macvlan_mac = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_vf_macvlan_filter, - address); -cmdline_parse_token_string_t cmd_set_vf_macvlan_filter_type = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - filter_type,"exact-mac#exact-mac-vlan" -"#hashmac#hashmac-vlan" ); -cmdline_parse_token_string_t cmd_set_vf_macvlan_mode = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - mode,"on#off" ); - -cmdline_parse_inst_t cmd_set_vf_macvlan_filter = { - .f = cmd_set_vf_macvlan_parsed, - .data =NULL , - .help_str ="set port <port_id> vf <vf_id> <mac_addr> " - "exact-mac|exact-mac-vlan|hashmac|hashmac-vlan on|off:"
app/test-pmd/cmdline.c +0
-2-"Exact match rule: exact match of MAC or MAC and VLAN; " - "hash match rule: hash match of MAC and exact match ofVLAN",
app/test-pmd/cmdline.c +0
-14- .tokens = { - (void *)&cmd_set_vf_macvlan_set, - (void *)&cmd_set_vf_macvlan_port, - (void *)&cmd_set_vf_macvlan_portid, - (void *)&cmd_set_vf_macvlan_vf, - (void *)&cmd_set_vf_macvlan_vf_id, - (void *)&cmd_set_vf_macvlan_mac, - (void *)&cmd_set_vf_macvlan_filter_type, - (void *)&cmd_set_vf_macvlan_mode, - NULL, - }, -}; -/* *** CONFIGURE VF TRAFFIC CONTROL *** */ struct cmd_set_vf_traffic {cmdline_fixed_string_t set;@@ -20041,7 +19932,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_set_uc_hash_filter, (cmdline_parse_inst_t *)&cmd_set_uc_all_hash_filter, (cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter, - (cmdline_parse_inst_t *)&cmd_set_vf_macvlan_filter, (cmdline_parse_inst_t *)&cmd_queue_rate_limit, (cmdline_parse_inst_t *)&cmd_tunnel_filter, (cmdline_parse_inst_t *)&cmd_tunnel_udp_config, diff --git
a/doc/guides/rel_notes/deprecation.rstb/doc/guides/rel_notes/deprecation.rst
indexff39243f32..223ff7661f100644doc/guides/rel_notes/deprecation.rst +1
-1@@ -108,7 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types MACVLAN, ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, + as filter types ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter.The legacy API will be removed in DPDK 20.11.
drivers/net/i40e/i40e_ethdev.c +0
-45@@ -4386,119 +4386,6 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index) } } -/* Set perfect match or hash match of MAC and VLAN for a VF */ -static int - i40e_vf_mac_filter_set(struct i40e_pf *pf, - struct rte_eth_mac_filter *filter, - bool add) -{ -struct i40e_hw *hw; -struct i40e_mac_filter_info mac_filter; -struct rte_ether_addr old_mac; -struct rte_ether_addr *new_mac; -struct i40e_pf_vf *vf =NULL ; -uint16_t vf_id; -int ret; - -if (pf ==NULL ) { -PMD_DRV_LOG (ERR ,"Invalid PF argument." ); -return -EINVAL ; - } - hw =I40E_PF_TO_HW (pf); - -if (filter ==NULL ) { -PMD_DRV_LOG (ERR ,"Invalid mac filter argument." ); -return -EINVAL ; - } - - new_mac = &filter->mac_addr; - -if (rte_is_zero_ether_addr (new_mac)) { -PMD_DRV_LOG (ERR ,"Invalid ethernet address." ); -return -EINVAL ; - } - - vf_id = filter->dst_id; - -if (vf_id > pf->vf_num -1 || !pf->vfs) { -PMD_DRV_LOG (ERR ,"Invalid argument." ); -return -EINVAL ; - } - vf = &pf->vfs[vf_id]; - -if (add &&rte_is_same_ether_addr (new_mac, &pf->dev_addr)) { - PMD_DRV_LOG(INFO, "Ignore adding permanent MAC address."); -return -EINVAL ; - } - -if (add) { - rte_memcpy(&old_mac, hw->mac.addr,
RTE_ETHER_ADDR_LEN);drivers/net/i40e/i40e_ethdev.c +0
-24-rte_memcpy (hw->mac.addr, new_mac->addr_bytes, -RTE_ETHER_ADDR_LEN ); -rte_memcpy (&mac_filter.mac_addr, &filter->mac_addr, -RTE_ETHER_ADDR_LEN ); - - mac_filter.filter_type = filter->filter_type; - ret =i40e_vsi_add_mac (vf->vsi, &mac_filter); -if (ret !=I40E_SUCCESS ) { -PMD_DRV_LOG (ERR ,"Failed to add MAC filter." ); -return -1 ; - } -rte_ether_addr_copy (new_mac, &pf->dev_addr); - }else { -rte_memcpy (hw->mac.addr, hw->mac.perm_addr, -RTE_ETHER_ADDR_LEN ); - ret =i40e_vsi_delete_mac (vf->vsi, &filter->mac_addr); -if (ret !=I40E_SUCCESS ) { -PMD_DRV_LOG (ERR ,"Failed to delete MAC filter." ); -return -1 ; - } - -/* Clear device address as it has been removed */ -if (rte_is_same_ether_addr (&pf->dev_addr, new_mac)) - memset(&pf->dev_addr, 0, sizeof(struct
rte_ether_addr));drivers/net/i40e/i40e_ethdev.c +0
-8- } - -return 0 ; -} - -/* MAC filter handle */ -static int -i40e_mac_filter_handle(struct rte_eth_dev *dev, enum rte_filter_op
filter_op,drivers/net/i40e/i40e_ethdev.c +0
-3- void *arg) -{ - struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data-Quoted 1 line
dev_private);drivers/net/i40e/i40e_ethdev.c +0
-31-struct rte_eth_mac_filter *filter; -struct i40e_hw *hw =I40E_PF_TO_HW (pf); -int ret =I40E_NOT_SUPPORTED ; - - filter = (struct rte_eth_mac_filter *)(arg); - -switch (filter_op) { -case RTE_ETH_FILTER_NOP : - ret =I40E_SUCCESS ; -break ; -case RTE_ETH_FILTER_ADD : -i40e_pf_disable_irq0 (hw); -if (filter->is_vf) - ret =i40e_vf_mac_filter_set (pf, filter,1 ); -i40e_pf_enable_irq0 (hw); -break ; -case RTE_ETH_FILTER_DELETE : -i40e_pf_disable_irq0 (hw); -if (filter->is_vf) - ret =i40e_vf_mac_filter_set (pf, filter,0 ); -i40e_pf_enable_irq0 (hw); -break ; -default : -PMD_DRV_LOG (ERR ,"unknown operation %u" , filter_op); - ret =I40E_ERR_PARAM ; -break ; - } - -return ret; -} -static int i40e_get_rss_lut(struct i40e_vsi *vsi, uint8_t *lut, uint16_t lut_size) { @@ -10620,9 +10507,6 @@ i40e_dev_filter_ctrl(struct
rte_eth_dev*dev,drivers/net/i40e/i40e_ethdev.c +0
-3case RTE_ETH_FILTER_HASH : ret =i40e_hash_filter_ctrl (dev, filter_op, arg);break ; -case RTE_ETH_FILTER_MACVLAN : - ret =i40e_mac_filter_handle (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_ETHERTYPE : ret =i40e_ethertype_filter_handle (dev, filter_op, arg);break ;drivers/net/qede/qede_filter.c +0
-1@@ -1561,7 +1561,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops;return 0 ; -case RTE_ETH_FILTER_MACVLAN :case RTE_ETH_FILTER_ETHERTYPE :case RTE_ETH_FILTER_FLEXIBLE :drivers/net/qede/qede_filter.c +0
-0case RTE_ETH_FILTER_SYN :drivers/net/sfc/sfc_ethdev.c +0
-3@@ -1748,9 +1748,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enumrte_filter_type filter_type, case RTE_ETH_FILTER_NONE: sfc_err(sa, "Global filters configuration not supported");break ; -case RTE_ETH_FILTER_MACVLAN : -sfc_err (sa,"MACVLAN filters not supported" ); -break ;case RTE_ETH_FILTER_ETHERTYPE :sfc_err (sa,"EtherType filters not supported" );drivers/net/sfc/sfc_ethdev.c +0
-0break ;lib/librte_ethdev/rte_eth_ctrl.h +0
-12@@ -27,7 +27,6 @@ extern "C" {*/ enum rte_filter_type {RTE_ETH_FILTER_NONE =0 , -RTE_ETH_FILTER_MACVLAN ,RTE_ETH_FILTER_ETHERTYPE ,RTE_ETH_FILTER_FLEXIBLE ,RTE_ETH_FILTER_SYN ,@@ -68,16 +67,6 @@ enum rte_mac_filter_type { RTE_MACVLAN_HASH_MATCH, }; -/** -* MAC filter info -*/ -struct rte_eth_mac_filter { -uint8_t is_vf;/**< 1 for VF, 0 for port dev */ -uint16_t dst_id;/**< VF ID, available when is_vf is 1*/ -enum rte_mac_filter_type filter_type;/**< MAC filter type */ -struct rte_ether_addr mac_addr; -}; -/** * Define all structures for Ethertype Filter type. */ --2.17.1
Re: [dpdk-dev] [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support
Quoted 14 lines · Jia
Quoted 14 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Guo, Jia <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support
Quoted 4 lines
Quoted 1 line
RTE flow API should be used for filtering.
Look like each patch in the patch set remove one specific legacy filter, so I think the removing filter info is need to show in the commit log to make it more clear, please add in the next version.
Sorry, don't understand. Isn't MACVLAN in summary sufficient?
Re: [dpdk-dev] [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support
Quoted 33 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Thursday, October 22, 2020 12:05 AM
To: Guo, Jia <[email protected]>; Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 01/14] ethdev: remove legacy MACVLAN filter type supportQuoted 8 lines · Jia
Quoted 8 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Guo, Jia <[email protected]>;Rasesh
Quoted 2 lines
Quoted 2 lines
Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas
Monjalon
Quoted 5 lines
Quoted 5 lines
<[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
RTE flow API should be used for filtering.
Look like each patch in the patch set remove one specific legacy filter, so I think the removing filter info is need to show in the commit log
to make it more clear, please add in the next version.
Sorry, don't understand. Isn't MACVLAN in summary sufficient?
Sorry, maybe I did't say clear. Basically we concentrate the context in title and then detail more in description, for this description, maybe some confuse that if this patch is wholly for all filtering but eventually it just specific for one filtering.
PATCH 2/14 ethdev: move MAC filter type to i40e driver
In reply to Andrew Rybchenkonet/i40e driver is the only user of the enum rte_mac_filter_type. Move the define to the driver and use i40e_ prefix instead of rte_.
--- drivers/net/i40e/i40e_ethdev.c | 58 ++++++++++++++++---------------- drivers/net/i40e/i40e_ethdev.h | 15 +++++++-- drivers/net/i40e/i40e_pf.c | 2 +- drivers/net/i40e/rte_pmd_i40e.c | 30 ++++++++--------- lib/librte_ethdev/rte_eth_ctrl.h | 11 ------ 5 files changed, 58 insertions(+), 58 deletions(-)
drivers/net/i40e/i40e_ethdev.c +29 -29
@@ -4329,9 +4329,9 @@ i40e_macaddr_add(struct rte_eth_dev *dev,rte_memcpy (&mac_filter.mac_addr, mac_addr,RTE_ETHER_ADDR_LEN );if (rxmode->offloads &DEV_RX_OFFLOAD_VLAN_FILTER ) - mac_filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + mac_filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;else - mac_filter.filter_type =RTE_MAC_PERFECT_MATCH ; + mac_filter.filter_type =I40E_MAC_PERFECT_MATCH ;if (pool ==0 ) vsi = pf->main_vsi;
@@ -5537,7 +5537,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) mac = &f->mac_info.mac_addr;rte_memcpy (&mac->addr_bytes, hw->mac.perm_addr,ETH_ADDR_LEN ); - f->mac_info.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + f->mac_info.filter_type =I40E_MACVLAN_PERFECT_MATCH ;TAILQ_INSERT_TAIL (&vsi->mac_list, f, next); vsi->mac_num++;
@@ -5545,7 +5545,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) }rte_memcpy (&filter.mac_addr, (struct rte_ether_addr *)(hw->mac.perm_addr),ETH_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;return i40e_vsi_add_mac (vsi, &filter); }
@@ -6011,7 +6011,7 @@ i40e_vsi_setup(struct i40e_pf *pf,/* MAC/VLAN configuration */ rte_memcpy (&filter.mac_addr, &broadcast,RTE_ETHER_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ; ret =i40e_vsi_add_mac (vsi, &filter);if (ret !=I40E_SUCCESS ) {
@@ -6039,15 +6039,15 @@ i40e_vsi_config_vlan_filter(struct i40e_vsi *vsi, bool on)struct i40e_mac_filter *f;void *temp;struct i40e_mac_filter_info *mac_filter; -enum rte_mac_filter_type desired_filter; +enum i40e_mac_filter_type desired_filter;int ret =I40E_SUCCESS ;if (on) {/* Filter to match MAC and VLAN */ - desired_filter =RTE_MACVLAN_PERFECT_MATCH ; + desired_filter =I40E_MACVLAN_PERFECT_MATCH ; }else {/* Filter to match only MAC */ - desired_filter =RTE_MAC_PERFECT_MATCH ; + desired_filter =I40E_MAC_PERFECT_MATCH ; } num = vsi->mac_num;
@@ -6990,18 +6990,18 @@ i40e_add_macvlan_filters(struct i40e_vsi *vsi,rte_cpu_to_le_16 (filter[num + i].vlan_id);switch (filter[num + i].filter_type) { -case RTE_MAC_PERFECT_MATCH : +case I40E_MAC_PERFECT_MATCH : flags =I40E_AQC_MACVLAN_ADD_PERFECT_MATCH |I40E_AQC_MACVLAN_ADD_IGNORE_VLAN ;break ; -case RTE_MACVLAN_PERFECT_MATCH : +case I40E_MACVLAN_PERFECT_MATCH : flags =I40E_AQC_MACVLAN_ADD_PERFECT_MATCH ;break ; -case RTE_MAC_HASH_MATCH : +case I40E_MAC_HASH_MATCH : flags =I40E_AQC_MACVLAN_ADD_HASH_MATCH |I40E_AQC_MACVLAN_ADD_IGNORE_VLAN ;break ; -case RTE_MACVLAN_HASH_MATCH : +case I40E_MACVLAN_HASH_MATCH : flags =I40E_AQC_MACVLAN_ADD_HASH_MATCH ;break ;default :
@@ -7065,18 +7065,18 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi,rte_cpu_to_le_16 (filter[num + i].vlan_id);switch (filter[num + i].filter_type) { -case RTE_MAC_PERFECT_MATCH : +case I40E_MAC_PERFECT_MATCH : flags =I40E_AQC_MACVLAN_DEL_PERFECT_MATCH |I40E_AQC_MACVLAN_DEL_IGNORE_VLAN ;break ; -case RTE_MACVLAN_PERFECT_MATCH : +case I40E_MACVLAN_PERFECT_MATCH : flags =I40E_AQC_MACVLAN_DEL_PERFECT_MATCH ;break ; -case RTE_MAC_HASH_MATCH : +case I40E_MAC_HASH_MATCH : flags =I40E_AQC_MACVLAN_DEL_HASH_MATCH |I40E_AQC_MACVLAN_DEL_IGNORE_VLAN ;break ; -case RTE_MACVLAN_HASH_MATCH : +case I40E_MACVLAN_HASH_MATCH : flags =I40E_AQC_MACVLAN_DEL_HASH_MATCH ;break ;default :
@@ -7421,8 +7421,8 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter) f =i40e_find_mac_filter (vsi, &mac_filter->mac_addr);if (f !=NULL )return I40E_SUCCESS ; -if ((mac_filter->filter_type ==RTE_MACVLAN_PERFECT_MATCH ) || - (mac_filter->filter_type ==RTE_MACVLAN_HASH_MATCH )) { +if (mac_filter->filter_type ==I40E_MACVLAN_PERFECT_MATCH || + mac_filter->filter_type ==I40E_MACVLAN_HASH_MATCH ) {/** * If vlan_num is 0, that's the first time to add mac,
@@ -7433,8 +7433,8 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter) vsi->vlan_num =1 ; } vlan_num = vsi->vlan_num; - }else if ((mac_filter->filter_type ==RTE_MAC_PERFECT_MATCH ) || - (mac_filter->filter_type ==RTE_MAC_HASH_MATCH )) + }else if (mac_filter->filter_type ==I40E_MAC_PERFECT_MATCH || + mac_filter->filter_type ==I40E_MAC_HASH_MATCH ) vlan_num =1 ; mv_f =rte_zmalloc ("macvlan_data" , vlan_num *sizeof (*mv_f),0 );
@@ -7449,8 +7449,8 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter) ETH_ADDR_LEN); } -if (mac_filter->filter_type ==RTE_MACVLAN_PERFECT_MATCH || - mac_filter->filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (mac_filter->filter_type ==I40E_MACVLAN_PERFECT_MATCH || + mac_filter->filter_type ==I40E_MACVLAN_HASH_MATCH ) { ret =i40e_find_all_vlan_for_mac (vsi, mv_f, vlan_num, &mac_filter->mac_addr);if (ret !=I40E_SUCCESS )
@@ -7487,7 +7487,7 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr)struct i40e_mac_filter *f;struct i40e_macvlan_filter *mv_f;int i, vlan_num; -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;int ret =I40E_SUCCESS ;/* Can't find it, return an error */
@@ -7497,14 +7497,14 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr) vlan_num = vsi->vlan_num; filter_type = f->mac_info.filter_type; -if (filter_type ==RTE_MACVLAN_PERFECT_MATCH || - filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || + filter_type ==I40E_MACVLAN_HASH_MATCH ) {if (vlan_num ==0 ) {PMD_DRV_LOG (ERR ,"VLAN number shouldn't be 0" );return I40E_ERR_PARAM ; } - }else if (filter_type ==RTE_MAC_PERFECT_MATCH || - filter_type ==RTE_MAC_HASH_MATCH ) + }else if (filter_type ==I40E_MAC_PERFECT_MATCH || + filter_type ==I40E_MAC_HASH_MATCH ) vlan_num =1 ; mv_f =rte_zmalloc ("macvlan_data" , vlan_num *sizeof (*mv_f),0 );
@@ -7518,8 +7518,8 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr)rte_memcpy (&mv_f[i].macaddr, &f->mac_info.mac_addr,ETH_ADDR_LEN ); } -if (filter_type ==RTE_MACVLAN_PERFECT_MATCH || - filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || + filter_type ==I40E_MACVLAN_HASH_MATCH ) { ret =i40e_find_all_vlan_for_mac (vsi, mv_f, vlan_num, addr);if (ret !=I40E_SUCCESS ) goto DONE;
drivers/net/i40e/i40e_ethdev.h +13 -2
@@ -288,11 +288,22 @@ struct rte_flow {struct i40e_adapter ;struct rte_pci_driver ; +/** +* MAC filter type +*/ +enum i40e_mac_filter_type { +I40E_MAC_PERFECT_MATCH =1 ,/**< exact match of MAC addr. */ +I40E_MACVLAN_PERFECT_MATCH ,/**< exact match of MAC addr and VLAN ID. */ +I40E_MAC_HASH_MATCH ,/**< hash match of MAC addr. */ +/** hash match of MAC addr and exact match of VLAN ID. */ +I40E_MACVLAN_HASH_MATCH , +}; +/** * MAC filter structure */ struct i40e_mac_filter_info { -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;struct rte_ether_addr mac_addr; };
@@ -347,7 +358,7 @@ struct i40e_veb {/* i40e MACVLAN filter structure */ struct i40e_macvlan_filter {struct rte_ether_addr macaddr; -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;uint16_t vlan_id; };
drivers/net/i40e/i40e_pf.c +1 -1
@@ -844,7 +844,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf,for (i =0 ; i < addr_list->num_elements; i++) { mac = (struct rte_ether_addr *)(addr_list->list[i].addr);rte_memcpy (&filter.mac_addr, mac,RTE_ETHER_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;if (rte_is_zero_ether_addr (mac) ||i40e_vsi_add_mac (vf->vsi, &filter)) { ret =I40E_ERR_INVALID_MAC_ADDR ;
drivers/net/i40e/rte_pmd_i40e.c +15 -15
@@ -211,7 +211,7 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi)struct i40e_mac_filter *f;struct i40e_macvlan_filter *mv_f;int i, vlan_num; -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;int ret =I40E_SUCCESS ;void *temp;
@@ -219,14 +219,14 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi) TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) { vlan_num = vsi->vlan_num; filter_type = f->mac_info.filter_type; -if (filter_type ==RTE_MACVLAN_PERFECT_MATCH || - filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || + filter_type ==I40E_MACVLAN_HASH_MATCH ) {if (vlan_num ==0 ) {PMD_DRV_LOG (ERR ,"VLAN number shouldn't be 0" );return I40E_ERR_PARAM ; } - }else if (filter_type ==RTE_MAC_PERFECT_MATCH || - filter_type ==RTE_MAC_HASH_MATCH ) + }else if (filter_type ==I40E_MAC_PERFECT_MATCH || + filter_type ==I40E_MAC_HASH_MATCH ) vlan_num =1 ; mv_f =rte_zmalloc ("macvlan_data" , vlan_num *sizeof (*mv_f),0 );
@@ -241,8 +241,8 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi) &f->mac_info.mac_addr, ETH_ADDR_LEN); } -if (filter_type ==RTE_MACVLAN_PERFECT_MATCH || - filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || + filter_type ==I40E_MACVLAN_HASH_MATCH ) { ret =i40e_find_all_vlan_for_mac (vsi, mv_f, vlan_num, &f->mac_info.mac_addr);if (ret !=I40E_SUCCESS ) {
@@ -275,8 +275,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi)/* restore all the MACs */ TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) { -if ((f->mac_info.filter_type ==RTE_MACVLAN_PERFECT_MATCH ) || - (f->mac_info.filter_type ==RTE_MACVLAN_HASH_MATCH )) { +if (f->mac_info.filter_type ==I40E_MACVLAN_PERFECT_MATCH || + f->mac_info.filter_type ==I40E_MACVLAN_HASH_MATCH ) {/** * If vlan_num is 0, that's the first time to add mac, * set mask for vlan_id 0.
@@ -286,8 +286,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi) vsi->vlan_num =1 ; } vlan_num = vsi->vlan_num; - }else if ((f->mac_info.filter_type ==RTE_MAC_PERFECT_MATCH ) || - (f->mac_info.filter_type ==RTE_MAC_HASH_MATCH )) + }else if (f->mac_info.filter_type ==I40E_MAC_PERFECT_MATCH || + f->mac_info.filter_type ==I40E_MAC_HASH_MATCH ) vlan_num =1 ; mv_f =rte_zmalloc ("macvlan_data" , vlan_num *sizeof (*mv_f),0 );
@@ -303,8 +303,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi) ETH_ADDR_LEN); } -if (f->mac_info.filter_type ==RTE_MACVLAN_PERFECT_MATCH || - f->mac_info.filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (f->mac_info.filter_type ==I40E_MACVLAN_PERFECT_MATCH || + f->mac_info.filter_type ==I40E_MACVLAN_HASH_MATCH ) { ret =i40e_find_all_vlan_for_mac (vsi, mv_f, vlan_num, &f->mac_info.mac_addr);if (ret !=I40E_SUCCESS ) {
@@ -768,7 +768,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id,if (on) {rte_memcpy (&filter.mac_addr, &broadcast,RTE_ETHER_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ; ret =i40e_vsi_add_mac (vsi, &filter); }else { ret =i40e_vsi_delete_mac (vsi, &broadcast);
@@ -2388,7 +2388,7 @@ rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,return -EINVAL ; } - mac_filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + mac_filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;rte_ether_addr_copy (mac_addr, &mac_filter.mac_addr); ret =i40e_vsi_add_mac (vsi, &mac_filter);if (ret !=I40E_SUCCESS ) {
lib/librte_ethdev/rte_eth_ctrl.h +0 -11
@@ -56,17 +56,6 @@ enum rte_filter_op { RTE_ETH_FILTER_OP_MAX }; -/** -* MAC filter type -*/ -enum rte_mac_filter_type { -RTE_MAC_PERFECT_MATCH =1 ,/**< exact match of MAC addr. */ -RTE_MACVLAN_PERFECT_MATCH ,/**< exact match of MAC addr and VLAN ID. */ -RTE_MAC_HASH_MATCH ,/**< hash match of MAC addr. */ -/** hash match of MAC addr and exact match of VLAN ID. */ -RTE_MACVLAN_HASH_MATCH , -}; -/** * Define all structures for Ethertype Filter type. */
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 02/14] ethdev: move MAC filter type to i40e driver
Quoted 14 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]
Subject: [PATCH 02/14] ethdev: move MAC filter type to i40e drivernet/i40e driver is the only user of the enum
rte_mac_filter_type. Move the define to the driver and usei40e_prefix instead ofrte_.
Quoted 9 lines
Signed-off-by Andrew Rybchenko <[email protected]>--- drivers/net/i40e/i40e_ethdev.c | 58 ++++++++++++++++---------------- drivers/net/i40e/i40e_ethdev.h | 15 +++++++-- drivers/net/i40e/i40e_pf.c | 2 +- drivers/net/i40e/rte_pmd_i40e.c | 30 ++++++++--------- lib/librte_ethdev/rte_eth_ctrl.h | 11 ------ 5 files changed, 58 insertions(+), 58 deletions(-)
Where is the related remove in testpmd about the rte_mac_filter_type?
Quoted 397 lines
drivers/net/i40e/i40e_ethdev.c +2
-2@@ -4329,9 +4329,9 @@ i40e_macaddr_add(struct rte_eth_dev *dev,rte_memcpy (&mac_filter.mac_addr, mac_addr,RTE_ETHER_ADDR_LEN );if (rxmode->offloads &DEV_RX_OFFLOAD_VLAN_FILTER ) - mac_filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + mac_filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;else - mac_filter.filter_type =RTE_MAC_PERFECT_MATCH ; + mac_filter.filter_type =I40E_MAC_PERFECT_MATCH ;if (pool ==0 )drivers/net/i40e/i40e_ethdev.c +6
-6vsi = pf->main_vsi;@@ -5537,7 +5537,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) mac = &f->mac_info.mac_addr;rte_memcpy (&mac->addr_bytes, hw->mac.perm_addr,ETH_ADDR_LEN ); - f->mac_info.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + f->mac_info.filter_type =I40E_MACVLAN_PERFECT_MATCH ;TAILQ_INSERT_TAIL (&vsi->mac_list, f, next); vsi->mac_num++;@@ -5545,7 +5545,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) }rte_memcpy (&filter.mac_addr, (struct rte_ether_addr *)(hw->mac.perm_addr),ETH_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;return i40e_vsi_add_mac (vsi, &filter); }@@ -6011,7 +6011,7 @@ i40e_vsi_setup(struct i40e_pf *pf,/* MAC/VLAN configuration */ rte_memcpy (&filter.mac_addr, &broadcast,RTE_ETHER_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ; ret =i40e_vsi_add_mac (vsi, &filter);if (ret !=I40E_SUCCESS ) {@@ -6039,15 +6039,15 @@ i40e_vsi_config_vlan_filter(struct i40e_vsi *vsi, bool on)struct i40e_mac_filter *f;void *temp;struct i40e_mac_filter_info *mac_filter; -enum rte_mac_filter_type desired_filter; +enum i40e_mac_filter_type desired_filter;int ret =I40E_SUCCESS ;if (on) {/* Filter to match MAC and VLAN */ - desired_filter =RTE_MACVLAN_PERFECT_MATCH ; + desired_filter =I40E_MACVLAN_PERFECT_MATCH ; }else {/* Filter to match only MAC */ - desired_filter =RTE_MAC_PERFECT_MATCH ; + desired_filter =I40E_MAC_PERFECT_MATCH ; }drivers/net/i40e/i40e_ethdev.c +1
-1num = vsi->mac_num;@@ -6990,18 +6990,18 @@ i40e_add_macvlan_filters(struct i40e_vsi *vsi,rte_cpu_to_le_16 (filter[num + i].vlan_id);switch (filter[num + i].filter_type) { -case RTE_MAC_PERFECT_MATCH : +case I40E_MAC_PERFECT_MATCH : flags =
I40E_AQC_MACVLAN_ADD_PERFECT_MATCH|I40E_AQC_MACVLAN_ADD_IGNORE_VLAN;drivers/net/i40e/i40e_ethdev.c +1
-1break ; -case RTE_MACVLAN_PERFECT_MATCH : +case I40E_MACVLAN_PERFECT_MATCH : flags =
I40E_AQC_MACVLAN_ADD_PERFECT_MATCH;drivers/net/i40e/i40e_ethdev.c +1
-1break ; -case RTE_MAC_HASH_MATCH : +case I40E_MAC_HASH_MATCH : flags =
I40E_AQC_MACVLAN_ADD_HASH_MATCH|I40E_AQC_MACVLAN_ADD_IGNORE_VLAN;drivers/net/i40e/i40e_ethdev.c +1
-1break ; -case RTE_MACVLAN_HASH_MATCH : +case I40E_MACVLAN_HASH_MATCH : flags =
I40E_AQC_MACVLAN_ADD_HASH_MATCH;drivers/net/i40e/i40e_ethdev.c +1
-1break ;default :@@ -7065,18 +7065,18 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi,rte_cpu_to_le_16 (filter[num + i].vlan_id);switch (filter[num + i].filter_type) { -case RTE_MAC_PERFECT_MATCH : +case I40E_MAC_PERFECT_MATCH : flags =
I40E_AQC_MACVLAN_DEL_PERFECT_MATCH|I40E_AQC_MACVLAN_DEL_IGNORE_VLAN;drivers/net/i40e/i40e_ethdev.c +1
-1break ; -case RTE_MACVLAN_PERFECT_MATCH : +case I40E_MACVLAN_PERFECT_MATCH : flags =
I40E_AQC_MACVLAN_DEL_PERFECT_MATCH;drivers/net/i40e/i40e_ethdev.c +1
-1break ; -case RTE_MAC_HASH_MATCH : +case I40E_MAC_HASH_MATCH : flags =
I40E_AQC_MACVLAN_DEL_HASH_MATCH|I40E_AQC_MACVLAN_DEL_IGNORE_VLAN;drivers/net/i40e/i40e_ethdev.c +1
-1break ; -case RTE_MACVLAN_HASH_MATCH : +case I40E_MACVLAN_HASH_MATCH : flags =
I40E_AQC_MACVLAN_DEL_HASH_MATCH;drivers/net/i40e/i40e_ethdev.c +2
-2break ;default :@@ -7421,8 +7421,8 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter) f =i40e_find_mac_filter (vsi, &mac_filter->mac_addr);if (f !=NULL )return I40E_SUCCESS ; -if ((mac_filter->filter_type ==RTE_MACVLAN_PERFECT_MATCH ) || - (mac_filter->filter_type ==RTE_MACVLAN_HASH_MATCH )) { +if (mac_filter->filter_type ==I40E_MACVLAN_PERFECT_MATCH || + mac_filter->filter_type ==I40E_MACVLAN_HASH_MATCH ) {drivers/net/i40e/i40e_ethdev.c +0
-0/** * If vlan_num is 0, that's the first time to add mac, @@ - 7433,8 +7433,8 @@
i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter)drivers/net/i40e/i40e_ethdev.c +0
-2vsi->vlan_num =1 ; } vlan_num = vsi->vlan_num; - } else if ((mac_filter->filter_type == RTE_MAC_PERFECT_MATCH) || - (mac_filter->filter_type ==
RTE_MAC_HASH_MATCH))drivers/net/i40e/i40e_ethdev.c +4
-2+ }else if (mac_filter->filter_type ==I40E_MAC_PERFECT_MATCH || + mac_filter->filter_type ==I40E_MAC_HASH_MATCH ) vlan_num =1 ; mv_f =rte_zmalloc ("macvlan_data" , vlan_num *sizeof (*mv_f),0 );@@ -7449,8 +7449,8 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter) ETH_ADDR_LEN); } -if (mac_filter->filter_type ==RTE_MACVLAN_PERFECT_MATCH || - mac_filter->filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (mac_filter->filter_type ==I40E_MACVLAN_PERFECT_MATCH || + mac_filter->filter_type ==I40E_MACVLAN_HASH_MATCH ) { ret =i40e_find_all_vlan_for_mac (vsi, mv_f, vlan_num, &mac_filter->mac_addr);drivers/net/i40e/i40e_ethdev.c +1
-1if (ret !=I40E_SUCCESS )@@ -7487,7 +7487,7 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr)struct i40e_mac_filter *f;struct i40e_macvlan_filter *mv_f;int i, vlan_num; -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;int ret =I40E_SUCCESS ;drivers/net/i40e/i40e_ethdev.c +4
-4/* Can't find it, return an error */ @@ -7497,14 +7497,14 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr) vlan_num = vsi->vlan_num; filter_type = f->mac_info.filter_type; -if (filter_type ==RTE_MACVLAN_PERFECT_MATCH || - filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || + filter_type ==I40E_MACVLAN_HASH_MATCH ) {if (vlan_num ==0 ) {PMD_DRV_LOG (ERR ,"VLAN number shouldn't be 0" );return I40E_ERR_PARAM ; } - }else if (filter_type ==RTE_MAC_PERFECT_MATCH || - filter_type ==RTE_MAC_HASH_MATCH ) + }else if (filter_type ==I40E_MAC_PERFECT_MATCH || + filter_type ==I40E_MAC_HASH_MATCH ) vlan_num =1 ;drivers/net/i40e/i40e_ethdev.c +2
-2mv_f =rte_zmalloc ("macvlan_data" , vlan_num *sizeof (*mv_f),0 );@@ -7518,8 +7518,8 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr) rte_memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,ETH_ADDR_LEN ); } -if (filter_type ==RTE_MACVLAN_PERFECT_MATCH || - filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || + filter_type ==I40E_MACVLAN_HASH_MATCH ) { ret =i40e_find_all_vlan_for_mac (vsi, mv_f, vlan_num, addr);if (ret !=I40E_SUCCESS )drivers/net/i40e/i40e_ethdev.c +0
-0goto DONE;(quoted diff) +0
-0
b/drivers/net/i40e/i40e_ethdev.hindex1466998aa1..458219c784100644drivers/net/i40e/i40e_ethdev.h +6
-0@@ -288,11 +288,22 @@ struct rte_flow {struct i40e_adapter ;struct rte_pci_driver ; +/** +* MAC filter type +*/ +enum i40e_mac_filter_type { +I40E_MAC_PERFECT_MATCH =1 ,/**< exact match of MAC addr. */ +I40E_MACVLAN_PERFECT_MATCH ,/**< exact match of MAC addr and VLAN ID. */
drivers/net/i40e/i40e_ethdev.h +7
-2+I40E_MAC_HASH_MATCH ,/**< hash match of MAC addr. */ +/** hash match of MAC addr and exact match of VLAN ID. */ + I40E_MACVLAN_HASH_MATCH, +}; +/** * MAC filter structure */ struct i40e_mac_filter_info { -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;struct rte_ether_addr mac_addr; };@@ -347,7 +358,7 @@ struct i40e_veb {/* i40e MACVLAN filter structure */ struct i40e_macvlan_filter {struct rte_ether_addr macaddr; -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;uint16_t vlan_id; };drivers/net/i40e/i40e_pf.c index renamed from drivers/net/i40e/i40e_pf.c +0
-0
03c2070c3f..65d649b627100644drivers/net/i40e/i40e_pf.c +1
-1@@ -844,7 +844,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf, for (i = 0; i < addr_list->num_elements; i++) { mac = (struct rte_ether_addr *)(addr_list->list[i].addr);rte_memcpy (&filter.mac_addr, mac,RTE_ETHER_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;if (rte_is_zero_ether_addr (mac) ||i40e_vsi_add_mac (vf->vsi, &filter)) {drivers/net/i40e/i40e_pf.c +0
-0ret =I40E_ERR_INVALID_MAC_ADDR ;(quoted diff) +0
-0
b/drivers/net/i40e/rte_pmd_i40e.cindex17938e7d30..790d042002100644drivers/net/i40e/rte_pmd_i40e.c +5
-5@@ -211,7 +211,7 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi)struct i40e_mac_filter *f;struct i40e_macvlan_filter *mv_f;int i, vlan_num; -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;int ret =I40E_SUCCESS ;void *temp;@@ -219,14 +219,14 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi) TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) { vlan_num = vsi->vlan_num; filter_type = f->mac_info.filter_type; - if (filter_type == RTE_MACVLAN_PERFECT_MATCH || - filter_type == RTE_MACVLAN_HASH_MATCH) { + if (filter_type == I40E_MACVLAN_PERFECT_MATCH || + filter_type == I40E_MACVLAN_HASH_MATCH) { if (vlan_num == 0) { PMD_DRV_LOG(ERR, "VLAN number shouldn't be 0"); return I40E_ERR_PARAM; } - } else if (filter_type == RTE_MAC_PERFECT_MATCH || - filter_type == RTE_MAC_HASH_MATCH) + } else if (filter_type == I40E_MAC_PERFECT_MATCH || + filter_type == I40E_MAC_HASH_MATCH) vlan_num = 1;
mv_f= rte_zmalloc("macvlan_data",vlan_num*sizeof(*mv_f), 0); @@ -241,8 +241,8 @@i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi)drivers/net/i40e/rte_pmd_i40e.c +2
-2&f->mac_info.mac_addr, ETH_ADDR_LEN); } -if (filter_type ==RTE_MACVLAN_PERFECT_MATCH || - filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || + filter_type ==I40E_MACVLAN_HASH_MATCH ) { ret = i40e_find_all_vlan_for_mac(vsi, mv_f,
vlan_num,
&f-Quoted 1 line
mac_info.mac_addr);
drivers/net/i40e/rte_pmd_i40e.c +0
-1if (ret !=I40E_SUCCESS ) {@@ -275,8 +275,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi)/* restore all the MACs */ TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) { - if ((f->mac_info.filter_type ==
RTE_MACVLAN_PERFECT_MATCH) ||drivers/net/i40e/rte_pmd_i40e.c +0
-1- (f->mac_info.filter_type ==
RTE_MACVLAN_HASH_MATCH)) {drivers/net/i40e/rte_pmd_i40e.c +1
-0+ if (f->mac_info.filter_type ==
I40E_MACVLAN_PERFECT_MATCH||drivers/net/i40e/rte_pmd_i40e.c +1
-0+ f->mac_info.filter_type == I40E_MACVLAN_HASH_MATCH){
drivers/net/i40e/rte_pmd_i40e.c +0
-1/** * If vlan_num is 0, that's the first time to add mac, * set mask for vlan_id 0. @@ -286,8 +286,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi) vsi->vlan_num =1 ; } vlan_num = vsi->vlan_num; - } else if ((f->mac_info.filter_type ==
RTE_MAC_PERFECT_MATCH) ||drivers/net/i40e/rte_pmd_i40e.c +0
-1- (f->mac_info.filter_type ==
RTE_MAC_HASH_MATCH))drivers/net/i40e/rte_pmd_i40e.c +1
-0+ } else if (f->mac_info.filter_type ==
I40E_MAC_PERFECT_MATCH||drivers/net/i40e/rte_pmd_i40e.c +1
-0+ f->mac_info.filter_type ==
I40E_MAC_HASH_MATCH)drivers/net/i40e/rte_pmd_i40e.c +0
-0vlan_num =1 ; mv_f = rte_zmalloc("macvlan_data", vlan_num *
sizeof(*mv_f), 0); @@ -303,8 +303,8 @@i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi)drivers/net/i40e/rte_pmd_i40e.c +0
-1ETH_ADDR_LEN); } - if (f->mac_info.filter_type ==
RTE_MACVLAN_PERFECT_MATCH||drivers/net/i40e/rte_pmd_i40e.c +0
-1- f->mac_info.filter_type == RTE_MACVLAN_HASH_MATCH){
drivers/net/i40e/rte_pmd_i40e.c +1
-0+ if (f->mac_info.filter_type ==
I40E_MACVLAN_PERFECT_MATCH||drivers/net/i40e/rte_pmd_i40e.c +1
-0+ f->mac_info.filter_type == I40E_MACVLAN_HASH_MATCH){
ret = i40e_find_all_vlan_for_mac(vsi,mv_f,vlan_num,
&f-Quoted 1 line
mac_info.mac_addr);
drivers/net/i40e/rte_pmd_i40e.c +1
-1if (ret !=I40E_SUCCESS ) {@@ -768,7 +768,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, if (on) {rte_memcpy (&filter.mac_addr, &broadcast,RTE_ETHER_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ; ret =i40e_vsi_add_mac (vsi, &filter);drivers/net/i40e/rte_pmd_i40e.c +2
-1}else { ret = i40e_vsi_delete_mac(vsi, &broadcast); @@ -2388,7 +2388,7 @@ rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id, return -EINVAL; } - mac_filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + mac_filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;rte_ether_addr_copy (mac_addr, &mac_filter.mac_addr); ret =i40e_vsi_add_mac (vsi, &mac_filter);if (ret !=I40E_SUCCESS ) {lib/librte_ethdev/rte_eth_ctrl.h +0
-6@@ -56,17 +56,6 @@ enum rte_filter_op { RTE_ETH_FILTER_OP_MAX }; -/** -* MAC filter type -*/ -enum rte_mac_filter_type { -RTE_MAC_PERFECT_MATCH =1 ,/**< exact match of MAC addr. */ -RTE_MACVLAN_PERFECT_MATCH ,/**< exact match of MAC addr and VLAN ID. */
lib/librte_ethdev/rte_eth_ctrl.h +0
-6-RTE_MAC_HASH_MATCH ,/**< hash match of MAC addr. */ -/** hash match of MAC addr and exact match of VLAN ID. */ - RTE_MACVLAN_HASH_MATCH, -}; -/** * Define all structures for Ethertype Filter type. */ --2.17.1
Re: [dpdk-dev] [PATCH 02/14] ethdev: move MAC filter type to i40e driver
Quoted 24 lines · Jia
Quoted 14 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]
Subject: [PATCH 02/14] ethdev: move MAC filter type to i40e drivernet/i40e driver is the only user of the enum
rte_mac_filter_type. Move the define to the driver and usei40e_prefix instead ofrte_.Quoted 9 lines
Signed-off-by Andrew Rybchenko <[email protected]>--- drivers/net/i40e/i40e_ethdev.c | 58 ++++++++++++++++---------------- drivers/net/i40e/i40e_ethdev.h | 15 +++++++-- drivers/net/i40e/i40e_pf.c | 2 +- drivers/net/i40e/rte_pmd_i40e.c | 30 ++++++++--------- lib/librte_ethdev/rte_eth_ctrl.h | 11 ------ 5 files changed, 58 insertions(+), 58 deletions(-)
Quoted 1 line
Where is the related remove in testpmd about the
rte_mac_filter_type?
There is no rte_mac_filter_type in testpmd. Corresponding filter support is removed in the previous patch including testpmd.
Re: [dpdk-dev] [PATCH 02/14] ethdev: move MAC filter type to i40e driver
Quoted 36 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Thursday, October 22, 2020 12:09 AM
To: Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 02/14] ethdev: move MAC filter type to i40e driverQuoted 24 lines · Jia
Quoted 23 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]
Subject: [PATCH 02/14] ethdev: move MAC filter type to i40e drivernet/i40e driver is the only user of the enum
rte_mac_filter_type. Move the define to the driver and usei40e_prefix instead ofrte_.Signed-off-by Andrew Rybchenko <[email protected]>--- drivers/net/i40e/i40e_ethdev.c | 58 ++++++++++++++++---------------- drivers/net/i40e/i40e_ethdev.h | 15 +++++++-- drivers/net/i40e/i40e_pf.c | 2 +- drivers/net/i40e/rte_pmd_i40e.c | 30 ++++++++--------- lib/librte_ethdev/rte_eth_ctrl.h | 11 ------ 5 files changed, 58 insertions(+), 58 deletions(-)
Quoted 5 lines
Quoted 1 line
Where is the related remove in testpmd about the
rte_mac_filter_type?There is no
rte_mac_filter_typein testpmd.
Corresponding filter support is removed in the previous patch including testpmd.
Oh, seems that there is some overlap between MACVLAN and MAC filter patch, I am not sure if this is a good suggestion that decouple this two testpmd usage or just merge this two patch into one patch, basically flow that one patch involve the removing of the function and corresponding usage.
Re: [dpdk-dev] [PATCH 02/14] ethdev: move MAC filter type to i40e driver
Quoted 36 lines · Jia
Quoted 36 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Thursday, October 22, 2020 12:09 AM
To: Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 02/14] ethdev: move MAC filter type to i40e driverQuoted 24 lines · Jia
Quoted 23 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Xing, Beilei <[email protected]>; Guo, Jia <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]
Subject: [PATCH 02/14] ethdev: move MAC filter type to i40e drivernet/i40e driver is the only user of the enum
rte_mac_filter_type. Move the define to the driver and usei40e_prefix instead ofrte_.Signed-off-by Andrew Rybchenko <[email protected]>--- drivers/net/i40e/i40e_ethdev.c | 58 ++++++++++++++++---------------- drivers/net/i40e/i40e_ethdev.h | 15 +++++++-- drivers/net/i40e/i40e_pf.c | 2 +- drivers/net/i40e/rte_pmd_i40e.c | 30 ++++++++--------- lib/librte_ethdev/rte_eth_ctrl.h | 11 ------ 5 files changed, 58 insertions(+), 58 deletions(-)
Quoted 9 lines
Quoted 5 lines
Quoted 1 line
Where is the related remove in testpmd about the
rte_mac_filter_type?There is no
rte_mac_filter_typein testpmd.
Corresponding filter support is removed in the previous patch including testpmd.Oh, seems that there is some overlap between MACVLAN and MAC filter patch, I am not sure if this is a good suggestion that decouple this two testpmd usage or just merge this two patch into one patch, basically flow that one patch involve the removing of the function and corresponding usage.
It is just inconsistency in terminology in legacy filter API. MAC filter type is flavor of MACVLAN.
PATCH 3/14 ethdev: remove legacy EtherType filter type support
In reply to Andrew RybchenkoRTE flow API should be used for filtering.
Move corresponding definitions to ethdev internal driver API since it is used by drivers internally.
Preserve RTE_ETH_FILTER_ETHERTYPE because of it as well.
--- app/test-pmd/cmdline.c | 115 ------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 157 -------------------------- drivers/net/e1000/igb_ethdev.c | 85 -------------- drivers/net/hinic/hinic_pmd_ethdev.h | 1 + drivers/net/i40e/i40e_ethdev.c | 45 -------- drivers/net/ixgbe/ixgbe_ethdev.c | 85 -------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 19 ---- lib/librte_ethdev/rte_ethdev_driver.h | 23 ++++ 11 files changed, 25 insertions(+), 511 deletions(-)
app/test-pmd/cmdline.c +0 -115
@@ -976,11 +976,6 @@ static void cmd_help_long_parsed(void *parsed_result,"filters:\n" "--------\n\n" -"ethertype_filter (port_id) (add|del)" -" (mac_addr|mac_ignr) (mac_address) ethertype" -" (ether_type) (drop|fwd) queue (queue_id)\n" -" Add/Del an ethertype filter.\n\n" -"2tuple_filter (port_id) (add|del)" " dst_port (dst_port_value) protocol (protocol_value)" " mask (mask_value) tcp_flags (tcp_flags_value)"
@@ -11069,115 +11064,6 @@ cmdline_parse_inst_t cmd_flex_filter = {/* *** Filters Control *** */ -/* *** deal with ethertype filter *** */ -struct cmd_ethertype_filter_result { -cmdline_fixed_string_t filter; -portid_t port_id; -cmdline_fixed_string_t ops; -cmdline_fixed_string_t mac; -struct rte_ether_addr mac_addr; -cmdline_fixed_string_t ethertype; -uint16_t ethertype_value; -cmdline_fixed_string_t drop; -cmdline_fixed_string_t queue; -uint16_t queue_id; -}; - -cmdline_parse_token_string_t cmd_ethertype_filter_filter = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - filter,"ethertype_filter" ); -cmdline_parse_token_num_t cmd_ethertype_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_ethertype_filter_ops = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - ops,"add#del" ); -cmdline_parse_token_string_t cmd_ethertype_filter_mac = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - mac,"mac_addr#mac_ignr" ); -cmdline_parse_token_etheraddr_t cmd_ethertype_filter_mac_addr = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_ethertype_filter_result, - mac_addr); -cmdline_parse_token_string_t cmd_ethertype_filter_ethertype = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - ethertype,"ethertype" ); -cmdline_parse_token_num_t cmd_ethertype_filter_ethertype_value = - TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result, - ethertype_value,UINT16 ); -cmdline_parse_token_string_t cmd_ethertype_filter_drop = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - drop,"drop#fwd" ); -cmdline_parse_token_string_t cmd_ethertype_filter_queue = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - queue,"queue" ); -cmdline_parse_token_num_t cmd_ethertype_filter_queue_id = - TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result, - queue_id,UINT16 ); - -static void -cmd_ethertype_filter_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_ethertype_filter_result *res = parsed_result; -struct rte_eth_ethertype_filter filter; -int ret =0 ; - - ret =rte_eth_dev_filter_supported (res->port_id, -RTE_ETH_FILTER_ETHERTYPE ); -if (ret <0 ) { -printf ("ethertype filter is not supported on port %u.\n" , - res->port_id); -return ; - } - -memset (&filter,0 ,sizeof (filter)); -if (!strcmp (res->mac,"mac_addr" )) { - filter.flags |=RTE_ETHTYPE_FLAGS_MAC ; -rte_memcpy (&filter.mac_addr, &res->mac_addr, -sizeof (struct rte_ether_addr )); - } -if (!strcmp (res->drop,"drop" )) - filter.flags |=RTE_ETHTYPE_FLAGS_DROP ; - filter.ether_type = res->ethertype_value; - filter.queue = res->queue_id; - -if (!strcmp (res->ops,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_ETHERTYPE , -RTE_ETH_FILTER_ADD , - &filter); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_ETHERTYPE , -RTE_ETH_FILTER_DELETE , - &filter); -if (ret <0 ) -printf ("ethertype filter programming error: (%s)\n" , -strerror (-ret)); -} - -cmdline_parse_inst_t cmd_ethertype_filter = { - .f = cmd_ethertype_filter_parsed, - .data =NULL , - .help_str ="ethertype_filter <port_id> add|del mac_addr|mac_ignr " -"<mac_addr> ethertype <value> drop|fw queue <queue_id>: " -"Add or delete an ethertype filter entry" , - .tokens = { - (void *)&cmd_ethertype_filter_filter, - (void *)&cmd_ethertype_filter_port_id, - (void *)&cmd_ethertype_filter_ops, - (void *)&cmd_ethertype_filter_mac, - (void *)&cmd_ethertype_filter_mac_addr, - (void *)&cmd_ethertype_filter_ethertype, - (void *)&cmd_ethertype_filter_ethertype_value, - (void *)&cmd_ethertype_filter_drop, - (void *)&cmd_ethertype_filter_queue, - (void *)&cmd_ethertype_filter_queue_id, -NULL , - }, -}; -/* *** deal with flow director filter *** */ struct cmd_flow_director_result {cmdline_fixed_string_t flow_director_filter;
@@ -19944,7 +19830,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_config_rss_hash_key, (cmdline_parse_inst_t *)&cmd_dump, (cmdline_parse_inst_t *)&cmd_dump_one, - (cmdline_parse_inst_t *)&cmd_ethertype_filter, (cmdline_parse_inst_t *)&cmd_syn_filter, (cmdline_parse_inst_t *)&cmd_2tuple_filter, (cmdline_parse_inst_t *)&cmd_5tuple_filter,
doc/guides/rel_notes/deprecation.rst +1 -1
@@ -108,7 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, + as filter types FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.
drivers/net/bnxt/bnxt_ethdev.c +0 -157
169 lines not on this page · raw message
drivers/net/e1000/igb_ethdev.c +0 -85
103 lines not on this page · raw message
drivers/net/hinic/hinic_pmd_ethdev.h +1 -0
@@ -7,6 +7,7 @@#include <rte_ethdev.h> #include <rte_ethdev_core.h> +#include <rte_ethdev_driver.h> #include "base/hinic_compat.h" #include "base/hinic_pmd_cfg.h"
drivers/net/i40e/i40e_ethdev.c +0 -45
63 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_ethdev.c +0 -85
103 lines not on this page · raw message
drivers/net/qede/qede_filter.c +0 -1
@@ -1561,7 +1561,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops;return 0 ; -case RTE_ETH_FILTER_ETHERTYPE :case RTE_ETH_FILTER_FLEXIBLE :case RTE_ETH_FILTER_SYN :case RTE_ETH_FILTER_HASH :
drivers/net/sfc/sfc_ethdev.c +0 -3
@@ -1748,9 +1748,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,case RTE_ETH_FILTER_NONE :sfc_err (sa,"Global filters configuration not supported" );break ; -case RTE_ETH_FILTER_ETHERTYPE : -sfc_err (sa,"EtherType filters not supported" ); -break ;case RTE_ETH_FILTER_FLEXIBLE :sfc_err (sa,"Flexible filters not supported" );break ;
lib/librte_ethdev/rte_eth_ctrl.h +0 -19
@@ -56,25 +56,6 @@ enum rte_filter_op { RTE_ETH_FILTER_OP_MAX }; -/** -* Define all structures for Ethertype Filter type. -*/ - -#define RTE_ETHTYPE_FLAGS_MAC 0x0001/**< If set, compare mac */ -#define RTE_ETHTYPE_FLAGS_DROP 0x0002/**< If set, drop packet when match */ - -/** -* A structure used to define the ethertype filter entry -* to support RTE_ETH_FILTER_ETHERTYPE with RTE_ETH_FILTER_ADD, -* RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations. -*/ -struct rte_eth_ethertype_filter { -struct rte_ether_addr mac_addr;/**< Mac address to match. */ -uint16_t ether_type;/**< Ether type to match */ -uint16_t flags;/**< Flags from RTE_ETHTYPE_FLAGS_* */ -uint16_t queue;/**< Queue assigned to when match*/ -}; -#define RTE_FLEX_FILTER_MAXLEN 128/**< bytes to use in flex filter. */ #define RTE_FLEX_FILTER_MASK_SIZE \ (RTE_ALIGN(RTE_FLEX_FILTER_MAXLEN, CHAR_BIT) / CHAR_BIT)
lib/librte_ethdev/rte_ethdev_driver.h +23 -0
@@ -1342,6 +1342,29 @@ int rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue, uint32_t direction); + +/* +* Legacy ethdev API used internally by drivers. +*/ + +/** +* Define all structures for Ethertype Filter type. +*/ + +#define RTE_ETHTYPE_FLAGS_MAC 0x0001/**< If set, compare mac */ +#define RTE_ETHTYPE_FLAGS_DROP 0x0002/**< If set, drop packet when match */ + +/** +* A structure used to define the ethertype filter entry +* to support RTE_ETH_FILTER_ETHERTYPE data representation. +*/ +struct rte_eth_ethertype_filter { +struct rte_ether_addr mac_addr;/**< Mac address to match. */ +uint16_t ether_type;/**< Ether type to match */ +uint16_t flags;/**< Flags from RTE_ETHTYPE_FLAGS_* */ +uint16_t queue;/**< Queue assigned to when match*/ +}; + #ifdef __cplusplus }#endif
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 03/14] ethdev: remove legacy EtherType filter type support
Quoted 8 lines · Andrew Rybchenko
RTE flow API should be used for filtering.
Move corresponding definitions to ethdev internal driver API since it is used by drivers internally.
PreserveRTE_ETH_FILTER_ETHERTYPEbecause of it as well.Signed-off-by Andrew Rybchenko <[email protected]>
For bnxt PMD
Quoted 737 lines
--- app/test-pmd/cmdline.c | 115 ------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 157 -------------------------- drivers/net/e1000/igb_ethdev.c | 85 -------------- drivers/net/hinic/hinic_pmd_ethdev.h | 1 + drivers/net/i40e/i40e_ethdev.c | 45 -------- drivers/net/ixgbe/ixgbe_ethdev.c | 85 -------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 19 ---- lib/librte_ethdev/rte_ethdev_driver.h | 23 ++++ 11 files changed, 25 insertions(+), 511 deletions(-)app/test-pmd/cmdline.c +0
-115@@ -976,11 +976,6 @@ static void cmd_help_long_parsed(void *parsed_result,"filters:\n" "--------\n\n" -"ethertype_filter (port_id) (add|del)" -" (mac_addr|mac_ignr) (mac_address) ethertype" -" (ether_type) (drop|fwd) queue (queue_id)\n" -" Add/Del an ethertype filter.\n\n" -"2tuple_filter (port_id) (add|del)" " dst_port (dst_port_value) protocol (protocol_value)" " mask (mask_value) tcp_flags (tcp_flags_value)" @@ -11069,115 +11064,6 @@ cmdline_parse_inst_t cmd_flex_filter = {/* *** Filters Control *** */ -/* *** deal with ethertype filter *** */ -struct cmd_ethertype_filter_result { -cmdline_fixed_string_t filter; -portid_t port_id; -cmdline_fixed_string_t ops; -cmdline_fixed_string_t mac; -struct rte_ether_addr mac_addr; -cmdline_fixed_string_t ethertype; -uint16_t ethertype_value; -cmdline_fixed_string_t drop; -cmdline_fixed_string_t queue; -uint16_t queue_id; -}; - -cmdline_parse_token_string_t cmd_ethertype_filter_filter = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - filter,"ethertype_filter" ); -cmdline_parse_token_num_t cmd_ethertype_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_ethertype_filter_ops = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - ops,"add#del" ); -cmdline_parse_token_string_t cmd_ethertype_filter_mac = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - mac,"mac_addr#mac_ignr" ); -cmdline_parse_token_etheraddr_t cmd_ethertype_filter_mac_addr = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_ethertype_filter_result, - mac_addr); -cmdline_parse_token_string_t cmd_ethertype_filter_ethertype = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - ethertype,"ethertype" ); -cmdline_parse_token_num_t cmd_ethertype_filter_ethertype_value = - TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result, - ethertype_value,UINT16 ); -cmdline_parse_token_string_t cmd_ethertype_filter_drop = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - drop,"drop#fwd" ); -cmdline_parse_token_string_t cmd_ethertype_filter_queue = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - queue,"queue" ); -cmdline_parse_token_num_t cmd_ethertype_filter_queue_id = - TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result, - queue_id,UINT16 ); - -static void -cmd_ethertype_filter_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_ethertype_filter_result *res = parsed_result; -struct rte_eth_ethertype_filter filter; -int ret =0 ; - - ret =rte_eth_dev_filter_supported (res->port_id, -RTE_ETH_FILTER_ETHERTYPE ); -if (ret <0 ) { -printf ("ethertype filter is not supported on port %u.\n" , - res->port_id); -return ; - } - -memset (&filter,0 ,sizeof (filter)); -if (!strcmp (res->mac,"mac_addr" )) { - filter.flags |=RTE_ETHTYPE_FLAGS_MAC ; -rte_memcpy (&filter.mac_addr, &res->mac_addr, -sizeof (struct rte_ether_addr )); - } -if (!strcmp (res->drop,"drop" )) - filter.flags |=RTE_ETHTYPE_FLAGS_DROP ; - filter.ether_type = res->ethertype_value; - filter.queue = res->queue_id; - -if (!strcmp (res->ops,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_ETHERTYPE , -RTE_ETH_FILTER_ADD , - &filter); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_ETHERTYPE , -RTE_ETH_FILTER_DELETE , - &filter); -if (ret <0 ) -printf ("ethertype filter programming error: (%s)\n" , -strerror (-ret)); -} - -cmdline_parse_inst_t cmd_ethertype_filter = { - .f = cmd_ethertype_filter_parsed, - .data =NULL , - .help_str ="ethertype_filter <port_id> add|del mac_addr|mac_ignr " -"<mac_addr> ethertype <value> drop|fw queue <queue_id>: " -"Add or delete an ethertype filter entry" , - .tokens = { - (void *)&cmd_ethertype_filter_filter, - (void *)&cmd_ethertype_filter_port_id, - (void *)&cmd_ethertype_filter_ops, - (void *)&cmd_ethertype_filter_mac, - (void *)&cmd_ethertype_filter_mac_addr, - (void *)&cmd_ethertype_filter_ethertype, - (void *)&cmd_ethertype_filter_ethertype_value, - (void *)&cmd_ethertype_filter_drop, - (void *)&cmd_ethertype_filter_queue, - (void *)&cmd_ethertype_filter_queue_id, -NULL , - }, -}; -/* *** deal with flow director filter *** */ struct cmd_flow_director_result {cmdline_fixed_string_t flow_director_filter;@@ -19944,7 +19830,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_config_rss_hash_key, (cmdline_parse_inst_t *)&cmd_dump, (cmdline_parse_inst_t *)&cmd_dump_one, - (cmdline_parse_inst_t *)&cmd_ethertype_filter, (cmdline_parse_inst_t *)&cmd_syn_filter, (cmdline_parse_inst_t *)&cmd_2tuple_filter, (cmdline_parse_inst_t *)&cmd_5tuple_filter,doc/guides/rel_notes/deprecation.rst +1
-1@@ -108,7 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, + as filter types FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.drivers/net/bnxt/bnxt_ethdev.c +0
-157@@ -2987,160 +2987,6 @@ bnxt_tx_descriptor_status_op(void *tx_queue, uint16_t offset)return RTE_ETH_TX_DESC_FULL ; } -static struct bnxt_filter_info * -bnxt_match_and_validate_ether_filter (struct bnxt *bp, -struct rte_eth_ethertype_filter *efilter, -struct bnxt_vnic_info *vnic0, -struct bnxt_vnic_info *vnic, -int *ret) -{ -struct bnxt_filter_info *mfilter =NULL ; -int match =0 ; - *ret =0 ; - -if (efilter->ether_type ==RTE_ETHER_TYPE_IPV4 || - efilter->ether_type ==RTE_ETHER_TYPE_IPV6 ) { -PMD_DRV_LOG (ERR ,"invalid ether_type(0x%04x) in" -" ethertype filter." , efilter->ether_type); - *ret = -EINVAL ; - goto exit; - } -if (efilter->queue >= bp->rx_nr_rings) { -PMD_DRV_LOG (ERR ,"Invalid queue %d\n" , efilter->queue); - *ret = -EINVAL ; - goto exit; - } - - vnic0 =BNXT_GET_DEFAULT_VNIC (bp); - vnic = &bp->vnic_info[efilter->queue]; -if (vnic ==NULL ) { -PMD_DRV_LOG (ERR ,"Invalid queue %d\n" , efilter->queue); - *ret = -EINVAL ; - goto exit; - } - -if (efilter->flags &RTE_ETHTYPE_FLAGS_DROP ) { - STAILQ_FOREACH(mfilter, &vnic0->filter, next) { -if ((!memcmp (efilter->mac_addr.addr_bytes, - mfilter->l2_addr,RTE_ETHER_ADDR_LEN ) && - mfilter->flags == -HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP && - mfilter->ethertype == efilter->ether_type)) { - match =1 ; -break ; - } - } - }else { - STAILQ_FOREACH(mfilter, &vnic->filter, next) -if ((!memcmp (efilter->mac_addr.addr_bytes, - mfilter->l2_addr,RTE_ETHER_ADDR_LEN ) && - mfilter->ethertype == efilter->ether_type && - mfilter->flags == -HWRM_CFA_L2_FILTER_CFG_INPUT_FLAGS_PATH_RX )) { - match =1 ; -break ; - } - } - -if (match) - *ret = -EEXIST ; - -exit: -return mfilter; -} - -static int -bnxt_ethertype_filter (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg) -{ -struct bnxt *bp = dev->data->dev_private; -struct rte_eth_ethertype_filter *efilter = - (struct rte_eth_ethertype_filter *)arg; -struct bnxt_filter_info *bfilter, *filter1; -struct bnxt_vnic_info *vnic, *vnic0; -int ret; - -if (filter_op ==RTE_ETH_FILTER_NOP ) -return 0 ; - -if (arg ==NULL ) { -PMD_DRV_LOG (ERR ,"arg shouldn't be NULL for operation %u." , - filter_op); -return -EINVAL ; - } - - vnic0 =BNXT_GET_DEFAULT_VNIC (bp); - vnic = &bp->vnic_info[efilter->queue]; - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : -bnxt_match_and_validate_ether_filter (bp, efilter, - vnic0, vnic, &ret); -if (ret <0 ) -return ret; - - bfilter =bnxt_get_unused_filter (bp); -if (bfilter ==NULL ) { -PMD_DRV_LOG (ERR , -"Not enough resources for a new filter.\n" ); -return -ENOMEM ; - } - bfilter->filter_type =HWRM_CFA_NTUPLE_FILTER ; -memcpy (bfilter->l2_addr, efilter->mac_addr.addr_bytes, -RTE_ETHER_ADDR_LEN ); -memcpy (bfilter->dst_macaddr, efilter->mac_addr.addr_bytes, -RTE_ETHER_ADDR_LEN ); - bfilter->enables |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_MACADDR ; - bfilter->ethertype = efilter->ether_type; - bfilter->enables |=NTUPLE_FLTR_ALLOC_INPUT_EN_ETHERTYPE ; - - filter1 =bnxt_get_l2_filter (bp, bfilter, vnic0); -if (filter1 ==NULL ) { - ret = -EINVAL ; - goto cleanup; - } - bfilter->enables |= -HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID ; - bfilter->fw_l2_filter_id = filter1->fw_l2_filter_id; - - bfilter->dst_id = vnic->fw_vnic_id; - -if (efilter->flags &RTE_ETHTYPE_FLAGS_DROP ) { - bfilter->flags = -HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP ; - } - - ret =bnxt_hwrm_set_ntuple_filter (bp, bfilter->dst_id, bfilter); -if (ret) - goto cleanup; -STAILQ_INSERT_TAIL (&vnic->filter, bfilter, next); -break ; -case RTE_ETH_FILTER_DELETE : - filter1 =bnxt_match_and_validate_ether_filter (bp, efilter, - vnic0, vnic, &ret); -if (ret == -EEXIST ) { - ret =bnxt_hwrm_clear_ntuple_filter (bp, filter1); - -STAILQ_REMOVE (&vnic->filter, filter1, bnxt_filter_info, - next); -bnxt_free_filter (bp, filter1); - }else if (ret ==0 ) { -PMD_DRV_LOG (ERR ,"No matching filter found\n" ); - } -break ; -default : -PMD_DRV_LOG (ERR ,"unsupported operation %u." , filter_op); - ret = -EINVAL ; - goto error; - } -return ret; -cleanup: -bnxt_free_filter (bp, bfilter); -error: -return ret; -} - static inline int parse_ntuple_filter(struct bnxt *bp, struct rte_eth_ntuple_filter *nfilter,@@ -3815,9 +3661,6 @@ bnxt_filter_ctrl_op(struct rte_eth_dev *dev,case RTE_ETH_FILTER_NTUPLE : ret =bnxt_ntuple_filter (dev, filter_op, arg);break ; -case RTE_ETH_FILTER_ETHERTYPE : - ret =bnxt_ethertype_filter (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_GENERIC :if (filter_op !=RTE_ETH_FILTER_GET )return -EINVAL ;drivers/net/e1000/igb_ethdev.c +0
-85@@ -209,11 +209,6 @@ static int igb_get_ntuple_filter(struct rte_eth_dev *dev,static int igb_ntuple_filter_handle (struct rte_eth_dev *dev,enum rte_filter_op filter_op,void *arg); -static int igb_ethertype_filter_handle (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg); -static int igb_get_ethertype_filter (struct rte_eth_dev *dev, -struct rte_eth_ethertype_filter *filter); static int eth_igb_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type, enum rte_filter_op filter_op,@@ -4842,83 +4837,6 @@ igb_add_del_ethertype_filter(struct rte_eth_dev *dev,return 0 ; } -static int -igb_get_ethertype_filter (struct rte_eth_dev *dev, -struct rte_eth_ethertype_filter *filter) -{ -struct e1000_hw *hw =E1000_DEV_PRIVATE_TO_HW (dev->data->dev_private); -struct e1000_filter_info *filter_info = -E1000_DEV_PRIVATE_TO_FILTER_INFO (dev->data->dev_private); -uint32_t etqf; -int ret; - - ret =igb_ethertype_filter_lookup (filter_info, filter->ether_type); -if (ret <0 ) { -PMD_DRV_LOG (ERR ,"ethertype (0x%04x) filter doesn't exist." , - filter->ether_type); -return -ENOENT ; - } - - etqf =E1000_READ_REG (hw,E1000_ETQF (ret)); -if (etqf &E1000_ETQF_FILTER_ENABLE ) { - filter->ether_type = etqf &E1000_ETQF_ETHERTYPE ; - filter->flags =0 ; - filter->queue = (etqf &E1000_ETQF_QUEUE ) >> -E1000_ETQF_QUEUE_SHIFT ; -return 0 ; - } - -return -ENOENT ; -} - -/* -* igb_ethertype_filter_handle - Handle operations for ethertype filter. -* @dev: pointer to rte_eth_dev structure -* @filter_op:operation will be taken. -* @arg: a pointer to specific structure corresponding to the filter_op -*/ -static int -igb_ethertype_filter_handle (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg) -{ -struct e1000_hw *hw =E1000_DEV_PRIVATE_TO_HW (dev->data->dev_private); -int ret; - -MAC_TYPE_FILTER_SUP (hw->mac.type); - -if (filter_op ==RTE_ETH_FILTER_NOP ) -return 0 ; - -if (arg ==NULL ) { -PMD_DRV_LOG (ERR ,"arg shouldn't be NULL for operation %u." , - filter_op); -return -EINVAL ; - } - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : - ret =igb_add_del_ethertype_filter (dev, - (struct rte_eth_ethertype_filter *)arg, - TRUE); -break ; -case RTE_ETH_FILTER_DELETE : - ret =igb_add_del_ethertype_filter (dev, - (struct rte_eth_ethertype_filter *)arg, - FALSE); -break ; -case RTE_ETH_FILTER_GET : - ret =igb_get_ethertype_filter (dev, - (struct rte_eth_ethertype_filter *)arg); -break ; -default : -PMD_DRV_LOG (ERR ,"unsupported operation %u." , filter_op); - ret = -EINVAL ; -break ; - } -return ret; -} - static int eth_igb_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,@@ -4931,9 +4849,6 @@ eth_igb_filter_ctrl(struct rte_eth_dev *dev,case RTE_ETH_FILTER_NTUPLE : ret =igb_ntuple_filter_handle (dev, filter_op, arg);break ; -case RTE_ETH_FILTER_ETHERTYPE : - ret =igb_ethertype_filter_handle (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_SYN : ret =eth_igb_syn_filter_handle (dev, filter_op, arg);break ;drivers/net/hinic/hinic_pmd_ethdev.h +1
-0@@ -7,6 +7,7 @@#include <rte_ethdev.h> #include <rte_ethdev_core.h> +#include <rte_ethdev_driver.h> #include "base/hinic_compat.h" #include "base/hinic_pmd_cfg.h" drivers/net/i40e/i40e_ethdev.c +0
-45@@ -319,9 +319,6 @@ static int i40e_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,static int i40e_dev_udp_tunnel_port_del (struct rte_eth_dev *dev,struct rte_eth_udp_tunnel *udp_tunnel);static void i40e_filter_input_set_init (struct i40e_pf *pf); -static int i40e_ethertype_filter_handle (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg); static int i40e_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type, enum rte_filter_op filter_op,@@ -10449,45 +10446,6 @@ i40e_ethertype_filter_set(struct i40e_pf *pf,return ret; } -/* -* Handle operations for ethertype filter. -*/ -static int -i40e_ethertype_filter_handle (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg) -{ -struct i40e_pf *pf =I40E_DEV_PRIVATE_TO_PF (dev->data->dev_private); -int ret =0 ; - -if (filter_op ==RTE_ETH_FILTER_NOP ) -return ret; - -if (arg ==NULL ) { -PMD_DRV_LOG (ERR ,"arg shouldn't be NULL for operation %u" , - filter_op); -return -EINVAL ; - } - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : - ret =i40e_ethertype_filter_set (pf, - (struct rte_eth_ethertype_filter *)arg, - TRUE); -break ; -case RTE_ETH_FILTER_DELETE : - ret =i40e_ethertype_filter_set (pf, - (struct rte_eth_ethertype_filter *)arg, - FALSE); -break ; -default : -PMD_DRV_LOG (ERR ,"unsupported operation %u" , filter_op); - ret = -ENOSYS ; -break ; - } -return ret; -} - static int i40e_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,@@ -10507,9 +10465,6 @@ i40e_dev_filter_ctrl(struct rte_eth_dev *dev,case RTE_ETH_FILTER_HASH : ret =i40e_hash_filter_ctrl (dev, filter_op, arg);break ; -case RTE_ETH_FILTER_ETHERTYPE : - ret =i40e_ethertype_filter_handle (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_TUNNEL : ret =i40e_tunnel_filter_handle (dev, filter_op, arg);break ;drivers/net/ixgbe/ixgbe_ethdev.c +0
-85@@ -314,11 +314,6 @@ static int ixgbe_ntuple_filter_handle(struct rte_eth_dev *dev, void *arg);static int ixgbe_get_ntuple_filter (struct rte_eth_dev *dev,struct rte_eth_ntuple_filter *filter); -static int ixgbe_ethertype_filter_handle (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg); -static int ixgbe_get_ethertype_filter (struct rte_eth_dev *dev, -struct rte_eth_ethertype_filter *filter); static int ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type, enum rte_filter_op filter_op,@@ -6967,83 +6962,6 @@ ixgbe_add_del_ethertype_filter(struct rte_eth_dev *dev,return 0 ; } -static int -ixgbe_get_ethertype_filter (struct rte_eth_dev *dev, -struct rte_eth_ethertype_filter *filter) -{ -struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); -struct ixgbe_filter_info *filter_info = -IXGBE_DEV_PRIVATE_TO_FILTER_INFO (dev->data->dev_private); -uint32_t etqf, etqs; -int ret; - - ret =ixgbe_ethertype_filter_lookup (filter_info, filter->ether_type); -if (ret <0 ) { -PMD_DRV_LOG (ERR ,"ethertype (0x%04x) filter doesn't exist." , - filter->ether_type); -return -ENOENT ; - } - - etqf =IXGBE_READ_REG (hw,IXGBE_ETQF (ret)); -if (etqf &IXGBE_ETQF_FILTER_EN ) { - etqs =IXGBE_READ_REG (hw,IXGBE_ETQS (ret)); - filter->ether_type = etqf &IXGBE_ETQF_ETHERTYPE ; - filter->flags =0 ; - filter->queue = (etqs &IXGBE_ETQS_RX_QUEUE ) >> -IXGBE_ETQS_RX_QUEUE_SHIFT ; -return 0 ; - } -return -ENOENT ; -} - -/* -* ixgbe_ethertype_filter_handle - Handle operations for ethertype filter. -* @dev: pointer to rte_eth_dev structure -* @filter_op:operation will be taken. -* @arg: a pointer to specific structure corresponding to the filter_op -*/ -static int -ixgbe_ethertype_filter_handle (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg) -{ -struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); -int ret; - -MAC_TYPE_FILTER_SUP (hw->mac.type); - -if (filter_op ==RTE_ETH_FILTER_NOP ) -return 0 ; - -if (arg ==NULL ) { -PMD_DRV_LOG (ERR ,"arg shouldn't be NULL for operation %u." , - filter_op); -return -EINVAL ; - } - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : - ret =ixgbe_add_del_ethertype_filter (dev, - (struct rte_eth_ethertype_filter *)arg, - TRUE); -break ; -case RTE_ETH_FILTER_DELETE : - ret =ixgbe_add_del_ethertype_filter (dev, - (struct rte_eth_ethertype_filter *)arg, - FALSE); -break ; -case RTE_ETH_FILTER_GET : - ret =ixgbe_get_ethertype_filter (dev, - (struct rte_eth_ethertype_filter *)arg); -break ; -default : -PMD_DRV_LOG (ERR ,"unsupported operation %u." , filter_op); - ret = -EINVAL ; -break ; - } -return ret; -} - static int ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,@@ -7056,9 +6974,6 @@ ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev,case RTE_ETH_FILTER_NTUPLE : ret =ixgbe_ntuple_filter_handle (dev, filter_op, arg);break ; -case RTE_ETH_FILTER_ETHERTYPE : - ret =ixgbe_ethertype_filter_handle (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_SYN : ret =ixgbe_syn_filter_handle (dev, filter_op, arg);break ;drivers/net/qede/qede_filter.c +0
-1@@ -1561,7 +1561,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops;return 0 ; -case RTE_ETH_FILTER_ETHERTYPE :case RTE_ETH_FILTER_FLEXIBLE :case RTE_ETH_FILTER_SYN :case RTE_ETH_FILTER_HASH :drivers/net/sfc/sfc_ethdev.c +0
-3@@ -1748,9 +1748,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,case RTE_ETH_FILTER_NONE :sfc_err (sa,"Global filters configuration not supported" );break ; -case RTE_ETH_FILTER_ETHERTYPE : -sfc_err (sa,"EtherType filters not supported" ); -break ;case RTE_ETH_FILTER_FLEXIBLE :sfc_err (sa,"Flexible filters not supported" );break ;lib/librte_ethdev/rte_eth_ctrl.h +0
-19@@ -56,25 +56,6 @@ enum rte_filter_op { RTE_ETH_FILTER_OP_MAX }; -/** -* Define all structures for Ethertype Filter type. -*/ - -#define RTE_ETHTYPE_FLAGS_MAC 0x0001/**< If set, compare mac */ -#define RTE_ETHTYPE_FLAGS_DROP 0x0002/**< If set, drop packet when match */ - -/** -* A structure used to define the ethertype filter entry -* to support RTE_ETH_FILTER_ETHERTYPE with RTE_ETH_FILTER_ADD, -* RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations. -*/ -struct rte_eth_ethertype_filter { -struct rte_ether_addr mac_addr;/**< Mac address to match. */ -uint16_t ether_type;/**< Ether type to match */ -uint16_t flags;/**< Flags from RTE_ETHTYPE_FLAGS_* */ -uint16_t queue;/**< Queue assigned to when match*/ -}; -#define RTE_FLEX_FILTER_MAXLEN 128/**< bytes to use in flex filter. */ #define RTE_FLEX_FILTER_MASK_SIZE \ (RTE_ALIGN(RTE_FLEX_FILTER_MAXLEN, CHAR_BIT) / CHAR_BIT)lib/librte_ethdev/rte_ethdev_driver.h +23
-1@@ -1342,6 +1342,29 @@ int rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue, uint32_t direction); + +/* +* Legacy ethdev API used internally by drivers. +*/ + +/** +* Define all structures for Ethertype Filter type. +*/ + +#define RTE_ETHTYPE_FLAGS_MAC 0x0001/**< If set, compare mac */ +#define RTE_ETHTYPE_FLAGS_DROP 0x0002/**< If set, drop packet when match */ + +/** +* A structure used to define the ethertype filter entry +* to support RTE_ETH_FILTER_ETHERTYPE data representation. +*/ +struct rte_eth_ethertype_filter { +struct rte_ether_addr mac_addr;/**< Mac address to match. */ +uint16_t ether_type;/**< Ether type to match */ +uint16_t flags;/**< Flags from RTE_ETHTYPE_FLAGS_* */ +uint16_t queue;/**< Queue assigned to when match*/ +}; + #ifdef __cplusplus }#endif --2.17.1
Re: [dpdk-dev] [PATCH 03/14] ethdev: remove legacy EtherType filter type support
In reply to Andrew RybchenkoQuoted 21 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 22:09
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Ziyang Xuan <[email protected]>; Xiaoyun Wang <[email protected]>; Guoyang Zhou <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 03/14] ethdev: remove legacy EtherType filter type supportRTE flow API should be used for filtering.
Move corresponding definitions to ethdev internal driver API since it is used by drivers internally.
PreserveRTE_ETH_FILTER_ETHERTYPEbecause of it as well.Signed-off-by Andrew Rybchenko <[email protected]>
Quoted 14 lines
--- app/test-pmd/cmdline.c | 115 ------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 157 -------------------------- drivers/net/e1000/igb_ethdev.c | 85 -------------- drivers/net/hinic/hinic_pmd_ethdev.h | 1 + drivers/net/i40e/i40e_ethdev.c | 45 -------- drivers/net/ixgbe/ixgbe_ethdev.c | 85 -------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 19 ---- lib/librte_ethdev/rte_ethdev_driver.h | 23 ++++ 11 files changed, 25 insertions(+), 511 deletions(-)
For e1000, ixgbe PMDs
Quoted 1 line
2.17.1
A message that is not in the archive (sent off-list or not yet received): BYAPR11MB3493BE2EB0D5B91DDDCD99758C1C0@BYAPR11MB3493.namprd11.prod.outlook.com
Re: [dpdk-dev] [PATCH 03/14] ethdev: remove legacy EtherType filter type support
Quoted 41 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Ziyang Xuan <[email protected]>; Xiaoyun Wang <[email protected]>; Guoyang Zhou <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 03/14] ethdev: remove legacy EtherType filter type supportRTE flow API should be used for filtering.
Move corresponding definitions to ethdev internal driver API since it is used by drivers internally.
PreserveRTE_ETH_FILTER_ETHERTYPEbecause of it as well.Signed-off-by Andrew Rybchenko <[email protected]>--- app/test-pmd/cmdline.c | 115 ------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 157 -------------------------- drivers/net/e1000/igb_ethdev.c | 85 -------------- drivers/net/hinic/hinic_pmd_ethdev.h | 1 + drivers/net/i40e/i40e_ethdev.c | 45 -------- drivers/net/ixgbe/ixgbe_ethdev.c | 85 -------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 19 ---- lib/librte_ethdev/rte_ethdev_driver.h | 23 ++++ 11 files changed, 25 insertions(+), 511 deletions(-)
<...>
Quoted 9 lines
#define RTE_FLEX_FILTER_MAXLEN128/**< bytes to use in flex filter. */
#define RTE_FLEX_FILTER_MASK_SIZE\
(RTE_ALIGN(RTE_FLEX_FILTER_MAXLEN, CHAR_BIT)/CHAR_BIT) diff --gita/lib/librte_ethdev/rte_ethdev_driver.hb/lib/librte_ethdev/rte_ethdev_driver.h
indexc63b9f7eb7..67a83dacc7100644
lib/librte_ethdev/rte_ethdev_driver.h int · line 1347
Quoted 6 lines
lib/librte_ethdev/rte_ethdev_driver.h +2
-0@@ -1342,6 +1342,29 @@ int rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue, uint32_t direction); + +/*
s/*/**
lib/librte_ethdev/rte_ethdev_driver.h int · line 1349
Quoted 3 lines
lib/librte_ethdev/rte_ethdev_driver.h +3
-0+* Legacy ethdev API used internally by drivers. +*/ +
I am not sure if this doc is need?
Quoted 25 lines
lib/librte_ethdev/rte_ethdev_driver.h +6
-0+/** +* Define all structures for Ethertype Filter type. +*/ + +#define RTE_ETHTYPE_FLAGS_MAC 0x0001/**< If set, compare mac */ +#define RTE_ETHTYPE_FLAGS_DROP 0x0002/**< If set, drop packet when match */
lib/librte_ethdev/rte_ethdev_driver.h +12
-1+ +/** +* A structure used to define the ethertype filter entry +* to support RTE_ETH_FILTER_ETHERTYPE data representation. +*/ +struct rte_eth_ethertype_filter { +struct rte_ether_addr mac_addr;/**< Mac address to match. */ +uint16_t ether_type;/**< Ether type to match */ +uint16_t flags;/**< Flags from RTE_ETHTYPE_FLAGS_* */ +uint16_t queue;/**< Queue assigned to when match*/ +}; + #ifdef __cplusplus }#endif --2.17.1
Re: [dpdk-dev] [PATCH 03/14] ethdev: remove legacy EtherType filter type support
Quoted 57 lines · Jia
Quoted 41 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Ziyang Xuan <[email protected]>; Xiaoyun Wang <[email protected]>; Guoyang Zhou <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 03/14] ethdev: remove legacy EtherType filter type supportRTE flow API should be used for filtering.
Move corresponding definitions to ethdev internal driver API since it is used by drivers internally.
PreserveRTE_ETH_FILTER_ETHERTYPEbecause of it as well.Signed-off-by Andrew Rybchenko <[email protected]>--- app/test-pmd/cmdline.c | 115 ------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 157 -------------------------- drivers/net/e1000/igb_ethdev.c | 85 -------------- drivers/net/hinic/hinic_pmd_ethdev.h | 1 + drivers/net/i40e/i40e_ethdev.c | 45 -------- drivers/net/ixgbe/ixgbe_ethdev.c | 85 -------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 19 ---- lib/librte_ethdev/rte_ethdev_driver.h | 23 ++++ 11 files changed, 25 insertions(+), 511 deletions(-)<...>
Quoted 13 lines
#define RTE_FLEX_FILTER_MAXLEN128/**< bytes to use in flex filter. */
#define RTE_FLEX_FILTER_MASK_SIZE\
(RTE_ALIGN(RTE_FLEX_FILTER_MAXLEN, CHAR_BIT)/CHAR_BIT) diff --gita/lib/librte_ethdev/rte_ethdev_driver.hb/lib/librte_ethdev/rte_ethdev_driver.h
indexc63b9f7eb7..67a83dacc7100644lib/librte_ethdev/rte_ethdev_driver.h +0
-0@@ -1342,6 +1342,29 @@ int rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue, uint32_t direction);
Quoted 4 lines
lib/librte_ethdev/rte_ethdev_driver.h int · line 1346
Quoted 2 lines
lib/librte_ethdev/rte_ethdev_driver.h +2
-0+ +/* s/*/**
No, it is not going to be a comment picked up by doxygen. Otherwise it requires @group mark up etc which is not used in DPDK as far as I know.
Quoted 5 lines
lib/librte_ethdev/rte_ethdev_driver.h int · line 1349
Quoted 3 lines
lib/librte_ethdev/rte_ethdev_driver.h +3
-0+* Legacy ethdev API used internally by drivers. +*/ +I am not sure if this doc is need?
I think it is required to highlight that it is legacy and should not be used by new drivers.
Quoted 26 lines
Quoted 25 lines
lib/librte_ethdev/rte_ethdev_driver.h +6
-0+/** +* Define all structures for Ethertype Filter type. +*/ + +#define RTE_ETHTYPE_FLAGS_MAC 0x0001/**< If set, compare mac */ +#define RTE_ETHTYPE_FLAGS_DROP 0x0002/**< If set, drop packet when match */
lib/librte_ethdev/rte_ethdev_driver.h +12
-1+ +/** +* A structure used to define the ethertype filter entry +* to support RTE_ETH_FILTER_ETHERTYPE data representation. +*/ +struct rte_eth_ethertype_filter { +struct rte_ether_addr mac_addr;/**< Mac address to match. */ +uint16_t ether_type;/**< Ether type to match */ +uint16_t flags;/**< Flags from RTE_ETHTYPE_FLAGS_* */ +uint16_t queue;/**< Queue assigned to when match*/ +}; + #ifdef __cplusplus }#endif --2.17.1
PATCH 4/14 ethdev: remove legacy flexible filter type support
In reply to Andrew RybchenkoRTE flow API should be used for filtering.
Temporarily preserve helper defines in public interface.
--- app/test-pmd/cmdline.c | 195 --------------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/e1000/igb_ethdev.c | 104 -------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - 5 files changed, 1 insertion(+), 304 deletions(-)
app/test-pmd/cmdline.c +0 -195
@@ -993,11 +993,6 @@ static void cmd_help_long_parsed(void *parsed_result,"syn_filter (port_id) (add|del) priority (high|low) queue (queue_id)" " Add/Del syn filter.\n\n" -"flex_filter (port_id) (add|del) len (len_value)" -" bytes (bytes_value) mask (mask_value)" -" priority (prio_value) queue (queue_id)\n" -" Add/Del a flex filter.\n\n" -"flow_director_filter (port_id) mode IP (add|del|update)" " flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)" " src (src_ip_address) dst (dst_ip_address)"
@@ -10873,195 +10868,6 @@ cmdline_parse_inst_t cmd_5tuple_filter = { }, }; -/* *** ADD/REMOVE A flex FILTER *** */ -struct cmd_flex_filter_result { -cmdline_fixed_string_t filter; -cmdline_fixed_string_t ops; -portid_t port_id; -cmdline_fixed_string_t len; -uint8_t len_value; -cmdline_fixed_string_t bytes; -cmdline_fixed_string_t bytes_value; -cmdline_fixed_string_t mask; -cmdline_fixed_string_t mask_value; -cmdline_fixed_string_t priority; -uint8_t priority_value; -cmdline_fixed_string_t queue; -uint16_t queue_id; -}; - -static int xdigit2val (unsigned char c) -{ -int val; -if (isdigit (c)) - val = c -'0' ; -else if (isupper (c)) - val = c -'A' +10 ; -else - val = c -'a' +10 ; -return val; -} - -static void -cmd_flex_filter_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -int ret =0 ; -struct rte_eth_flex_filter filter; -struct cmd_flex_filter_result *res = parsed_result; -char *bytes_ptr, *mask_ptr; -uint16_t len, i, j =0 ; -char c; -int val; -uint8_t byte =0 ; - -if (res->len_value >RTE_FLEX_FILTER_MAXLEN ) { -printf ("the len exceed the max length 128\n" ); -return ; - } -memset (&filter,0 ,sizeof (struct rte_eth_flex_filter )); - filter.len = res->len_value; - filter.priority = res->priority_value; - filter.queue = res->queue_id; - bytes_ptr = res->bytes_value; - mask_ptr = res->mask_value; - -/* translate bytes string to array. */ -if (bytes_ptr[0 ] =='0' && ((bytes_ptr[1 ] =='x' ) || - (bytes_ptr[1 ] =='X' ))) - bytes_ptr +=2 ; - len =strnlen (bytes_ptr, res->len_value *2 ); -if (len ==0 || (len %8 !=0 )) { -printf ("please check len and bytes input\n" ); -return ; - } -for (i =0 ; i < len; i++) { - c = bytes_ptr[i]; -if (isxdigit (c) ==0 ) { -/* invalid characters. */ -printf ("invalid input\n" ); -return ; - } - val =xdigit2val (c); -if (i %2 ) { - byte |= val; - filter.bytes[j] = byte; -printf ("bytes[%d]:%02x " , j, filter.bytes[j]); - j++; - byte =0 ; - }else - byte |= val <<4 ; - } -printf ("\n" ); -/* translate mask string to uint8_t array. */ -if (mask_ptr[0 ] =='0' && ((mask_ptr[1 ] =='x' ) || - (mask_ptr[1 ] =='X' ))) - mask_ptr +=2 ; - len =strnlen (mask_ptr, (res->len_value +3 ) /4 ); -if (len ==0 ) { -printf ("invalid input\n" ); -return ; - } - j =0 ; - byte =0 ; -for (i =0 ; i < len; i++) { - c = mask_ptr[i]; -if (isxdigit (c) ==0 ) { -/* invalid characters. */ -printf ("invalid input\n" ); -return ; - } - val =xdigit2val (c); -if (i %2 ) { - byte |= val; - filter.mask[j] = byte; -printf ("mask[%d]:%02x " , j, filter.mask[j]); - j++; - byte =0 ; - }else - byte |= val <<4 ; - } -printf ("\n" ); - -if (!strcmp (res->ops,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_FLEXIBLE , -RTE_ETH_FILTER_ADD , - &filter); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_FLEXIBLE , -RTE_ETH_FILTER_DELETE , - &filter); - -if (ret <0 ) -printf ("flex filter setting error: (%s)\n" ,strerror (-ret)); -} - -cmdline_parse_token_string_t cmd_flex_filter_filter = - TOKEN_STRING_INITIALIZER(struct cmd_flex_filter_result, - filter,"flex_filter" ); -cmdline_parse_token_num_t cmd_flex_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_flex_filter_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_flex_filter_ops = - TOKEN_STRING_INITIALIZER(struct cmd_flex_filter_result, - ops,"add#del" ); -cmdline_parse_token_string_t cmd_flex_filter_len = - TOKEN_STRING_INITIALIZER(struct cmd_flex_filter_result, - len,"len" ); -cmdline_parse_token_num_t cmd_flex_filter_len_value = - TOKEN_NUM_INITIALIZER(struct cmd_flex_filter_result, - len_value,UINT8 ); -cmdline_parse_token_string_t cmd_flex_filter_bytes = - TOKEN_STRING_INITIALIZER(struct cmd_flex_filter_result, - bytes,"bytes" ); -cmdline_parse_token_string_t cmd_flex_filter_bytes_value = - TOKEN_STRING_INITIALIZER(struct cmd_flex_filter_result, - bytes_value,NULL ); -cmdline_parse_token_string_t cmd_flex_filter_mask = - TOKEN_STRING_INITIALIZER(struct cmd_flex_filter_result, - mask,"mask" ); -cmdline_parse_token_string_t cmd_flex_filter_mask_value = - TOKEN_STRING_INITIALIZER(struct cmd_flex_filter_result, - mask_value,NULL ); -cmdline_parse_token_string_t cmd_flex_filter_priority = - TOKEN_STRING_INITIALIZER(struct cmd_flex_filter_result, - priority,"priority" ); -cmdline_parse_token_num_t cmd_flex_filter_priority_value = - TOKEN_NUM_INITIALIZER(struct cmd_flex_filter_result, - priority_value,UINT8 ); -cmdline_parse_token_string_t cmd_flex_filter_queue = - TOKEN_STRING_INITIALIZER(struct cmd_flex_filter_result, - queue,"queue" ); -cmdline_parse_token_num_t cmd_flex_filter_queue_id = - TOKEN_NUM_INITIALIZER(struct cmd_flex_filter_result, - queue_id,UINT16 ); -cmdline_parse_inst_t cmd_flex_filter = { - .f = cmd_flex_filter_parsed, - .data =NULL , - .help_str ="flex_filter <port_id> add|del len <value> bytes " -"<value> mask <value> priority <value> queue <queue_id>: " -"Add/Del a flex filter" , - .tokens = { - (void *)&cmd_flex_filter_filter, - (void *)&cmd_flex_filter_port_id, - (void *)&cmd_flex_filter_ops, - (void *)&cmd_flex_filter_len, - (void *)&cmd_flex_filter_len_value, - (void *)&cmd_flex_filter_bytes, - (void *)&cmd_flex_filter_bytes_value, - (void *)&cmd_flex_filter_mask, - (void *)&cmd_flex_filter_mask_value, - (void *)&cmd_flex_filter_priority, - (void *)&cmd_flex_filter_priority_value, - (void *)&cmd_flex_filter_queue, - (void *)&cmd_flex_filter_queue_id, -NULL , - }, -}; -/* *** Filters Control *** */ /* *** deal with flow director filter *** */
@@ -19833,7 +19639,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_syn_filter, (cmdline_parse_inst_t *)&cmd_2tuple_filter, (cmdline_parse_inst_t *)&cmd_5tuple_filter, - (cmdline_parse_inst_t *)&cmd_flex_filter, (cmdline_parse_inst_t *)&cmd_add_del_ip_flow_director, (cmdline_parse_inst_t *)&cmd_add_del_udp_flow_director, (cmdline_parse_inst_t *)&cmd_add_del_sctp_flow_director,
doc/guides/rel_notes/deprecation.rst +1 -1
@@ -108,7 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, + as filter types SYN, NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.
drivers/net/e1000/igb_ethdev.c +0 -104
122 lines not on this page · raw message
drivers/net/qede/qede_filter.c +0 -1
@@ -1561,7 +1561,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops;return 0 ; -case RTE_ETH_FILTER_FLEXIBLE :case RTE_ETH_FILTER_SYN :case RTE_ETH_FILTER_HASH :case RTE_ETH_FILTER_L2_TUNNEL :
drivers/net/sfc/sfc_ethdev.c +0 -3
@@ -1748,9 +1748,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,case RTE_ETH_FILTER_NONE :sfc_err (sa,"Global filters configuration not supported" );break ; -case RTE_ETH_FILTER_FLEXIBLE : -sfc_err (sa,"Flexible filters not supported" ); -break ;case RTE_ETH_FILTER_SYN :sfc_err (sa,"SYN filters not supported" );break ;
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 04/14] ethdev: remove legacy flexible filter type support
Quoted 12 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 22:09
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]
Subject: [PATCH 04/14] ethdev: remove legacy flexible filter type supportRTE flow API should be used for filtering.
Quoted 7 lines
Temporarily preserve helper defines in public interface.
Signed-off-by Andrew Rybchenko <[email protected]>--- app/test-pmd/cmdline.c | 195 --------------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/e1000/igb_ethdev.c | 104 --------------
For igb PMD,
Quoted 6 lines
drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - 5 files changed, 1 insertion(+), 304 deletions(-)2.17.1
PATCH 5/14 ethdev: move flexible filter type to e1000 driver
In reply to Andrew Rybchenkonet/e1000 driver is the only user of the struct rte_eth_flex_filter and helper defines. Move it to the driver and use igb_ prefix instead of rte_eth_.
--- drivers/net/e1000/e1000_ethdev.h | 22 +++++++++++++++++-- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_flow.c | 36 ++++++++++++++++---------------- lib/librte_ethdev/rte_eth_ctrl.h | 19 ----------------- 4 files changed, 39 insertions(+), 40 deletions(-)
drivers/net/e1000/e1000_ethdev.h +20 -2
@@ -331,10 +331,28 @@ struct igb_eth_syn_filter_ele {struct rte_eth_syn_filter filter_info; }; +#define IGB_FLEX_FILTER_MAXLEN 128/**< bytes to use in flex filter. */ +#define IGB_FLEX_FILTER_MASK_SIZE \ + (RTE_ALIGN(IGB_FLEX_FILTER_MAXLEN, CHAR_BIT) / CHAR_BIT) +/**< mask bytes in flex filter. */ + +/** +* A structure used to define the flex filter entry +* to support RTE_ETH_FILTER_FLEXIBLE data representation. +*/ +struct igb_flex_filter { +uint16_t len; +uint8_t bytes[IGB_FLEX_FILTER_MAXLEN ];/**< flex bytes in big endian. */ +uint8_t mask[IGB_FLEX_FILTER_MASK_SIZE ]; +/**< if mask bit is 1b, do not compare corresponding byte. */ +uint8_t priority; +uint16_t queue;/**< Queue assigned to when match. */ +}; +/* flex filter list structure */ struct igb_flex_filter_ele {TAILQ_ENTRY (igb_flex_filter_ele) entries; -struct rte_eth_flex_filter filter_info; +struct igb_flex_filter filter_info; };/* rss filter list structure */
@@ -515,7 +533,7 @@ int eth_igb_syn_filter_set(struct rte_eth_dev *dev,struct rte_eth_syn_filter *filter, bool add);int eth_igb_add_del_flex_filter (struct rte_eth_dev *dev, -struct rte_eth_flex_filter *filter, +struct igb_flex_filter *filter,bool add); int igb_rss_conf_init(struct rte_eth_dev *dev, struct igb_rte_flow_rss_conf *out,
drivers/net/e1000/igb_ethdev.c +1 -1
@@ -4050,7 +4050,7 @@ igb_remove_flex_filter(struct rte_eth_dev *dev,int eth_igb_add_del_flex_filter (struct rte_eth_dev *dev, -struct rte_eth_flex_filter *filter, +struct igb_flex_filter *filter,bool add) { struct e1000_filter_info *filter_info =
drivers/net/e1000/igb_flow.c +18 -18
@@ -1041,7 +1041,7 @@ static int cons_parse_flex_filter(const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], - struct rte_eth_flex_filter *filter, + struct igb_flex_filter *filter, struct rte_flow_error *error) { const struct rte_flow_item *item;
@@ -1102,7 +1102,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,if (!raw_mask->length || !raw_mask->relative) { -memset (filter,0 ,sizeof (struct rte_eth_flex_filter )); +memset (filter,0 ,sizeof (struct igb_flex_filter ));rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ITEM , item,"Not supported by flex filter" );
@@ -1116,7 +1116,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,for (j =0 ; j < raw_spec->length; j++) {if (raw_mask->pattern[j] !=0xFF ) { -memset (filter,0 ,sizeof (struct rte_eth_flex_filter )); +memset (filter,0 ,sizeof (struct igb_flex_filter ));rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ITEM , item,"Not supported by flex filter" );
@@ -1140,8 +1140,8 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr, }if ((raw_spec->length + offset + total_offset) > -RTE_FLEX_FILTER_MAXLEN ) { -memset (filter,0 ,sizeof (struct rte_eth_flex_filter )); +IGB_FLEX_FILTER_MAXLEN ) { +memset (filter,0 ,sizeof (struct igb_flex_filter ));rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ITEM , item,"Not supported by flex filter" );
@@ -1204,7 +1204,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,/* check if the first not void action is QUEUE. */ NEXT_ITEM_OF_ACTION (act, actions, index);if (act->type !=RTE_FLOW_ACTION_TYPE_QUEUE ) { -memset (filter,0 ,sizeof (struct rte_eth_flex_filter )); +memset (filter,0 ,sizeof (struct igb_flex_filter ));rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ACTION , act,"Not supported action." );
@@ -1218,7 +1218,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr, index++;NEXT_ITEM_OF_ACTION (act, actions, index);if (act->type !=RTE_FLOW_ACTION_TYPE_END ) { -memset (filter,0 ,sizeof (struct rte_eth_flex_filter )); +memset (filter,0 ,sizeof (struct igb_flex_filter ));rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ACTION , act,"Not supported action." );
@@ -1228,7 +1228,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,/* parse attr */ /* must be input direction */ if (!attr->ingress) { -memset (filter,0 ,sizeof (struct rte_eth_flex_filter )); +memset (filter,0 ,sizeof (struct igb_flex_filter ));rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR_INGRESS , attr,"Only support ingress." );
@@ -1237,7 +1237,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,/* not supported */ if (attr->egress) { -memset (filter,0 ,sizeof (struct rte_eth_flex_filter )); +memset (filter,0 ,sizeof (struct igb_flex_filter ));rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR_EGRESS , attr,"Not support egress." );
@@ -1246,7 +1246,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,/* not supported */ if (attr->transfer) { -memset (filter,0 ,sizeof (struct rte_eth_flex_filter )); +memset (filter,0 ,sizeof (struct igb_flex_filter ));rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER , attr,"No support for transfer." );
@@ -1254,7 +1254,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr, }if (attr->priority >0xFFFF ) { -memset (filter,0 ,sizeof (struct rte_eth_flex_filter )); +memset (filter,0 ,sizeof (struct igb_flex_filter ));rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY , attr,"Error priority." );
@@ -1271,7 +1271,7 @@ igb_parse_flex_filter(struct rte_eth_dev *dev,const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], - struct rte_eth_flex_filter *filter, + struct igb_flex_filter *filter, struct rte_flow_error *error) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -1283,7 +1283,7 @@ igb_parse_flex_filter(struct rte_eth_dev *dev, actions, filter, error);if (filter->queue >=IGB_MAX_RX_QUEUE_NUM ) { -memset (filter,0 ,sizeof (struct rte_eth_flex_filter )); +memset (filter,0 ,sizeof (struct igb_flex_filter ));rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ITEM ,NULL ,"queue number not supported by flex filter" );
@@ -1444,7 +1444,7 @@ igb_flow_create(struct rte_eth_dev *dev,struct rte_eth_ntuple_filter ntuple_filter;struct rte_eth_ethertype_filter ethertype_filter;struct rte_eth_syn_filter syn_filter; -struct rte_eth_flex_filter flex_filter; +struct igb_flex_filter flex_filter;struct igb_rte_flow_rss_conf rss_conf;struct rte_flow *flow =NULL ;struct igb_ntuple_filter_ele *ntuple_filter_ptr;
@@ -1549,7 +1549,7 @@ igb_flow_create(struct rte_eth_dev *dev, goto out; } -memset (&flex_filter,0 ,sizeof (struct rte_eth_flex_filter )); +memset (&flex_filter,0 ,sizeof (struct igb_flex_filter )); ret =igb_parse_flex_filter (dev, attr, pattern, actions, &flex_filter, error);if (!ret) {
@@ -1564,7 +1564,7 @@ igb_flow_create(struct rte_eth_dev *dev,rte_memcpy (&flex_filter_ptr->filter_info, &flex_filter, -sizeof (struct rte_eth_flex_filter )); +sizeof (struct igb_flex_filter ));TAILQ_INSERT_TAIL (&igb_filter_flex_list, flex_filter_ptr, entries); flow->rule = flex_filter_ptr;
@@ -1621,7 +1621,7 @@ igb_flow_validate(__rte_unused struct rte_eth_dev *dev,struct rte_eth_ntuple_filter ntuple_filter;struct rte_eth_ethertype_filter ethertype_filter;struct rte_eth_syn_filter syn_filter; -struct rte_eth_flex_filter flex_filter; +struct igb_flex_filter flex_filter;struct igb_rte_flow_rss_conf rss_conf;int ret;
@@ -1643,7 +1643,7 @@ igb_flow_validate(__rte_unused struct rte_eth_dev *dev,if (!ret)return 0 ; -memset (&flex_filter,0 ,sizeof (struct rte_eth_flex_filter )); +memset (&flex_filter,0 ,sizeof (struct igb_flex_filter )); ret =igb_parse_flex_filter (dev, attr, pattern, actions, &flex_filter, error);if (!ret)
lib/librte_ethdev/rte_eth_ctrl.h +0 -19
@@ -56,25 +56,6 @@ enum rte_filter_op { RTE_ETH_FILTER_OP_MAX }; -#define RTE_FLEX_FILTER_MAXLEN 128/**< bytes to use in flex filter. */ -#define RTE_FLEX_FILTER_MASK_SIZE \ - (RTE_ALIGN(RTE_FLEX_FILTER_MAXLEN, CHAR_BIT) / CHAR_BIT) -/**< mask bytes in flex filter. */ - -/** -* A structure used to define the flex filter entry -* to support RTE_ETH_FILTER_FLEXIBLE with RTE_ETH_FILTER_ADD, -* RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations. -*/ -struct rte_eth_flex_filter { -uint16_t len; -uint8_t bytes[RTE_FLEX_FILTER_MAXLEN ];/**< flex bytes in big endian.*/ -uint8_t mask[RTE_FLEX_FILTER_MASK_SIZE ];/**< if mask bit is 1b, do -not compare corresponding byte. */ -uint8_t priority; -uint16_t queue;/**< Queue assigned to when match. */ -}; -/** * A structure used to define the TCP syn filter entry * to support RTE_ETH_FILTER_SYN with RTE_ETH_FILTER_ADD,
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 05/14] ethdev: move flexible filter type to e1000 driver
Quoted 13 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 22:09
To: Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]
Subject: [PATCH 05/14] ethdev: move flexible filter type to e1000 drivernet/e1000 driver is the only user of the struct
rte_eth_flex_filterand helper defines. Move it to the driver and useigb_prefix instead ofrte_eth_.
Quoted 7 lines
Signed-off-by Andrew Rybchenko <[email protected]>--- drivers/net/e1000/e1000_ethdev.h | 22 +++++++++++++++++-- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_flow.c | 36 ++++++++++++++++---------------- lib/librte_ethdev/rte_eth_ctrl.h | 19 ----------------- 4 files changed, 39 insertions(+), 40 deletions(-)
Quoted 1 line
2.17.1
PATCH 6/14 ethdev: remove legacy SYN filter type support
In reply to Andrew RybchenkoRTE flow API should be used for filtering.
Move corresponding definitions to ethdev internal driver API since it is used by drivers internally.
Preserve RTE_ETH_FILTER_SYN because of it as well.
--- app/test-pmd/cmdline.c | 95 --------------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/e1000/igb_ethdev.c | 70 -------------------- drivers/net/ixgbe/ixgbe_ethdev.c | 66 ------------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 11 ---- lib/librte_ethdev/rte_ethdev_driver.h | 10 +++ 8 files changed, 11 insertions(+), 247 deletions(-)
app/test-pmd/cmdline.c +0 -95
@@ -990,9 +990,6 @@ static void cmd_help_long_parsed(void *parsed_result," priority (prio_value) queue (queue_id)\n" " Add/Del a 5tuple filter.\n\n" -"syn_filter (port_id) (add|del) priority (high|low) queue (queue_id)" -" Add/Del syn filter.\n\n" -"flow_director_filter (port_id) mode IP (add|del|update)" " flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)" " src (src_ip_address) dst (dst_ip_address)"
@@ -9982,97 +9979,6 @@ cmdline_parse_inst_t cmd_dump_one = { }, }; -/* *** Add/Del syn filter *** */ -struct cmd_syn_filter_result { -cmdline_fixed_string_t filter; -portid_t port_id; -cmdline_fixed_string_t ops; -cmdline_fixed_string_t priority; -cmdline_fixed_string_t high; -cmdline_fixed_string_t queue; -uint16_t queue_id; -}; - -static void -cmd_syn_filter_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_syn_filter_result *res = parsed_result; -struct rte_eth_syn_filter syn_filter; -int ret =0 ; - - ret =rte_eth_dev_filter_supported (res->port_id, -RTE_ETH_FILTER_SYN ); -if (ret <0 ) { -printf ("syn filter is not supported on port %u.\n" , - res->port_id); -return ; - } - -memset (&syn_filter,0 ,sizeof (syn_filter)); - -if (!strcmp (res->ops,"add" )) { -if (!strcmp (res->high,"high" )) - syn_filter.hig_pri =1 ; -else - syn_filter.hig_pri =0 ; - - syn_filter.queue = res->queue_id; - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_SYN , -RTE_ETH_FILTER_ADD , - &syn_filter); - }else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_SYN , -RTE_ETH_FILTER_DELETE , - &syn_filter); - -if (ret <0 ) -printf ("syn filter programming error: (%s)\n" , -strerror (-ret)); -} - -cmdline_parse_token_string_t cmd_syn_filter_filter = - TOKEN_STRING_INITIALIZER(struct cmd_syn_filter_result, - filter,"syn_filter" ); -cmdline_parse_token_num_t cmd_syn_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_syn_filter_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_syn_filter_ops = - TOKEN_STRING_INITIALIZER(struct cmd_syn_filter_result, - ops,"add#del" ); -cmdline_parse_token_string_t cmd_syn_filter_priority = - TOKEN_STRING_INITIALIZER(struct cmd_syn_filter_result, - priority,"priority" ); -cmdline_parse_token_string_t cmd_syn_filter_high = - TOKEN_STRING_INITIALIZER(struct cmd_syn_filter_result, - high,"high#low" ); -cmdline_parse_token_string_t cmd_syn_filter_queue = - TOKEN_STRING_INITIALIZER(struct cmd_syn_filter_result, - queue,"queue" ); -cmdline_parse_token_num_t cmd_syn_filter_queue_id = - TOKEN_NUM_INITIALIZER(struct cmd_syn_filter_result, - queue_id,UINT16 ); - -cmdline_parse_inst_t cmd_syn_filter = { - .f = cmd_syn_filter_parsed, - .data =NULL , - .help_str ="syn_filter <port_id> add|del priority high|low queue " -"<queue_id>: Add/Delete syn filter" , - .tokens = { - (void *)&cmd_syn_filter_filter, - (void *)&cmd_syn_filter_port_id, - (void *)&cmd_syn_filter_ops, - (void *)&cmd_syn_filter_priority, - (void *)&cmd_syn_filter_high, - (void *)&cmd_syn_filter_queue, - (void *)&cmd_syn_filter_queue_id, -NULL , - }, -}; -/* *** queue region set *** */ struct cmd_queue_region_result {cmdline_fixed_string_t set;
@@ -19636,7 +19542,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_config_rss_hash_key, (cmdline_parse_inst_t *)&cmd_dump, (cmdline_parse_inst_t *)&cmd_dump_one, - (cmdline_parse_inst_t *)&cmd_syn_filter, (cmdline_parse_inst_t *)&cmd_2tuple_filter, (cmdline_parse_inst_t *)&cmd_5tuple_filter, (cmdline_parse_inst_t *)&cmd_add_del_ip_flow_director,
doc/guides/rel_notes/deprecation.rst +1 -1
@@ -108,7 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types SYN, NTUPLE, TUNNEL, FDIR, + as filter types NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.
drivers/net/e1000/igb_ethdev.c +0 -70
88 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_ethdev.c +0 -66
84 lines not on this page · raw message
drivers/net/qede/qede_filter.c +0 -1
@@ -1561,7 +1561,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops;return 0 ; -case RTE_ETH_FILTER_SYN :case RTE_ETH_FILTER_HASH :case RTE_ETH_FILTER_L2_TUNNEL :case RTE_ETH_FILTER_MAX :
drivers/net/sfc/sfc_ethdev.c +0 -3
@@ -1748,9 +1748,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,case RTE_ETH_FILTER_NONE :sfc_err (sa,"Global filters configuration not supported" );break ; -case RTE_ETH_FILTER_SYN : -sfc_err (sa,"SYN filters not supported" ); -break ;case RTE_ETH_FILTER_NTUPLE :sfc_err (sa,"NTUPLE filters not supported" );break ;
lib/librte_ethdev/rte_eth_ctrl.h +0 -11
@@ -56,17 +56,6 @@ enum rte_filter_op { RTE_ETH_FILTER_OP_MAX }; -/** -* A structure used to define the TCP syn filter entry -* to support RTE_ETH_FILTER_SYN with RTE_ETH_FILTER_ADD, -* RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations. -*/ -struct rte_eth_syn_filter { -uint8_t hig_pri;/**< 1 - higher priority than other filters, -0 - lower priority. */ -uint16_t queue;/**< Queue assigned to when match */ -}; -/** * Define all structures for ntuple Filter type. */
lib/librte_ethdev/rte_ethdev_driver.h +10 -0
@@ -1365,6 +1365,16 @@ struct rte_eth_ethertype_filter {uint16_t queue;/**< Queue assigned to when match*/ }; +/** +* A structure used to define the TCP syn filter entry +* to support RTE_ETH_FILTER_SYN data representation. +*/ +struct rte_eth_syn_filter { +/** 1 - higher priority than other filters, 0 - lower priority. */ +uint8_t hig_pri; +uint16_t queue;/**< Queue assigned to when match */ +}; + #ifdef __cplusplus }#endif
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 06/14] ethdev: remove legacy SYN filter type support
Quoted 18 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 22:09
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 06/14] ethdev: remove legacy SYN filter type supportRTE flow API should be used for filtering.
Move corresponding definitions to ethdev internal driver API since it is used by drivers internally.
PreserveRTE_ETH_FILTER_SYNbecause of it as well.Signed-off-by Andrew Rybchenko <[email protected]>
Quoted 11 lines
--- app/test-pmd/cmdline.c | 95 --------------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/e1000/igb_ethdev.c | 70 -------------------- drivers/net/ixgbe/ixgbe_ethdev.c | 66 ------------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 11 ---- lib/librte_ethdev/rte_ethdev_driver.h | 10 +++ 8 files changed, 11 insertions(+), 247 deletions(-)
For e1000, ixgbe PMDs,
Quoted 2 lines
--
2.17.1
PATCH 7/14 ethdev: remove legacy N-tuple filter type support
In reply to Andrew RybchenkoRTE flow API should be used for filtering.
Preserve struct rte_eth_ntuple_filter in ethdev API since the structure and related defines are used in flow classify library and a number of drivers.
Preserve RTE_ETH_FILTER_NTUPLE because of usage in drivers.
--- app/test-pmd/cmdline.c | 369 --------------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 245 ------------------ drivers/net/e1000/igb_ethdev.c | 130 +--------- drivers/net/ixgbe/ixgbe_ethdev.c | 101 -------- drivers/net/qede/qede_filter.c | 63 ----- drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 3 +- 8 files changed, 3 insertions(+), 913 deletions(-)
app/test-pmd/cmdline.c +0 -369
@@ -976,20 +976,6 @@ static void cmd_help_long_parsed(void *parsed_result,"filters:\n" "--------\n\n" -"2tuple_filter (port_id) (add|del)" -" dst_port (dst_port_value) protocol (protocol_value)" -" mask (mask_value) tcp_flags (tcp_flags_value)" -" priority (prio_value) queue (queue_id)\n" -" Add/Del a 2tuple filter.\n\n" - -"5tuple_filter (port_id) (add|del)" -" dst_ip (dst_address) src_ip (src_address)" -" dst_port (dst_port_value) src_port (src_port_value)" -" protocol (protocol_value)" -" mask (mask_value) tcp_flags (tcp_flags_value)" -" priority (prio_value) queue (queue_id)\n" -" Add/Del a 5tuple filter.\n\n" -"flow_director_filter (port_id) mode IP (add|del|update)" " flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)" " src (src_ip_address) dst (dst_ip_address)"
@@ -10421,359 +10407,6 @@ cmdline_parse_inst_t cmd_show_queue_region_info_all = { }, }; -/* *** ADD/REMOVE A 2tuple FILTER *** */ -struct cmd_2tuple_filter_result { -cmdline_fixed_string_t filter; -portid_t port_id; -cmdline_fixed_string_t ops; -cmdline_fixed_string_t dst_port; -uint16_t dst_port_value; -cmdline_fixed_string_t protocol; -uint8_t protocol_value; -cmdline_fixed_string_t mask; -uint8_t mask_value; -cmdline_fixed_string_t tcp_flags; -uint8_t tcp_flags_value; -cmdline_fixed_string_t priority; -uint8_t priority_value; -cmdline_fixed_string_t queue; -uint16_t queue_id; -}; - -static void -cmd_2tuple_filter_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct rte_eth_ntuple_filter filter; -struct cmd_2tuple_filter_result *res = parsed_result; -int ret =0 ; - - ret =rte_eth_dev_filter_supported (res->port_id,RTE_ETH_FILTER_NTUPLE ); -if (ret <0 ) { -printf ("ntuple filter is not supported on port %u.\n" , - res->port_id); -return ; - } - -memset (&filter,0 ,sizeof (struct rte_eth_ntuple_filter )); - - filter.flags =RTE_2TUPLE_FLAGS ; - filter.dst_port_mask = (res->mask_value &0x02 ) ?UINT16_MAX :0 ; - filter.proto_mask = (res->mask_value &0x01 ) ?UINT8_MAX :0 ; - filter.proto = res->protocol_value; - filter.priority = res->priority_value; -if (res->tcp_flags_value !=0 && filter.proto !=IPPROTO_TCP ) { -printf ("nonzero tcp_flags is only meaningful" -" when protocol is TCP.\n" ); -return ; - } -if (res->tcp_flags_value >RTE_NTUPLE_TCP_FLAGS_MASK ) { -printf ("invalid TCP flags.\n" ); -return ; - } - -if (res->tcp_flags_value !=0 ) { - filter.flags |=RTE_NTUPLE_FLAGS_TCP_FLAG ; - filter.tcp_flags = res->tcp_flags_value; - } - -/* need convert to big endian. */ - filter.dst_port =rte_cpu_to_be_16 (res->dst_port_value); - filter.queue = res->queue_id; - -if (!strcmp (res->ops,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_NTUPLE , -RTE_ETH_FILTER_ADD , - &filter); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_NTUPLE , -RTE_ETH_FILTER_DELETE , - &filter); -if (ret <0 ) -printf ("2tuple filter programming error: (%s)\n" , -strerror (-ret)); - -} - -cmdline_parse_token_string_t cmd_2tuple_filter_filter = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - filter,"2tuple_filter" ); -cmdline_parse_token_num_t cmd_2tuple_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_2tuple_filter_ops = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - ops,"add#del" ); -cmdline_parse_token_string_t cmd_2tuple_filter_dst_port = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - dst_port,"dst_port" ); -cmdline_parse_token_num_t cmd_2tuple_filter_dst_port_value = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - dst_port_value,UINT16 ); -cmdline_parse_token_string_t cmd_2tuple_filter_protocol = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - protocol,"protocol" ); -cmdline_parse_token_num_t cmd_2tuple_filter_protocol_value = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - protocol_value,UINT8 ); -cmdline_parse_token_string_t cmd_2tuple_filter_mask = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - mask,"mask" ); -cmdline_parse_token_num_t cmd_2tuple_filter_mask_value = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - mask_value,INT8 ); -cmdline_parse_token_string_t cmd_2tuple_filter_tcp_flags = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - tcp_flags,"tcp_flags" ); -cmdline_parse_token_num_t cmd_2tuple_filter_tcp_flags_value = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - tcp_flags_value,UINT8 ); -cmdline_parse_token_string_t cmd_2tuple_filter_priority = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - priority,"priority" ); -cmdline_parse_token_num_t cmd_2tuple_filter_priority_value = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - priority_value,UINT8 ); -cmdline_parse_token_string_t cmd_2tuple_filter_queue = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - queue,"queue" ); -cmdline_parse_token_num_t cmd_2tuple_filter_queue_id = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - queue_id,UINT16 ); - -cmdline_parse_inst_t cmd_2tuple_filter = { - .f = cmd_2tuple_filter_parsed, - .data =NULL , - .help_str ="2tuple_filter <port_id> add|del dst_port <value> protocol " -"<value> mask <value> tcp_flags <value> priority <value> queue " -"<queue_id>: Add a 2tuple filter" , - .tokens = { - (void *)&cmd_2tuple_filter_filter, - (void *)&cmd_2tuple_filter_port_id, - (void *)&cmd_2tuple_filter_ops, - (void *)&cmd_2tuple_filter_dst_port, - (void *)&cmd_2tuple_filter_dst_port_value, - (void *)&cmd_2tuple_filter_protocol, - (void *)&cmd_2tuple_filter_protocol_value, - (void *)&cmd_2tuple_filter_mask, - (void *)&cmd_2tuple_filter_mask_value, - (void *)&cmd_2tuple_filter_tcp_flags, - (void *)&cmd_2tuple_filter_tcp_flags_value, - (void *)&cmd_2tuple_filter_priority, - (void *)&cmd_2tuple_filter_priority_value, - (void *)&cmd_2tuple_filter_queue, - (void *)&cmd_2tuple_filter_queue_id, -NULL , - }, -}; - -/* *** ADD/REMOVE A 5tuple FILTER *** */ -struct cmd_5tuple_filter_result { -cmdline_fixed_string_t filter; -portid_t port_id; -cmdline_fixed_string_t ops; -cmdline_fixed_string_t dst_ip; -cmdline_ipaddr_t dst_ip_value; -cmdline_fixed_string_t src_ip; -cmdline_ipaddr_t src_ip_value; -cmdline_fixed_string_t dst_port; -uint16_t dst_port_value; -cmdline_fixed_string_t src_port; -uint16_t src_port_value; -cmdline_fixed_string_t protocol; -uint8_t protocol_value; -cmdline_fixed_string_t mask; -uint8_t mask_value; -cmdline_fixed_string_t tcp_flags; -uint8_t tcp_flags_value; -cmdline_fixed_string_t priority; -uint8_t priority_value; -cmdline_fixed_string_t queue; -uint16_t queue_id; -}; - -static void -cmd_5tuple_filter_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct rte_eth_ntuple_filter filter; -struct cmd_5tuple_filter_result *res = parsed_result; -int ret =0 ; - - ret =rte_eth_dev_filter_supported (res->port_id,RTE_ETH_FILTER_NTUPLE ); -if (ret <0 ) { -printf ("ntuple filter is not supported on port %u.\n" , - res->port_id); -return ; - } - -memset (&filter,0 ,sizeof (struct rte_eth_ntuple_filter )); - - filter.flags =RTE_5TUPLE_FLAGS ; - filter.dst_ip_mask = (res->mask_value &0x10 ) ?UINT32_MAX :0 ; - filter.src_ip_mask = (res->mask_value &0x08 ) ?UINT32_MAX :0 ; - filter.dst_port_mask = (res->mask_value &0x04 ) ?UINT16_MAX :0 ; - filter.src_port_mask = (res->mask_value &0x02 ) ?UINT16_MAX :0 ; - filter.proto_mask = (res->mask_value &0x01 ) ?UINT8_MAX :0 ; - filter.proto = res->protocol_value; - filter.priority = res->priority_value; -if (res->tcp_flags_value !=0 && filter.proto !=IPPROTO_TCP ) { -printf ("nonzero tcp_flags is only meaningful" -" when protocol is TCP.\n" ); -return ; - } -if (res->tcp_flags_value >RTE_NTUPLE_TCP_FLAGS_MASK ) { -printf ("invalid TCP flags.\n" ); -return ; - } - -if (res->tcp_flags_value !=0 ) { - filter.flags |=RTE_NTUPLE_FLAGS_TCP_FLAG ; - filter.tcp_flags = res->tcp_flags_value; - } - -if (res->dst_ip_value.family ==AF_INET ) -/* no need to convert, already big endian. */ - filter.dst_ip = res->dst_ip_value.addr.ipv4.s_addr; -else { -if (filter.dst_ip_mask ==0 ) { -printf ("can not support ipv6 involved compare.\n" ); -return ; - } - filter.dst_ip =0 ; - } - -if (res->src_ip_value.family ==AF_INET ) -/* no need to convert, already big endian. */ - filter.src_ip = res->src_ip_value.addr.ipv4.s_addr; -else { -if (filter.src_ip_mask ==0 ) { -printf ("can not support ipv6 involved compare.\n" ); -return ; - } - filter.src_ip =0 ; - } -/* need convert to big endian. */ - filter.dst_port =rte_cpu_to_be_16 (res->dst_port_value); - filter.src_port =rte_cpu_to_be_16 (res->src_port_value); - filter.queue = res->queue_id; - -if (!strcmp (res->ops,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_NTUPLE , -RTE_ETH_FILTER_ADD , - &filter); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_NTUPLE , -RTE_ETH_FILTER_DELETE , - &filter); -if (ret <0 ) -printf ("5tuple filter programming error: (%s)\n" , -strerror (-ret)); -} - -cmdline_parse_token_string_t cmd_5tuple_filter_filter = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - filter,"5tuple_filter" ); -cmdline_parse_token_num_t cmd_5tuple_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_5tuple_filter_ops = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - ops,"add#del" ); -cmdline_parse_token_string_t cmd_5tuple_filter_dst_ip = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - dst_ip,"dst_ip" ); -cmdline_parse_token_ipaddr_t cmd_5tuple_filter_dst_ip_value = - TOKEN_IPADDR_INITIALIZER(struct cmd_5tuple_filter_result, - dst_ip_value); -cmdline_parse_token_string_t cmd_5tuple_filter_src_ip = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - src_ip,"src_ip" ); -cmdline_parse_token_ipaddr_t cmd_5tuple_filter_src_ip_value = - TOKEN_IPADDR_INITIALIZER(struct cmd_5tuple_filter_result, - src_ip_value); -cmdline_parse_token_string_t cmd_5tuple_filter_dst_port = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - dst_port,"dst_port" ); -cmdline_parse_token_num_t cmd_5tuple_filter_dst_port_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - dst_port_value,UINT16 ); -cmdline_parse_token_string_t cmd_5tuple_filter_src_port = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - src_port,"src_port" ); -cmdline_parse_token_num_t cmd_5tuple_filter_src_port_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - src_port_value,UINT16 ); -cmdline_parse_token_string_t cmd_5tuple_filter_protocol = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - protocol,"protocol" ); -cmdline_parse_token_num_t cmd_5tuple_filter_protocol_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - protocol_value,UINT8 ); -cmdline_parse_token_string_t cmd_5tuple_filter_mask = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - mask,"mask" ); -cmdline_parse_token_num_t cmd_5tuple_filter_mask_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - mask_value,INT8 ); -cmdline_parse_token_string_t cmd_5tuple_filter_tcp_flags = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - tcp_flags,"tcp_flags" ); -cmdline_parse_token_num_t cmd_5tuple_filter_tcp_flags_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - tcp_flags_value,UINT8 ); -cmdline_parse_token_string_t cmd_5tuple_filter_priority = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - priority,"priority" ); -cmdline_parse_token_num_t cmd_5tuple_filter_priority_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - priority_value,UINT8 ); -cmdline_parse_token_string_t cmd_5tuple_filter_queue = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - queue,"queue" ); -cmdline_parse_token_num_t cmd_5tuple_filter_queue_id = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - queue_id,UINT16 ); - -cmdline_parse_inst_t cmd_5tuple_filter = { - .f = cmd_5tuple_filter_parsed, - .data =NULL , - .help_str ="5tuple_filter <port_id> add|del dst_ip <value> " -"src_ip <value> dst_port <value> src_port <value> " -"protocol <value> mask <value> tcp_flags <value> " -"priority <value> queue <queue_id>: Add/Del a 5tuple filter" , - .tokens = { - (void *)&cmd_5tuple_filter_filter, - (void *)&cmd_5tuple_filter_port_id, - (void *)&cmd_5tuple_filter_ops, - (void *)&cmd_5tuple_filter_dst_ip, - (void *)&cmd_5tuple_filter_dst_ip_value, - (void *)&cmd_5tuple_filter_src_ip, - (void *)&cmd_5tuple_filter_src_ip_value, - (void *)&cmd_5tuple_filter_dst_port, - (void *)&cmd_5tuple_filter_dst_port_value, - (void *)&cmd_5tuple_filter_src_port, - (void *)&cmd_5tuple_filter_src_port_value, - (void *)&cmd_5tuple_filter_protocol, - (void *)&cmd_5tuple_filter_protocol_value, - (void *)&cmd_5tuple_filter_mask, - (void *)&cmd_5tuple_filter_mask_value, - (void *)&cmd_5tuple_filter_tcp_flags, - (void *)&cmd_5tuple_filter_tcp_flags_value, - (void *)&cmd_5tuple_filter_priority, - (void *)&cmd_5tuple_filter_priority_value, - (void *)&cmd_5tuple_filter_queue, - (void *)&cmd_5tuple_filter_queue_id, -NULL , - }, -}; -/* *** Filters Control *** */ /* *** deal with flow director filter *** */
@@ -19542,8 +19175,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_config_rss_hash_key, (cmdline_parse_inst_t *)&cmd_dump, (cmdline_parse_inst_t *)&cmd_dump_one, - (cmdline_parse_inst_t *)&cmd_2tuple_filter, - (cmdline_parse_inst_t *)&cmd_5tuple_filter, (cmdline_parse_inst_t *)&cmd_add_del_ip_flow_director, (cmdline_parse_inst_t *)&cmd_add_del_udp_flow_director, (cmdline_parse_inst_t *)&cmd_add_del_sctp_flow_director,
doc/guides/rel_notes/deprecation.rst +1 -1
@@ -108,7 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types NTUPLE, TUNNEL, FDIR, + as filter types TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.
drivers/net/bnxt/bnxt_ethdev.c +0 -245
257 lines not on this page · raw message
drivers/net/e1000/igb_ethdev.c +1 -129
154 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_ethdev.c +0 -101
119 lines not on this page · raw message
drivers/net/qede/qede_filter.c +0 -63
75 lines not on this page · raw message
drivers/net/sfc/sfc_ethdev.c +0 -3
@@ -1748,9 +1748,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,case RTE_ETH_FILTER_NONE :sfc_err (sa,"Global filters configuration not supported" );break ; -case RTE_ETH_FILTER_NTUPLE : -sfc_err (sa,"NTUPLE filters not supported" ); -break ;case RTE_ETH_FILTER_TUNNEL :sfc_err (sa,"Tunnel filters not supported" );break ;
lib/librte_ethdev/rte_eth_ctrl.h +1 -2
@@ -82,8 +82,7 @@ enum rte_filter_op {/** * A structure used to define the ntuple filter entry -* to support RTE_ETH_FILTER_NTUPLE with RTE_ETH_FILTER_ADD, -* RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations. +* to support RTE_ETH_FILTER_NTUPLE data representation. */ struct rte_eth_ntuple_filter {uint16_t flags;/**< Flags from RTE_NTUPLE_FLAGS_* */
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 07/14] ethdev: remove legacy N-tuple filter type support
Quoted 10 lines · Andrew Rybchenko
RTE flow API should be used for filtering.
Preserve struct
rte_eth_ntuple_filterin ethdev API since the structure and related defines are used in flow classify library and a number of drivers.Preserve
RTE_ETH_FILTER_NTUPLEbecause of usage in drivers.Signed-off-by Andrew Rybchenko <[email protected]>
For bnxt PMD
Quoted 1,082 lines
--- app/test-pmd/cmdline.c | 369 --------------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 245 ------------------ drivers/net/e1000/igb_ethdev.c | 130 +--------- drivers/net/ixgbe/ixgbe_ethdev.c | 101 -------- drivers/net/qede/qede_filter.c | 63 ----- drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 3 +- 8 files changed, 3 insertions(+), 913 deletions(-)app/test-pmd/cmdline.c +0
-369@@ -976,20 +976,6 @@ static void cmd_help_long_parsed(void *parsed_result,"filters:\n" "--------\n\n" -"2tuple_filter (port_id) (add|del)" -" dst_port (dst_port_value) protocol (protocol_value)" -" mask (mask_value) tcp_flags (tcp_flags_value)" -" priority (prio_value) queue (queue_id)\n" -" Add/Del a 2tuple filter.\n\n" - -"5tuple_filter (port_id) (add|del)" -" dst_ip (dst_address) src_ip (src_address)" -" dst_port (dst_port_value) src_port (src_port_value)" -" protocol (protocol_value)" -" mask (mask_value) tcp_flags (tcp_flags_value)" -" priority (prio_value) queue (queue_id)\n" -" Add/Del a 5tuple filter.\n\n" -"flow_director_filter (port_id) mode IP (add|del|update)" " flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)" " src (src_ip_address) dst (dst_ip_address)" @@ -10421,359 +10407,6 @@ cmdline_parse_inst_t cmd_show_queue_region_info_all = { }, }; -/* *** ADD/REMOVE A 2tuple FILTER *** */ -struct cmd_2tuple_filter_result { -cmdline_fixed_string_t filter; -portid_t port_id; -cmdline_fixed_string_t ops; -cmdline_fixed_string_t dst_port; -uint16_t dst_port_value; -cmdline_fixed_string_t protocol; -uint8_t protocol_value; -cmdline_fixed_string_t mask; -uint8_t mask_value; -cmdline_fixed_string_t tcp_flags; -uint8_t tcp_flags_value; -cmdline_fixed_string_t priority; -uint8_t priority_value; -cmdline_fixed_string_t queue; -uint16_t queue_id; -}; - -static void -cmd_2tuple_filter_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct rte_eth_ntuple_filter filter; -struct cmd_2tuple_filter_result *res = parsed_result; -int ret =0 ; - - ret =rte_eth_dev_filter_supported (res->port_id,RTE_ETH_FILTER_NTUPLE ); -if (ret <0 ) { -printf ("ntuple filter is not supported on port %u.\n" , - res->port_id); -return ; - } - -memset (&filter,0 ,sizeof (struct rte_eth_ntuple_filter )); - - filter.flags =RTE_2TUPLE_FLAGS ; - filter.dst_port_mask = (res->mask_value &0x02 ) ?UINT16_MAX :0 ; - filter.proto_mask = (res->mask_value &0x01 ) ?UINT8_MAX :0 ; - filter.proto = res->protocol_value; - filter.priority = res->priority_value; -if (res->tcp_flags_value !=0 && filter.proto !=IPPROTO_TCP ) { -printf ("nonzero tcp_flags is only meaningful" -" when protocol is TCP.\n" ); -return ; - } -if (res->tcp_flags_value >RTE_NTUPLE_TCP_FLAGS_MASK ) { -printf ("invalid TCP flags.\n" ); -return ; - } - -if (res->tcp_flags_value !=0 ) { - filter.flags |=RTE_NTUPLE_FLAGS_TCP_FLAG ; - filter.tcp_flags = res->tcp_flags_value; - } - -/* need convert to big endian. */ - filter.dst_port =rte_cpu_to_be_16 (res->dst_port_value); - filter.queue = res->queue_id; - -if (!strcmp (res->ops,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_NTUPLE , -RTE_ETH_FILTER_ADD , - &filter); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_NTUPLE , -RTE_ETH_FILTER_DELETE , - &filter); -if (ret <0 ) -printf ("2tuple filter programming error: (%s)\n" , -strerror (-ret)); - -} - -cmdline_parse_token_string_t cmd_2tuple_filter_filter = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - filter,"2tuple_filter" ); -cmdline_parse_token_num_t cmd_2tuple_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_2tuple_filter_ops = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - ops,"add#del" ); -cmdline_parse_token_string_t cmd_2tuple_filter_dst_port = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - dst_port,"dst_port" ); -cmdline_parse_token_num_t cmd_2tuple_filter_dst_port_value = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - dst_port_value,UINT16 ); -cmdline_parse_token_string_t cmd_2tuple_filter_protocol = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - protocol,"protocol" ); -cmdline_parse_token_num_t cmd_2tuple_filter_protocol_value = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - protocol_value,UINT8 ); -cmdline_parse_token_string_t cmd_2tuple_filter_mask = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - mask,"mask" ); -cmdline_parse_token_num_t cmd_2tuple_filter_mask_value = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - mask_value,INT8 ); -cmdline_parse_token_string_t cmd_2tuple_filter_tcp_flags = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - tcp_flags,"tcp_flags" ); -cmdline_parse_token_num_t cmd_2tuple_filter_tcp_flags_value = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - tcp_flags_value,UINT8 ); -cmdline_parse_token_string_t cmd_2tuple_filter_priority = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - priority,"priority" ); -cmdline_parse_token_num_t cmd_2tuple_filter_priority_value = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - priority_value,UINT8 ); -cmdline_parse_token_string_t cmd_2tuple_filter_queue = - TOKEN_STRING_INITIALIZER(struct cmd_2tuple_filter_result, - queue,"queue" ); -cmdline_parse_token_num_t cmd_2tuple_filter_queue_id = - TOKEN_NUM_INITIALIZER(struct cmd_2tuple_filter_result, - queue_id,UINT16 ); - -cmdline_parse_inst_t cmd_2tuple_filter = { - .f = cmd_2tuple_filter_parsed, - .data =NULL , - .help_str ="2tuple_filter <port_id> add|del dst_port <value> protocol " -"<value> mask <value> tcp_flags <value> priority <value> queue " -"<queue_id>: Add a 2tuple filter" , - .tokens = { - (void *)&cmd_2tuple_filter_filter, - (void *)&cmd_2tuple_filter_port_id, - (void *)&cmd_2tuple_filter_ops, - (void *)&cmd_2tuple_filter_dst_port, - (void *)&cmd_2tuple_filter_dst_port_value, - (void *)&cmd_2tuple_filter_protocol, - (void *)&cmd_2tuple_filter_protocol_value, - (void *)&cmd_2tuple_filter_mask, - (void *)&cmd_2tuple_filter_mask_value, - (void *)&cmd_2tuple_filter_tcp_flags, - (void *)&cmd_2tuple_filter_tcp_flags_value, - (void *)&cmd_2tuple_filter_priority, - (void *)&cmd_2tuple_filter_priority_value, - (void *)&cmd_2tuple_filter_queue, - (void *)&cmd_2tuple_filter_queue_id, -NULL , - }, -}; - -/* *** ADD/REMOVE A 5tuple FILTER *** */ -struct cmd_5tuple_filter_result { -cmdline_fixed_string_t filter; -portid_t port_id; -cmdline_fixed_string_t ops; -cmdline_fixed_string_t dst_ip; -cmdline_ipaddr_t dst_ip_value; -cmdline_fixed_string_t src_ip; -cmdline_ipaddr_t src_ip_value; -cmdline_fixed_string_t dst_port; -uint16_t dst_port_value; -cmdline_fixed_string_t src_port; -uint16_t src_port_value; -cmdline_fixed_string_t protocol; -uint8_t protocol_value; -cmdline_fixed_string_t mask; -uint8_t mask_value; -cmdline_fixed_string_t tcp_flags; -uint8_t tcp_flags_value; -cmdline_fixed_string_t priority; -uint8_t priority_value; -cmdline_fixed_string_t queue; -uint16_t queue_id; -}; - -static void -cmd_5tuple_filter_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct rte_eth_ntuple_filter filter; -struct cmd_5tuple_filter_result *res = parsed_result; -int ret =0 ; - - ret =rte_eth_dev_filter_supported (res->port_id,RTE_ETH_FILTER_NTUPLE ); -if (ret <0 ) { -printf ("ntuple filter is not supported on port %u.\n" , - res->port_id); -return ; - } - -memset (&filter,0 ,sizeof (struct rte_eth_ntuple_filter )); - - filter.flags =RTE_5TUPLE_FLAGS ; - filter.dst_ip_mask = (res->mask_value &0x10 ) ?UINT32_MAX :0 ; - filter.src_ip_mask = (res->mask_value &0x08 ) ?UINT32_MAX :0 ; - filter.dst_port_mask = (res->mask_value &0x04 ) ?UINT16_MAX :0 ; - filter.src_port_mask = (res->mask_value &0x02 ) ?UINT16_MAX :0 ; - filter.proto_mask = (res->mask_value &0x01 ) ?UINT8_MAX :0 ; - filter.proto = res->protocol_value; - filter.priority = res->priority_value; -if (res->tcp_flags_value !=0 && filter.proto !=IPPROTO_TCP ) { -printf ("nonzero tcp_flags is only meaningful" -" when protocol is TCP.\n" ); -return ; - } -if (res->tcp_flags_value >RTE_NTUPLE_TCP_FLAGS_MASK ) { -printf ("invalid TCP flags.\n" ); -return ; - } - -if (res->tcp_flags_value !=0 ) { - filter.flags |=RTE_NTUPLE_FLAGS_TCP_FLAG ; - filter.tcp_flags = res->tcp_flags_value; - } - -if (res->dst_ip_value.family ==AF_INET ) -/* no need to convert, already big endian. */ - filter.dst_ip = res->dst_ip_value.addr.ipv4.s_addr; -else { -if (filter.dst_ip_mask ==0 ) { -printf ("can not support ipv6 involved compare.\n" ); -return ; - } - filter.dst_ip =0 ; - } - -if (res->src_ip_value.family ==AF_INET ) -/* no need to convert, already big endian. */ - filter.src_ip = res->src_ip_value.addr.ipv4.s_addr; -else { -if (filter.src_ip_mask ==0 ) { -printf ("can not support ipv6 involved compare.\n" ); -return ; - } - filter.src_ip =0 ; - } -/* need convert to big endian. */ - filter.dst_port =rte_cpu_to_be_16 (res->dst_port_value); - filter.src_port =rte_cpu_to_be_16 (res->src_port_value); - filter.queue = res->queue_id; - -if (!strcmp (res->ops,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_NTUPLE , -RTE_ETH_FILTER_ADD , - &filter); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_NTUPLE , -RTE_ETH_FILTER_DELETE , - &filter); -if (ret <0 ) -printf ("5tuple filter programming error: (%s)\n" , -strerror (-ret)); -} - -cmdline_parse_token_string_t cmd_5tuple_filter_filter = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - filter,"5tuple_filter" ); -cmdline_parse_token_num_t cmd_5tuple_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_5tuple_filter_ops = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - ops,"add#del" ); -cmdline_parse_token_string_t cmd_5tuple_filter_dst_ip = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - dst_ip,"dst_ip" ); -cmdline_parse_token_ipaddr_t cmd_5tuple_filter_dst_ip_value = - TOKEN_IPADDR_INITIALIZER(struct cmd_5tuple_filter_result, - dst_ip_value); -cmdline_parse_token_string_t cmd_5tuple_filter_src_ip = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - src_ip,"src_ip" ); -cmdline_parse_token_ipaddr_t cmd_5tuple_filter_src_ip_value = - TOKEN_IPADDR_INITIALIZER(struct cmd_5tuple_filter_result, - src_ip_value); -cmdline_parse_token_string_t cmd_5tuple_filter_dst_port = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - dst_port,"dst_port" ); -cmdline_parse_token_num_t cmd_5tuple_filter_dst_port_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - dst_port_value,UINT16 ); -cmdline_parse_token_string_t cmd_5tuple_filter_src_port = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - src_port,"src_port" ); -cmdline_parse_token_num_t cmd_5tuple_filter_src_port_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - src_port_value,UINT16 ); -cmdline_parse_token_string_t cmd_5tuple_filter_protocol = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - protocol,"protocol" ); -cmdline_parse_token_num_t cmd_5tuple_filter_protocol_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - protocol_value,UINT8 ); -cmdline_parse_token_string_t cmd_5tuple_filter_mask = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - mask,"mask" ); -cmdline_parse_token_num_t cmd_5tuple_filter_mask_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - mask_value,INT8 ); -cmdline_parse_token_string_t cmd_5tuple_filter_tcp_flags = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - tcp_flags,"tcp_flags" ); -cmdline_parse_token_num_t cmd_5tuple_filter_tcp_flags_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - tcp_flags_value,UINT8 ); -cmdline_parse_token_string_t cmd_5tuple_filter_priority = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - priority,"priority" ); -cmdline_parse_token_num_t cmd_5tuple_filter_priority_value = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - priority_value,UINT8 ); -cmdline_parse_token_string_t cmd_5tuple_filter_queue = - TOKEN_STRING_INITIALIZER(struct cmd_5tuple_filter_result, - queue,"queue" ); -cmdline_parse_token_num_t cmd_5tuple_filter_queue_id = - TOKEN_NUM_INITIALIZER(struct cmd_5tuple_filter_result, - queue_id,UINT16 ); - -cmdline_parse_inst_t cmd_5tuple_filter = { - .f = cmd_5tuple_filter_parsed, - .data =NULL , - .help_str ="5tuple_filter <port_id> add|del dst_ip <value> " -"src_ip <value> dst_port <value> src_port <value> " -"protocol <value> mask <value> tcp_flags <value> " -"priority <value> queue <queue_id>: Add/Del a 5tuple filter" , - .tokens = { - (void *)&cmd_5tuple_filter_filter, - (void *)&cmd_5tuple_filter_port_id, - (void *)&cmd_5tuple_filter_ops, - (void *)&cmd_5tuple_filter_dst_ip, - (void *)&cmd_5tuple_filter_dst_ip_value, - (void *)&cmd_5tuple_filter_src_ip, - (void *)&cmd_5tuple_filter_src_ip_value, - (void *)&cmd_5tuple_filter_dst_port, - (void *)&cmd_5tuple_filter_dst_port_value, - (void *)&cmd_5tuple_filter_src_port, - (void *)&cmd_5tuple_filter_src_port_value, - (void *)&cmd_5tuple_filter_protocol, - (void *)&cmd_5tuple_filter_protocol_value, - (void *)&cmd_5tuple_filter_mask, - (void *)&cmd_5tuple_filter_mask_value, - (void *)&cmd_5tuple_filter_tcp_flags, - (void *)&cmd_5tuple_filter_tcp_flags_value, - (void *)&cmd_5tuple_filter_priority, - (void *)&cmd_5tuple_filter_priority_value, - (void *)&cmd_5tuple_filter_queue, - (void *)&cmd_5tuple_filter_queue_id, -NULL , - }, -}; -/* *** Filters Control *** */ /* *** deal with flow director filter *** */ @@ -19542,8 +19175,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_config_rss_hash_key, (cmdline_parse_inst_t *)&cmd_dump, (cmdline_parse_inst_t *)&cmd_dump_one, - (cmdline_parse_inst_t *)&cmd_2tuple_filter, - (cmdline_parse_inst_t *)&cmd_5tuple_filter, (cmdline_parse_inst_t *)&cmd_add_del_ip_flow_director, (cmdline_parse_inst_t *)&cmd_add_del_udp_flow_director, (cmdline_parse_inst_t *)&cmd_add_del_sctp_flow_director,doc/guides/rel_notes/deprecation.rst +1
-1@@ -108,7 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types NTUPLE, TUNNEL, FDIR, + as filter types TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.drivers/net/bnxt/bnxt_ethdev.c +0
-245@@ -2987,248 +2987,6 @@ bnxt_tx_descriptor_status_op(void *tx_queue, uint16_t offset)return RTE_ETH_TX_DESC_FULL ; } -static inline int -parse_ntuple_filter (struct bnxt *bp, -struct rte_eth_ntuple_filter *nfilter, -struct bnxt_filter_info *bfilter) -{ -uint32_t en =0 ; - -if (nfilter->queue >= bp->rx_nr_rings) { -PMD_DRV_LOG (ERR ,"Invalid queue %d\n" , nfilter->queue); -return -EINVAL ; - } - -switch (nfilter->dst_port_mask) { -case UINT16_MAX : - bfilter->dst_port_mask =-1 ; - bfilter->dst_port = nfilter->dst_port; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT | -NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT_MASK ; -break ; -default : -PMD_DRV_LOG (ERR ,"invalid dst_port mask." ); -return -EINVAL ; - } - - bfilter->ip_addr_type =NTUPLE_FLTR_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 ; - en |=NTUPLE_FLTR_ALLOC_IN_EN_IP_PROTO ; - -switch (nfilter->proto_mask) { -case UINT8_MAX : -if (nfilter->proto ==17 )/* IPPROTO_UDP */ - bfilter->ip_protocol =17 ; -else if (nfilter->proto ==6 )/* IPPROTO_TCP */ - bfilter->ip_protocol =6 ; -else -return -EINVAL ; - en |=NTUPLE_FLTR_ALLOC_IN_EN_IP_PROTO ; -break ; -default : -PMD_DRV_LOG (ERR ,"invalid protocol mask." ); -return -EINVAL ; - } - -switch (nfilter->dst_ip_mask) { -case UINT32_MAX : - bfilter->dst_ipaddr_mask[0 ] =-1 ; - bfilter->dst_ipaddr[0 ] = nfilter->dst_ip; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR | -NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK ; -break ; -default : -PMD_DRV_LOG (ERR ,"invalid dst_ip mask." ); -return -EINVAL ; - } - -switch (nfilter->src_ip_mask) { -case UINT32_MAX : - bfilter->src_ipaddr_mask[0 ] =-1 ; - bfilter->src_ipaddr[0 ] = nfilter->src_ip; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR | -NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK ; -break ; -default : -PMD_DRV_LOG (ERR ,"invalid src_ip mask." ); -return -EINVAL ; - } - -switch (nfilter->src_port_mask) { -case UINT16_MAX : - bfilter->src_port_mask =-1 ; - bfilter->src_port = nfilter->src_port; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_PORT | -NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_PORT_MASK ; -break ; -default : -PMD_DRV_LOG (ERR ,"invalid src_port mask." ); -return -EINVAL ; - } - - bfilter->enables = en; -return 0 ; -} - -static struct bnxt_filter_info * -bnxt_match_ntuple_filter (struct bnxt *bp, -struct bnxt_filter_info *bfilter, -struct bnxt_vnic_info **mvnic) -{ -struct bnxt_filter_info *mfilter =NULL ; -int i; - -for (i = bp->nr_vnics -1 ; i >=0 ; i--) { -struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; - STAILQ_FOREACH(mfilter, &vnic->filter, next) { -if (bfilter->src_ipaddr[0 ] == mfilter->src_ipaddr[0 ] && - bfilter->src_ipaddr_mask[0 ] == - mfilter->src_ipaddr_mask[0 ] && - bfilter->src_port == mfilter->src_port && - bfilter->src_port_mask == mfilter->src_port_mask && - bfilter->dst_ipaddr[0 ] == mfilter->dst_ipaddr[0 ] && - bfilter->dst_ipaddr_mask[0 ] == - mfilter->dst_ipaddr_mask[0 ] && - bfilter->dst_port == mfilter->dst_port && - bfilter->dst_port_mask == mfilter->dst_port_mask && - bfilter->flags == mfilter->flags && - bfilter->enables == mfilter->enables) { -if (mvnic) - *mvnic = vnic; -return mfilter; - } - } - } -return NULL ; -} - -static int -bnxt_cfg_ntuple_filter (struct bnxt *bp, -struct rte_eth_ntuple_filter *nfilter, -enum rte_filter_op filter_op) -{ -struct bnxt_filter_info *bfilter, *mfilter, *filter1; -struct bnxt_vnic_info *vnic, *vnic0, *mvnic; -int ret; - -if (nfilter->flags !=RTE_5TUPLE_FLAGS ) { -PMD_DRV_LOG (ERR ,"only 5tuple is supported." ); -return -EINVAL ; - } - -if (nfilter->flags &RTE_NTUPLE_FLAGS_TCP_FLAG ) { -PMD_DRV_LOG (ERR ,"Ntuple filter: TCP flags not supported\n" ); -return -EINVAL ; - } - - bfilter =bnxt_get_unused_filter (bp); -if (bfilter ==NULL ) { -PMD_DRV_LOG (ERR , -"Not enough resources for a new filter.\n" ); -return -ENOMEM ; - } - ret =parse_ntuple_filter (bp, nfilter, bfilter); -if (ret <0 ) - goto free_filter; - - vnic = &bp->vnic_info[nfilter->queue]; - vnic0 =BNXT_GET_DEFAULT_VNIC (bp); - filter1 =STAILQ_FIRST (&vnic0->filter); -if (filter1 ==NULL ) { - ret = -EINVAL ; - goto free_filter; - } - - bfilter->dst_id = vnic->fw_vnic_id; - bfilter->fw_l2_filter_id = filter1->fw_l2_filter_id; - bfilter->enables |= -HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID ; - bfilter->ethertype =0x800 ; - bfilter->enables |=NTUPLE_FLTR_ALLOC_INPUT_EN_ETHERTYPE ; - - mfilter =bnxt_match_ntuple_filter (bp, bfilter, &mvnic); - -if (mfilter !=NULL && filter_op ==RTE_ETH_FILTER_ADD && - bfilter->dst_id == mfilter->dst_id) { -PMD_DRV_LOG (ERR ,"filter exists.\n" ); - ret = -EEXIST ; - goto free_filter; - }else if (mfilter !=NULL && filter_op ==RTE_ETH_FILTER_ADD && - bfilter->dst_id != mfilter->dst_id) { - mfilter->dst_id = vnic->fw_vnic_id; - ret =bnxt_hwrm_set_ntuple_filter (bp, mfilter->dst_id, mfilter); -STAILQ_REMOVE (&mvnic->filter, mfilter, bnxt_filter_info, next); -STAILQ_INSERT_TAIL (&vnic->filter, mfilter, next); -PMD_DRV_LOG (ERR ,"filter with matching pattern exists.\n" ); -PMD_DRV_LOG (ERR ," Updated it to the new destination queue\n" ); - goto free_filter; - } -if (mfilter ==NULL && filter_op ==RTE_ETH_FILTER_DELETE ) { -PMD_DRV_LOG (ERR ,"filter doesn't exist." ); - ret = -ENOENT ; - goto free_filter; - } - -if (filter_op ==RTE_ETH_FILTER_ADD ) { - bfilter->filter_type =HWRM_CFA_NTUPLE_FILTER ; - ret =bnxt_hwrm_set_ntuple_filter (bp, bfilter->dst_id, bfilter); -if (ret) - goto free_filter; -STAILQ_INSERT_TAIL (&vnic->filter, bfilter, next); - }else { -if (mfilter ==NULL ) { -/* This should not happen. But for Coverity! */ - ret = -ENOENT ; - goto free_filter; - } - ret =bnxt_hwrm_clear_ntuple_filter (bp, mfilter); - -STAILQ_REMOVE (&vnic->filter, mfilter, bnxt_filter_info, next); -bnxt_free_filter (bp, mfilter); -bnxt_free_filter (bp, bfilter); - } - -return 0 ; -free_filter: -bnxt_free_filter (bp, bfilter); -return ret; -} - -static int -bnxt_ntuple_filter (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg) -{ -struct bnxt *bp = dev->data->dev_private; -int ret; - -if (filter_op ==RTE_ETH_FILTER_NOP ) -return 0 ; - -if (arg ==NULL ) { -PMD_DRV_LOG (ERR ,"arg shouldn't be NULL for operation %u." , - filter_op); -return -EINVAL ; - } - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : - ret =bnxt_cfg_ntuple_filter (bp, - (struct rte_eth_ntuple_filter *)arg, - filter_op); -break ; -case RTE_ETH_FILTER_DELETE : - ret =bnxt_cfg_ntuple_filter (bp, - (struct rte_eth_ntuple_filter *)arg, - filter_op); -break ; -default : -PMD_DRV_LOG (ERR ,"unsupported operation %u." , filter_op); - ret = -EINVAL ; -break ; - } -return ret; -} - static int bnxt_parse_fdir_filter(struct bnxt *bp, struct rte_eth_fdir_filter *fdir,@@ -3658,9 +3416,6 @@ bnxt_filter_ctrl_op(struct rte_eth_dev *dev,case RTE_ETH_FILTER_FDIR : ret =bnxt_fdir_filter (dev, filter_op, arg);break ; -case RTE_ETH_FILTER_NTUPLE : - ret =bnxt_ntuple_filter (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_GENERIC :if (filter_op !=RTE_ETH_FILTER_GET )return -EINVAL ;drivers/net/e1000/igb_ethdev.c +1
-129@@ -194,11 +194,6 @@ static int igb_add_5tuple_filter_82576(struct rte_eth_dev *dev, struct rte_eth_ntuple_filter *ntuple_filter);static int igb_remove_5tuple_filter_82576 (struct rte_eth_dev *dev,struct rte_eth_ntuple_filter *ntuple_filter); -static int igb_get_ntuple_filter (struct rte_eth_dev *dev, -struct rte_eth_ntuple_filter *filter); -static int igb_ntuple_filter_handle (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg); static int eth_igb_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type, enum rte_filter_op filter_op,@@ -4445,126 +4440,6 @@ igb_add_del_ntuple_filter(struct rte_eth_dev *dev,return ret; } -/* -* igb_get_ntuple_filter - get a ntuple filter -* -* @param -* dev: Pointer to struct rte_eth_dev. -* ntuple_filter: Pointer to struct rte_eth_ntuple_filter -* -* @return -* - On success, zero. -* - On failure, a negative value. -*/ -static int -igb_get_ntuple_filter (struct rte_eth_dev *dev, -struct rte_eth_ntuple_filter *ntuple_filter) -{ -struct e1000_hw *hw =E1000_DEV_PRIVATE_TO_HW (dev->data->dev_private); -struct e1000_filter_info *filter_info = -E1000_DEV_PRIVATE_TO_FILTER_INFO (dev->data->dev_private); -struct e1000_5tuple_filter_info filter_5tuple; -struct e1000_2tuple_filter_info filter_2tuple; -struct e1000_5tuple_filter *p_5tuple_filter; -struct e1000_2tuple_filter *p_2tuple_filter; -int ret; - -switch (ntuple_filter->flags) { -case RTE_5TUPLE_FLAGS : -case (RTE_5TUPLE_FLAGS |RTE_NTUPLE_FLAGS_TCP_FLAG ): -if (hw->mac.type != e1000_82576) -return -ENOTSUP ; -memset (&filter_5tuple, -0 , -sizeof (struct e1000_5tuple_filter_info )); - ret =ntuple_filter_to_5tuple_82576 (ntuple_filter, - &filter_5tuple); -if (ret <0 ) -return ret; - p_5tuple_filter =igb_5tuple_filter_lookup_82576 ( - &filter_info->fivetuple_list, - &filter_5tuple); -if (p_5tuple_filter ==NULL ) { -PMD_DRV_LOG (ERR ,"filter doesn't exist." ); -return -ENOENT ; - } - ntuple_filter->queue = p_5tuple_filter->queue; -break ; -case RTE_2TUPLE_FLAGS : -case (RTE_2TUPLE_FLAGS |RTE_NTUPLE_FLAGS_TCP_FLAG ): -if (hw->mac.type != e1000_82580 && hw->mac.type != e1000_i350) -return -ENOTSUP ; -memset (&filter_2tuple, -0 , -sizeof (struct e1000_2tuple_filter_info )); - ret =ntuple_filter_to_2tuple (ntuple_filter, &filter_2tuple); -if (ret <0 ) -return ret; - p_2tuple_filter =igb_2tuple_filter_lookup ( - &filter_info->twotuple_list, - &filter_2tuple); -if (p_2tuple_filter ==NULL ) { -PMD_DRV_LOG (ERR ,"filter doesn't exist." ); -return -ENOENT ; - } - ntuple_filter->queue = p_2tuple_filter->queue; -break ; -default : - ret = -EINVAL ; -break ; - } - -return 0 ; -} - -/* -* igb_ntuple_filter_handle - Handle operations for ntuple filter. -* @dev: pointer to rte_eth_dev structure -* @filter_op:operation will be taken. -* @arg: a pointer to specific structure corresponding to the filter_op -*/ -static int -igb_ntuple_filter_handle (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg) -{ -struct e1000_hw *hw =E1000_DEV_PRIVATE_TO_HW (dev->data->dev_private); -int ret; - -MAC_TYPE_FILTER_SUP (hw->mac.type); - -if (filter_op ==RTE_ETH_FILTER_NOP ) -return 0 ; - -if (arg ==NULL ) { -PMD_DRV_LOG (ERR ,"arg shouldn't be NULL for operation %u." , - filter_op); -return -EINVAL ; - } - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : - ret =igb_add_del_ntuple_filter (dev, - (struct rte_eth_ntuple_filter *)arg, - TRUE); -break ; -case RTE_ETH_FILTER_DELETE : - ret =igb_add_del_ntuple_filter (dev, - (struct rte_eth_ntuple_filter *)arg, - FALSE); -break ; -case RTE_ETH_FILTER_GET : - ret =igb_get_ntuple_filter (dev, - (struct rte_eth_ntuple_filter *)arg); -break ; -default : -PMD_DRV_LOG (ERR ,"unsupported operation %u." , filter_op); - ret = -EINVAL ; -break ; - } -return ret; -} -static inline int igb_ethertype_filter_lookup (struct e1000_filter_info *filter_info,uint16_t ethertype)@@ -4670,7 +4545,7 @@ igb_add_del_ethertype_filter(struct rte_eth_dev *dev, }static int -eth_igb_filter_ctrl (struct rte_eth_dev *dev, +eth_igb_filter_ctrl(struct rte_eth_dev *dev __rte_unused,enum rte_filter_type filter_type,enum rte_filter_op filter_op,void *arg)@@ -4678,9 +4553,6 @@ eth_igb_filter_ctrl(struct rte_eth_dev *dev,int ret =0 ;switch (filter_type) { -case RTE_ETH_FILTER_NTUPLE : - ret =igb_ntuple_filter_handle (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_GENERIC :if (filter_op !=RTE_ETH_FILTER_GET )return -EINVAL ;drivers/net/ixgbe/ixgbe_ethdev.c +0
-101@@ -304,11 +304,6 @@ static int ixgbe_add_5tuple_filter(struct rte_eth_dev *dev, struct ixgbe_5tuple_filter *filter);static void ixgbe_remove_5tuple_filter (struct rte_eth_dev *dev,struct ixgbe_5tuple_filter *filter); -static int ixgbe_ntuple_filter_handle (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg); -static int ixgbe_get_ntuple_filter (struct rte_eth_dev *dev, -struct rte_eth_ntuple_filter *filter); static int ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type, enum rte_filter_op filter_op,@@ -6732,99 +6727,6 @@ ixgbe_add_del_ntuple_filter(struct rte_eth_dev *dev,return 0 ; } -/* -* get a ntuple filter -* -* @param -* dev: Pointer to struct rte_eth_dev. -* ntuple_filter: Pointer to struct rte_eth_ntuple_filter -* -* @return -* - On success, zero. -* - On failure, a negative value. -*/ -static int -ixgbe_get_ntuple_filter (struct rte_eth_dev *dev, -struct rte_eth_ntuple_filter *ntuple_filter) -{ -struct ixgbe_filter_info *filter_info = -IXGBE_DEV_PRIVATE_TO_FILTER_INFO (dev->data->dev_private); -struct ixgbe_5tuple_filter_info filter_5tuple; -struct ixgbe_5tuple_filter *filter; -int ret; - -if (ntuple_filter->flags !=RTE_5TUPLE_FLAGS ) { -PMD_DRV_LOG (ERR ,"only 5tuple is supported." ); -return -EINVAL ; - } - -memset (&filter_5tuple,0 ,sizeof (struct ixgbe_5tuple_filter_info )); - ret =ntuple_filter_to_5tuple (ntuple_filter, &filter_5tuple); -if (ret <0 ) -return ret; - - filter =ixgbe_5tuple_filter_lookup (&filter_info->fivetuple_list, - &filter_5tuple); -if (filter ==NULL ) { -PMD_DRV_LOG (ERR ,"filter doesn't exist." ); -return -ENOENT ; - } - ntuple_filter->queue = filter->queue; -return 0 ; -} - -/* -* ixgbe_ntuple_filter_handle - Handle operations for ntuple filter. -* @dev: pointer to rte_eth_dev structure -* @filter_op:operation will be taken. -* @arg: a pointer to specific structure corresponding to the filter_op -* -* @return -* - On success, zero. -* - On failure, a negative value. -*/ -static int -ixgbe_ntuple_filter_handle (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg) -{ -struct ixgbe_hw *hw =IXGBE_DEV_PRIVATE_TO_HW (dev->data->dev_private); -int ret; - -MAC_TYPE_FILTER_SUP_EXT (hw->mac.type); - -if (filter_op ==RTE_ETH_FILTER_NOP ) -return 0 ; - -if (arg ==NULL ) { -PMD_DRV_LOG (ERR ,"arg shouldn't be NULL for operation %u." , - filter_op); -return -EINVAL ; - } - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : - ret =ixgbe_add_del_ntuple_filter (dev, - (struct rte_eth_ntuple_filter *)arg, - TRUE); -break ; -case RTE_ETH_FILTER_DELETE : - ret =ixgbe_add_del_ntuple_filter (dev, - (struct rte_eth_ntuple_filter *)arg, - FALSE); -break ; -case RTE_ETH_FILTER_GET : - ret =ixgbe_get_ntuple_filter (dev, - (struct rte_eth_ntuple_filter *)arg); -break ; -default : -PMD_DRV_LOG (ERR ,"unsupported operation %u." , filter_op); - ret = -EINVAL ; -break ; - } -return ret; -} - int ixgbe_add_del_ethertype_filter(struct rte_eth_dev *dev, struct rte_eth_ethertype_filter *filter,@@ -6908,9 +6810,6 @@ ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev,int ret =0 ;switch (filter_type) { -case RTE_ETH_FILTER_NTUPLE : - ret =ixgbe_ntuple_filter_handle (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_FDIR : ret =ixgbe_fdir_ctrl_func (dev, filter_op, arg);break ;drivers/net/qede/qede_filter.c +0
-63@@ -590,67 +590,6 @@ qede_fdir_filter_conf(struct rte_eth_dev *eth_dev,return ret; } -int qede_ntuple_filter_conf (struct rte_eth_dev *eth_dev, -enum rte_filter_op filter_op, -void *arg) -{ -struct qede_dev *qdev =QEDE_INIT_QDEV (eth_dev); -struct ecore_dev *edev =QEDE_INIT_EDEV (qdev); -struct rte_eth_ntuple_filter *ntuple; -struct rte_eth_fdir_filter fdir_entry; -struct rte_eth_tcpv4_flow *tcpv4_flow; -struct rte_eth_udpv4_flow *udpv4_flow; -bool add = false; - -switch (filter_op) { -case RTE_ETH_FILTER_NOP : -/* Typically used to query fdir support */ -if (ECORE_IS_CMT (edev)) { -DP_ERR (edev,"flowdir is not supported in 100G mode\n" ); -return -ENOTSUP ; - } -return 0 ;/* means supported */ -case RTE_ETH_FILTER_ADD : - add = true; -break ; -case RTE_ETH_FILTER_DELETE : -break ; -case RTE_ETH_FILTER_INFO : -case RTE_ETH_FILTER_GET : -case RTE_ETH_FILTER_UPDATE : -case RTE_ETH_FILTER_FLUSH : -case RTE_ETH_FILTER_SET : -case RTE_ETH_FILTER_STATS : -case RTE_ETH_FILTER_OP_MAX : -DP_ERR (edev,"Unsupported filter_op %d\n" , filter_op); -return -ENOTSUP ; - } - ntuple = (struct rte_eth_ntuple_filter *)arg; -/* Internally convert ntuple to fdir entry */ -memset (&fdir_entry,0 ,sizeof (fdir_entry)); -if (ntuple->proto ==IPPROTO_TCP ) { - fdir_entry.input.flow_type =RTE_ETH_FLOW_NONFRAG_IPV4_TCP ; - tcpv4_flow = &fdir_entry.input.flow.tcp4_flow; - tcpv4_flow->ip.src_ip = ntuple->src_ip; - tcpv4_flow->ip.dst_ip = ntuple->dst_ip; - tcpv4_flow->ip.proto =IPPROTO_TCP ; - tcpv4_flow->src_port = ntuple->src_port; - tcpv4_flow->dst_port = ntuple->dst_port; - }else { - fdir_entry.input.flow_type =RTE_ETH_FLOW_NONFRAG_IPV4_UDP ; - udpv4_flow = &fdir_entry.input.flow.udp4_flow; - udpv4_flow->ip.src_ip = ntuple->src_ip; - udpv4_flow->ip.dst_ip = ntuple->dst_ip; - udpv4_flow->ip.proto =IPPROTO_TCP ; - udpv4_flow->src_port = ntuple->src_port; - udpv4_flow->dst_port = ntuple->dst_port; - } - - fdir_entry.action.rx_queue = ntuple->queue; - -return qede_config_cmn_fdir_filter (eth_dev, &fdir_entry, add); -} -static int qede_tunnel_update (struct qede_dev *qdev,struct ecore_tunnel_info *tunn_info)@@ -1548,8 +1487,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev,break ;case RTE_ETH_FILTER_FDIR :return qede_fdir_filter_conf (eth_dev, filter_op, arg); -case RTE_ETH_FILTER_NTUPLE : -return qede_ntuple_filter_conf (eth_dev, filter_op, arg);case RTE_ETH_FILTER_GENERIC :if (ECORE_IS_CMT (edev)) {DP_ERR (edev,"flowdir is not supported in 100G mode\n" );drivers/net/sfc/sfc_ethdev.c +0
-3@@ -1748,9 +1748,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,case RTE_ETH_FILTER_NONE :sfc_err (sa,"Global filters configuration not supported" );break ; -case RTE_ETH_FILTER_NTUPLE : -sfc_err (sa,"NTUPLE filters not supported" ); -break ;case RTE_ETH_FILTER_TUNNEL :sfc_err (sa,"Tunnel filters not supported" );break ;lib/librte_ethdev/rte_eth_ctrl.h +1
-3@@ -82,8 +82,7 @@ enum rte_filter_op {/** * A structure used to define the ntuple filter entry -* to support RTE_ETH_FILTER_NTUPLE with RTE_ETH_FILTER_ADD, -* RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations. +* to support RTE_ETH_FILTER_NTUPLE data representation. */ struct rte_eth_ntuple_filter {uint16_t flags;/**< Flags from RTE_NTUPLE_FLAGS_* */ --2.17.1
Re: [dpdk-dev] [PATCH 07/14] ethdev: remove legacy N-tuple filter type support
In reply to Andrew RybchenkoQuoted 21 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 22:09
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 07/14] ethdev: remove legacy N-tuple filter type supportRTE flow API should be used for filtering.
Preserve struct
rte_eth_ntuple_filterin ethdev API since the structure and related defines are used in flow classify library and a number of drivers.Preserve
RTE_ETH_FILTER_NTUPLEbecause of usage in drivers.Signed-off-by Andrew Rybchenko <[email protected]>
Quoted 11 lines
--- app/test-pmd/cmdline.c | 369 --------------------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 245 ------------------ drivers/net/e1000/igb_ethdev.c | 130 +--------- drivers/net/ixgbe/ixgbe_ethdev.c | 101 -------- drivers/net/qede/qede_filter.c | 63 ----- drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 3 +- 8 files changed, 3 insertions(+), 913 deletions(-)
For e1000, ixgbe PMDs,
Quoted 2 lines
2.17.1
PATCH 8/14 ethdev: remove legacy TUNNEL filter type support
In reply to Andrew RybchenkoRTE flow API should be used for filtering.
Preserve struct rte_eth_ntuple_filter in ethdev API since the structure and related defines are used in flow classify library and a number of drivers.
Preserve RTE_ETH_FILTER_TUNNEL because of usage in drivers.
What to do with examples/tep_termination?
--- app/test-pmd/cmdline.c | 162 ----------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 4 - drivers/net/i40e/i40e_ethdev.c | 210 ---------------------- drivers/net/qede/qede_filter.c | 257 --------------------------- drivers/net/sfc/sfc_ethdev.c | 3 - 6 files changed, 1 insertion(+), 637 deletions(-)
app/test-pmd/cmdline.c +0 -162
@@ -408,16 +408,6 @@ static void cmd_help_long_parsed(void *parsed_result," Remove a vlan_id, to the set of VLAN identifiers" "filtered for VF(s) from port_id.\n\n" -"tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " -"(inner_vlan) (vxlan|nvgre|ipingre|vxlan-gpe) (imac-ivlan|imac-ivlan-tenid|" -"imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" -" add a tunnel filter of a port.\n\n" - -"tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) " -"(inner_vlan) (vxlan|nvgre|ipingre|vxlan-gpe) (imac-ivlan|imac-ivlan-tenid|" -"imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" -" remove a tunnel filter of a port.\n\n" -"rx_vxlan_port add (udp_port) (port_id)\n" " Add an UDP port for VXLAN packet filter on a port\n\n"
@@ -9195,157 +9185,6 @@ cmdline_parse_inst_t cmd_vf_rate_limit = { }, }; -/* *** ADD TUNNEL FILTER OF A PORT *** */ -struct cmd_tunnel_filter_result { -cmdline_fixed_string_t cmd; -cmdline_fixed_string_t what; -portid_t port_id; -struct rte_ether_addr outer_mac; -struct rte_ether_addr inner_mac; -cmdline_ipaddr_t ip_value; -uint16_t inner_vlan; -cmdline_fixed_string_t tunnel_type; -cmdline_fixed_string_t filter_type; -uint32_t tenant_id; -uint16_t queue_num; -}; - -static void -cmd_tunnel_filter_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_tunnel_filter_result *res = parsed_result; -struct rte_eth_tunnel_filter_conf tunnel_filter_conf; -int ret =0 ; - -memset (&tunnel_filter_conf,0 ,sizeof (tunnel_filter_conf)); - -rte_ether_addr_copy (&res->outer_mac, &tunnel_filter_conf.outer_mac); -rte_ether_addr_copy (&res->inner_mac, &tunnel_filter_conf.inner_mac); - tunnel_filter_conf.inner_vlan = res->inner_vlan; - -if (res->ip_value.family ==AF_INET ) { - tunnel_filter_conf.ip_addr.ipv4_addr = - res->ip_value.addr.ipv4.s_addr; - tunnel_filter_conf.ip_type =RTE_TUNNEL_IPTYPE_IPV4 ; - }else { -memcpy (&(tunnel_filter_conf.ip_addr.ipv6_addr), - &(res->ip_value.addr.ipv6), -sizeof (struct in6_addr )); - tunnel_filter_conf.ip_type =RTE_TUNNEL_IPTYPE_IPV6 ; - } - -if (!strcmp (res->filter_type,"imac-ivlan" )) - tunnel_filter_conf.filter_type =RTE_TUNNEL_FILTER_IMAC_IVLAN ; -else if (!strcmp (res->filter_type,"imac-ivlan-tenid" )) - tunnel_filter_conf.filter_type = -RTE_TUNNEL_FILTER_IMAC_IVLAN_TENID ; -else if (!strcmp (res->filter_type,"imac-tenid" )) - tunnel_filter_conf.filter_type =RTE_TUNNEL_FILTER_IMAC_TENID ; -else if (!strcmp (res->filter_type,"imac" )) - tunnel_filter_conf.filter_type =ETH_TUNNEL_FILTER_IMAC ; -else if (!strcmp (res->filter_type,"omac-imac-tenid" )) - tunnel_filter_conf.filter_type = -RTE_TUNNEL_FILTER_OMAC_TENID_IMAC ; -else if (!strcmp (res->filter_type,"oip" )) - tunnel_filter_conf.filter_type =ETH_TUNNEL_FILTER_OIP ; -else if (!strcmp (res->filter_type,"iip" )) - tunnel_filter_conf.filter_type =ETH_TUNNEL_FILTER_IIP ; -else { -printf ("The filter type is not supported" ); -return ; - } - -if (!strcmp (res->tunnel_type,"vxlan" )) - tunnel_filter_conf.tunnel_type =RTE_TUNNEL_TYPE_VXLAN ; -else if (!strcmp (res->tunnel_type,"vxlan-gpe" )) - tunnel_filter_conf.tunnel_type =RTE_TUNNEL_TYPE_VXLAN_GPE ; -else if (!strcmp (res->tunnel_type,"nvgre" )) - tunnel_filter_conf.tunnel_type =RTE_TUNNEL_TYPE_NVGRE ; -else if (!strcmp (res->tunnel_type,"ipingre" )) - tunnel_filter_conf.tunnel_type =RTE_TUNNEL_TYPE_IP_IN_GRE ; -else { -printf ("The tunnel type %s not supported.\n" , res->tunnel_type); -return ; - } - - tunnel_filter_conf.tenant_id = res->tenant_id; - tunnel_filter_conf.queue_id = res->queue_num; -if (!strcmp (res->what,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_TUNNEL , -RTE_ETH_FILTER_ADD , - &tunnel_filter_conf); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_TUNNEL , -RTE_ETH_FILTER_DELETE , - &tunnel_filter_conf); -if (ret <0 ) -printf ("cmd_tunnel_filter_parsed error: (%s)\n" , -strerror (-ret)); - -} -cmdline_parse_token_string_t cmd_tunnel_filter_cmd = - TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - cmd,"tunnel_filter" ); -cmdline_parse_token_string_t cmd_tunnel_filter_what = - TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - what,"add#rm" ); -cmdline_parse_token_num_t cmd_tunnel_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, - port_id,UINT16 ); -cmdline_parse_token_etheraddr_t cmd_tunnel_filter_outer_mac = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_tunnel_filter_result, - outer_mac); -cmdline_parse_token_etheraddr_t cmd_tunnel_filter_inner_mac = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_tunnel_filter_result, - inner_mac); -cmdline_parse_token_num_t cmd_tunnel_filter_innner_vlan = - TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, - inner_vlan,UINT16 ); -cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value = - TOKEN_IPADDR_INITIALIZER(struct cmd_tunnel_filter_result, - ip_value); -cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type = - TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - tunnel_type,"vxlan#nvgre#ipingre#vxlan-gpe" ); - -cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = - TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - filter_type,"oip#iip#imac-ivlan#imac-ivlan-tenid#imac-tenid#" -"imac#omac-imac-tenid" ); -cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = - TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, - tenant_id,UINT32 ); -cmdline_parse_token_num_t cmd_tunnel_filter_queue_num = - TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, - queue_num,UINT16 ); - -cmdline_parse_inst_t cmd_tunnel_filter = { - .f = cmd_tunnel_filter_parsed, - .data = (void *)0 , - .help_str ="tunnel_filter add|rm <port_id> <outer_mac> <inner_mac> " -"<ip> <inner_vlan> vxlan|nvgre|ipingre oip|iip|imac-ivlan|" -"imac-ivlan-tenid|imac-tenid|imac|omac-imac-tenid <tenant_id> " -"<queue_id>: Add/Rm tunnel filter of a port" , - .tokens = { - (void *)&cmd_tunnel_filter_cmd, - (void *)&cmd_tunnel_filter_what, - (void *)&cmd_tunnel_filter_port_id, - (void *)&cmd_tunnel_filter_outer_mac, - (void *)&cmd_tunnel_filter_inner_mac, - (void *)&cmd_tunnel_filter_ip_value, - (void *)&cmd_tunnel_filter_innner_vlan, - (void *)&cmd_tunnel_filter_tunnel_type, - (void *)&cmd_tunnel_filter_filter_type, - (void *)&cmd_tunnel_filter_tenant_id, - (void *)&cmd_tunnel_filter_queue_num, -NULL , - }, -}; -/* *** CONFIGURE TUNNEL UDP PORT *** */ struct cmd_tunnel_udp_config {cmdline_fixed_string_t cmd;
@@ -19164,7 +19003,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_set_uc_all_hash_filter, (cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter, (cmdline_parse_inst_t *)&cmd_queue_rate_limit, - (cmdline_parse_inst_t *)&cmd_tunnel_filter, (cmdline_parse_inst_t *)&cmd_tunnel_udp_config, (cmdline_parse_inst_t *)&cmd_global_config, (cmdline_parse_inst_t *)&cmd_set_mirror_mask,
doc/guides/rel_notes/deprecation.rst +1 -1
@@ -108,7 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types TUNNEL, FDIR, + as filter types FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.
drivers/net/bnxt/bnxt_ethdev.c +0 -4
@@ -3409,10 +3409,6 @@ bnxt_filter_ctrl_op(struct rte_eth_dev *dev,return ret;switch (filter_type) { -case RTE_ETH_FILTER_TUNNEL : -PMD_DRV_LOG (ERR , -"filter type: %d: To be implemented\n" , filter_type); -break ;case RTE_ETH_FILTER_FDIR : ret =bnxt_fdir_filter (dev, filter_op, arg);break ;
drivers/net/i40e/i40e_ethdev.c +0 -210
234 lines not on this page · raw message
drivers/net/qede/qede_filter.c +0 -257
277 lines not on this page · raw message
drivers/net/sfc/sfc_ethdev.c +0 -3
@@ -1748,9 +1748,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,case RTE_ETH_FILTER_NONE :sfc_err (sa,"Global filters configuration not supported" );break ; -case RTE_ETH_FILTER_TUNNEL : -sfc_err (sa,"Tunnel filters not supported" ); -break ;case RTE_ETH_FILTER_FDIR :sfc_err (sa,"Flow Director filters not supported" );break ;
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 08/14] ethdev: remove legacy TUNNEL filter type support
Quoted 7 lines · Andrew Rybchenko
RTE flow API should be used for filtering.
Preserve struct
rte_eth_ntuple_filterin ethdev API since the structure and related defines are used in flow classify library and a number of drivers.
Quoted 5 lines
Preserve
RTE_ETH_FILTER_TUNNELbecause of usage in drivers.What to do with examples/tep_termination?
Signed-off-by Andrew Rybchenko <[email protected]>
For bnxt PMD
Quoted 9 lines
--- app/test-pmd/cmdline.c | 162 ----------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 4 - drivers/net/i40e/i40e_ethdev.c | 210 ---------------------- drivers/net/qede/qede_filter.c | 257 --------------------------- drivers/net/sfc/sfc_ethdev.c | 3 - 6 files changed, 1 insertion(+), 637 deletions(-)
Re: [dpdk-dev] [PATCH 08/14] ethdev: remove legacy TUNNEL filter type support
In reply to Andrew RybchenkoHi
Thanks for the work and notice.
Actually, the tep_termination example has not been used for a long time. And the cases it want to test can already be covered by rte_flow_create tunnel test cases. So it makes sense to just deprecate this example. I'll do that soon and cc to you. So don't worry about that example.
BRs
Xiaoyun
Quoted 806 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 22:09
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; Guo, Jia <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; Li, Xiaoyun <[email protected]>
Subject: [PATCH 08/14] ethdev: remove legacy TUNNEL filter type supportRTE flow API should be used for filtering.
Preserve struct
rte_eth_ntuple_filterin ethdev API since the structure and related defines are used in flow classify library and a number of drivers.Preserve
RTE_ETH_FILTER_TUNNELbecause of usage in drivers.What to do with examples/tep_termination?
Signed-off-by Andrew Rybchenko <[email protected]>--- app/test-pmd/cmdline.c | 162 ----------------- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 4 - drivers/net/i40e/i40e_ethdev.c | 210 ---------------------- drivers/net/qede/qede_filter.c | 257 --------------------------- drivers/net/sfc/sfc_ethdev.c | 3 - 6 files changed, 1 insertion(+), 637 deletions(-)app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0
-0
1fdab5f026..f7169c7b9e100644app/test-pmd/cmdline.c +0
-1@@ -408,16 +408,6 @@ static void cmd_help_long_parsed(void *parsed_result," Remove a vlan_id, to the set of VLAN identifiers" "filtered for VF(s) from port_id.\n\n" - "tunnel_filter add (port_id) (outer_mac) (inner_mac)(
ip_addr) "app/test-pmd/cmdline.c +0
-1- "(inner_vlan) (vxlan|nvgre|ipingre|vxlan-gpe) (imac-ivlan|imac-ivlan-tenid|"
app/test-pmd/cmdline.c +0
-1- "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id)(queue_id)\n"
app/test-pmd/cmdline.c +0
-3-" add a tunnel filter of a port.\n\n" - - "tunnel_filter rm (port_id) (outer_mac) (inner_mac)(
ip_addr) "app/test-pmd/cmdline.c +0
-1- "(inner_vlan) (vxlan|nvgre|ipingre|vxlan-gpe) (imac-ivlan|imac-ivlan-tenid|"
app/test-pmd/cmdline.c +0
-1- "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id)(queue_id)\n"
app/test-pmd/cmdline.c +0
-2-" remove a tunnel filter of a port.\n\n" -"rx_vxlan_port add (udp_port) (port_id)\n" " Add an UDP port for VXLAN packet filter on aport\n\n"
app/test-pmd/cmdline.c +0
-65@@ -9195,157 +9185,6 @@ cmdline_parse_inst_t cmd_vf_rate_limit = { }, }; -/* *** ADD TUNNEL FILTER OF A PORT *** */ -struct cmd_tunnel_filter_result { -cmdline_fixed_string_t cmd; -cmdline_fixed_string_t what; -portid_t port_id; -struct rte_ether_addr outer_mac; -struct rte_ether_addr inner_mac; -cmdline_ipaddr_t ip_value; -uint16_t inner_vlan; -cmdline_fixed_string_t tunnel_type; -cmdline_fixed_string_t filter_type; -uint32_t tenant_id; -uint16_t queue_num; -}; - -static void -cmd_tunnel_filter_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_tunnel_filter_result *res = parsed_result; -struct rte_eth_tunnel_filter_conf tunnel_filter_conf; -int ret =0 ; - -memset (&tunnel_filter_conf,0 ,sizeof (tunnel_filter_conf)); - -rte_ether_addr_copy (&res->outer_mac, &tunnel_filter_conf.outer_mac); -rte_ether_addr_copy (&res->inner_mac, &tunnel_filter_conf.inner_mac); - tunnel_filter_conf.inner_vlan = res->inner_vlan; - -if (res->ip_value.family ==AF_INET ) { - tunnel_filter_conf.ip_addr.ipv4_addr = - res->ip_value.addr.ipv4.s_addr; - tunnel_filter_conf.ip_type =RTE_TUNNEL_IPTYPE_IPV4 ; - }else { -memcpy (&(tunnel_filter_conf.ip_addr.ipv6_addr), - &(res->ip_value.addr.ipv6), -sizeof (struct in6_addr )); - tunnel_filter_conf.ip_type =RTE_TUNNEL_IPTYPE_IPV6 ; - } - -if (!strcmp (res->filter_type,"imac-ivlan" )) - tunnel_filter_conf.filter_type =RTE_TUNNEL_FILTER_IMAC_IVLAN ; -else if (!strcmp (res->filter_type,"imac-ivlan-tenid" )) - tunnel_filter_conf.filter_type = -RTE_TUNNEL_FILTER_IMAC_IVLAN_TENID ; -else if (!strcmp (res->filter_type,"imac-tenid" )) - tunnel_filter_conf.filter_type =RTE_TUNNEL_FILTER_IMAC_TENID ; -else if (!strcmp (res->filter_type,"imac" )) - tunnel_filter_conf.filter_type =ETH_TUNNEL_FILTER_IMAC ; -else if (!strcmp (res->filter_type,"omac-imac-tenid" )) - tunnel_filter_conf.filter_type = -RTE_TUNNEL_FILTER_OMAC_TENID_IMAC ; -else if (!strcmp (res->filter_type,"oip" )) - tunnel_filter_conf.filter_type =ETH_TUNNEL_FILTER_OIP ; -else if (!strcmp (res->filter_type,"iip" )) - tunnel_filter_conf.filter_type =ETH_TUNNEL_FILTER_IIP ; -else { -printf ("The filter type is not supported" ); -return ; - } - -if (!strcmp (res->tunnel_type,"vxlan" )) - tunnel_filter_conf.tunnel_type =RTE_TUNNEL_TYPE_VXLAN ; -else if (!strcmp (res->tunnel_type,"vxlan-gpe" )) - tunnel_filter_conf.tunnel_type =
RTE_TUNNEL_TYPE_VXLAN_GPE;app/test-pmd/cmdline.c +0
-4-else if (!strcmp (res->tunnel_type,"nvgre" )) - tunnel_filter_conf.tunnel_type =RTE_TUNNEL_TYPE_NVGRE ; -else if (!strcmp (res->tunnel_type,"ipingre" )) - tunnel_filter_conf.tunnel_type =
RTE_TUNNEL_TYPE_IP_IN_GRE;app/test-pmd/cmdline.c +0
-64- else { -printf ("The tunnel type %s not supported.\n" , res->tunnel_type); -return ; - } - - tunnel_filter_conf.tenant_id = res->tenant_id; - tunnel_filter_conf.queue_id = res->queue_num; -if (!strcmp (res->what,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_TUNNEL , -RTE_ETH_FILTER_ADD , - &tunnel_filter_conf); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_TUNNEL , -RTE_ETH_FILTER_DELETE , - &tunnel_filter_conf); -if (ret <0 ) -printf ("cmd_tunnel_filter_parsed error: (%s)\n" , -strerror (-ret)); - -} -cmdline_parse_token_string_t cmd_tunnel_filter_cmd = - TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - cmd,"tunnel_filter" ); -cmdline_parse_token_string_t cmd_tunnel_filter_what = - TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - what,"add#rm" ); -cmdline_parse_token_num_t cmd_tunnel_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, - port_id,UINT16 ); -cmdline_parse_token_etheraddr_t cmd_tunnel_filter_outer_mac = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_tunnel_filter_result, - outer_mac); -cmdline_parse_token_etheraddr_t cmd_tunnel_filter_inner_mac = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_tunnel_filter_result, - inner_mac); -cmdline_parse_token_num_t cmd_tunnel_filter_innner_vlan = - TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, - inner_vlan,UINT16 ); -cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value = - TOKEN_IPADDR_INITIALIZER(struct cmd_tunnel_filter_result, - ip_value); -cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type = - TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - tunnel_type,"vxlan#nvgre#ipingre#vxlan-gpe" ); - -cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = - TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - filter_type,"oip#iip#imac-ivlan#imac-ivlan-tenid#imac-tenid#" -"imac#omac-imac-tenid" ); -cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = - TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, - tenant_id,UINT32 ); -cmdline_parse_token_num_t cmd_tunnel_filter_queue_num = - TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, - queue_num,UINT16 ); - -cmdline_parse_inst_t cmd_tunnel_filter = { - .f = cmd_tunnel_filter_parsed, - .data = (void *)0 , - .help_str ="tunnel_filter add|rm <port_id> <outer_mac> <inner_mac> " -"<ip> <inner_vlan> vxlan|nvgre|ipingre oip|iip|imac-ivlan|" - "imac-ivlan-tenid|imac-tenid|imac|omac-imac-tenid<
tenant_id> "app/test-pmd/cmdline.c +0
-18- "<queue_id>: Add/Rm tunnel filter of a port", - .tokens = { - (void *)&cmd_tunnel_filter_cmd, - (void *)&cmd_tunnel_filter_what, - (void *)&cmd_tunnel_filter_port_id, - (void *)&cmd_tunnel_filter_outer_mac, - (void *)&cmd_tunnel_filter_inner_mac, - (void *)&cmd_tunnel_filter_ip_value, - (void *)&cmd_tunnel_filter_innner_vlan, - (void *)&cmd_tunnel_filter_tunnel_type, - (void *)&cmd_tunnel_filter_filter_type, - (void *)&cmd_tunnel_filter_tenant_id, - (void *)&cmd_tunnel_filter_queue_num, - NULL, - }, -}; -/* *** CONFIGURE TUNNEL UDP PORT *** */ struct cmd_tunnel_udp_config {cmdline_fixed_string_t cmd;@@ -19164,7 +19003,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_set_uc_all_hash_filter, (cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter, (cmdline_parse_inst_t *)&cmd_queue_rate_limit, - (cmdline_parse_inst_t *)&cmd_tunnel_filter, (cmdline_parse_inst_t *)&cmd_tunnel_udp_config, (cmdline_parse_inst_t *)&cmd_global_config, (cmdline_parse_inst_t *)&cmd_set_mirror_mask, diff --git
a/doc/guides/rel_notes/deprecation.rstb/doc/guides/rel_notes/deprecation.rstindexa531edc88c..a807cb9ad9100644doc/guides/rel_notes/deprecation.rst +1
-1@@ -108,7 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types TUNNEL, FDIR, + as filter types FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.drivers/net/bnxt/bnxt_ethdev.c +0
-4@@ -3409,10 +3409,6 @@ bnxt_filter_ctrl_op(struct rte_eth_dev *dev,return ret;switch (filter_type) { -case RTE_ETH_FILTER_TUNNEL : -PMD_DRV_LOG (ERR , -"filter type: %d: To be implemented\n" , filter_type); -break ;case RTE_ETH_FILTER_FDIR : ret =bnxt_fdir_filter (dev, filter_op, arg);break ;drivers/net/i40e/i40e_ethdev.c +0
-139@@ -7863,145 +7863,6 @@ i40e_sw_tunnel_filter_del(struct i40e_pf *pf,return 0 ; } -int -i40e_dev_tunnel_filter_set (struct i40e_pf *pf, -struct rte_eth_tunnel_filter_conf *tunnel_filter, -uint8_t add) -{ -uint16_t ip_type; -uint32_t ipv4_addr, ipv4_addr_le; -uint8_t i, tun_type =0 ; -/* internal varialbe to convert ipv6 byte order */ -uint32_t convert_ipv6[4 ]; -int val, ret =0 ; -struct i40e_hw *hw =I40E_PF_TO_HW (pf); -struct i40e_vsi *vsi = pf->main_vsi; -struct i40e_aqc_cloud_filters_element_bb *cld_filter; -struct i40e_aqc_cloud_filters_element_bb *pfilter; -struct i40e_tunnel_rule *tunnel_rule = &pf->tunnel; -struct i40e_tunnel_filter *tunnel, *node; -struct i40e_tunnel_filter check_filter;/* Check if filter exists */ - - cld_filter =rte_zmalloc ("tunnel_filter" , -sizeof (struct i40e_aqc_add_rm_cloud_filt_elem_ext ), -0 ); - -if (NULL == cld_filter) { -PMD_DRV_LOG (ERR ,"Failed to alloc memory." ); -return -ENOMEM ; - } - pfilter = cld_filter; - -rte_ether_addr_copy (&tunnel_filter->outer_mac, - (struct rte_ether_addr *)&pfilter->element.outer_mac); -rte_ether_addr_copy (&tunnel_filter->inner_mac, - (struct rte_ether_addr *)&pfilter->element.inner_mac); - - pfilter->element.inner_vlan = -rte_cpu_to_le_16 (tunnel_filter->inner_vlan); -if (tunnel_filter->ip_type ==RTE_TUNNEL_IPTYPE_IPV4 ) { - ip_type =I40E_AQC_ADD_CLOUD_FLAGS_IPV4 ; - ipv4_addr =rte_be_to_cpu_32 (tunnel_filter- >ip_addr.ipv4_addr); - ipv4_addr_le =rte_cpu_to_le_32 (ipv4_addr); -rte_memcpy (&pfilter->element.ipaddr.v4.data, - &ipv4_addr_le, -sizeof (pfilter->element.ipaddr.v4.data)); - }else { - ip_type =I40E_AQC_ADD_CLOUD_FLAGS_IPV6 ; -for (i =0 ; i <4 ; i++) { - convert_ipv6[i] = -rte_cpu_to_le_32 (rte_be_to_cpu_32 (tunnel_filter- >ip_addr.ipv6_addr[i])); - } -rte_memcpy (&pfilter->element.ipaddr.v6.data, - &convert_ipv6, -sizeof (pfilter->element.ipaddr.v6.data)); - } - -/* check tunneled type */ -switch (tunnel_filter->tunnel_type) { -case RTE_TUNNEL_TYPE_VXLAN : - tun_type =I40E_AQC_ADD_CLOUD_TNL_TYPE_VXLAN ; -break ; -case RTE_TUNNEL_TYPE_NVGRE : - tun_type =I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC ; -break ; -case RTE_TUNNEL_TYPE_IP_IN_GRE : - tun_type =I40E_AQC_ADD_CLOUD_TNL_TYPE_IP ; -break ; -case RTE_TUNNEL_TYPE_VXLAN_GPE : - tun_type =I40E_AQC_ADD_CLOUD_TNL_TYPE_VXLAN_GPE ; -break ; -default : -/* Other tunnel types is not supported. */ -PMD_DRV_LOG (ERR ,"tunnel type is not supported." ); -rte_free (cld_filter); -return -EINVAL ; - } - - val =i40e_dev_get_filter_type (tunnel_filter->filter_type, - &pfilter->element.flags); -if (val <0 ) { -rte_free (cld_filter); -return -EINVAL ; - } - - pfilter->element.flags |=rte_cpu_to_le_16 ( -I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE | - ip_type | (tun_type << I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT)); - pfilter->element.tenant_id =rte_cpu_to_le_32 (tunnel_filter->tenant_id); - pfilter->element.queue_number = -rte_cpu_to_le_16 (tunnel_filter->queue_id); - -/* Check if there is the filter in SW list */ -memset (&check_filter,0 ,sizeof (check_filter)); -i40e_tunnel_filter_convert (cld_filter, &check_filter); - node =i40e_sw_tunnel_filter_lookup (tunnel_rule, &check_filter.input); -if (add && node) { -PMD_DRV_LOG (ERR ,"Conflict with existing tunnel rules!" ); -rte_free (cld_filter); -return -EINVAL ; - } - -if (!add && !node) { -PMD_DRV_LOG (ERR ,"There's no corresponding tunnel filter!" ); -rte_free (cld_filter); -return -EINVAL ; - } - -if (add) { - ret =i40e_aq_add_cloud_filters (hw, - vsi->seid, &cld_filter->element,1 ); -if (ret <0 ) { -PMD_DRV_LOG (ERR ,"Failed to add a tunnel filter." ); -rte_free (cld_filter); -return -ENOTSUP ; - } - tunnel =rte_zmalloc ("tunnel_filter" ,sizeof (*tunnel),0 ); -if (tunnel ==NULL ) { -PMD_DRV_LOG (ERR ,"Failed to alloc memory." ); -rte_free (cld_filter); -return -ENOMEM ; - } - -rte_memcpy (tunnel, &check_filter,sizeof (check_filter)); - ret =i40e_sw_tunnel_filter_insert (pf, tunnel); -if (ret <0 ) -rte_free (tunnel); - }else { - ret =i40e_aq_rem_cloud_filters (hw, vsi->seid, - &cld_filter->element,1 ); -if (ret <0 ) { -PMD_DRV_LOG (ERR ,"Failed to delete a tunnel filter." ); -rte_free (cld_filter); -return -ENOTSUP ; - } - ret =i40e_sw_tunnel_filter_del (pf, &node->input); - } - -rte_free (cld_filter); -return ret; -} -#define
I40E_AQC_REPLACE_CLOUD_CMD_INPUT_TR_WORD00x48
#defineI40E_TR_VXLAN_GRE_KEY_MASK0x4
#defineI40E_TR_GENEVE_KEY_MASK0x8drivers/net/i40e/i40e_ethdev.c +0
-68@@ -9004,40 +8865,6 @@ i40e_pf_config_rss(struct i40e_pf *pf)return i40e_hw_rss_hash_set (pf, &rss_conf); } -static int -i40e_tunnel_filter_param_check (struct i40e_pf *pf, -struct rte_eth_tunnel_filter_conf *filter) -{ -if (pf ==NULL || filter ==NULL ) { -PMD_DRV_LOG (ERR ,"Invalid parameter" ); -return -EINVAL ; - } - -if (filter->queue_id >= pf->dev_data->nb_rx_queues) { -PMD_DRV_LOG (ERR ,"Invalid queue ID" ); -return -EINVAL ; - } - -if (filter->inner_vlan >RTE_ETHER_MAX_VLAN_ID ) { -PMD_DRV_LOG (ERR ,"Invalid inner VLAN ID" ); -return -EINVAL ; - } - -if ((filter->filter_type Ð_TUNNEL_FILTER_OMAC ) && - (rte_is_zero_ether_addr (&filter->outer_mac))) { -PMD_DRV_LOG (ERR ,"Cannot add NULL outer MAC address" ); -return -EINVAL ; - } - -if ((filter->filter_type Ð_TUNNEL_FILTER_IMAC ) && - (rte_is_zero_ether_addr (&filter->inner_mac))) { -PMD_DRV_LOG (ERR ,"Cannot add NULL inner MAC address" ); -return -EINVAL ; - } - -return 0 ; -} -#define I40E_GL_PRS_FVBM_MSK_ENA 0x80000000#define I40E_GL_PRS_FVBM (_i) (0x00269760 + ((_i) * 4))int @@ -9123,40 +8950,6 @@ i40e_filter_ctrl_global_config(struct rte_eth_dev *dev, return ret; } -static int -i40e_tunnel_filter_handle (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg) -{ -struct rte_eth_tunnel_filter_conf *filter; -struct i40e_pf *pf =I40E_DEV_PRIVATE_TO_PF (dev->data- >dev_private); -int ret =I40E_SUCCESS ; - - filter = (struct rte_eth_tunnel_filter_conf *)(arg); - -if (i40e_tunnel_filter_param_check (pf, filter) <0 ) -return I40E_ERR_PARAM ; - -switch (filter_op) { -case RTE_ETH_FILTER_NOP : -if (!(pf->flags &I40E_FLAG_VXLAN )) - ret =I40E_NOT_SUPPORTED ; -break ; -case RTE_ETH_FILTER_ADD : - ret =i40e_dev_tunnel_filter_set (pf, filter,1 ); -break ; -case RTE_ETH_FILTER_DELETE : - ret =i40e_dev_tunnel_filter_set (pf, filter,0 ); -break ; -default : -PMD_DRV_LOG (ERR ,"unknown operation %u" , filter_op); - ret =I40E_ERR_PARAM ; -break ; - } - -return ret; -} - /* Get the symmetric hash enable configurations per port */ static void
i40e_get_symmetric_hash_enable_per_port(struct i40e_hw *hw, uint8_t *enable)@@ -10465,9 +10258,6 @@ i40e_dev_filter_ctrl(structrte_eth_dev*dev,drivers/net/i40e/i40e_ethdev.c +0
-3case RTE_ETH_FILTER_HASH : ret =i40e_hash_filter_ctrl (dev, filter_op, arg);break ; -case RTE_ETH_FILTER_TUNNEL : - ret =i40e_tunnel_filter_handle (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_FDIR : ret =i40e_fdir_ctrl_func (dev, filter_op, arg);break ;drivers/net/qede/qede_filter.c +0
-30@@ -696,36 +696,6 @@ qede_geneve_enable(struct rte_eth_dev *eth_dev,uint8_t clss, return rc; } -static int -qede_ipgre_enable (struct rte_eth_dev *eth_dev,uint8_t clss, -bool enable) -{ -struct qede_dev *qdev =QEDE_INIT_QDEV (eth_dev); -struct ecore_dev *edev =QEDE_INIT_EDEV (qdev); -enum _ecore_status_t rc =ECORE_INVAL ; -struct ecore_tunnel_info tunn; - -memset (&tunn,0 ,sizeof (struct ecore_tunnel_info )); - tunn.ip_gre.b_update_mode = true; - tunn.ip_gre.b_mode_enabled = enable; - tunn.ip_gre.tun_cls = clss; - tunn.ip_gre.tun_cls = clss; - tunn.b_update_rx_cls = true; - tunn.b_update_tx_cls = true; - - rc =qede_tunnel_update (qdev, &tunn); -if (rc ==ECORE_SUCCESS ) { - qdev->ipgre.enable = enable; -DP_INFO (edev,"IPGRE is %s\n" , - enable ?"enabled" :"disabled" ); - }else { -DP_ERR (edev,"Failed to update tunn_clss %u\n" , - clss); - } - -return rc; -} - int qede_udp_dst_port_del(struct rte_eth_dev *eth_dev,drivers/net/qede/qede_filter.c +1
-227struct rte_eth_udp_tunnel *tunnel_udp) @@ -902,210 +872,6 @@ qede_udp_dst_port_add(struct rte_eth_dev *eth_dev, return 0; } -static void qede_get_ecore_tunn_params (uint32_t filter,uint32_t *type, -uint32_t *clss,char *str) -{ -uint16_t j; - *clss =MAX_ECORE_TUNN_CLSS ; - -for (j =0 ; j <RTE_DIM (qede_tunn_types); j++) { -if (filter == qede_tunn_types[j].rte_filter_type) { - *type = qede_tunn_types[j].qede_type; - *clss = qede_tunn_types[j].qede_tunn_clss; -strcpy (str, qede_tunn_types[j].string); -return ; - } - } -} - -static int -qede_set_ucast_tunn_cmn_param (struct ecore_filter_ucast *ucast, -const struct rte_eth_tunnel_filter_conf *conf, -uint32_t type) -{ -/* Init commmon ucast params first */ -qede_set_ucast_cmn_params (ucast); - -/* Copy out the required fields based on classification type */ - ucast->type = type; - -switch (type) { -case ECORE_FILTER_VNI : - ucast->vni = conf->tenant_id; -break ; -case ECORE_FILTER_INNER_VLAN : - ucast->vlan = conf->inner_vlan; -break ; -case ECORE_FILTER_MAC : -memcpy (ucast->mac, conf->outer_mac.addr_bytes, -RTE_ETHER_ADDR_LEN ); -break ; -case ECORE_FILTER_INNER_MAC : -memcpy (ucast->mac, conf->inner_mac.addr_bytes, -RTE_ETHER_ADDR_LEN ); -break ; -case ECORE_FILTER_MAC_VNI_PAIR : -memcpy (ucast->mac, conf->outer_mac.addr_bytes, -RTE_ETHER_ADDR_LEN ); - ucast->vni = conf->tenant_id; -break ; -case ECORE_FILTER_INNER_MAC_VNI_PAIR : -memcpy (ucast->mac, conf->inner_mac.addr_bytes, -RTE_ETHER_ADDR_LEN ); - ucast->vni = conf->tenant_id; -break ; -case ECORE_FILTER_INNER_PAIR : -memcpy (ucast->mac, conf->inner_mac.addr_bytes, -RTE_ETHER_ADDR_LEN ); - ucast->vlan = conf->inner_vlan; -break ; -default : -return -EINVAL ; - } - -return ECORE_SUCCESS ; -} - -static int -_qede_tunn_filter_config (struct rte_eth_dev *eth_dev, -const struct rte_eth_tunnel_filter_conf *conf, - __rte_unused enum rte_filter_op filter_op, -enum ecore_tunn_clss *clss, -bool add) -{ -struct qede_dev *qdev =QEDE_INIT_QDEV (eth_dev); -struct ecore_dev *edev =QEDE_INIT_EDEV (qdev); -struct ecore_filter_ucast ucast = {0 }; -enum ecore_filter_ucast_type type; -uint16_t filter_type =0 ; -char str[80 ]; -int rc; - - filter_type = conf->filter_type; -/* Determine if the given filter classification is supported */ -qede_get_ecore_tunn_params (filter_type, &type, clss, str); -if (*clss ==MAX_ECORE_TUNN_CLSS ) { -DP_ERR (edev,"Unsupported filter type\n" ); -return -EINVAL ; - } -/* Init tunnel ucast params */ - rc =qede_set_ucast_tunn_cmn_param (&ucast, conf, type); -if (rc !=ECORE_SUCCESS ) { -DP_ERR (edev,"Unsupported Tunnel filter type 0x%x\n" , - conf->filter_type); -return rc; - } -DP_INFO (edev,"Rule: \"%s\", op %d, type 0x%x\n" , - str, filter_op, ucast.type); - - ucast.opcode = add ?ECORE_FILTER_ADD :ECORE_FILTER_REMOVE ; - -/* Skip MAC/VLAN if filter is based on VNI */ -if (!(filter_type Ð_TUNNEL_FILTER_TENID )) { - rc =qede_mac_int_ops (eth_dev, &ucast, add); -if (rc ==0 && add) { -/* Enable accept anyvlan */ -qede_config_accept_any_vlan (qdev, true); - } - }else { - rc =qede_ucast_filter (eth_dev, &ucast, add); -if (rc ==0 ) - rc =ecore_filter_ucast_cmd (edev, &ucast, -ECORE_SPQ_MODE_CB ,NULL ); - } - -return rc; -} - -static int -qede_tunn_enable (struct rte_eth_dev *eth_dev,uint8_t clss, -enum rte_eth_tunnel_type tunn_type,bool enable) -{ -int rc = -EINVAL ; - -switch (tunn_type) { -case RTE_TUNNEL_TYPE_VXLAN : - rc =qede_vxlan_enable (eth_dev, clss, enable); -break ; -case RTE_TUNNEL_TYPE_GENEVE : - rc =qede_geneve_enable (eth_dev, clss, enable); -break ; -case RTE_TUNNEL_TYPE_IP_IN_GRE : - rc =qede_ipgre_enable (eth_dev, clss, enable); -break ; -default : - rc = -EINVAL ; -break ; - } - -return rc; -} - -static int -qede_tunn_filter_config (struct rte_eth_dev *eth_dev, -enum rte_filter_op filter_op, -const struct rte_eth_tunnel_filter_conf *conf) -{ -struct qede_dev *qdev =QEDE_INIT_QDEV (eth_dev); -struct ecore_dev *edev =QEDE_INIT_EDEV (qdev); -enum ecore_tunn_clss clss =MAX_ECORE_TUNN_CLSS ; -bool add; -int rc; - -PMD_INIT_FUNC_TRACE (edev); - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : - add = true; -break ; -case RTE_ETH_FILTER_DELETE : - add = false; -break ; -default : -DP_ERR (edev,"Unsupported operation %d\n" , filter_op); -return -EINVAL ; - } - -if (IS_VF (edev)) -return qede_tunn_enable (eth_dev, -ECORE_TUNN_CLSS_MAC_VLAN , - conf->tunnel_type, add); - - rc =_qede_tunn_filter_config (eth_dev, conf, filter_op, &clss, add); -if (rc !=ECORE_SUCCESS ) -return rc; - -if (add) { -if (conf->tunnel_type ==RTE_TUNNEL_TYPE_VXLAN ) { - qdev->vxlan.num_filters++; - qdev->vxlan.filter_type = conf->filter_type; - }else {/* GENEVE */ - qdev->geneve.num_filters++; - qdev->geneve.filter_type = conf->filter_type; - } - -if (!qdev->vxlan.enable || !qdev->geneve.enable || - !qdev->ipgre.enable) -return qede_tunn_enable (eth_dev, clss, - conf->tunnel_type, - true); - }else { -if (conf->tunnel_type ==RTE_TUNNEL_TYPE_VXLAN ) - qdev->vxlan.num_filters--; -else /*GENEVE*/ - qdev->geneve.num_filters--; - -/* Disable VXLAN if VXLAN filters become 0 */ -if (qdev->vxlan.num_filters ==0 || - qdev->geneve.num_filters ==0 ) -return qede_tunn_enable (eth_dev, clss, - conf->tunnel_type, - false); - } - -return 0 ; -} - static int qede_flow_validate_attr(__rte_unused struct rte_eth_dev *dev, const struct rte_flow_attr *attr,@@ -1460,31 +1226,8 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, {struct qede_dev *qdev =QEDE_INIT_QDEV (eth_dev);struct ecore_dev *edev =QEDE_INIT_EDEV (qdev); -struct rte_eth_tunnel_filter_conf *filter_conf = - (struct rte_eth_tunnel_filter_conf *)arg;switch (filter_type) { -case RTE_ETH_FILTER_TUNNEL : -switch (filter_conf->tunnel_type) { -case RTE_TUNNEL_TYPE_VXLAN : -case RTE_TUNNEL_TYPE_GENEVE : -case RTE_TUNNEL_TYPE_IP_IN_GRE : -DP_INFO (edev, -"Packet steering to the specified Rx queue" -" is not supported with UDP tunneling" ); -return (qede_tunn_filter_config (eth_dev, filter_op, - filter_conf)); -case RTE_TUNNEL_TYPE_TEREDO : -case RTE_TUNNEL_TYPE_NVGRE : -case RTE_L2_TUNNEL_TYPE_E_TAG : -DP_ERR (edev,"Unsupported tunnel type %d\n" , - filter_conf->tunnel_type); -return -EINVAL ; -case RTE_TUNNEL_TYPE_NONE : -default : -return 0 ; - } -break ;case RTE_ETH_FILTER_FDIR :return qede_fdir_filter_conf (eth_dev, filter_op, arg);case RTE_ETH_FILTER_GENERIC :drivers/net/sfc/sfc_ethdev.c index renamed from drivers/net/sfc/sfc_ethdev.c +0
-0
4291a932e8..51d33f3710100644drivers/net/sfc/sfc_ethdev.c +0
-3@@ -1748,9 +1748,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enumrte_filter_type filter_type, case RTE_ETH_FILTER_NONE: sfc_err(sa, "Global filters configuration not supported");break ; -case RTE_ETH_FILTER_TUNNEL : -sfc_err (sa,"Tunnel filters not supported" ); -break ;case RTE_ETH_FILTER_FDIR :sfc_err (sa,"Flow Director filters not supported" );break;
--
2.17.1
PATCH 9/14 ethdev: remove legacy HASH filter type support
In reply to Andrew RybchenkoRTE flow API should be used for filtering.
Preserve RTE_ETH_FILTER_HASH since it is used in drivers internally in RTE flow API support.
--- app/test-pmd/cmdline.c | 434 --------------------------- doc/guides/rel_notes/deprecation.rst | 4 +- drivers/net/i40e/i40e_ethdev.c | 268 ----------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 57 ---- 6 files changed, 2 insertions(+), 765 deletions(-)
app/test-pmd/cmdline.c +0 -434
@@ -1048,34 +1048,6 @@ static void cmd_help_long_parsed(void *parsed_result," (raw|l2|l3|l4) (config)\n" " Configure flex payload selection.\n\n" -"get_sym_hash_ena_per_port (port_id)\n" -" get symmetric hash enable configuration per port.\n\n" - -"set_sym_hash_ena_per_port (port_id) (enable|disable)\n" -" set symmetric hash enable configuration per port" -" to enable or disable.\n\n" - -"get_hash_global_config (port_id)\n" -" Get the global configurations of hash filters.\n\n" - -"set_hash_global_config (port_id) (toeplitz|simple_xor|symmetric_toeplitz|default)" -" (ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|" -"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload)" -" (enable|disable)\n" -" Set the global configurations of hash filters.\n\n" - -"set_hash_input_set (port_id) (ipv4|ipv4-frag|" -"ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|" -"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|" -"l2_payload|<flowtype_id>) (ovlan|ivlan|src-ipv4|dst-ipv4|" -"src-ipv6|dst-ipv6|ipv4-tos|ipv4-proto|ipv6-tc|" -"ipv6-next-header|udp-src-port|udp-dst-port|" -"tcp-src-port|tcp-dst-port|sctp-src-port|" -"sctp-dst-port|sctp-veri-tag|udp-key|gre-key|fld-1st|" -"fld-2nd|fld-3rd|fld-4th|fld-5th|fld-6th|fld-7th|" -"fld-8th|none) (select|add)\n" -" Set the input set for hash.\n\n" -"set_fdir_input_set (port_id) " "(ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|" "ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
@@ -11503,343 +11475,6 @@ cmdline_parse_inst_t cmd_set_flow_director_flex_payload = {extern cmdline_parse_inst_t cmd_flow;/* *** Classification Filters Control *** */ -/* *** Get symmetric hash enable per port *** */ -struct cmd_get_sym_hash_ena_per_port_result { -cmdline_fixed_string_t get_sym_hash_ena_per_port; -portid_t port_id; -}; - -static void -cmd_get_sym_hash_per_port_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_get_sym_hash_ena_per_port_result *res = parsed_result; -struct rte_eth_hash_filter_info info; -int ret; - -if (rte_eth_dev_filter_supported (res->port_id, -RTE_ETH_FILTER_HASH ) <0 ) { -printf ("RTE_ETH_FILTER_HASH not supported on port: %d\n" , - res->port_id); -return ; - } - -memset (&info,0 ,sizeof (info)); - info.info_type =RTE_ETH_HASH_FILTER_SYM_HASH_ENA_PER_PORT ; - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_HASH , -RTE_ETH_FILTER_GET , &info); - -if (ret <0 ) { -printf ("Cannot get symmetric hash enable per port " -"on port %u\n" , res->port_id); -return ; - } - -printf ("Symmetric hash is %s on port %u\n" , info.info.enable ? -"enabled" :"disabled" , res->port_id); -} - -cmdline_parse_token_string_t cmd_get_sym_hash_ena_per_port_all = - TOKEN_STRING_INITIALIZER(struct cmd_get_sym_hash_ena_per_port_result, - get_sym_hash_ena_per_port,"get_sym_hash_ena_per_port" ); -cmdline_parse_token_num_t cmd_get_sym_hash_ena_per_port_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_get_sym_hash_ena_per_port_result, - port_id,UINT16 ); - -cmdline_parse_inst_t cmd_get_sym_hash_ena_per_port = { - .f = cmd_get_sym_hash_per_port_parsed, - .data =NULL , - .help_str ="get_sym_hash_ena_per_port <port_id>" , - .tokens = { - (void *)&cmd_get_sym_hash_ena_per_port_all, - (void *)&cmd_get_sym_hash_ena_per_port_port_id, -NULL , - }, -}; - -/* *** Set symmetric hash enable per port *** */ -struct cmd_set_sym_hash_ena_per_port_result { -cmdline_fixed_string_t set_sym_hash_ena_per_port; -cmdline_fixed_string_t enable; -portid_t port_id; -}; - -static void -cmd_set_sym_hash_per_port_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_set_sym_hash_ena_per_port_result *res = parsed_result; -struct rte_eth_hash_filter_info info; -int ret; - -if (rte_eth_dev_filter_supported (res->port_id, -RTE_ETH_FILTER_HASH ) <0 ) { -printf ("RTE_ETH_FILTER_HASH not supported on port: %d\n" , - res->port_id); -return ; - } - -memset (&info,0 ,sizeof (info)); - info.info_type =RTE_ETH_HASH_FILTER_SYM_HASH_ENA_PER_PORT ; -if (!strcmp (res->enable,"enable" )) - info.info.enable =1 ; - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_HASH , -RTE_ETH_FILTER_SET , &info); -if (ret <0 ) { -printf ("Cannot set symmetric hash enable per port on " -"port %u\n" , res->port_id); -return ; - } -printf ("Symmetric hash has been set to %s on port %u\n" , - res->enable, res->port_id); -} - -cmdline_parse_token_string_t cmd_set_sym_hash_ena_per_port_all = - TOKEN_STRING_INITIALIZER(struct cmd_set_sym_hash_ena_per_port_result, - set_sym_hash_ena_per_port,"set_sym_hash_ena_per_port" ); -cmdline_parse_token_num_t cmd_set_sym_hash_ena_per_port_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_set_sym_hash_ena_per_port_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_set_sym_hash_ena_per_port_enable = - TOKEN_STRING_INITIALIZER(struct cmd_set_sym_hash_ena_per_port_result, - enable,"enable#disable" ); - -cmdline_parse_inst_t cmd_set_sym_hash_ena_per_port = { - .f = cmd_set_sym_hash_per_port_parsed, - .data =NULL , - .help_str ="set_sym_hash_ena_per_port <port_id> enable|disable" , - .tokens = { - (void *)&cmd_set_sym_hash_ena_per_port_all, - (void *)&cmd_set_sym_hash_ena_per_port_port_id, - (void *)&cmd_set_sym_hash_ena_per_port_enable, -NULL , - }, -}; - -/* Get global config of hash function */ -struct cmd_get_hash_global_config_result { -cmdline_fixed_string_t get_hash_global_config; -portid_t port_id; -}; - -static char * -flowtype_to_str (uint16_t ftype) -{ -uint16_t i; -static struct { -char str[16 ]; -uint16_t ftype; - } ftype_table[] = { - {"ipv4" ,RTE_ETH_FLOW_IPV4 }, - {"ipv4-frag" ,RTE_ETH_FLOW_FRAG_IPV4 }, - {"ipv4-tcp" ,RTE_ETH_FLOW_NONFRAG_IPV4_TCP }, - {"ipv4-udp" ,RTE_ETH_FLOW_NONFRAG_IPV4_UDP }, - {"ipv4-sctp" ,RTE_ETH_FLOW_NONFRAG_IPV4_SCTP }, - {"ipv4-other" ,RTE_ETH_FLOW_NONFRAG_IPV4_OTHER }, - {"ipv6" ,RTE_ETH_FLOW_IPV6 }, - {"ipv6-frag" ,RTE_ETH_FLOW_FRAG_IPV6 }, - {"ipv6-tcp" ,RTE_ETH_FLOW_NONFRAG_IPV6_TCP }, - {"ipv6-udp" ,RTE_ETH_FLOW_NONFRAG_IPV6_UDP }, - {"ipv6-sctp" ,RTE_ETH_FLOW_NONFRAG_IPV6_SCTP }, - {"ipv6-other" ,RTE_ETH_FLOW_NONFRAG_IPV6_OTHER }, - {"l2_payload" ,RTE_ETH_FLOW_L2_PAYLOAD }, - {"port" ,RTE_ETH_FLOW_PORT }, - {"vxlan" ,RTE_ETH_FLOW_VXLAN }, - {"geneve" ,RTE_ETH_FLOW_GENEVE }, - {"nvgre" ,RTE_ETH_FLOW_NVGRE }, - {"vxlan-gpe" ,RTE_ETH_FLOW_VXLAN_GPE }, - }; - -for (i =0 ; i <RTE_DIM (ftype_table); i++) { -if (ftype_table[i].ftype == ftype) -return ftype_table[i].str; - } - -return NULL ; -} - -static void -cmd_get_hash_global_config_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_get_hash_global_config_result *res = parsed_result; -struct rte_eth_hash_filter_info info; -uint32_t idx, offset; -uint16_t i; -char *str; -int ret; - -if (rte_eth_dev_filter_supported (res->port_id, -RTE_ETH_FILTER_HASH ) <0 ) { -printf ("RTE_ETH_FILTER_HASH not supported on port %d\n" , - res->port_id); -return ; - } - -memset (&info,0 ,sizeof (info)); - info.info_type =RTE_ETH_HASH_FILTER_GLOBAL_CONFIG ; - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_HASH , -RTE_ETH_FILTER_GET , &info); -if (ret <0 ) { -printf ("Cannot get hash global configurations by port %d\n" , - res->port_id); -return ; - } - -switch (info.info.global_conf.hash_func) { -case RTE_ETH_HASH_FUNCTION_TOEPLITZ : -printf ("Hash function is Toeplitz\n" ); -break ; -case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR : -printf ("Hash function is Simple XOR\n" ); -break ; -case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ : -printf ("Hash function is Symmetric Toeplitz\n" ); -break ; -default : -printf ("Unknown hash function\n" ); -break ; - } - -for (i =0 ; i <RTE_ETH_FLOW_MAX ; i++) { - idx = i /UINT64_BIT ; - offset = i %UINT64_BIT ; -if (!(info.info.global_conf.valid_bit_mask[idx] & - (1ULL << offset))) -continue ; - str =flowtype_to_str (i); -if (!str) -continue ; -printf ("Symmetric hash is %s globally for flow type %s " -"by port %d\n" , - ((info.info.global_conf.sym_hash_enable_mask[idx] & - (1ULL << offset)) ?"enabled" :"disabled" ), str, - res->port_id); - } -} - -cmdline_parse_token_string_t cmd_get_hash_global_config_all = - TOKEN_STRING_INITIALIZER(struct cmd_get_hash_global_config_result, - get_hash_global_config,"get_hash_global_config" ); -cmdline_parse_token_num_t cmd_get_hash_global_config_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_get_hash_global_config_result, - port_id,UINT16 ); - -cmdline_parse_inst_t cmd_get_hash_global_config = { - .f = cmd_get_hash_global_config_parsed, - .data =NULL , - .help_str ="get_hash_global_config <port_id>" , - .tokens = { - (void *)&cmd_get_hash_global_config_all, - (void *)&cmd_get_hash_global_config_port_id, -NULL , - }, -}; - -/* Set global config of hash function */ -struct cmd_set_hash_global_config_result { -cmdline_fixed_string_t set_hash_global_config; -portid_t port_id; -cmdline_fixed_string_t hash_func; -cmdline_fixed_string_t flow_type; -cmdline_fixed_string_t enable; -}; - -static void -cmd_set_hash_global_config_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_set_hash_global_config_result *res = parsed_result; -struct rte_eth_hash_filter_info info; -uint32_t ftype, idx, offset; -int ret; - -if (rte_eth_dev_filter_supported (res->port_id, -RTE_ETH_FILTER_HASH ) <0 ) { -printf ("RTE_ETH_FILTER_HASH not supported on port %d\n" , - res->port_id); -return ; - } -memset (&info,0 ,sizeof (info)); - info.info_type =RTE_ETH_HASH_FILTER_GLOBAL_CONFIG ; -if (!strcmp (res->hash_func,"toeplitz" )) - info.info.global_conf.hash_func = -RTE_ETH_HASH_FUNCTION_TOEPLITZ ; -else if (!strcmp (res->hash_func,"simple_xor" )) - info.info.global_conf.hash_func = -RTE_ETH_HASH_FUNCTION_SIMPLE_XOR ; -else if (!strcmp (res->hash_func,"symmetric_toeplitz" )) - info.info.global_conf.hash_func = -RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ ; -else if (!strcmp (res->hash_func,"default" )) - info.info.global_conf.hash_func = -RTE_ETH_HASH_FUNCTION_DEFAULT ; - - ftype =str2flowtype (res->flow_type); - idx = ftype /UINT64_BIT ; - offset = ftype %UINT64_BIT ; - info.info.global_conf.valid_bit_mask[idx] |= (1ULL << offset); -if (!strcmp (res->enable,"enable" )) - info.info.global_conf.sym_hash_enable_mask[idx] |= - (1ULL << offset); - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_HASH , -RTE_ETH_FILTER_SET , &info); -if (ret <0 ) -printf ("Cannot set global hash configurations by port %d\n" , - res->port_id); -else -printf ("Global hash configurations have been set " -"successfully by port %d\n" , res->port_id); -} - -cmdline_parse_token_string_t cmd_set_hash_global_config_all = - TOKEN_STRING_INITIALIZER(struct cmd_set_hash_global_config_result, - set_hash_global_config,"set_hash_global_config" ); -cmdline_parse_token_num_t cmd_set_hash_global_config_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_set_hash_global_config_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_set_hash_global_config_hash_func = - TOKEN_STRING_INITIALIZER(struct cmd_set_hash_global_config_result, - hash_func,"toeplitz#simple_xor#symmetric_toeplitz#default" ); -cmdline_parse_token_string_t cmd_set_hash_global_config_flow_type = - TOKEN_STRING_INITIALIZER(struct cmd_set_hash_global_config_result, - flow_type, -"ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#ipv6#" -"ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#ipv6-other#l2_payload" ); -cmdline_parse_token_string_t cmd_set_hash_global_config_enable = - TOKEN_STRING_INITIALIZER(struct cmd_set_hash_global_config_result, - enable,"enable#disable" ); - -cmdline_parse_inst_t cmd_set_hash_global_config = { - .f = cmd_set_hash_global_config_parsed, - .data =NULL , - .help_str ="set_hash_global_config <port_id> " -"toeplitz|simple_xor|symmetric_toeplitz|default " -"ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|" -"ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|" -"l2_payload enable|disable" , - .tokens = { - (void *)&cmd_set_hash_global_config_all, - (void *)&cmd_set_hash_global_config_port_id, - (void *)&cmd_set_hash_global_config_hash_func, - (void *)&cmd_set_hash_global_config_flow_type, - (void *)&cmd_set_hash_global_config_enable, -NULL , - }, -}; - -/* Set hash input set */ -struct cmd_set_hash_input_set_result { -cmdline_fixed_string_t set_hash_input_set; -portid_t port_id; -cmdline_fixed_string_t flow_type; -cmdline_fixed_string_t inset_field; -cmdline_fixed_string_t select; -};static enum rte_eth_input_set_field str2inset (char *string)
@@ -11891,70 +11526,6 @@ str2inset(char *string)return RTE_ETH_INPUT_SET_UNKNOWN ; } -static void -cmd_set_hash_input_set_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_set_hash_input_set_result *res = parsed_result; -struct rte_eth_hash_filter_info info; - -memset (&info,0 ,sizeof (info)); - info.info_type =RTE_ETH_HASH_FILTER_INPUT_SET_SELECT ; - info.info.input_set_conf.flow_type =str2flowtype (res->flow_type); - info.info.input_set_conf.field[0 ] =str2inset (res->inset_field); - info.info.input_set_conf.inset_size =1 ; -if (!strcmp (res->select,"select" )) - info.info.input_set_conf.op =RTE_ETH_INPUT_SET_SELECT ; -else if (!strcmp (res->select,"add" )) - info.info.input_set_conf.op =RTE_ETH_INPUT_SET_ADD ; -rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_HASH , -RTE_ETH_FILTER_SET , &info); -} - -cmdline_parse_token_string_t cmd_set_hash_input_set_cmd = - TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result, - set_hash_input_set,"set_hash_input_set" ); -cmdline_parse_token_num_t cmd_set_hash_input_set_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_set_hash_input_set_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_set_hash_input_set_flow_type = - TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result, - flow_type,NULL ); -cmdline_parse_token_string_t cmd_set_hash_input_set_field = - TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result, - inset_field, -"ovlan#ivlan#src-ipv4#dst-ipv4#src-ipv6#dst-ipv6#" -"ipv4-tos#ipv4-proto#ipv6-tc#ipv6-next-header#udp-src-port#" -"udp-dst-port#tcp-src-port#tcp-dst-port#sctp-src-port#" -"sctp-dst-port#sctp-veri-tag#udp-key#gre-key#fld-1st#" -"fld-2nd#fld-3rd#fld-4th#fld-5th#fld-6th#fld-7th#" -"fld-8th#none" ); -cmdline_parse_token_string_t cmd_set_hash_input_set_select = - TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result, - select,"select#add" ); - -cmdline_parse_inst_t cmd_set_hash_input_set = { - .f = cmd_set_hash_input_set_parsed, - .data =NULL , - .help_str ="set_hash_input_set <port_id> " -"ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|" -"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload|<flowtype_id> " -"ovlan|ivlan|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|ipv4-tos|ipv4-proto|" -"ipv6-tc|ipv6-next-header|udp-src-port|udp-dst-port|tcp-src-port|" -"tcp-dst-port|sctp-src-port|sctp-dst-port|sctp-veri-tag|udp-key|" -"gre-key|fld-1st|fld-2nd|fld-3rd|fld-4th|fld-5th|fld-6th|" -"fld-7th|fld-8th|none select|add" , - .tokens = { - (void *)&cmd_set_hash_input_set_cmd, - (void *)&cmd_set_hash_input_set_port_id, - (void *)&cmd_set_hash_input_set_flow_type, - (void *)&cmd_set_hash_input_set_field, - (void *)&cmd_set_hash_input_set_select, -NULL , - }, -}; -/* Set flow director input set */ struct cmd_set_fdir_input_set_result {cmdline_fixed_string_t set_fdir_input_set;
@@ -19026,11 +18597,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_set_flow_director_tunnel_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_flex_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_flex_payload, - (cmdline_parse_inst_t *)&cmd_get_sym_hash_ena_per_port, - (cmdline_parse_inst_t *)&cmd_set_sym_hash_ena_per_port, - (cmdline_parse_inst_t *)&cmd_get_hash_global_config, - (cmdline_parse_inst_t *)&cmd_set_hash_global_config, - (cmdline_parse_inst_t *)&cmd_set_hash_input_set, (cmdline_parse_inst_t *)&cmd_set_fdir_input_set, (cmdline_parse_inst_t *)&cmd_flow, (cmdline_parse_inst_t *)&cmd_show_port_meter_cap,
doc/guides/rel_notes/deprecation.rst +2 -2
@@ -108,8 +108,8 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types FDIR, - HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in + as filter types FDIR + and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.
drivers/net/i40e/i40e_ethdev.c +0 -268
292 lines not on this page · raw message
drivers/net/qede/qede_filter.c +0 -1
@@ -1241,7 +1241,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops;return 0 ; -case RTE_ETH_FILTER_HASH :case RTE_ETH_FILTER_L2_TUNNEL :case RTE_ETH_FILTER_MAX :default :
drivers/net/sfc/sfc_ethdev.c +0 -3
@@ -1751,9 +1751,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,case RTE_ETH_FILTER_FDIR :sfc_err (sa,"Flow Director filters not supported" );break ; -case RTE_ETH_FILTER_HASH : -sfc_err (sa,"Hash filters not supported" ); -break ;case RTE_ETH_FILTER_GENERIC :if (filter_op !=RTE_ETH_FILTER_GET ) { rc =EINVAL ;
lib/librte_ethdev/rte_eth_ctrl.h +0 -57
63 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 10/14 ethdev: remove legacy L2_TUNNEL filter type support
In reply to Andrew RybchenkoRTE flow API should be used for filtering.
Preserve RTE_ETH_FILTER_L2_TUNNEL since it is used in drivers internally in RTE flow API support.
rte_eth_l2_tunnel_conf structure is used in other ethdev API functions.
--- app/test-pmd/cmdline.c | 123 --------------------------- doc/guides/rel_notes/deprecation.rst | 3 +- drivers/net/ixgbe/ixgbe_ethdev.c | 48 ----------- drivers/net/qede/qede_filter.c | 1 - 4 files changed, 1 insertion(+), 174 deletions(-)
app/test-pmd/cmdline.c +0 -123
@@ -664,13 +664,6 @@ static void cmd_help_long_parsed(void *parsed_result," Enable/disable E-tag based forwarding" " on a port\n\n" -"E-tag set filter add e-tag-id (value) dst-pool" -" (pool_id) port (port_id)\n" -" Add an E-tag forwarding filter on a port\n\n" - -"E-tag set filter del e-tag-id (value) port (port_id)\n" -" Delete an E-tag forwarding filter on a port\n\n" -"ddp add (port_id) (profile_path[,backup_profile_path])\n" " Load a profile package on a port\n\n"
@@ -12199,120 +12192,6 @@ cmdline_parse_inst_t cmd_config_e_tag_forwarding_en_dis = { }, }; -/* E-tag filter configuration */ -static void -cmd_config_e_tag_filter_add_parsed ( -void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_config_e_tag_result *res = parsed_result; -struct rte_eth_l2_tunnel_conf entry; -int ret =0 ; - -if (port_id_is_invalid (res->port_id,ENABLED_WARN )) -return ; - -if (res->e_tag_id_val >0x3fff ) { -printf ("e-tag-id must be equal or less than 0x3fff.\n" ); -return ; - } - - ret =rte_eth_dev_filter_supported (res->port_id, -RTE_ETH_FILTER_L2_TUNNEL ); -if (ret <0 ) { -printf ("E-tag filter is not supported on port %u.\n" , - res->port_id); -return ; - } - - entry.l2_tunnel_type =RTE_L2_TUNNEL_TYPE_E_TAG ; - entry.tunnel_id = res->e_tag_id_val; - entry.pool = res->dst_pool_val; - - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_L2_TUNNEL , -RTE_ETH_FILTER_ADD , - &entry); -if (ret <0 ) -printf ("E-tag filter programming error: (%s)\n" , -strerror (-ret)); -} - -cmdline_parse_inst_t cmd_config_e_tag_filter_add = { - .f = cmd_config_e_tag_filter_add_parsed, - .data =NULL , - .help_str ="E-tag ... : E-tag filter add" , - .tokens = { - (void *)&cmd_config_e_tag_e_tag, - (void *)&cmd_config_e_tag_set, - (void *)&cmd_config_e_tag_filter, - (void *)&cmd_config_e_tag_add, - (void *)&cmd_config_e_tag_e_tag_id, - (void *)&cmd_config_e_tag_e_tag_id_val, - (void *)&cmd_config_e_tag_dst_pool, - (void *)&cmd_config_e_tag_dst_pool_val, - (void *)&cmd_config_e_tag_port, - (void *)&cmd_config_e_tag_port_id, -NULL , - }, -}; - -static void -cmd_config_e_tag_filter_del_parsed ( -void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_config_e_tag_result *res = parsed_result; -struct rte_eth_l2_tunnel_conf entry; -int ret =0 ; - -if (port_id_is_invalid (res->port_id,ENABLED_WARN )) -return ; - -if (res->e_tag_id_val >0x3fff ) { -printf ("e-tag-id must be less than 0x3fff.\n" ); -return ; - } - - ret =rte_eth_dev_filter_supported (res->port_id, -RTE_ETH_FILTER_L2_TUNNEL ); -if (ret <0 ) { -printf ("E-tag filter is not supported on port %u.\n" , - res->port_id); -return ; - } - - entry.l2_tunnel_type =RTE_L2_TUNNEL_TYPE_E_TAG ; - entry.tunnel_id = res->e_tag_id_val; - - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_L2_TUNNEL , -RTE_ETH_FILTER_DELETE , - &entry); -if (ret <0 ) -printf ("E-tag filter programming error: (%s)\n" , -strerror (-ret)); -} - -cmdline_parse_inst_t cmd_config_e_tag_filter_del = { - .f = cmd_config_e_tag_filter_del_parsed, - .data =NULL , - .help_str ="E-tag ... : E-tag filter delete" , - .tokens = { - (void *)&cmd_config_e_tag_e_tag, - (void *)&cmd_config_e_tag_set, - (void *)&cmd_config_e_tag_filter, - (void *)&cmd_config_e_tag_del, - (void *)&cmd_config_e_tag_e_tag_id, - (void *)&cmd_config_e_tag_e_tag_id_val, - (void *)&cmd_config_e_tag_port, - (void *)&cmd_config_e_tag_port_id, -NULL , - }, -}; -/* vf vlan anti spoof configuration */ /* Common result structure for vf vlan anti spoof */
@@ -18621,8 +18500,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_config_e_tag_insertion_dis, (cmdline_parse_inst_t *)&cmd_config_e_tag_stripping_en_dis, (cmdline_parse_inst_t *)&cmd_config_e_tag_forwarding_en_dis, - (cmdline_parse_inst_t *)&cmd_config_e_tag_filter_add, - (cmdline_parse_inst_t *)&cmd_config_e_tag_filter_del, (cmdline_parse_inst_t *)&cmd_set_vf_vlan_anti_spoof, (cmdline_parse_inst_t *)&cmd_set_vf_mac_anti_spoof, (cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq,
doc/guides/rel_notes/deprecation.rst +1 -2
@@ -108,8 +108,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types FDIR - and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in + as filter types FDIR, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.
drivers/net/ixgbe/ixgbe_ethdev.c +0 -48
66 lines not on this page · raw message
drivers/net/qede/qede_filter.c +0 -1
@@ -1241,7 +1241,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops;return 0 ; -case RTE_ETH_FILTER_L2_TUNNEL :case RTE_ETH_FILTER_MAX :default : DP_ERR(edev, "Unsupported filter type %d\n",
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 10/14] ethdev: remove legacy L2_TUNNEL filter type support
Quoted 18 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 22:09
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>
Cc: [email protected]
Subject: [PATCH 10/14] ethdev: remove legacyL2_TUNNELfilter type supportRTE flow API should be used for filtering.
Preserve
RTE_ETH_FILTER_L2_TUNNELsince it is used in drivers internally in RTE flow API support.
rte_eth_l2_tunnel_confstructure is used in other ethdev API functions.
Quoted 7 lines
Signed-off-by Andrew Rybchenko <[email protected]>--- app/test-pmd/cmdline.c | 123 --------------------------- doc/guides/rel_notes/deprecation.rst | 3 +- drivers/net/ixgbe/ixgbe_ethdev.c | 48 ----------- drivers/net/qede/qede_filter.c | 1 - 4 files changed, 1 insertion(+), 174 deletions(-)
For ixgbe PMD,
Quoted 1 line
2.17.1
PATCH 11/14 ethdev: remove legacy global filter configuration support
In reply to Andrew Rybchenko--- app/test-pmd/cmdline.c | 57 ---------------------------------- drivers/net/i40e/i40e_ethdev.c | 45 --------------------------- drivers/net/sfc/sfc_ethdev.c | 3 -- 3 files changed, 105 deletions(-)
app/test-pmd/cmdline.c +0 -57
@@ -9295,62 +9295,6 @@ cmdline_parse_inst_t cmd_cfg_tunnel_udp_port = { }, }; -/* *** GLOBAL CONFIG *** */ -struct cmd_global_config_result { -cmdline_fixed_string_t cmd; -portid_t port_id; -cmdline_fixed_string_t cfg_type; -uint8_t len; -}; - -static void -cmd_global_config_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_global_config_result *res = parsed_result; -struct rte_eth_global_cfg conf; -int ret; - -memset (&conf,0 ,sizeof (conf)); - conf.cfg_type =RTE_ETH_GLOBAL_CFG_TYPE_GRE_KEY_LEN ; - conf.cfg.gre_key_len = res->len; - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_NONE , -RTE_ETH_FILTER_SET , &conf); -#ifdef RTE_LIBRTE_I40E_PMD -if (ret == -ENOTSUP ) - ret =rte_pmd_i40e_set_gre_key_len (res->port_id, res->len); -#endif -if (ret !=0 ) -printf ("Global config error\n" ); -} - -cmdline_parse_token_string_t cmd_global_config_cmd = - TOKEN_STRING_INITIALIZER(struct cmd_global_config_result, cmd, -"global_config" ); -cmdline_parse_token_num_t cmd_global_config_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_global_config_result, port_id, -UINT16 ); -cmdline_parse_token_string_t cmd_global_config_type = - TOKEN_STRING_INITIALIZER(struct cmd_global_config_result, - cfg_type,"gre-key-len" ); -cmdline_parse_token_num_t cmd_global_config_gre_key_len = - TOKEN_NUM_INITIALIZER(struct cmd_global_config_result, - len,UINT8 ); - -cmdline_parse_inst_t cmd_global_config = { - .f = cmd_global_config_parsed, - .data = (void *)NULL , - .help_str ="global_config <port_id> gre-key-len <key_len>" , - .tokens = { - (void *)&cmd_global_config_cmd, - (void *)&cmd_global_config_port_id, - (void *)&cmd_global_config_type, - (void *)&cmd_global_config_gre_key_len, -NULL , - }, -}; -/* *** CONFIGURE VM MIRROR VLAN/POOL RULE *** */ struct cmd_set_mirror_mask_result {cmdline_fixed_string_t set;
@@ -18454,7 +18398,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter, (cmdline_parse_inst_t *)&cmd_queue_rate_limit, (cmdline_parse_inst_t *)&cmd_tunnel_udp_config, - (cmdline_parse_inst_t *)&cmd_global_config, (cmdline_parse_inst_t *)&cmd_set_mirror_mask, (cmdline_parse_inst_t *)&cmd_set_mirror_link, (cmdline_parse_inst_t *)&cmd_reset_mirror_rule,
drivers/net/i40e/i40e_ethdev.c +0 -45
57 lines not on this page · raw message
drivers/net/sfc/sfc_ethdev.c +0 -3
@@ -1745,9 +1745,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,sfc_log_init (sa,"entry" );switch (filter_type) { -case RTE_ETH_FILTER_NONE : -sfc_err (sa,"Global filters configuration not supported" ); -break ;case RTE_ETH_FILTER_FDIR :sfc_err (sa,"Flow Director filters not supported" );break ;
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 11/14] ethdev: remove legacy global filter configuration support
Quoted 12 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Guo, Jia <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]
Subject: [PATCH 11/14] ethdev: remove legacy global filter configuration support
Please add the description of the patch.
Quoted 167 lines
Signed-off-by Andrew Rybchenko <[email protected]>--- app/test-pmd/cmdline.c | 57 ---------------------------------- drivers/net/i40e/i40e_ethdev.c | 45 --------------------------- drivers/net/sfc/sfc_ethdev.c | 3 -- 3 files changed, 105 deletions(-)app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0
-0
b031fb94b2..9abe8659f5100644app/test-pmd/cmdline.c +0
-56@@ -9295,62 +9295,6 @@ cmdline_parse_inst_t cmd_cfg_tunnel_udp_port = { }, }; -/* *** GLOBAL CONFIG *** */ -struct cmd_global_config_result { -cmdline_fixed_string_t cmd; -portid_t port_id; -cmdline_fixed_string_t cfg_type; -uint8_t len; -}; - -static void -cmd_global_config_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_global_config_result *res = parsed_result; -struct rte_eth_global_cfg conf; -int ret; - -memset (&conf,0 ,sizeof (conf)); - conf.cfg_type =RTE_ETH_GLOBAL_CFG_TYPE_GRE_KEY_LEN ; - conf.cfg.gre_key_len = res->len; - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_NONE , -RTE_ETH_FILTER_SET , &conf); -#ifdef RTE_LIBRTE_I40E_PMD -if (ret == -ENOTSUP ) - ret =rte_pmd_i40e_set_gre_key_len (res->port_id, res- >len); -#endif -if (ret !=0 ) -printf ("Global config error\n" ); -} - -cmdline_parse_token_string_t cmd_global_config_cmd = - TOKEN_STRING_INITIALIZER(struct cmd_global_config_result, cmd, -"global_config" ); -cmdline_parse_token_num_t cmd_global_config_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_global_config_result, port_id, -UINT16 ); -cmdline_parse_token_string_t cmd_global_config_type = - TOKEN_STRING_INITIALIZER(struct cmd_global_config_result, - cfg_type,"gre-key-len" ); -cmdline_parse_token_num_t cmd_global_config_gre_key_len = - TOKEN_NUM_INITIALIZER(struct cmd_global_config_result, - len,UINT8 ); - -cmdline_parse_inst_t cmd_global_config = { - .f = cmd_global_config_parsed, - .data = (void *)NULL , - .help_str ="global_config <port_id> gre-key-len <key_len>" , - .tokens = { - (void *)&cmd_global_config_cmd, - (void *)&cmd_global_config_port_id, - (void *)&cmd_global_config_type, - (void *)&cmd_global_config_gre_key_len, -NULL , - }, -}; - /* *** CONFIGURE VM MIRROR VLAN/POOL RULE *** */ struct
cmd_set_mirror_mask_result{app/test-pmd/cmdline.c +0
-1cmdline_fixed_string_t set;@@ -18454,7 +18398,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter, (cmdline_parse_inst_t *)&cmd_queue_rate_limit, (cmdline_parse_inst_t *)&cmd_tunnel_udp_config, - (cmdline_parse_inst_t *)&cmd_global_config, (cmdline_parse_inst_t *)&cmd_set_mirror_mask, (cmdline_parse_inst_t *)&cmd_set_mirror_link, (cmdline_parse_inst_t *)&cmd_reset_mirror_rule, diff --git
a/drivers/net/i40e/i40e_ethdev.cb/drivers/net/i40e/i40e_ethdev.cindexcd57126aa5..9d6d482aba100644drivers/net/i40e/i40e_ethdev.c +0
-25@@ -8909,47 +8909,6 @@ i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len)return ret; } -static int -i40e_dev_global_config_set (struct i40e_hw *hw,struct rte_eth_global_cfg *cfg) -{ -int ret = -EINVAL ; - -if (!hw || !cfg) -return -EINVAL ; - -switch (cfg->cfg_type) { -case RTE_ETH_GLOBAL_CFG_TYPE_GRE_KEY_LEN : - ret =i40e_dev_set_gre_key_len (hw, cfg->cfg.gre_key_len); -break ; -default : -PMD_DRV_LOG (ERR ,"Unknown config type %u" , cfg- >cfg_type); -break ; - } - -return ret; -} - -static int -i40e_filter_ctrl_global_config (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg) -{ - struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data-Quoted 1 line
dev_private);drivers/net/i40e/i40e_ethdev.c +0
-15-int ret =I40E_ERR_PARAM ; - -switch (filter_op) { -case RTE_ETH_FILTER_SET : - ret =i40e_dev_global_config_set (hw, - (struct rte_eth_global_cfg *)arg); -break ; -default : -PMD_DRV_LOG (ERR ,"unknown operation %u" , filter_op); -break ; - } - -return ret; -} - /* Set the symmetric hash enable configurations per port */ static void
i40e_set_symmetric_hash_enable_per_port(struct i40e_hw *hw, uint8_t enable)@@ -9986,10 +9945,6 @@ i40e_dev_filter_ctrl(structrte_eth_dev*dev,drivers/net/i40e/i40e_ethdev.c +0
-4return -EINVAL ;switch (filter_type) { -case RTE_ETH_FILTER_NONE : -/* For global configuration */ - ret =i40e_filter_ctrl_global_config (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_FDIR : ret =i40e_fdir_ctrl_func (dev, filter_op, arg);break ;drivers/net/sfc/sfc_ethdev.c +0
-3@@ -1745,9 +1745,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enumrte_filter_type filter_type, sfc_log_init(sa, "entry");switch (filter_type) { -case RTE_ETH_FILTER_NONE : -sfc_err (sa,"Global filters configuration not supported" ); -break ;case RTE_ETH_FILTER_FDIR :sfc_err (sa,"Flow Director filters not supported" );break;
--
2.17.1
PATCH 12/14 ethdev: remove legacy FDIR filter type support
In reply to Andrew RybchenkoRTE flow API should be used for filtering.
--- app/test-pmd/cmdline.c | 897 +++------------------------ app/test-pmd/config.c | 15 +- app/test-pmd/testpmd.h | 2 + doc/guides/rel_notes/deprecation.rst | 4 +- drivers/net/bnxt/bnxt_ethdev.c | 396 ------------ drivers/net/enic/enic.h | 7 - drivers/net/enic/enic_clsf.c | 168 ----- drivers/net/enic/enic_ethdev.c | 48 -- drivers/net/i40e/i40e_ethdev.c | 86 --- drivers/net/i40e/i40e_ethdev.h | 11 +- drivers/net/i40e/i40e_fdir.c | 539 ---------------- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 - drivers/net/ixgbe/ixgbe_fdir.c | 220 ------- drivers/net/mlx5/mlx5.h | 1 - drivers/net/mlx5/mlx5_flow.c | 516 --------------- drivers/net/mlx5/mlx5_flow.h | 8 - drivers/net/qede/qede_ethdev.h | 5 - drivers/net/qede/qede_filter.c | 171 ----- drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 27 +- 21 files changed, 81 insertions(+), 3050 deletions(-)
app/test-pmd/cmdline.c +69 -828
@@ -959,62 +959,12 @@ static void cmd_help_long_parsed(void *parsed_result, "filters:\n" "--------\n\n" -"flow_director_filter (port_id) mode IP (add|del|update)" -" flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)" -" src (src_ip_address) dst (dst_ip_address)" -" tos (tos_value) proto (proto_value) ttl (ttl_value)" -" vlan (vlan_value) flexbytes (flexbytes_value)" -" (drop|fwd) pf|vf(vf_id) queue (queue_id)" -" fd_id (fd_id_value)\n" -" Add/Del an IP type flow director filter.\n\n" - -"flow_director_filter (port_id) mode IP (add|del|update)" -" flow (ipv4-tcp|ipv4-udp|ipv6-tcp|ipv6-udp)" -" src (src_ip_address) (src_port)" -" dst (dst_ip_address) (dst_port)" -" tos (tos_value) ttl (ttl_value)" -" vlan (vlan_value) flexbytes (flexbytes_value)" -" (drop|fwd) pf|vf(vf_id) queue (queue_id)" -" fd_id (fd_id_value)\n" -" Add/Del an UDP/TCP type flow director filter.\n\n" - -"flow_director_filter (port_id) mode IP (add|del|update)" -" flow (ipv4-sctp|ipv6-sctp)" -" src (src_ip_address) (src_port)" -" dst (dst_ip_address) (dst_port)" -" tag (verification_tag) " -" tos (tos_value) ttl (ttl_value)" -" vlan (vlan_value)" -" flexbytes (flexbytes_value) (drop|fwd)" -" pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n" -" Add/Del a SCTP type flow director filter.\n\n" - -"flow_director_filter (port_id) mode IP (add|del|update)" -" flow l2_payload ether (ethertype)" -" flexbytes (flexbytes_value) (drop|fwd)" -" pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n" -" Add/Del a l2 payload type flow director filter.\n\n" - -"flow_director_filter (port_id) mode MAC-VLAN (add|del|update)" -" mac (mac_address) vlan (vlan_value)" -" flexbytes (flexbytes_value) (drop|fwd)" -" queue (queue_id) fd_id (fd_id_value)\n" -" Add/Del a MAC-VLAN flow director filter.\n\n" - -"flow_director_filter (port_id) mode Tunnel (add|del|update)" -" mac (mac_address) vlan (vlan_value)" -" tunnel (NVGRE|VxLAN) tunnel-id (tunnel_id_value)" -" flexbytes (flexbytes_value) (drop|fwd)" -" queue (queue_id) fd_id (fd_id_value)\n" -" Add/Del a Tunnel flow director filter.\n\n" - +#ifdef RTE_LIBRTE_I40E_PMD "flow_director_filter (port_id) mode raw (add|del|update)" " flow (flow_id) (drop|fwd) queue (queue_id)" " fd_id (fd_id_value) packet (packet file name)\n" " Add/Del a raw type flow director filter.\n\n" - -"flush_flow_director (port_id)\n" -" Flush all flow director entries of a device.\n\n" +#endif"flow_director_mask (port_id) mode IP vlan (vlan_value)" " src_mask (ipv4_src) (ipv6_src) (src_port)"
@@ -1041,17 +991,6 @@ static void cmd_help_long_parsed(void *parsed_result," (raw|l2|l3|l4) (config)\n" " Configure flex payload selection.\n\n" -"set_fdir_input_set (port_id) " -"(ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|" -"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|" -"l2_payload) (ivlan|ethertype|src-ipv4|dst-ipv4|src-ipv6|" -"dst-ipv6|ipv4-tos|ipv4-proto|ipv4-ttl|ipv6-tc|" -"ipv6-next-header|ipv6-hop-limits|udp-src-port|" -"udp-dst-port|tcp-src-port|tcp-dst-port|" -"sctp-src-port|sctp-dst-port|sctp-veri-tag|none)" -" (select|add)\n" -" Set the input set for FDir.\n\n" -"flow validate {port_id}" " [group {group_id}] [priority {level}]" " [ingress] [egress]"
@@ -7628,9 +7567,11 @@ static void cmd_showportall_parsed(void *parsed_result,else if (!strcmp (res->what,"xstats" )) RTE_ETH_FOREACH_DEV(i)nic_xstats_display (i); +#if defined(RTE_LIBRTE_I40E_PMD ) || defined(RTE_LIBRTE_IXGBE_PMD ) else if (!strcmp(res->what, "fdir"))RTE_ETH_FOREACH_DEV (i)fdir_get_infos (i); +#endif else if (!strcmp(res->what, "stat_qmap"))RTE_ETH_FOREACH_DEV (i)nic_stats_mapping_display (i);
@@ -7694,8 +7635,10 @@ static void cmd_showport_parsed(void *parsed_result,nic_stats_display (res->portnum); else if (!strcmp(res->what, "xstats"))nic_xstats_display (res->portnum); +#if defined(RTE_LIBRTE_I40E_PMD ) || defined(RTE_LIBRTE_IXGBE_PMD ) else if (!strcmp(res->what, "fdir"))fdir_get_infos (res->portnum); +#endif else if (!strcmp(res->what, "stat_qmap"))nic_stats_mapping_display (res->portnum); else if (!strcmp(res->what, "dcb_tc"))
@@ -10157,51 +10100,6 @@ cmdline_parse_inst_t cmd_show_queue_region_info_all = {/* *** Filters Control *** */ -/* *** deal with flow director filter *** */ -struct cmd_flow_director_result { -cmdline_fixed_string_t flow_director_filter; -portid_t port_id; -cmdline_fixed_string_t mode; -cmdline_fixed_string_t mode_value; -cmdline_fixed_string_t ops; -cmdline_fixed_string_t flow; -cmdline_fixed_string_t flow_type; -cmdline_fixed_string_t ether; -uint16_t ether_type; -cmdline_fixed_string_t src; -cmdline_ipaddr_t ip_src; -uint16_t port_src; -cmdline_fixed_string_t dst; -cmdline_ipaddr_t ip_dst; -uint16_t port_dst; -cmdline_fixed_string_t verify_tag; -uint32_t verify_tag_value; -cmdline_fixed_string_t tos; -uint8_t tos_value; -cmdline_fixed_string_t proto; -uint8_t proto_value; -cmdline_fixed_string_t ttl; -uint8_t ttl_value; -cmdline_fixed_string_t vlan; -uint16_t vlan_value; -cmdline_fixed_string_t flexbytes; -cmdline_fixed_string_t flexbytes_value; -cmdline_fixed_string_t pf_vf; -cmdline_fixed_string_t drop; -cmdline_fixed_string_t queue; -uint16_t queue_id; -cmdline_fixed_string_t fd_id; -uint32_t fd_id_value; -cmdline_fixed_string_t mac; -struct rte_ether_addr mac_addr; -cmdline_fixed_string_t tunnel; -cmdline_fixed_string_t tunnel_type; -cmdline_fixed_string_t tunnel_id; -uint32_t tunnel_id_value; -cmdline_fixed_string_t packet; -char filepath[]; -}; -static inline int parse_flexbytes (const char *q_arg,uint8_t *flexbytes,uint16_t max_num) {
@@ -10275,26 +10173,6 @@ str2flowtype(char *string)return RTE_ETH_FLOW_UNKNOWN ; } -static enum rte_eth_fdir_tunnel_type -str2fdir_tunneltype (char *string) -{ -uint8_t i =0 ; - -static const struct { -char str[32 ]; -enum rte_eth_fdir_tunnel_type type; - } tunneltype_str[] = { - {"NVGRE" ,RTE_FDIR_TUNNEL_TYPE_NVGRE }, - {"VxLAN" ,RTE_FDIR_TUNNEL_TYPE_VXLAN }, - }; - -for (i =0 ; i <RTE_DIM (tunneltype_str); i++) { -if (!strcmp (tunneltype_str[i].str, string)) -return tunneltype_str[i].type; - } -return RTE_FDIR_TUNNEL_TYPE_UNKNOWN ; -} -#define IPV4_ADDR_TO_UINT (ip_addr, ip) \ do { \ if ((ip_addr).family == AF_INET) \
@@ -10317,252 +10195,83 @@ do { \ } \ } while (0) +#ifdef RTE_LIBRTE_I40E_PMD + +/* *** deal with flow director filter *** */ +struct cmd_flow_director_result { +cmdline_fixed_string_t flow_director_filter; +portid_t port_id; +cmdline_fixed_string_t mode; +cmdline_fixed_string_t mode_value; +cmdline_fixed_string_t ops; +cmdline_fixed_string_t flow; +cmdline_fixed_string_t flow_type; +cmdline_fixed_string_t drop; +cmdline_fixed_string_t queue; +uint16_t queue_id; +cmdline_fixed_string_t fd_id; +uint32_t fd_id_value; +cmdline_fixed_string_t packet; +char filepath[]; +}; +static void cmd_flow_director_filter_parsed (void *parsed_result, __rte_unused struct cmdline *cl, __rte_unused void *data) {struct cmd_flow_director_result *res = parsed_result; -struct rte_eth_fdir_filter entry; -uint8_t flexbytes[RTE_ETH_FDIR_MAX_FLEXLEN ]; -char *end; -unsigned long vf_id;int ret =0 ; +struct rte_pmd_i40e_flow_type_mapping + mapping[RTE_PMD_I40E_FLOW_TYPE_MAX ]; +struct rte_pmd_i40e_pkt_template_conf conf; +uint16_t flow_type =str2flowtype (res->flow_type); +uint16_t i, port = res->port_id; +uint8_t add; - ret =rte_eth_dev_filter_supported (res->port_id,RTE_ETH_FILTER_FDIR ); -if (ret <0 ) { -printf ("flow director is not supported on port %u.\n" , - res->port_id); -return ; - } -memset (flexbytes,0 ,sizeof (flexbytes)); -memset (&entry,0 ,sizeof (struct rte_eth_fdir_filter )); - -if (fdir_conf.mode ==RTE_FDIR_MODE_PERFECT_MAC_VLAN ) { -if (strcmp (res->mode_value,"MAC-VLAN" )) { -printf ("Please set mode to MAC-VLAN.\n" ); -return ; - } - }else if (fdir_conf.mode ==RTE_FDIR_MODE_PERFECT_TUNNEL ) { -if (strcmp (res->mode_value,"Tunnel" )) { -printf ("Please set mode to Tunnel.\n" ); -return ; - } - }else { -if (!strcmp (res->mode_value,"raw" )) { -#ifdef RTE_LIBRTE_I40E_PMD -struct rte_pmd_i40e_flow_type_mapping - mapping[RTE_PMD_I40E_FLOW_TYPE_MAX ]; -struct rte_pmd_i40e_pkt_template_conf conf; -uint16_t flow_type =str2flowtype (res->flow_type); -uint16_t i, port = res->port_id; -uint8_t add; - -memset (&conf,0 ,sizeof (conf)); +memset (&conf,0 ,sizeof (conf)); -if (flow_type ==RTE_ETH_FLOW_UNKNOWN ) { -printf ("Invalid flow type specified.\n" ); -return ; - } - ret =rte_pmd_i40e_flow_type_mapping_get (res->port_id, - mapping); -if (ret) -return ; -if (mapping[flow_type].pctype ==0ULL ) { -printf ("Invalid flow type specified.\n" ); -return ; - } -for (i =0 ; i <RTE_PMD_I40E_PCTYPE_MAX ; i++) { -if (mapping[flow_type].pctype & (1ULL << i)) { - conf.input.pctype = i; -break ; - } - } - - conf.input.packet =open_file (res->filepath, - &conf.input.length); -if (!conf.input.packet) -return ; -if (!strcmp (res->drop,"drop" )) - conf.action.behavior = -RTE_PMD_I40E_PKT_TEMPLATE_REJECT ; -else - conf.action.behavior = -RTE_PMD_I40E_PKT_TEMPLATE_ACCEPT ; - conf.action.report_status = -RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID ; - conf.action.rx_queue = res->queue_id; - conf.soft_id = res->fd_id_value; - add =strcmp (res->ops,"del" ) ?1 :0 ; - ret =rte_pmd_i40e_flow_add_del_packet_template (port, - &conf, - add); -if (ret <0 ) -printf ("flow director config error: (%s)\n" , -strerror (-ret)); -close_file (conf.input.packet); -#endif -return ; - }else if (strcmp (res->mode_value,"IP" )) { -printf ("Please set mode to IP or raw.\n" ); -return ; - } - entry.input.flow_type =str2flowtype (res->flow_type); - } - - ret =parse_flexbytes (res->flexbytes_value, - flexbytes, -RTE_ETH_FDIR_MAX_FLEXLEN ); -if (ret <0 ) { -printf ("error: Cannot parse flexbytes input.\n" ); +if (flow_type ==RTE_ETH_FLOW_UNKNOWN ) { +printf ("Invalid flow type specified.\n" );return ; } - -switch (entry.input.flow_type) { -case RTE_ETH_FLOW_FRAG_IPV4 : -case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER : - entry.input.flow.ip4_flow.proto = res->proto_value; -/* fall-through */ -case RTE_ETH_FLOW_NONFRAG_IPV4_UDP : -case RTE_ETH_FLOW_NONFRAG_IPV4_TCP : -IPV4_ADDR_TO_UINT (res->ip_dst, - entry.input.flow.ip4_flow.dst_ip); -IPV4_ADDR_TO_UINT (res->ip_src, - entry.input.flow.ip4_flow.src_ip); - entry.input.flow.ip4_flow.tos = res->tos_value; - entry.input.flow.ip4_flow.ttl = res->ttl_value; -/* need convert to big endian. */ - entry.input.flow.udp4_flow.dst_port = -rte_cpu_to_be_16 (res->port_dst); - entry.input.flow.udp4_flow.src_port = -rte_cpu_to_be_16 (res->port_src); -break ; -case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP : -IPV4_ADDR_TO_UINT (res->ip_dst, - entry.input.flow.sctp4_flow.ip.dst_ip); -IPV4_ADDR_TO_UINT (res->ip_src, - entry.input.flow.sctp4_flow.ip.src_ip); - entry.input.flow.ip4_flow.tos = res->tos_value; - entry.input.flow.ip4_flow.ttl = res->ttl_value; -/* need convert to big endian. */ - entry.input.flow.sctp4_flow.dst_port = -rte_cpu_to_be_16 (res->port_dst); - entry.input.flow.sctp4_flow.src_port = -rte_cpu_to_be_16 (res->port_src); - entry.input.flow.sctp4_flow.verify_tag = -rte_cpu_to_be_32 (res->verify_tag_value); -break ; -case RTE_ETH_FLOW_FRAG_IPV6 : -case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER : - entry.input.flow.ipv6_flow.proto = res->proto_value; -/* fall-through */ -case RTE_ETH_FLOW_NONFRAG_IPV6_UDP : -case RTE_ETH_FLOW_NONFRAG_IPV6_TCP : -IPV6_ADDR_TO_ARRAY (res->ip_dst, - entry.input.flow.ipv6_flow.dst_ip); -IPV6_ADDR_TO_ARRAY (res->ip_src, - entry.input.flow.ipv6_flow.src_ip); - entry.input.flow.ipv6_flow.tc = res->tos_value; - entry.input.flow.ipv6_flow.hop_limits = res->ttl_value; -/* need convert to big endian. */ - entry.input.flow.udp6_flow.dst_port = -rte_cpu_to_be_16 (res->port_dst); - entry.input.flow.udp6_flow.src_port = -rte_cpu_to_be_16 (res->port_src); -break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP : -IPV6_ADDR_TO_ARRAY (res->ip_dst, - entry.input.flow.sctp6_flow.ip.dst_ip); -IPV6_ADDR_TO_ARRAY (res->ip_src, - entry.input.flow.sctp6_flow.ip.src_ip); - entry.input.flow.ipv6_flow.tc = res->tos_value; - entry.input.flow.ipv6_flow.hop_limits = res->ttl_value; -/* need convert to big endian. */ - entry.input.flow.sctp6_flow.dst_port = -rte_cpu_to_be_16 (res->port_dst); - entry.input.flow.sctp6_flow.src_port = -rte_cpu_to_be_16 (res->port_src); - entry.input.flow.sctp6_flow.verify_tag = -rte_cpu_to_be_32 (res->verify_tag_value); -break ; -case RTE_ETH_FLOW_L2_PAYLOAD : - entry.input.flow.l2_flow.ether_type = -rte_cpu_to_be_16 (res->ether_type); -break ; -default : -break ; - } - -if (fdir_conf.mode ==RTE_FDIR_MODE_PERFECT_MAC_VLAN ) -rte_memcpy (&entry.input.flow.mac_vlan_flow.mac_addr, - &res->mac_addr, -sizeof (struct rte_ether_addr )); - -if (fdir_conf.mode ==RTE_FDIR_MODE_PERFECT_TUNNEL ) { -rte_memcpy (&entry.input.flow.tunnel_flow.mac_addr, - &res->mac_addr, -sizeof (struct rte_ether_addr )); - entry.input.flow.tunnel_flow.tunnel_type = -str2fdir_tunneltype (res->tunnel_type); - entry.input.flow.tunnel_flow.tunnel_id = -rte_cpu_to_be_32 (res->tunnel_id_value); + ret =rte_pmd_i40e_flow_type_mapping_get (res->port_id, + mapping); +if (ret) +return ; +if (mapping[flow_type].pctype ==0ULL ) { +printf ("Invalid flow type specified.\n" ); +return ; } - -rte_memcpy (entry.input.flow_ext.flexbytes, - flexbytes, -RTE_ETH_FDIR_MAX_FLEXLEN ); - - entry.input.flow_ext.vlan_tci =rte_cpu_to_be_16 (res->vlan_value); - - entry.action.flex_off =0 ;/*use 0 by default */ -if (!strcmp (res->drop,"drop" )) - entry.action.behavior =RTE_ETH_FDIR_REJECT ; -else - entry.action.behavior =RTE_ETH_FDIR_ACCEPT ; - -if (fdir_conf.mode !=RTE_FDIR_MODE_PERFECT_MAC_VLAN && - fdir_conf.mode !=RTE_FDIR_MODE_PERFECT_TUNNEL ) { -if (!strcmp (res->pf_vf,"pf" )) - entry.input.flow_ext.is_vf =0 ; -else if (!strncmp (res->pf_vf,"vf" ,2 )) { -struct rte_eth_dev_info dev_info; - - ret =eth_dev_info_get_print_err (res->port_id, - &dev_info); -if (ret !=0 ) -return ; - - errno =0 ; - vf_id =strtoul (res->pf_vf +2 , &end,10 ); -if (errno !=0 || *end !='\0' || - vf_id >= dev_info.max_vfs) { -printf ("invalid parameter %s.\n" , res->pf_vf); -return ; - } - entry.input.flow_ext.is_vf =1 ; - entry.input.flow_ext.dst_id = (uint16_t )vf_id; - }else { -printf ("invalid parameter %s.\n" , res->pf_vf); -return ; +for (i =0 ; i <RTE_PMD_I40E_PCTYPE_MAX ; i++) { +if (mapping[flow_type].pctype & (1ULL << i)) { + conf.input.pctype = i; +break ; } } -/* set to report FD ID by default */ - entry.action.report_status =RTE_ETH_FDIR_REPORT_ID ; - entry.action.rx_queue = res->queue_id; - entry.soft_id = res->fd_id_value; -if (!strcmp (res->ops,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_ADD , &entry); -else if (!strcmp (res->ops,"del" )) - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_DELETE , &entry); + conf.input.packet =open_file (res->filepath, + &conf.input.length); +if (!conf.input.packet) +return ; +if (!strcmp (res->drop,"drop" )) + conf.action.behavior = +RTE_PMD_I40E_PKT_TEMPLATE_REJECT ;else - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_UPDATE , &entry); + conf.action.behavior = +RTE_PMD_I40E_PKT_TEMPLATE_ACCEPT ; + conf.action.report_status = +RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID ; + conf.action.rx_queue = res->queue_id; + conf.soft_id = res->fd_id_value; + add =strcmp (res->ops,"del" ) ?1 :0 ; + ret =rte_pmd_i40e_flow_add_del_packet_template (port, + &conf, + add);if (ret <0 ) -printf ("flow director programming error: (%s)\n" , -strerror (-ret)); +printf ("flow director config error: (%s)\n" , +strerror (-ret)); +close_file (conf.input.packet); } cmdline_parse_token_string_t cmd_flow_director_filter =
@@ -10580,72 +10289,9 @@ cmdline_parse_token_string_t cmd_flow_director_flow =cmdline_parse_token_string_t cmd_flow_director_flow_type = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, flow_type,NULL ); -cmdline_parse_token_string_t cmd_flow_director_ether = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - ether,"ether" ); -cmdline_parse_token_num_t cmd_flow_director_ether_type = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - ether_type,UINT16 ); -cmdline_parse_token_string_t cmd_flow_director_src = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - src,"src" ); -cmdline_parse_token_ipaddr_t cmd_flow_director_ip_src = - TOKEN_IPADDR_INITIALIZER(struct cmd_flow_director_result, - ip_src); -cmdline_parse_token_num_t cmd_flow_director_port_src = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - port_src,UINT16 ); -cmdline_parse_token_string_t cmd_flow_director_dst = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - dst,"dst" ); -cmdline_parse_token_ipaddr_t cmd_flow_director_ip_dst = - TOKEN_IPADDR_INITIALIZER(struct cmd_flow_director_result, - ip_dst); -cmdline_parse_token_num_t cmd_flow_director_port_dst = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - port_dst,UINT16 ); -cmdline_parse_token_string_t cmd_flow_director_verify_tag = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - verify_tag,"verify_tag" ); -cmdline_parse_token_num_t cmd_flow_director_verify_tag_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - verify_tag_value,UINT32 ); -cmdline_parse_token_string_t cmd_flow_director_tos = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - tos,"tos" ); -cmdline_parse_token_num_t cmd_flow_director_tos_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - tos_value,UINT8 ); -cmdline_parse_token_string_t cmd_flow_director_proto = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - proto,"proto" ); -cmdline_parse_token_num_t cmd_flow_director_proto_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - proto_value,UINT8 ); -cmdline_parse_token_string_t cmd_flow_director_ttl = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - ttl,"ttl" ); -cmdline_parse_token_num_t cmd_flow_director_ttl_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - ttl_value,UINT8 ); -cmdline_parse_token_string_t cmd_flow_director_vlan = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - vlan,"vlan" ); -cmdline_parse_token_num_t cmd_flow_director_vlan_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - vlan_value,UINT16 ); -cmdline_parse_token_string_t cmd_flow_director_flexbytes = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - flexbytes,"flexbytes" ); -cmdline_parse_token_string_t cmd_flow_director_flexbytes_value = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - flexbytes_value,NULL );cmdline_parse_token_string_t cmd_flow_director_drop = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, drop,"drop#fwd" ); -cmdline_parse_token_string_t cmd_flow_director_pf_vf = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - pf_vf,NULL );cmdline_parse_token_string_t cmd_flow_director_queue = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, queue,"queue" );
@@ -10662,36 +10308,9 @@ cmdline_parse_token_num_t cmd_flow_director_fd_id_value =cmdline_parse_token_string_t cmd_flow_director_mode = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, mode,"mode" ); -cmdline_parse_token_string_t cmd_flow_director_mode_ip = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - mode_value,"IP" ); -cmdline_parse_token_string_t cmd_flow_director_mode_mac_vlan = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - mode_value,"MAC-VLAN" ); -cmdline_parse_token_string_t cmd_flow_director_mode_tunnel = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - mode_value,"Tunnel" );cmdline_parse_token_string_t cmd_flow_director_mode_raw = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, mode_value,"raw" ); -cmdline_parse_token_string_t cmd_flow_director_mac = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - mac,"mac" ); -cmdline_parse_token_etheraddr_t cmd_flow_director_mac_addr = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_flow_director_result, - mac_addr); -cmdline_parse_token_string_t cmd_flow_director_tunnel = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - tunnel,"tunnel" ); -cmdline_parse_token_string_t cmd_flow_director_tunnel_type = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - tunnel_type,"NVGRE#VxLAN" ); -cmdline_parse_token_string_t cmd_flow_director_tunnel_id = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - tunnel_id,"tunnel-id" ); -cmdline_parse_token_num_t cmd_flow_director_tunnel_id_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - tunnel_id_value,UINT32 );cmdline_parse_token_string_t cmd_flow_director_packet = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, packet,"packet" );
@@ -10699,208 +10318,6 @@ cmdline_parse_token_string_t cmd_flow_director_filepath = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, filepath, NULL); -cmdline_parse_inst_t cmd_add_del_ip_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data =NULL , - .help_str ="flow_director_filter <port_id> mode IP add|del|update flow" -" ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|" -"ipv6-other|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|" -"l2_payload src <src_ip> dst <dst_ip> tos <tos_value> " -"proto <proto_value> ttl <ttl_value> vlan <vlan_value> " -"flexbytes <flexbyte_values> drop|fw <pf_vf> queue <queue_id> " -"fd_id <fd_id_value>: " -"Add or delete an ip flow director entry on NIC" , - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_ip, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_flow, - (void *)&cmd_flow_director_flow_type, - (void *)&cmd_flow_director_src, - (void *)&cmd_flow_director_ip_src, - (void *)&cmd_flow_director_dst, - (void *)&cmd_flow_director_ip_dst, - (void *)&cmd_flow_director_tos, - (void *)&cmd_flow_director_tos_value, - (void *)&cmd_flow_director_proto, - (void *)&cmd_flow_director_proto_value, - (void *)&cmd_flow_director_ttl, - (void *)&cmd_flow_director_ttl_value, - (void *)&cmd_flow_director_vlan, - (void *)&cmd_flow_director_vlan_value, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_pf_vf, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, -NULL , - }, -}; - -cmdline_parse_inst_t cmd_add_del_udp_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data =NULL , - .help_str ="flow_director_filter ... : Add or delete an udp/tcp flow " -"director entry on NIC" , - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_ip, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_flow, - (void *)&cmd_flow_director_flow_type, - (void *)&cmd_flow_director_src, - (void *)&cmd_flow_director_ip_src, - (void *)&cmd_flow_director_port_src, - (void *)&cmd_flow_director_dst, - (void *)&cmd_flow_director_ip_dst, - (void *)&cmd_flow_director_port_dst, - (void *)&cmd_flow_director_tos, - (void *)&cmd_flow_director_tos_value, - (void *)&cmd_flow_director_ttl, - (void *)&cmd_flow_director_ttl_value, - (void *)&cmd_flow_director_vlan, - (void *)&cmd_flow_director_vlan_value, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_pf_vf, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, -NULL , - }, -}; - -cmdline_parse_inst_t cmd_add_del_sctp_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data =NULL , - .help_str ="flow_director_filter ... : Add or delete a sctp flow " -"director entry on NIC" , - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_ip, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_flow, - (void *)&cmd_flow_director_flow_type, - (void *)&cmd_flow_director_src, - (void *)&cmd_flow_director_ip_src, - (void *)&cmd_flow_director_port_src, - (void *)&cmd_flow_director_dst, - (void *)&cmd_flow_director_ip_dst, - (void *)&cmd_flow_director_port_dst, - (void *)&cmd_flow_director_verify_tag, - (void *)&cmd_flow_director_verify_tag_value, - (void *)&cmd_flow_director_tos, - (void *)&cmd_flow_director_tos_value, - (void *)&cmd_flow_director_ttl, - (void *)&cmd_flow_director_ttl_value, - (void *)&cmd_flow_director_vlan, - (void *)&cmd_flow_director_vlan_value, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_pf_vf, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, -NULL , - }, -}; - -cmdline_parse_inst_t cmd_add_del_l2_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data =NULL , - .help_str ="flow_director_filter ... : Add or delete a L2 flow " -"director entry on NIC" , - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_ip, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_flow, - (void *)&cmd_flow_director_flow_type, - (void *)&cmd_flow_director_ether, - (void *)&cmd_flow_director_ether_type, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_pf_vf, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, -NULL , - }, -}; - -cmdline_parse_inst_t cmd_add_del_mac_vlan_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data =NULL , - .help_str ="flow_director_filter ... : Add or delete a MAC VLAN flow " -"director entry on NIC" , - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_mac_vlan, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_mac, - (void *)&cmd_flow_director_mac_addr, - (void *)&cmd_flow_director_vlan, - (void *)&cmd_flow_director_vlan_value, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, -NULL , - }, -}; - -cmdline_parse_inst_t cmd_add_del_tunnel_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data =NULL , - .help_str ="flow_director_filter ... : Add or delete a tunnel flow " -"director entry on NIC" , - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_tunnel, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_mac, - (void *)&cmd_flow_director_mac_addr, - (void *)&cmd_flow_director_vlan, - (void *)&cmd_flow_director_vlan_value, - (void *)&cmd_flow_director_tunnel, - (void *)&cmd_flow_director_tunnel_type, - (void *)&cmd_flow_director_tunnel_id, - (void *)&cmd_flow_director_tunnel_id_value, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, -NULL , - }, -}; -cmdline_parse_inst_t cmd_add_del_raw_flow_director = { .f = cmd_flow_director_filter_parsed, .data =NULL ,
@@ -10925,51 +10342,7 @@ cmdline_parse_inst_t cmd_add_del_raw_flow_director = { }, }; -struct cmd_flush_flow_director_result { -cmdline_fixed_string_t flush_flow_director; -portid_t port_id; -}; - -cmdline_parse_token_string_t cmd_flush_flow_director_flush = - TOKEN_STRING_INITIALIZER(struct cmd_flush_flow_director_result, - flush_flow_director,"flush_flow_director" ); -cmdline_parse_token_num_t cmd_flush_flow_director_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_flush_flow_director_result, - port_id,UINT16 ); - -static void -cmd_flush_flow_director_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_flow_director_result *res = parsed_result; -int ret =0 ; - - ret =rte_eth_dev_filter_supported (res->port_id,RTE_ETH_FILTER_FDIR ); -if (ret <0 ) { -printf ("flow director is not supported on port %u.\n" , - res->port_id); -return ; - } - - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_FLUSH ,NULL ); -if (ret <0 ) -printf ("flow director table flushing error: (%s)\n" , -strerror (-ret)); -} - -cmdline_parse_inst_t cmd_flush_flow_director = { - .f = cmd_flush_flow_director_parsed, - .data =NULL , - .help_str ="flush_flow_director <port_id>: " -"Flush all flow director entries of a device on NIC" , - .tokens = { - (void *)&cmd_flush_flow_director_flush, - (void *)&cmd_flush_flow_director_port_id, -NULL , - }, -}; +#endif /* RTE_LIBRTE_I40E_PMD */ /* *** deal with flow director mask *** */ struct cmd_flow_director_mask_result {
@@ -11411,132 +10784,6 @@ cmdline_parse_inst_t cmd_set_flow_director_flex_payload = {/* Generic flow interface command. */ extern cmdline_parse_inst_t cmd_flow; -/* *** Classification Filters Control *** */ - -static enum rte_eth_input_set_field -str2inset (char *string) -{ -uint16_t i; - -static const struct { -char str[32 ]; -enum rte_eth_input_set_field inset; - } inset_table[] = { - {"ethertype" ,RTE_ETH_INPUT_SET_L2_ETHERTYPE }, - {"ovlan" ,RTE_ETH_INPUT_SET_L2_OUTER_VLAN }, - {"ivlan" ,RTE_ETH_INPUT_SET_L2_INNER_VLAN }, - {"src-ipv4" ,RTE_ETH_INPUT_SET_L3_SRC_IP4 }, - {"dst-ipv4" ,RTE_ETH_INPUT_SET_L3_DST_IP4 }, - {"ipv4-tos" ,RTE_ETH_INPUT_SET_L3_IP4_TOS }, - {"ipv4-proto" ,RTE_ETH_INPUT_SET_L3_IP4_PROTO }, - {"ipv4-ttl" ,RTE_ETH_INPUT_SET_L3_IP4_TTL }, - {"src-ipv6" ,RTE_ETH_INPUT_SET_L3_SRC_IP6 }, - {"dst-ipv6" ,RTE_ETH_INPUT_SET_L3_DST_IP6 }, - {"ipv6-tc" ,RTE_ETH_INPUT_SET_L3_IP6_TC }, - {"ipv6-next-header" ,RTE_ETH_INPUT_SET_L3_IP6_NEXT_HEADER }, - {"ipv6-hop-limits" ,RTE_ETH_INPUT_SET_L3_IP6_HOP_LIMITS }, - {"udp-src-port" ,RTE_ETH_INPUT_SET_L4_UDP_SRC_PORT }, - {"udp-dst-port" ,RTE_ETH_INPUT_SET_L4_UDP_DST_PORT }, - {"tcp-src-port" ,RTE_ETH_INPUT_SET_L4_TCP_SRC_PORT }, - {"tcp-dst-port" ,RTE_ETH_INPUT_SET_L4_TCP_DST_PORT }, - {"sctp-src-port" ,RTE_ETH_INPUT_SET_L4_SCTP_SRC_PORT }, - {"sctp-dst-port" ,RTE_ETH_INPUT_SET_L4_SCTP_DST_PORT }, - {"sctp-veri-tag" ,RTE_ETH_INPUT_SET_L4_SCTP_VERIFICATION_TAG }, - {"udp-key" ,RTE_ETH_INPUT_SET_TUNNEL_L4_UDP_KEY }, - {"gre-key" ,RTE_ETH_INPUT_SET_TUNNEL_GRE_KEY }, - {"fld-1st" ,RTE_ETH_INPUT_SET_FLEX_PAYLOAD_1ST_WORD }, - {"fld-2nd" ,RTE_ETH_INPUT_SET_FLEX_PAYLOAD_2ND_WORD }, - {"fld-3rd" ,RTE_ETH_INPUT_SET_FLEX_PAYLOAD_3RD_WORD }, - {"fld-4th" ,RTE_ETH_INPUT_SET_FLEX_PAYLOAD_4TH_WORD }, - {"fld-5th" ,RTE_ETH_INPUT_SET_FLEX_PAYLOAD_5TH_WORD }, - {"fld-6th" ,RTE_ETH_INPUT_SET_FLEX_PAYLOAD_6TH_WORD }, - {"fld-7th" ,RTE_ETH_INPUT_SET_FLEX_PAYLOAD_7TH_WORD }, - {"fld-8th" ,RTE_ETH_INPUT_SET_FLEX_PAYLOAD_8TH_WORD }, - {"none" ,RTE_ETH_INPUT_SET_NONE }, - }; - -for (i =0 ; i <RTE_DIM (inset_table); i++) { -if (!strcmp (string, inset_table[i].str)) -return inset_table[i].inset; - } - -return RTE_ETH_INPUT_SET_UNKNOWN ; -} - -/* Set flow director input set */ -struct cmd_set_fdir_input_set_result { -cmdline_fixed_string_t set_fdir_input_set; -portid_t port_id; -cmdline_fixed_string_t flow_type; -cmdline_fixed_string_t inset_field; -cmdline_fixed_string_t select; -}; - -static void -cmd_set_fdir_input_set_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_set_fdir_input_set_result *res = parsed_result; -struct rte_eth_fdir_filter_info info; - -memset (&info,0 ,sizeof (info)); - info.info_type =RTE_ETH_FDIR_FILTER_INPUT_SET_SELECT ; - info.info.input_set_conf.flow_type =str2flowtype (res->flow_type); - info.info.input_set_conf.field[0 ] =str2inset (res->inset_field); - info.info.input_set_conf.inset_size =1 ; -if (!strcmp (res->select,"select" )) - info.info.input_set_conf.op =RTE_ETH_INPUT_SET_SELECT ; -else if (!strcmp (res->select,"add" )) - info.info.input_set_conf.op =RTE_ETH_INPUT_SET_ADD ; -rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_SET , &info); -} - -cmdline_parse_token_string_t cmd_set_fdir_input_set_cmd = - TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result, - set_fdir_input_set,"set_fdir_input_set" ); -cmdline_parse_token_num_t cmd_set_fdir_input_set_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_set_fdir_input_set_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_set_fdir_input_set_flow_type = - TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result, - flow_type, -"ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#" -"ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#ipv6-other#l2_payload" ); -cmdline_parse_token_string_t cmd_set_fdir_input_set_field = - TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result, - inset_field, -"ivlan#ethertype#src-ipv4#dst-ipv4#src-ipv6#dst-ipv6#" -"ipv4-tos#ipv4-proto#ipv4-ttl#ipv6-tc#ipv6-next-header#" -"ipv6-hop-limits#udp-src-port#udp-dst-port#" -"tcp-src-port#tcp-dst-port#sctp-src-port#sctp-dst-port#" -"sctp-veri-tag#none" ); -cmdline_parse_token_string_t cmd_set_fdir_input_set_select = - TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result, - select,"select#add" ); - -cmdline_parse_inst_t cmd_set_fdir_input_set = { - .f = cmd_set_fdir_input_set_parsed, - .data =NULL , - .help_str ="set_fdir_input_set <port_id> " -"ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|" -"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload " -"ivlan|ethertype|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|" -"ipv4-tos|ipv4-proto|ipv4-ttl|ipv6-tc|ipv6-next-header|" -"ipv6-hop-limits|udp-src-port|udp-dst-port|" -"tcp-src-port|tcp-dst-port|sctp-src-port|sctp-dst-port|" -"sctp-veri-tag|none select|add" , - .tokens = { - (void *)&cmd_set_fdir_input_set_cmd, - (void *)&cmd_set_fdir_input_set_port_id, - (void *)&cmd_set_fdir_input_set_flow_type, - (void *)&cmd_set_fdir_input_set_field, - (void *)&cmd_set_fdir_input_set_select, -NULL , - }, -}; -/* *** ADD/REMOVE A MULTICAST MAC ADDRESS TO/FROM A PORT *** */ struct cmd_mcast_addr_result {cmdline_fixed_string_t mcast_addr_cmd;
@@ -18406,20 +17653,14 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_config_rss_hash_key, (cmdline_parse_inst_t *)&cmd_dump, (cmdline_parse_inst_t *)&cmd_dump_one, - (cmdline_parse_inst_t *)&cmd_add_del_ip_flow_director, - (cmdline_parse_inst_t *)&cmd_add_del_udp_flow_director, - (cmdline_parse_inst_t *)&cmd_add_del_sctp_flow_director, - (cmdline_parse_inst_t *)&cmd_add_del_l2_flow_director, - (cmdline_parse_inst_t *)&cmd_add_del_mac_vlan_flow_director, - (cmdline_parse_inst_t *)&cmd_add_del_tunnel_flow_director, +#ifdef RTE_LIBRTE_I40E_PMD (cmdline_parse_inst_t *)&cmd_add_del_raw_flow_director, - (cmdline_parse_inst_t *)&cmd_flush_flow_director, +#endif (cmdline_parse_inst_t *)&cmd_set_flow_director_ip_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_mac_vlan_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_tunnel_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_flex_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_flex_payload, - (cmdline_parse_inst_t *)&cmd_set_fdir_input_set, (cmdline_parse_inst_t *)&cmd_flow, (cmdline_parse_inst_t *)&cmd_show_port_meter_cap, (cmdline_parse_inst_t *)&cmd_add_port_meter_profile_srtcm,
app/test-pmd/config.c +5 -10
@@ -4711,6 +4711,8 @@ flowtype_to_str(uint16_t flow_type)return NULL ; } +#if defined(RTE_LIBRTE_I40E_PMD ) || defined(RTE_LIBRTE_IXGBE_PMD ) +static inline void print_fdir_flex_mask (struct rte_eth_fdir_flex_conf *flex_conf,uint32_t num) {
@@ -4750,16 +4752,7 @@ static int get_fdir_info(portid_t port_id, struct rte_eth_fdir_info *fdir_info, struct rte_eth_fdir_stats *fdir_stat) { - int ret; - - ret =rte_eth_dev_filter_supported (port_id,RTE_ETH_FILTER_FDIR ); -if (!ret) { -rte_eth_dev_filter_ctrl (port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_INFO , fdir_info); -rte_eth_dev_filter_ctrl (port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_STATS , fdir_stat); -return 0 ; - } + int ret = -ENOTSUP; #ifdef RTE_LIBRTE_I40E_PMD if (ret == -ENOTSUP) {
@@ -4857,6 +4850,8 @@ fdir_get_infos(portid_t port_id) fdir_stats_border, fdir_stats_border); } +#endif /* RTE_LIBRTE_I40E_PMD || RTE_LIBRTE_IXGBE_PMD */ +void fdir_set_flex_mask (portid_t port_id,struct rte_eth_fdir_flex_mask *cfg) {
app/test-pmd/testpmd.h +2 -0
@@ -921,7 +921,9 @@ int all_ports_stopped(void);int port_is_stopped (portid_t port_id);int port_is_started (portid_t port_id);void pmd_test_exit (void ); +#if defined(RTE_LIBRTE_I40E_PMD ) || defined(RTE_LIBRTE_IXGBE_PMD )void fdir_get_infos (portid_t port_id); +#endif void fdir_set_flex_mask (portid_t port_id,struct rte_eth_fdir_flex_mask *cfg); void fdir_set_flex_payload(portid_t port_id,
doc/guides/rel_notes/deprecation.rst +2 -2
@@ -107,8 +107,8 @@ Deprecation Notices * ethdev: the legacy filter API, including - ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types FDIR, is superseded by the generic flow API (rte_flow) in + ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` + is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.
drivers/net/bnxt/bnxt_ethdev.c +0 -396
408 lines not on this page · raw message
drivers/net/enic/enic.h +0 -7
@@ -394,12 +394,6 @@ enic_ring_incr(uint32_t n_descriptors, uint32_t idx) }int dev_is_enic (struct rte_eth_dev *dev); -void enic_fdir_stats_get (struct enic *enic, -struct rte_eth_fdir_stats *stats); -int enic_fdir_add_fltr (struct enic *enic, -struct rte_eth_fdir_filter *params); -int enic_fdir_del_fltr (struct enic *enic, -struct rte_eth_fdir_filter *params);void enic_free_wq (void *txq);int enic_alloc_intr_resources (struct enic *enic);int enic_setup_finish (struct enic *enic);
@@ -464,7 +458,6 @@ bool enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev);void enic_pick_rx_handler (struct rte_eth_dev *eth_dev);void enic_pick_tx_handler (struct rte_eth_dev *eth_dev);void enic_fdir_info (struct enic *enic); -void enic_fdir_info_get (struct enic *enic,struct rte_eth_fdir_info *stats);int enic_vf_representor_init (struct rte_eth_dev *eth_dev,void *init_params);int enic_vf_representor_uninit (struct rte_eth_dev *ethdev);int enic_fm_allocate_switch_domain (struct enic *pf);
drivers/net/enic/enic_clsf.c +0 -168
180 lines not on this page · raw message
drivers/net/enic/enic_ethdev.c +0 -48
60 lines not on this page · raw message
drivers/net/i40e/i40e_ethdev.c +0 -86
98 lines not on this page · raw message
drivers/net/i40e/i40e_ethdev.h +1 -10
@@ -664,8 +664,7 @@ struct i40e_fdir_action { };/* A structure used to define the flow director filter entry by filter_ctrl API -* It supports RTE_ETH_FILTER_FDIR with RTE_ETH_FILTER_ADD and -* RTE_ETH_FILTER_DELETE operations. +* It supports RTE_ETH_FILTER_FDIR data representation. */ struct i40e_fdir_filter_conf {uint32_t soft_id;
@@ -1368,17 +1367,12 @@ void i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir);void i40e_fdir_stats_get (struct rte_eth_dev *dev,struct rte_eth_fdir_stats *stat); -int i40e_fdir_ctrl_func (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg);int i40e_select_filter_input_set (struct i40e_hw *hw,struct rte_eth_input_set_conf *conf,enum rte_filter_type filter);void i40e_fdir_filter_restore (struct i40e_pf *pf);int i40e_hash_filter_inset_select (struct i40e_hw *hw,struct rte_eth_input_set_conf *conf); -int i40e_fdir_filter_inset_select (struct i40e_pf *pf, -struct rte_eth_input_set_conf *conf);int i40e_pf_host_send_msg_to_vf (struct i40e_pf_vf *vf,uint32_t opcode,uint32_t retval,uint8_t *msg,uint16_t msglen);
@@ -1406,9 +1400,6 @@ uint64_t i40e_get_default_input_set(uint16_t pctype);int i40e_ethertype_filter_set (struct i40e_pf *pf,struct rte_eth_ethertype_filter *filter,bool add); -int i40e_add_del_fdir_filter (struct rte_eth_dev *dev, -const struct rte_eth_fdir_filter *filter, -bool add);struct rte_flow *i40e_fdir_entry_pool_get (struct i40e_fdir_info *fdir_info); void i40e_fdir_entry_pool_put(struct i40e_fdir_info *fdir_info,
drivers/net/i40e/i40e_fdir.c +0 -539
569 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_ethdev.c +1 -4
@@ -6799,7 +6799,7 @@ ixgbe_add_del_ethertype_filter(struct rte_eth_dev *dev, }static int -ixgbe_dev_filter_ctrl (struct rte_eth_dev *dev, +ixgbe_dev_filter_ctrl(__rte_unused struct rte_eth_dev *dev,enum rte_filter_type filter_type,enum rte_filter_op filter_op,void *arg)
@@ -6807,9 +6807,6 @@ ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev,int ret =0 ;switch (filter_type) { -case RTE_ETH_FILTER_FDIR : - ret =ixgbe_fdir_ctrl_func (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_GENERIC :if (filter_op !=RTE_ETH_FILTER_GET )return -EINVAL ;
drivers/net/ixgbe/ixgbe_ethdev.h +0 -2
@@ -727,8 +727,6 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev);uint32_t ixgbe_convert_vm_rx_mask_to_val (uint16_t rx_mask,uint32_t orig_val); -int ixgbe_fdir_ctrl_func (struct rte_eth_dev *dev, -enum rte_filter_op filter_op,void *arg);void ixgbe_fdir_filter_restore (struct rte_eth_dev *dev);int ixgbe_clear_all_fdir_filter (struct rte_eth_dev *dev);
drivers/net/ixgbe/ixgbe_fdir.c +0 -220
256 lines not on this page · raw message
drivers/net/mlx5/mlx5.h +0 -1
@@ -878,7 +878,6 @@ struct mlx5_priv {uint8_t skip_default_rss_reta;/* Skip configuration of default reta. */ uint8_t fdb_def_rule;/* Whether fdb jump to table 1 is configured. */ struct mlx5_mp_id mp_id;/* ID of a multi-process process */ - LIST_HEAD(fdir, mlx5_fdir_flow) fdir_flows; /* fdir flows. */ };#define PORT_ID (priv) ((priv)->dev_data->port_id)
drivers/net/mlx5/mlx5_flow.c +0 -516
278 lines not on this page · raw message
drivers/net/qede/qede_filter.c +0 -171
171 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.17.1
Part of the diff is not shown here. View the raw message.
Re: [dpdk-dev] [PATCH 12/14] ethdev: remove legacy FDIR filter type support
Quoted 4 lines · Andrew Rybchenko
RTE flow API should be used for filtering.
Signed-off-by Andrew Rybchenko <[email protected]>
For bnxt PMD
Quoted 24 lines
--- app/test-pmd/cmdline.c | 897 +++------------------------ app/test-pmd/config.c | 15 +- app/test-pmd/testpmd.h | 2 + doc/guides/rel_notes/deprecation.rst | 4 +- drivers/net/bnxt/bnxt_ethdev.c | 396 ------------ drivers/net/enic/enic.h | 7 - drivers/net/enic/enic_clsf.c | 168 ----- drivers/net/enic/enic_ethdev.c | 48 -- drivers/net/i40e/i40e_ethdev.c | 86 --- drivers/net/i40e/i40e_ethdev.h | 11 +- drivers/net/i40e/i40e_fdir.c | 539 ---------------- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 - drivers/net/ixgbe/ixgbe_fdir.c | 220 ------- drivers/net/mlx5/mlx5.h | 1 - drivers/net/mlx5/mlx5_flow.c | 516 --------------- drivers/net/mlx5/mlx5_flow.h | 8 - drivers/net/qede/qede_ethdev.h | 5 - drivers/net/qede/qede_filter.c | 171 ----- drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 27 +- 21 files changed, 81 insertions(+), 3050 deletions(-)
Re: [dpdk-dev] [PATCH 12/14] ethdev: remove legacy FDIR filter type support
In reply to Andrew RybchenkoQuoted 32 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 22:09
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; John Daley <[email protected]>; Hyong Youb Kim <[email protected]>; Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Matan Azrad <[email protected]>; Shahaf Shuler <[email protected]>; Viacheslav Ovsiienko <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 12/14] ethdev: remove legacy FDIR filter type supportRTE flow API should be used for filtering.
Signed-off-by Andrew Rybchenko <[email protected]>--- app/test-pmd/cmdline.c | 897 +++------------------------ app/test-pmd/config.c | 15 +- app/test-pmd/testpmd.h | 2 + doc/guides/rel_notes/deprecation.rst | 4 +- drivers/net/bnxt/bnxt_ethdev.c | 396 ------------ drivers/net/enic/enic.h | 7 - drivers/net/enic/enic_clsf.c | 168 ----- drivers/net/enic/enic_ethdev.c | 48 -- drivers/net/i40e/i40e_ethdev.c | 86 --- drivers/net/i40e/i40e_ethdev.h | 11 +- drivers/net/i40e/i40e_fdir.c | 539 ---------------- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 - drivers/net/ixgbe/ixgbe_fdir.c | 220 -------
Quoted 9 lines
drivers/net/mlx5/mlx5.h | 1 - drivers/net/mlx5/mlx5_flow.c | 516 --------------- drivers/net/mlx5/mlx5_flow.h | 8 - drivers/net/qede/qede_ethdev.h | 5 - drivers/net/qede/qede_filter.c | 171 ----- drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 27 +- 21 files changed, 81 insertions(+), 3050 deletions(-)
Thanks Andrew, removing the legacy filter from deprecation note, testpmd, lib, to PMDs per type is very clear, and easy to review.
Very appreciate your professional work! ;-)
For ixgbe PMD,
Quoted 2 lines
--
2.17.1
Re: [dpdk-dev] [PATCH 12/14] ethdev: remove legacy FDIR filter type support
In reply to Andrew RybchenkoQuoted 20 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; John Daley <[email protected]>; Hyong Youb Kim <[email protected]>; Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Matan Azrad <[email protected]>; Shahaf Shuler <[email protected]>; Viacheslav Ovsiienko <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 12/14] ethdev: remove legacy FDIR filter type support
Quoted 2 lines
RTE flow API should be used for filtering.
The same as previous patch comment, please detail which part be remove and which part is reserve if have. Thanks.
Quoted 3,903 lines
Signed-off-by Andrew Rybchenko <[email protected]>--- app/test-pmd/cmdline.c | 897 +++------------------------ app/test-pmd/config.c | 15 +- app/test-pmd/testpmd.h | 2 + doc/guides/rel_notes/deprecation.rst | 4 +- drivers/net/bnxt/bnxt_ethdev.c | 396 ------------ drivers/net/enic/enic.h | 7 - drivers/net/enic/enic_clsf.c | 168 ----- drivers/net/enic/enic_ethdev.c | 48 -- drivers/net/i40e/i40e_ethdev.c | 86 --- drivers/net/i40e/i40e_ethdev.h | 11 +- drivers/net/i40e/i40e_fdir.c | 539 ---------------- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 - drivers/net/ixgbe/ixgbe_fdir.c | 220 ------- drivers/net/mlx5/mlx5.h | 1 - drivers/net/mlx5/mlx5_flow.c | 516 --------------- drivers/net/mlx5/mlx5_flow.h | 8 - drivers/net/qede/qede_ethdev.h | 5 - drivers/net/qede/qede_filter.c | 171 ----- drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 27 +- 21 files changed, 81 insertions(+), 3050 deletions(-)app/test-pmd/cmdline.c +0
-1@@ -959,62 +959,12 @@ static void cmd_help_long_parsed(void *parsed_result,"filters:\n" "--------\n\n" - "flow_director_filter (port_id) mode IP(add|del|update)"
app/test-pmd/cmdline.c +0
-9-" flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)" -" src (src_ip_address) dst (dst_ip_address)" -" tos (tos_value) proto (proto_value) ttl (ttl_value)" -" vlan (vlan_value) flexbytes (flexbytes_value)" -" (drop|fwd) pf|vf(vf_id) queue (queue_id)" -" fd_id (fd_id_value)\n" -" Add/Del an IP type flow director filter.\n\n" - - "flow_director_filter (port_id) mode IP(add|del|update)"
app/test-pmd/cmdline.c +0
-8-" flow (ipv4-tcp|ipv4-udp|ipv6-tcp|ipv6-udp)" -" src (src_ip_address) (src_port)" -" dst (dst_ip_address) (dst_port)" -" tos (tos_value) ttl (ttl_value)" -" vlan (vlan_value) flexbytes (flexbytes_value)" -" (drop|fwd) pf|vf(vf_id) queue (queue_id)" -" fd_id (fd_id_value)\n" - " Add/Del an UDP/TCP type flow directorfilter.\n\n"
app/test-pmd/cmdline.c +0
-2- - "flow_director_filter (port_id) mode IP(add|del|update)"
app/test-pmd/cmdline.c +0
-8-" flow (ipv4-sctp|ipv6-sctp)" -" src (src_ip_address) (src_port)" -" dst (dst_ip_address) (dst_port)" -" tag (verification_tag) " -" tos (tos_value) ttl (ttl_value)" -" vlan (vlan_value)" -" flexbytes (flexbytes_value) (drop|fwd)" - " pf|vf(vf_id) queue (queue_id) fd_id(fd_id_value)\n"
app/test-pmd/cmdline.c +0
-3-" Add/Del a SCTP type flow director filter.\n\n" - - "flow_director_filter (port_id) mode IP(add|del|update)"
app/test-pmd/cmdline.c +0
-3-" flow l2_payload ether (ethertype)" -" flexbytes (flexbytes_value) (drop|fwd)" - " pf|vf(vf_id) queue (queue_id) fd_id(fd_id_value)\n"
app/test-pmd/cmdline.c +0
-3-" Add/Del a l2 payload type flow director filter.\n\n" - - "flow_director_filter (port_id) mode MAC-VLAN(add|del|update)"
app/test-pmd/cmdline.c +0
-6-" mac (mac_address) vlan (vlan_value)" -" flexbytes (flexbytes_value) (drop|fwd)" -" queue (queue_id) fd_id (fd_id_value)\n" -" Add/Del a MAC-VLAN flow director filter.\n\n" - - "flow_director_filter (port_id) mode Tunnel(add|del|update)"
app/test-pmd/cmdline.c +0
-2-" mac (mac_address) vlan (vlan_value)" - " tunnel (NVGRE|VxLAN) tunnel-id(
tunnel_id_value)"app/test-pmd/cmdline.c +1
-4-" flexbytes (flexbytes_value) (drop|fwd)" -" queue (queue_id) fd_id (fd_id_value)\n" -" Add/Del a Tunnel flow director filter.\n\n" - +#ifdef RTE_LIBRTE_I40E_PMD "flow_director_filter (port_id) mode raw(add|del|update)"
app/test-pmd/cmdline.c +1
-3" flow (flow_id) (drop|fwd) queue (queue_id)" " fd_id (fd_id_value) packet (packet file name)\n" " Add/Del a raw type flow director filter.\n\n" - -"flush_flow_director (port_id)\n" -" Flush all flow director entries of a device.\n\n" +#endif "flow_director_mask (port_id) mode IP vlan(
vlan_value)"app/test-pmd/cmdline.c +0
-2" src_mask (ipv4_src) (ipv6_src) (src_port)" @@ -1041,17 +991,6 @@ static void cmd_help_long_parsed(void *parsed_result," (raw|l2|l3|l4) (config)\n" " Configure flex payload selection.\n\n" -"set_fdir_input_set (port_id) " - "(ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
app/test-pmd/cmdline.c +0
-2-"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|" - "l2_payload) (ivlan|ethertype|src-ipv4|dst-ipv4|src-ipv6|"
app/test-pmd/cmdline.c +2
-7-"dst-ipv6|ipv4-tos|ipv4-proto|ipv4-ttl|ipv6-tc|" -"ipv6-next-header|ipv6-hop-limits|udp-src-port|" -"udp-dst-port|tcp-src-port|tcp-dst-port|" -"sctp-src-port|sctp-dst-port|sctp-veri-tag|none)" -" (select|add)\n" -" Set the input set for FDir.\n\n" -"flow validate {port_id}" " [group {group_id}] [priority {level}]" " [ingress] [egress]" @@ -7628,9 +7567,11 @@ static void cmd_showportall_parsed(void *parsed_result, else if (!strcmp(res->what, "xstats")) RTE_ETH_FOREACH_DEV(i)nic_xstats_display (i); +#if defined(RTE_LIBRTE_I40E_PMD ) || defined(RTE_LIBRTE_IXGBE_PMD ) else if (!strcmp(res->what, "fdir"))RTE_ETH_FOREACH_DEV (i)fdir_get_infos (i); +#endif else if (!strcmp(res->what, "stat_qmap"))RTE_ETH_FOREACH_DEV (i)app/test-pmd/cmdline.c +2
-0nic_stats_mapping_display (i);@@ -7694,8 +7635,10 @@ static void cmd_showport_parsed(void *parsed_result,nic_stats_display (res->portnum); else if (!strcmp(res->what, "xstats"))nic_xstats_display (res->portnum); +#if defined(RTE_LIBRTE_I40E_PMD ) || defined(RTE_LIBRTE_IXGBE_PMD ) else if (!strcmp(res->what, "fdir"))fdir_get_infos (res->portnum); +#endif else if (!strcmp(res->what, "stat_qmap"))nic_stats_mapping_display (res->portnum);app/test-pmd/cmdline.c +0
-45else if (!strcmp (res->what,"dcb_tc" ))@@ -10157,51 +10100,6 @@ cmdline_parse_inst_t cmd_show_queue_region_info_all = {/* *** Filters Control *** */ -/* *** deal with flow director filter *** */ -struct cmd_flow_director_result { -cmdline_fixed_string_t flow_director_filter; -portid_t port_id; -cmdline_fixed_string_t mode; -cmdline_fixed_string_t mode_value; -cmdline_fixed_string_t ops; -cmdline_fixed_string_t flow; -cmdline_fixed_string_t flow_type; -cmdline_fixed_string_t ether; -uint16_t ether_type; -cmdline_fixed_string_t src; -cmdline_ipaddr_t ip_src; -uint16_t port_src; -cmdline_fixed_string_t dst; -cmdline_ipaddr_t ip_dst; -uint16_t port_dst; -cmdline_fixed_string_t verify_tag; -uint32_t verify_tag_value; -cmdline_fixed_string_t tos; -uint8_t tos_value; -cmdline_fixed_string_t proto; -uint8_t proto_value; -cmdline_fixed_string_t ttl; -uint8_t ttl_value; -cmdline_fixed_string_t vlan; -uint16_t vlan_value; -cmdline_fixed_string_t flexbytes; -cmdline_fixed_string_t flexbytes_value; -cmdline_fixed_string_t pf_vf; -cmdline_fixed_string_t drop; -cmdline_fixed_string_t queue; -uint16_t queue_id; -cmdline_fixed_string_t fd_id; -uint32_t fd_id_value; -cmdline_fixed_string_t mac; -struct rte_ether_addr mac_addr; -cmdline_fixed_string_t tunnel; -cmdline_fixed_string_t tunnel_type; -cmdline_fixed_string_t tunnel_id; -uint32_t tunnel_id_value; -cmdline_fixed_string_t packet; -char filepath[]; -}; -static inline int parse_flexbytes (const char *q_arg,uint8_t *flexbytes,uint16_t max_num){
app/test-pmd/cmdline.c +47
-246@@ -10275,26 +10173,6 @@ str2flowtype(char *string)return RTE_ETH_FLOW_UNKNOWN ; } -static enum rte_eth_fdir_tunnel_type -str2fdir_tunneltype (char *string) -{ -uint8_t i =0 ; - -static const struct { -char str[32 ]; -enum rte_eth_fdir_tunnel_type type; - } tunneltype_str[] = { - {"NVGRE" ,RTE_FDIR_TUNNEL_TYPE_NVGRE }, - {"VxLAN" ,RTE_FDIR_TUNNEL_TYPE_VXLAN }, - }; - -for (i =0 ; i <RTE_DIM (tunneltype_str); i++) { -if (!strcmp (tunneltype_str[i].str, string)) -return tunneltype_str[i].type; - } -return RTE_FDIR_TUNNEL_TYPE_UNKNOWN ; -} -#define IPV4_ADDR_TO_UINT (ip_addr, ip) \ do { \ if ((ip_addr).family == AF_INET) \@@ -10317,252 +10195,83 @@ do { \ } \ } while (0) +#ifdef RTE_LIBRTE_I40E_PMD + +/* *** deal with flow director filter *** */ +struct cmd_flow_director_result { +cmdline_fixed_string_t flow_director_filter; +portid_t port_id; +cmdline_fixed_string_t mode; +cmdline_fixed_string_t mode_value; +cmdline_fixed_string_t ops; +cmdline_fixed_string_t flow; +cmdline_fixed_string_t flow_type; +cmdline_fixed_string_t drop; +cmdline_fixed_string_t queue; +uint16_t queue_id; +cmdline_fixed_string_t fd_id; +uint32_t fd_id_value; +cmdline_fixed_string_t packet; +char filepath[]; +}; +static void cmd_flow_director_filter_parsed (void *parsed_result, __rte_unused struct cmdline *cl, __rte_unused void *data) {struct cmd_flow_director_result *res = parsed_result; -struct rte_eth_fdir_filter entry; -uint8_t flexbytes[RTE_ETH_FDIR_MAX_FLEXLEN ]; -char *end; -unsigned long vf_id;int ret =0 ; +struct rte_pmd_i40e_flow_type_mapping + mapping[RTE_PMD_I40E_FLOW_TYPE_MAX ]; +struct rte_pmd_i40e_pkt_template_conf conf; +uint16_t flow_type =str2flowtype (res->flow_type); +uint16_t i, port = res->port_id; +uint8_t add; - ret =rte_eth_dev_filter_supported (res->port_id, RTE_ETH_FILTER_FDIR); -if (ret <0 ) { -printf ("flow director is not supported on port %u.\n" , - res->port_id); -return ; - } -memset (flexbytes,0 ,sizeof (flexbytes)); -memset (&entry,0 ,sizeof (struct rte_eth_fdir_filter )); - -if (fdir_conf.mode ==RTE_FDIR_MODE_PERFECT_MAC_VLAN ) { -if (strcmp (res->mode_value,"MAC-VLAN" )) { -printf ("Please set mode to MAC-VLAN.\n" ); -return ; - } - }else if (fdir_conf.mode ==RTE_FDIR_MODE_PERFECT_TUNNEL ) { -if (strcmp (res->mode_value,"Tunnel" )) { -printf ("Please set mode to Tunnel.\n" ); -return ; - } - }else { -if (!strcmp (res->mode_value,"raw" )) { -#ifdef RTE_LIBRTE_I40E_PMD -struct rte_pmd_i40e_flow_type_mapping - mapping[RTE_PMD_I40E_FLOW_TYPE_MAX ]; -struct rte_pmd_i40e_pkt_template_conf conf; -uint16_t flow_type =str2flowtype (res->flow_type); -uint16_t i, port = res->port_id; -uint8_t add; - -memset (&conf,0 ,sizeof (conf)); +memset (&conf,0 ,sizeof (conf)); -if (flow_type ==RTE_ETH_FLOW_UNKNOWN ) { -printf ("Invalid flow type specified.\n" ); -return ; - } - ret =rte_pmd_i40e_flow_type_mapping_get (res- >port_id, - mapping); -if (ret) -return ; -if (mapping[flow_type].pctype ==0ULL ) { -printf ("Invalid flow type specified.\n" ); -return ; - } -for (i =0 ; i <RTE_PMD_I40E_PCTYPE_MAX ; i++) { -if (mapping[flow_type].pctype & (1ULL << i)) { - conf.input.pctype = i; -break ; - } - } - - conf.input.packet =open_file (res->filepath, - &conf.input.length); -if (!conf.input.packet) -return ; -if (!strcmp (res->drop,"drop" )) - conf.action.behavior = -RTE_PMD_I40E_PKT_TEMPLATE_REJECT ; -else - conf.action.behavior = -RTE_PMD_I40E_PKT_TEMPLATE_ACCEPT ; - conf.action.report_status = -RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID ; - conf.action.rx_queue = res->queue_id; - conf.soft_id = res->fd_id_value; - add =strcmp (res->ops,"del" ) ?1 :0 ; - ret = rte_pmd_i40e_flow_add_del_packet_template(port, - &conf, - add); -if (ret <0 ) -printf ("flow director config error: (%s)\n" , -strerror (-ret)); -close_file (conf.input.packet); -#endif -return ; - }else if (strcmp (res->mode_value,"IP" )) { -printf ("Please set mode to IP or raw.\n" ); -return ; - } - entry.input.flow_type =str2flowtype (res->flow_type); - } - - ret =parse_flexbytes (res->flexbytes_value, - flexbytes, -RTE_ETH_FDIR_MAX_FLEXLEN ); -if (ret <0 ) { -printf ("error: Cannot parse flexbytes input.\n" ); + if (flow_type == RTE_ETH_FLOW_UNKNOWN) { + printf("Invalid flow type specified.\n"); return; } - -switch (entry.input.flow_type) { -case RTE_ETH_FLOW_FRAG_IPV4 : -case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER : - entry.input.flow.ip4_flow.proto = res->proto_value; -/* fall-through */ -case RTE_ETH_FLOW_NONFRAG_IPV4_UDP : -case RTE_ETH_FLOW_NONFRAG_IPV4_TCP : -IPV4_ADDR_TO_UINT (res->ip_dst, - entry.input.flow.ip4_flow.dst_ip); -IPV4_ADDR_TO_UINT (res->ip_src, - entry.input.flow.ip4_flow.src_ip); - entry.input.flow.ip4_flow.tos = res->tos_value; - entry.input.flow.ip4_flow.ttl = res->ttl_value; -/* need convert to big endian. */ - entry.input.flow.udp4_flow.dst_port = -rte_cpu_to_be_16 (res->port_dst); - entry.input.flow.udp4_flow.src_port = -rte_cpu_to_be_16 (res->port_src); -break ; -case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP : -IPV4_ADDR_TO_UINT (res->ip_dst, - entry.input.flow.sctp4_flow.ip.dst_ip); -IPV4_ADDR_TO_UINT (res->ip_src, - entry.input.flow.sctp4_flow.ip.src_ip); - entry.input.flow.ip4_flow.tos = res->tos_value; - entry.input.flow.ip4_flow.ttl = res->ttl_value; -/* need convert to big endian. */ - entry.input.flow.sctp4_flow.dst_port = -rte_cpu_to_be_16 (res->port_dst); - entry.input.flow.sctp4_flow.src_port = -rte_cpu_to_be_16 (res->port_src); - entry.input.flow.sctp4_flow.verify_tag = -rte_cpu_to_be_32 (res->verify_tag_value); -break ; -case RTE_ETH_FLOW_FRAG_IPV6 : -case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER : - entry.input.flow.ipv6_flow.proto = res->proto_value; -/* fall-through */ -case RTE_ETH_FLOW_NONFRAG_IPV6_UDP : -case RTE_ETH_FLOW_NONFRAG_IPV6_TCP : -IPV6_ADDR_TO_ARRAY (res->ip_dst, - entry.input.flow.ipv6_flow.dst_ip); -IPV6_ADDR_TO_ARRAY (res->ip_src, - entry.input.flow.ipv6_flow.src_ip); - entry.input.flow.ipv6_flow.tc = res->tos_value; - entry.input.flow.ipv6_flow.hop_limits = res->ttl_value; -/* need convert to big endian. */ - entry.input.flow.udp6_flow.dst_port = -rte_cpu_to_be_16 (res->port_dst); - entry.input.flow.udp6_flow.src_port = -rte_cpu_to_be_16 (res->port_src); -break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP : -IPV6_ADDR_TO_ARRAY (res->ip_dst, - entry.input.flow.sctp6_flow.ip.dst_ip); -IPV6_ADDR_TO_ARRAY (res->ip_src, - entry.input.flow.sctp6_flow.ip.src_ip); - entry.input.flow.ipv6_flow.tc = res->tos_value; - entry.input.flow.ipv6_flow.hop_limits = res->ttl_value; -/* need convert to big endian. */ - entry.input.flow.sctp6_flow.dst_port = -rte_cpu_to_be_16 (res->port_dst); - entry.input.flow.sctp6_flow.src_port = -rte_cpu_to_be_16 (res->port_src); - entry.input.flow.sctp6_flow.verify_tag = -rte_cpu_to_be_32 (res->verify_tag_value); -break ; -case RTE_ETH_FLOW_L2_PAYLOAD : - entry.input.flow.l2_flow.ether_type = -rte_cpu_to_be_16 (res->ether_type); -break ; -default : -break ; - } - -if (fdir_conf.mode ==RTE_FDIR_MODE_PERFECT_MAC_VLAN ) -rte_memcpy (&entry.input.flow.mac_vlan_flow.mac_addr, - &res->mac_addr, -sizeof (struct rte_ether_addr )); - -if (fdir_conf.mode ==RTE_FDIR_MODE_PERFECT_TUNNEL ) { -rte_memcpy (&entry.input.flow.tunnel_flow.mac_addr, - &res->mac_addr, -sizeof (struct rte_ether_addr )); - entry.input.flow.tunnel_flow.tunnel_type = -str2fdir_tunneltype (res->tunnel_type); - entry.input.flow.tunnel_flow.tunnel_id = -rte_cpu_to_be_32 (res->tunnel_id_value); + ret =rte_pmd_i40e_flow_type_mapping_get (res->port_id, + mapping); +if (ret) +return ; +if (mapping[flow_type].pctype ==0ULL ) { +printf ("Invalid flow type specified.\n" ); +return ; } - -rte_memcpy (entry.input.flow_ext.flexbytes, - flexbytes, -RTE_ETH_FDIR_MAX_FLEXLEN ); - - entry.input.flow_ext.vlan_tci =rte_cpu_to_be_16 (res->vlan_value); - - entry.action.flex_off =0 ;/*use 0 by default */ -if (!strcmp (res->drop,"drop" )) - entry.action.behavior =RTE_ETH_FDIR_REJECT ; -else - entry.action.behavior =RTE_ETH_FDIR_ACCEPT ; - -if (fdir_conf.mode !=RTE_FDIR_MODE_PERFECT_MAC_VLAN && - fdir_conf.mode !=RTE_FDIR_MODE_PERFECT_TUNNEL ) { -if (!strcmp (res->pf_vf,"pf" )) - entry.input.flow_ext.is_vf =0 ; -else if (!strncmp (res->pf_vf,"vf" ,2 )) { -struct rte_eth_dev_info dev_info; - - ret =eth_dev_info_get_print_err (res->port_id, - &dev_info); -if (ret !=0 ) -return ; - - errno =0 ; - vf_id =strtoul (res->pf_vf +2 , &end,10 ); -if (errno !=0 || *end !='\0' || - vf_id >= dev_info.max_vfs) { -printf ("invalid parameter %s.\n" , res->pf_vf); -return ; - } - entry.input.flow_ext.is_vf =1 ; - entry.input.flow_ext.dst_id = (uint16_t )vf_id; - }else { -printf ("invalid parameter %s.\n" , res->pf_vf); -return ; +for (i =0 ; i <RTE_PMD_I40E_PCTYPE_MAX ; i++) { +if (mapping[flow_type].pctype & (1ULL << i)) { + conf.input.pctype = i; +break ; } } -/* set to report FD ID by default */ - entry.action.report_status =RTE_ETH_FDIR_REPORT_ID ; - entry.action.rx_queue = res->queue_id; - entry.soft_id = res->fd_id_value; -if (!strcmp (res->ops,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_ADD , &entry); -else if (!strcmp (res->ops,"del" )) - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_DELETE , &entry); + conf.input.packet =open_file (res->filepath, + &conf.input.length); +if (!conf.input.packet) +return ; +if (!strcmp (res->drop,"drop" )) + conf.action.behavior = +RTE_PMD_I40E_PKT_TEMPLATE_REJECT ;else - ret = rte_eth_dev_filter_ctrl(res->port_id,
RTE_ETH_FILTER_FDIR,app/test-pmd/cmdline.c +13
-3- RTE_ETH_FILTER_UPDATE, &entry); + conf.action.behavior = +RTE_PMD_I40E_PKT_TEMPLATE_ACCEPT ; + conf.action.report_status = +RTE_PMD_I40E_PKT_TEMPLATE_REPORT_ID ; + conf.action.rx_queue = res->queue_id; + conf.soft_id = res->fd_id_value; + add =strcmp (res->ops,"del" ) ?1 :0 ; + ret =rte_pmd_i40e_flow_add_del_packet_template (port, + &conf, + add);if (ret <0 ) -printf ("flow director programming error: (%s)\n" , -strerror (-ret)); +printf ("flow director config error: (%s)\n" , +strerror (-ret)); +close_file (conf.input.packet); } cmdline_parse_token_string_t cmd_flow_director_filter =@@ -10580,72 +10289,9 @@ cmdline_parse_token_string_t
cmd_flow_director_flow=
cmdline_parse_token_string_tcmd_flow_director_flow_type=app/test-pmd/cmdline.c +0
-63TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, flow_type, NULL); -cmdline_parse_token_string_t cmd_flow_director_ether = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - ether,"ether" ); -cmdline_parse_token_num_t cmd_flow_director_ether_type = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - ether_type,UINT16 ); -cmdline_parse_token_string_t cmd_flow_director_src = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - src,"src" ); -cmdline_parse_token_ipaddr_t cmd_flow_director_ip_src = - TOKEN_IPADDR_INITIALIZER(struct cmd_flow_director_result, - ip_src); -cmdline_parse_token_num_t cmd_flow_director_port_src = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - port_src,UINT16 ); -cmdline_parse_token_string_t cmd_flow_director_dst = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - dst,"dst" ); -cmdline_parse_token_ipaddr_t cmd_flow_director_ip_dst = - TOKEN_IPADDR_INITIALIZER(struct cmd_flow_director_result, - ip_dst); -cmdline_parse_token_num_t cmd_flow_director_port_dst = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - port_dst,UINT16 ); -cmdline_parse_token_string_t cmd_flow_director_verify_tag = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - verify_tag,"verify_tag" ); -cmdline_parse_token_num_t cmd_flow_director_verify_tag_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - verify_tag_value,UINT32 ); -cmdline_parse_token_string_t cmd_flow_director_tos = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - tos,"tos" ); -cmdline_parse_token_num_t cmd_flow_director_tos_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - tos_value,UINT8 ); -cmdline_parse_token_string_t cmd_flow_director_proto = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - proto,"proto" ); -cmdline_parse_token_num_t cmd_flow_director_proto_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - proto_value,UINT8 ); -cmdline_parse_token_string_t cmd_flow_director_ttl = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - ttl,"ttl" ); -cmdline_parse_token_num_t cmd_flow_director_ttl_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - ttl_value,UINT8 ); -cmdline_parse_token_string_t cmd_flow_director_vlan = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - vlan,"vlan" ); -cmdline_parse_token_num_t cmd_flow_director_vlan_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - vlan_value,UINT16 ); -cmdline_parse_token_string_t cmd_flow_director_flexbytes = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - flexbytes,"flexbytes" ); -cmdline_parse_token_string_t cmd_flow_director_flexbytes_value = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - flexbytes_value,NULL );cmdline_parse_token_string_t cmd_flow_director_drop = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, drop,"drop#fwd" ); -cmdline_parse_token_string_t cmd_flow_director_pf_vf = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - pf_vf,NULL );cmdline_parse_token_string_t cmd_flow_director_queue = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, queue,"queue" );@@ -10662,36 +10308,9 @@ cmdline_parse_token_num_t
cmd_flow_director_fd_id_value=
cmdline_parse_token_string_tcmd_flow_director_mode=app/test-pmd/cmdline.c +0
-27TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, mode, "mode"); -cmdline_parse_token_string_t cmd_flow_director_mode_ip = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - mode_value,"IP" ); -cmdline_parse_token_string_t cmd_flow_director_mode_mac_vlan = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - mode_value,"MAC-VLAN" ); -cmdline_parse_token_string_t cmd_flow_director_mode_tunnel = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - mode_value,"Tunnel" );cmdline_parse_token_string_t cmd_flow_director_mode_raw = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, mode_value,"raw" ); -cmdline_parse_token_string_t cmd_flow_director_mac = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - mac,"mac" ); -cmdline_parse_token_etheraddr_t cmd_flow_director_mac_addr = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_flow_director_result, - mac_addr); -cmdline_parse_token_string_t cmd_flow_director_tunnel = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - tunnel,"tunnel" ); -cmdline_parse_token_string_t cmd_flow_director_tunnel_type = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - tunnel_type,"NVGRE#VxLAN" ); -cmdline_parse_token_string_t cmd_flow_director_tunnel_id = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, - tunnel_id,"tunnel-id" ); -cmdline_parse_token_num_t cmd_flow_director_tunnel_id_value = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result, - tunnel_id_value,UINT32 );cmdline_parse_token_string_t cmd_flow_director_packet = TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, packet,"packet" );@@ -10699,208 +10318,6 @@ cmdline_parse_token_string_t
cmd_flow_director_filepath=app/test-pmd/cmdline.c +0
-4TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result, filepath, NULL); -cmdline_parse_inst_t cmd_add_del_ip_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data =NULL , - .help_str = "flow_director_filter <port_id> mode IP add|del|updateflow"
app/test-pmd/cmdline.c +0
-5-" ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|" -"ipv6-other|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|" -"l2_payload src <src_ip> dst <dst_ip> tos <tos_value> " -"proto <proto_value> ttl <ttl_value> vlan <vlan_value> " - "flexbytes <flexbyte_values> drop|fw <pf_vf> queue<
queue_id> "app/test-pmd/cmdline.c +0
-141- "fd_id <fd_id_value>: " - "Add or delete an ip flow director entry on NIC", - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_ip, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_flow, - (void *)&cmd_flow_director_flow_type, - (void *)&cmd_flow_director_src, - (void *)&cmd_flow_director_ip_src, - (void *)&cmd_flow_director_dst, - (void *)&cmd_flow_director_ip_dst, - (void *)&cmd_flow_director_tos, - (void *)&cmd_flow_director_tos_value, - (void *)&cmd_flow_director_proto, - (void *)&cmd_flow_director_proto_value, - (void *)&cmd_flow_director_ttl, - (void *)&cmd_flow_director_ttl_value, - (void *)&cmd_flow_director_vlan, - (void *)&cmd_flow_director_vlan_value, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_pf_vf, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, - NULL, - }, -}; - -cmdline_parse_inst_t cmd_add_del_udp_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data = NULL, - .help_str = "flow_director_filter ... : Add or delete an udp/tcp flow " - "director entry on NIC", - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_ip, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_flow, - (void *)&cmd_flow_director_flow_type, - (void *)&cmd_flow_director_src, - (void *)&cmd_flow_director_ip_src, - (void *)&cmd_flow_director_port_src, - (void *)&cmd_flow_director_dst, - (void *)&cmd_flow_director_ip_dst, - (void *)&cmd_flow_director_port_dst, - (void *)&cmd_flow_director_tos, - (void *)&cmd_flow_director_tos_value, - (void *)&cmd_flow_director_ttl, - (void *)&cmd_flow_director_ttl_value, - (void *)&cmd_flow_director_vlan, - (void *)&cmd_flow_director_vlan_value, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_pf_vf, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, - NULL, - }, -}; - -cmdline_parse_inst_t cmd_add_del_sctp_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data = NULL, - .help_str = "flow_director_filter ... : Add or delete a sctp flow " - "director entry on NIC", - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_ip, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_flow, - (void *)&cmd_flow_director_flow_type, - (void *)&cmd_flow_director_src, - (void *)&cmd_flow_director_ip_src, - (void *)&cmd_flow_director_port_src, - (void *)&cmd_flow_director_dst, - (void *)&cmd_flow_director_ip_dst, - (void *)&cmd_flow_director_port_dst, - (void *)&cmd_flow_director_verify_tag, - (void *)&cmd_flow_director_verify_tag_value, - (void *)&cmd_flow_director_tos, - (void *)&cmd_flow_director_tos_value, - (void *)&cmd_flow_director_ttl, - (void *)&cmd_flow_director_ttl_value, - (void *)&cmd_flow_director_vlan, - (void *)&cmd_flow_director_vlan_value, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_pf_vf, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, - NULL, - }, -}; - -cmdline_parse_inst_t cmd_add_del_l2_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data = NULL, - .help_str = "flow_director_filter ... : Add or delete a L2 flow " - "director entry on NIC", - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_ip, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_flow, - (void *)&cmd_flow_director_flow_type, - (void *)&cmd_flow_director_ether, - (void *)&cmd_flow_director_ether_type, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_pf_vf, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, - NULL, - }, -}; - -cmdline_parse_inst_t cmd_add_del_mac_vlan_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data = NULL, - .help_str = "flow_director_filter ... : Add or delete a MAC VLAN flow"
app/test-pmd/cmdline.c +1
-97- "director entry on NIC", - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_mac_vlan, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_mac, - (void *)&cmd_flow_director_mac_addr, - (void *)&cmd_flow_director_vlan, - (void *)&cmd_flow_director_vlan_value, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, - NULL, - }, -}; - -cmdline_parse_inst_t cmd_add_del_tunnel_flow_director = { - .f = cmd_flow_director_filter_parsed, - .data =NULL , - .help_str ="flow_director_filter ... : Add or delete a tunnel flow " -"director entry on NIC" , - .tokens = { - (void *)&cmd_flow_director_filter, - (void *)&cmd_flow_director_port_id, - (void *)&cmd_flow_director_mode, - (void *)&cmd_flow_director_mode_tunnel, - (void *)&cmd_flow_director_ops, - (void *)&cmd_flow_director_mac, - (void *)&cmd_flow_director_mac_addr, - (void *)&cmd_flow_director_vlan, - (void *)&cmd_flow_director_vlan_value, - (void *)&cmd_flow_director_tunnel, - (void *)&cmd_flow_director_tunnel_type, - (void *)&cmd_flow_director_tunnel_id, - (void *)&cmd_flow_director_tunnel_id_value, - (void *)&cmd_flow_director_flexbytes, - (void *)&cmd_flow_director_flexbytes_value, - (void *)&cmd_flow_director_drop, - (void *)&cmd_flow_director_queue, - (void *)&cmd_flow_director_queue_id, - (void *)&cmd_flow_director_fd_id, - (void *)&cmd_flow_director_fd_id_value, -NULL , - }, -}; -cmdline_parse_inst_t cmd_add_del_raw_flow_director = { .f = cmd_flow_director_filter_parsed, .data =NULL ,@@ -10925,51 +10342,7 @@ cmdline_parse_inst_t cmd_add_del_raw_flow_director = { }, }; -struct cmd_flush_flow_director_result { -cmdline_fixed_string_t flush_flow_director; -portid_t port_id; -}; - -cmdline_parse_token_string_t cmd_flush_flow_director_flush = - TOKEN_STRING_INITIALIZER(struct cmd_flush_flow_director_result, - flush_flow_director,"flush_flow_director" ); -cmdline_parse_token_num_t cmd_flush_flow_director_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_flush_flow_director_result, - port_id,UINT16 ); - -static void -cmd_flush_flow_director_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_flow_director_result *res = parsed_result; -int ret =0 ; - - ret =rte_eth_dev_filter_supported (res->port_id, RTE_ETH_FILTER_FDIR); -if (ret <0 ) { -printf ("flow director is not supported on port %u.\n" , - res->port_id); -return ; - } - - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_FLUSH ,NULL ); -if (ret <0 ) -printf ("flow director table flushing error: (%s)\n" , -strerror (-ret)); -} - -cmdline_parse_inst_t cmd_flush_flow_director = { - .f = cmd_flush_flow_director_parsed, - .data =NULL , - .help_str ="flush_flow_director <port_id>: " -"Flush all flow director entries of a device on NIC" , - .tokens = { - (void *)&cmd_flush_flow_director_flush, - (void *)&cmd_flush_flow_director_port_id, -NULL , - }, -}; +#endif /* RTE_LIBRTE_I40E_PMD */ /* *** deal with flow director mask *** */
structcmd_flow_director_mask_result{app/test-pmd/cmdline.c +0
-31@@ -11411,132 +10784,6 @@ cmdline_parse_inst_t cmd_set_flow_director_flex_payload = {/* Generic flow interface command. */ extern cmdline_parse_inst_t cmd_flow; -/* *** Classification Filters Control *** */ - -static enum rte_eth_input_set_field -str2inset (char *string) -{ -uint16_t i; - -static const struct { -char str[32 ]; -enum rte_eth_input_set_field inset; - } inset_table[] = { - {"ethertype" ,RTE_ETH_INPUT_SET_L2_ETHERTYPE }, - {"ovlan" ,RTE_ETH_INPUT_SET_L2_OUTER_VLAN }, - {"ivlan" ,RTE_ETH_INPUT_SET_L2_INNER_VLAN }, - {"src-ipv4" ,RTE_ETH_INPUT_SET_L3_SRC_IP4 }, - {"dst-ipv4" ,RTE_ETH_INPUT_SET_L3_DST_IP4 }, - {"ipv4-tos" ,RTE_ETH_INPUT_SET_L3_IP4_TOS }, - {"ipv4-proto" ,RTE_ETH_INPUT_SET_L3_IP4_PROTO }, - {"ipv4-ttl" ,RTE_ETH_INPUT_SET_L3_IP4_TTL }, - {"src-ipv6" ,RTE_ETH_INPUT_SET_L3_SRC_IP6 }, - {"dst-ipv6" ,RTE_ETH_INPUT_SET_L3_DST_IP6 }, - {"ipv6-tc" ,RTE_ETH_INPUT_SET_L3_IP6_TC }, - {"ipv6-next-header" , RTE_ETH_INPUT_SET_L3_IP6_NEXT_HEADER}, - {"ipv6-hop-limits" , RTE_ETH_INPUT_SET_L3_IP6_HOP_LIMITS}, - {"udp-src-port" ,RTE_ETH_INPUT_SET_L4_UDP_SRC_PORT }, - {"udp-dst-port" ,RTE_ETH_INPUT_SET_L4_UDP_DST_PORT }, - {"tcp-src-port" ,RTE_ETH_INPUT_SET_L4_TCP_SRC_PORT }, - {"tcp-dst-port" ,RTE_ETH_INPUT_SET_L4_TCP_DST_PORT }, - {"sctp-src-port" ,RTE_ETH_INPUT_SET_L4_SCTP_SRC_PORT }, - {"sctp-dst-port" ,RTE_ETH_INPUT_SET_L4_SCTP_DST_PORT }, - {"sctp-veri-tag" ,
RTE_ETH_INPUT_SET_L4_SCTP_VERIFICATION_TAG},app/test-pmd/cmdline.c +0
-3- {"udp-key", RTE_ETH_INPUT_SET_TUNNEL_L4_UDP_KEY}, - {"gre-key", RTE_ETH_INPUT_SET_TUNNEL_GRE_KEY}, - {"fld-1st",
RTE_ETH_INPUT_SET_FLEX_PAYLOAD_1ST_WORD},app/test-pmd/cmdline.c +0
-1- {"fld-2nd",
RTE_ETH_INPUT_SET_FLEX_PAYLOAD_2ND_WORD},app/test-pmd/cmdline.c +0
-1- {"fld-3rd",
RTE_ETH_INPUT_SET_FLEX_PAYLOAD_3RD_WORD},app/test-pmd/cmdline.c +0
-1- {"fld-4th",
RTE_ETH_INPUT_SET_FLEX_PAYLOAD_4TH_WORD},app/test-pmd/cmdline.c +0
-1- {"fld-5th",
RTE_ETH_INPUT_SET_FLEX_PAYLOAD_5TH_WORD},app/test-pmd/cmdline.c +0
-1- {"fld-6th",
RTE_ETH_INPUT_SET_FLEX_PAYLOAD_6TH_WORD},app/test-pmd/cmdline.c +0
-1- {"fld-7th",
RTE_ETH_INPUT_SET_FLEX_PAYLOAD_7TH_WORD},app/test-pmd/cmdline.c +0
-1- {"fld-8th",
RTE_ETH_INPUT_SET_FLEX_PAYLOAD_8TH_WORD},app/test-pmd/cmdline.c +2
-93- {"none", RTE_ETH_INPUT_SET_NONE}, - }; - -for (i =0 ; i <RTE_DIM (inset_table); i++) { -if (!strcmp (string, inset_table[i].str)) -return inset_table[i].inset; - } - -return RTE_ETH_INPUT_SET_UNKNOWN ; -} - -/* Set flow director input set */ -struct cmd_set_fdir_input_set_result { -cmdline_fixed_string_t set_fdir_input_set; -portid_t port_id; -cmdline_fixed_string_t flow_type; -cmdline_fixed_string_t inset_field; -cmdline_fixed_string_t select; -}; - -static void -cmd_set_fdir_input_set_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_set_fdir_input_set_result *res = parsed_result; -struct rte_eth_fdir_filter_info info; - -memset (&info,0 ,sizeof (info)); - info.info_type =RTE_ETH_FDIR_FILTER_INPUT_SET_SELECT ; - info.info.input_set_conf.flow_type =str2flowtype (res->flow_type); - info.info.input_set_conf.field[0 ] =str2inset (res->inset_field); - info.info.input_set_conf.inset_size =1 ; -if (!strcmp (res->select,"select" )) - info.info.input_set_conf.op =RTE_ETH_INPUT_SET_SELECT ; -else if (!strcmp (res->select,"add" )) - info.info.input_set_conf.op =RTE_ETH_INPUT_SET_ADD ; -rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_SET , &info); -} - -cmdline_parse_token_string_t cmd_set_fdir_input_set_cmd = - TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result, - set_fdir_input_set,"set_fdir_input_set" ); -cmdline_parse_token_num_t cmd_set_fdir_input_set_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_set_fdir_input_set_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_set_fdir_input_set_flow_type = - TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result, - flow_type, -"ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#" -"ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#ipv6-other#l2_payload" ); -cmdline_parse_token_string_t cmd_set_fdir_input_set_field = - TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result, - inset_field, -"ivlan#ethertype#src-ipv4#dst-ipv4#src-ipv6#dst-ipv6#" -"ipv4-tos#ipv4-proto#ipv4-ttl#ipv6-tc#ipv6-next-header#" -"ipv6-hop-limits#udp-src-port#udp-dst-port#" -"tcp-src-port#tcp-dst-port#sctp-src-port#sctp-dst-port#" -"sctp-veri-tag#none" ); -cmdline_parse_token_string_t cmd_set_fdir_input_set_select = - TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result, - select,"select#add" ); - -cmdline_parse_inst_t cmd_set_fdir_input_set = { - .f = cmd_set_fdir_input_set_parsed, - .data =NULL , - .help_str ="set_fdir_input_set <port_id> " -"ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|" -"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload " -"ivlan|ethertype|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|" -"ipv4-tos|ipv4-proto|ipv4-ttl|ipv6-tc|ipv6-next-header|" -"ipv6-hop-limits|udp-src-port|udp-dst-port|" -"tcp-src-port|tcp-dst-port|sctp-src-port|sctp-dst-port|" -"sctp-veri-tag|none select|add" , - .tokens = { - (void *)&cmd_set_fdir_input_set_cmd, - (void *)&cmd_set_fdir_input_set_port_id, - (void *)&cmd_set_fdir_input_set_flow_type, - (void *)&cmd_set_fdir_input_set_field, - (void *)&cmd_set_fdir_input_set_select, -NULL , - }, -}; -/* *** ADD/REMOVE A MULTICAST MAC ADDRESS TO/FROM A PORT *** */ struct cmd_mcast_addr_result {cmdline_fixed_string_t mcast_addr_cmd;@@ -18406,20 +17653,14 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_config_rss_hash_key, (cmdline_parse_inst_t *)&cmd_dump, (cmdline_parse_inst_t *)&cmd_dump_one, - (cmdline_parse_inst_t *)&cmd_add_del_ip_flow_director, - (cmdline_parse_inst_t *)&cmd_add_del_udp_flow_director, - (cmdline_parse_inst_t *)&cmd_add_del_sctp_flow_director, - (cmdline_parse_inst_t *)&cmd_add_del_l2_flow_director, - (cmdline_parse_inst_t *)&cmd_add_del_mac_vlan_flow_director, - (cmdline_parse_inst_t *)&cmd_add_del_tunnel_flow_director, +#ifdef RTE_LIBRTE_I40E_PMD (cmdline_parse_inst_t *)&cmd_add_del_raw_flow_director, - (cmdline_parse_inst_t *)&cmd_flush_flow_director, +#endif (cmdline_parse_inst_t *)&cmd_set_flow_director_ip_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_mac_vlan_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_tunnel_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_flex_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_flex_payload, - (cmdline_parse_inst_t *)&cmd_set_fdir_input_set, (cmdline_parse_inst_t *)&cmd_flow, (cmdline_parse_inst_t *)&cmd_show_port_meter_cap, (cmdline_parse_inst_t *)&cmd_add_port_meter_profile_srtcm,app/test-pmd/config.c +2
-0@@ -4711,6 +4711,8 @@ flowtype_to_str(uint16_t flow_type)return NULL ; } +#if defined(RTE_LIBRTE_I40E_PMD ) || defined(RTE_LIBRTE_IXGBE_PMD ) +static inline void print_fdir_flex_mask (struct rte_eth_fdir_flex_conf *flex_conf,uint32_t num){
app/test-pmd/config.c +3
-10@@ -4750,16 +4752,7 @@ static int get_fdir_info(portid_t port_id, struct rte_eth_fdir_info *fdir_info, struct rte_eth_fdir_stats *fdir_stat) { - int ret; - - ret =rte_eth_dev_filter_supported (port_id,RTE_ETH_FILTER_FDIR ); -if (!ret) { -rte_eth_dev_filter_ctrl (port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_INFO , fdir_info); -rte_eth_dev_filter_ctrl (port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_STATS , fdir_stat); -return 0 ; - } + int ret = -ENOTSUP; #ifdef RTE_LIBRTE_I40E_PMD if (ret == -ENOTSUP) {@@ -4857,6 +4850,8 @@ fdir_get_infos(portid_t port_id) fdir_stats_border, fdir_stats_border); } +#endif /* RTE_LIBRTE_I40E_PMD || RTE_LIBRTE_IXGBE_PMD */ +void fdir_set_flex_mask (portid_t port_id,struct rte_eth_fdir_flex_mask *cfg) {app/test-pmd/testpmd.h +2
-0@@ -921,7 +921,9 @@ int all_ports_stopped(void);int port_is_stopped (portid_t port_id);int port_is_started (portid_t port_id);void pmd_test_exit (void ); +#if defined(RTE_LIBRTE_I40E_PMD ) || defined(RTE_LIBRTE_IXGBE_PMD )void fdir_get_infos (portid_t port_id); +#endif void fdir_set_flex_mask (portid_t port_id,struct rte_eth_fdir_flex_mask *cfg); void fdir_set_flex_payload(portid_t port_id,doc/guides/rel_notes/deprecation.rst +2
-2@@ -107,8 +107,8 @@ Deprecation Notices * ethdev: the legacy filter API, including - ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types FDIR, is superseded by the generic flow API (rte_flow) in + ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` + is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.drivers/net/bnxt/bnxt_ethdev.c +0
-84@@ -2987,399 +2987,6 @@ bnxt_tx_descriptor_status_op(void *tx_queue, uint16_t offset)return RTE_ETH_TX_DESC_FULL ; } -static int -bnxt_parse_fdir_filter (struct bnxt *bp, -struct rte_eth_fdir_filter *fdir, -struct bnxt_filter_info *filter) -{ -enum rte_fdir_mode fdir_mode = - bp->eth_dev->data->dev_conf.fdir_conf.mode; -struct bnxt_vnic_info *vnic0, *vnic; -struct bnxt_filter_info *filter1; -uint32_t en =0 ; -int i; - -if (fdir_mode ==RTE_FDIR_MODE_PERFECT_TUNNEL ) -return -EINVAL ; - - filter->l2_ovlan = fdir->input.flow_ext.vlan_tci; - en |=EM_FLOW_ALLOC_INPUT_EN_OVLAN_VID ; - -switch (fdir->input.flow_type) { -case RTE_ETH_FLOW_IPV4 : -case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER : -/* FALLTHROUGH */ - filter->src_ipaddr[0 ] = fdir->input.flow.ip4_flow.src_ip; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR ; - filter->dst_ipaddr[0 ] = fdir->input.flow.ip4_flow.dst_ip; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR ; - filter->ip_protocol = fdir->input.flow.ip4_flow.proto; - en |=NTUPLE_FLTR_ALLOC_IN_EN_IP_PROTO ; - filter->ip_addr_type = -NTUPLE_FLTR_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 ; - filter->src_ipaddr_mask[0 ] =0xffffffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK ; - filter->dst_ipaddr_mask[0 ] =0xffffffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK ; - filter->ethertype =0x800 ; - filter->enables |=NTUPLE_FLTR_ALLOC_INPUT_EN_ETHERTYPE ; -break ; -case RTE_ETH_FLOW_NONFRAG_IPV4_TCP : - filter->src_port = fdir->input.flow.tcp4_flow.src_port; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_PORT ; - filter->dst_port = fdir->input.flow.tcp4_flow.dst_port; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT ; - filter->dst_port_mask =0xffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT_MASK ; - filter->src_port_mask =0xffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_PORT_MASK ; - filter->src_ipaddr[0 ] = fdir->input.flow.tcp4_flow.ip.src_ip; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR ; - filter->dst_ipaddr[0 ] = fdir->input.flow.tcp4_flow.ip.dst_ip; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR ; - filter->ip_protocol =6 ; - en |=NTUPLE_FLTR_ALLOC_IN_EN_IP_PROTO ; - filter->ip_addr_type = -NTUPLE_FLTR_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 ; - filter->src_ipaddr_mask[0 ] =0xffffffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK ; - filter->dst_ipaddr_mask[0 ] =0xffffffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK ; - filter->ethertype =0x800 ; - filter->enables |=NTUPLE_FLTR_ALLOC_INPUT_EN_ETHERTYPE ; -break ; -case RTE_ETH_FLOW_NONFRAG_IPV4_UDP : - filter->src_port = fdir->input.flow.udp4_flow.src_port; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_PORT ; - filter->dst_port = fdir->input.flow.udp4_flow.dst_port; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT ; - filter->dst_port_mask =0xffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT_MASK ; - filter->src_port_mask =0xffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_PORT_MASK ; - filter->src_ipaddr[0 ] = fdir->input.flow.udp4_flow.ip.src_ip; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR ; - filter->dst_ipaddr[0 ] = fdir->input.flow.udp4_flow.ip.dst_ip; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR ; - filter->ip_protocol =17 ; - en |=NTUPLE_FLTR_ALLOC_IN_EN_IP_PROTO ; - filter->ip_addr_type = -NTUPLE_FLTR_ALLOC_INPUT_IP_ADDR_TYPE_IPV4 ; - filter->src_ipaddr_mask[0 ] =0xffffffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK ; - filter->dst_ipaddr_mask[0 ] =0xffffffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK ; - filter->ethertype =0x800 ; - filter->enables |=
NTUPLE_FLTR_ALLOC_INPUT_EN_ETHERTYPE;drivers/net/bnxt/bnxt_ethdev.c +0
-20-break ; -case RTE_ETH_FLOW_IPV6 : -case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER : -/* FALLTHROUGH */ - filter->ip_addr_type = -NTUPLE_FLTR_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 ; - filter->ip_protocol = fdir->input.flow.ipv6_flow.proto; - en |=NTUPLE_FLTR_ALLOC_IN_EN_IP_PROTO ; -rte_memcpy (filter->src_ipaddr, - fdir->input.flow.ipv6_flow.src_ip,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR ; -rte_memcpy (filter->dst_ipaddr, - fdir->input.flow.ipv6_flow.dst_ip,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR ; -memset (filter->dst_ipaddr_mask,0xff ,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK ; -memset (filter->src_ipaddr_mask,0xff ,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK ; - filter->ethertype =0x86dd ; - filter->enables |=
NTUPLE_FLTR_ALLOC_INPUT_EN_ETHERTYPE;drivers/net/bnxt/bnxt_ethdev.c +0
-26-break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_TCP : - filter->src_port = fdir->input.flow.tcp6_flow.src_port; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_PORT ; - filter->dst_port = fdir->input.flow.tcp6_flow.dst_port; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT ; - filter->dst_port_mask =0xffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT_MASK ; - filter->src_port_mask =0xffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_PORT_MASK ; - filter->ip_addr_type = -NTUPLE_FLTR_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 ; - filter->ip_protocol = fdir->input.flow.tcp6_flow.ip.proto; - en |=NTUPLE_FLTR_ALLOC_IN_EN_IP_PROTO ; -rte_memcpy (filter->src_ipaddr, - fdir->input.flow.tcp6_flow.ip.src_ip,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR ; -rte_memcpy (filter->dst_ipaddr, - fdir->input.flow.tcp6_flow.ip.dst_ip,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR ; -memset (filter->dst_ipaddr_mask,0xff ,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK ; -memset (filter->src_ipaddr_mask,0xff ,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK ; - filter->ethertype =0x86dd ; - filter->enables |=
NTUPLE_FLTR_ALLOC_INPUT_EN_ETHERTYPE;drivers/net/bnxt/bnxt_ethdev.c +0
-26-break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_UDP : - filter->src_port = fdir->input.flow.udp6_flow.src_port; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_PORT ; - filter->dst_port = fdir->input.flow.udp6_flow.dst_port; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT ; - filter->dst_port_mask =0xffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT_MASK ; - filter->src_port_mask =0xffff ; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_PORT_MASK ; - filter->ip_addr_type = -NTUPLE_FLTR_ALLOC_INPUT_IP_ADDR_TYPE_IPV6 ; - filter->ip_protocol = fdir->input.flow.udp6_flow.ip.proto; - en |=NTUPLE_FLTR_ALLOC_IN_EN_IP_PROTO ; -rte_memcpy (filter->src_ipaddr, - fdir->input.flow.udp6_flow.ip.src_ip,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR ; -rte_memcpy (filter->dst_ipaddr, - fdir->input.flow.udp6_flow.ip.dst_ip,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR ; -memset (filter->dst_ipaddr_mask,0xff ,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK ; -memset (filter->src_ipaddr_mask,0xff ,16 ); - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK ; - filter->ethertype =0x86dd ; - filter->enables |=
NTUPLE_FLTR_ALLOC_INPUT_EN_ETHERTYPE;drivers/net/bnxt/bnxt_ethdev.c +0
-11-break ; -case RTE_ETH_FLOW_L2_PAYLOAD : - filter->ethertype = fdir->input.flow.l2_flow.ether_type; - en |=NTUPLE_FLTR_ALLOC_INPUT_EN_ETHERTYPE ; -break ; -case RTE_ETH_FLOW_VXLAN : -if (fdir->action.behavior ==RTE_ETH_FDIR_REJECT ) -return -EINVAL ; - filter->vni = fdir->input.flow.tunnel_flow.tunnel_id; - filter->tunnel_type = -CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN;drivers/net/bnxt/bnxt_ethdev.c +0
-1- en |=
HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE;drivers/net/bnxt/bnxt_ethdev.c +0
-7-break ; -case RTE_ETH_FLOW_NVGRE : -if (fdir->action.behavior ==RTE_ETH_FDIR_REJECT ) -return -EINVAL ; - filter->vni = fdir->input.flow.tunnel_flow.tunnel_id; - filter->tunnel_type = -CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_NVGRE;drivers/net/bnxt/bnxt_ethdev.c +0
-1- en |=
HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_TUNNEL_TYPE;drivers/net/bnxt/bnxt_ethdev.c +0
-20-break ; -case RTE_ETH_FLOW_UNKNOWN : -case RTE_ETH_FLOW_RAW : -case RTE_ETH_FLOW_FRAG_IPV4 : -case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP : -case RTE_ETH_FLOW_FRAG_IPV6 : -case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP : -case RTE_ETH_FLOW_IPV6_EX : -case RTE_ETH_FLOW_IPV6_TCP_EX : -case RTE_ETH_FLOW_IPV6_UDP_EX : -case RTE_ETH_FLOW_GENEVE : -/* FALLTHROUGH */ -default : -return -EINVAL ; - } - - vnic0 =BNXT_GET_DEFAULT_VNIC (bp); - vnic = &bp->vnic_info[fdir->action.rx_queue]; -if (vnic ==NULL ) { - PMD_DRV_LOG(ERR, "Invalid queue %d\n", fdir-Quoted 1 line
action.rx_queue);
drivers/net/bnxt/bnxt_ethdev.c +0
-6-return -EINVAL ; - } - -if (fdir_mode ==RTE_FDIR_MODE_PERFECT_MAC_VLAN ) { - rte_memcpy(filter->dst_macaddr, - fdir-Quoted 1 line
input.flow.mac_vlan_flow.mac_addr.addr_bytes, 6);
drivers/net/bnxt/bnxt_ethdev.c +0
-1- en |=
NTUPLE_FLTR_ALLOC_INPUT_EN_DST_MACADDR;drivers/net/bnxt/bnxt_ethdev.c +0
-4- } - -if (fdir->action.behavior ==RTE_ETH_FDIR_REJECT ) { - filter->flags =
HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_FLAGS_DROP;drivers/net/bnxt/bnxt_ethdev.c +0
-15- filter1 =STAILQ_FIRST (&vnic0->filter); -//filter1 = bnxt_get_l2_filter(bp, filter, vnic0); - }else { - filter->dst_id = vnic->fw_vnic_id; -for (i =0 ; i <RTE_ETHER_ADDR_LEN ; i++) -if (filter->dst_macaddr[i] ==0x00 ) - filter1 =STAILQ_FIRST (&vnic0->filter); -else - filter1 =bnxt_get_l2_filter (bp, filter, vnic); - } - -if (filter1 ==NULL ) -return -EINVAL ; - - en |=
HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_L2_FILTER_ID;drivers/net/bnxt/bnxt_ethdev.c +0
-44- filter->fw_l2_filter_id = filter1->fw_l2_filter_id; - - filter->enables = en; - - return 0; -} - -static struct bnxt_filter_info * -bnxt_match_fdir(struct bnxt *bp, struct bnxt_filter_info *nf, - struct bnxt_vnic_info **mvnic) -{ - struct bnxt_filter_info *mf = NULL; - int i; - - for (i = bp->nr_vnics - 1; i >= 0; i--) { - struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; - - STAILQ_FOREACH(mf, &vnic->filter, next) { - if (mf->filter_type == nf->filter_type && - mf->flags == nf->flags && - mf->src_port == nf->src_port && - mf->src_port_mask == nf->src_port_mask && - mf->dst_port == nf->dst_port && - mf->dst_port_mask == nf->dst_port_mask && - mf->ip_protocol == nf->ip_protocol && - mf->ip_addr_type == nf->ip_addr_type && - mf->ethertype == nf->ethertype && - mf->vni == nf->vni && - mf->tunnel_type == nf->tunnel_type && - mf->l2_ovlan == nf->l2_ovlan && - mf->l2_ovlan_mask == nf->l2_ovlan_mask && - mf->l2_ivlan == nf->l2_ivlan && - mf->l2_ivlan_mask == nf->l2_ivlan_mask && - !memcmp(mf->l2_addr, nf->l2_addr, - RTE_ETHER_ADDR_LEN) && - !memcmp(mf->l2_addr_mask, nf->l2_addr_mask, - RTE_ETHER_ADDR_LEN) && - !memcmp(mf->src_macaddr, nf->src_macaddr, - RTE_ETHER_ADDR_LEN) && - !memcmp(mf->dst_macaddr, nf->dst_macaddr, - RTE_ETHER_ADDR_LEN) && - !memcmp(mf->src_ipaddr, nf->src_ipaddr, - sizeof(nf->src_ipaddr)) && - !memcmp(mf->src_ipaddr_mask, nf-Quoted 1 line
src_ipaddr_mask,drivers/net/bnxt/bnxt_ethdev.c +0
-4- sizeof(nf->src_ipaddr_mask)) && - !memcmp (mf->dst_ipaddr, nf->dst_ipaddr, -sizeof (nf->dst_ipaddr)) && - !memcmp(mf->dst_ipaddr_mask, nf-Quoted 1 line
dst_ipaddr_mask,drivers/net/bnxt/bnxt_ethdev.c +0
-52- sizeof(nf->dst_ipaddr_mask))) { -if (mvnic) - *mvnic = vnic; -return mf; - } - } - } -return NULL ; -} - -static int -bnxt_fdir_filter (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg) -{ -struct bnxt *bp = dev->data->dev_private; -struct rte_eth_fdir_filter *fdir = (struct rte_eth_fdir_filter *)arg; -struct bnxt_filter_info *filter, *match; -struct bnxt_vnic_info *vnic, *mvnic; -int ret =0 , i; - -if (filter_op ==RTE_ETH_FILTER_NOP ) -return 0 ; - -if (arg ==NULL && filter_op !=RTE_ETH_FILTER_FLUSH ) -return -EINVAL ; - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : -case RTE_ETH_FILTER_DELETE : -/* FALLTHROUGH */ - filter =bnxt_get_unused_filter (bp); -if (filter ==NULL ) { -PMD_DRV_LOG (ERR , -"Not enough resources for a new flow.\n" ); -return -ENOMEM ; - } - - ret =bnxt_parse_fdir_filter (bp, fdir, filter); -if (ret !=0 ) - goto free_filter; - filter->filter_type =HWRM_CFA_NTUPLE_FILTER ; - -if (fdir->action.behavior ==RTE_ETH_FDIR_REJECT ) - vnic = &bp->vnic_info[0 ]; -else - vnic = &bp->vnic_info[fdir->action.rx_queue]; - - match =bnxt_match_fdir (bp, filter, &mvnic); -if (match !=NULL && filter_op ==RTE_ETH_FILTER_ADD ) { -if (match->dst_id == vnic->fw_vnic_id) { - PMD_DRV_LOG(ERR, "Flow alreadyexists.\n");
drivers/net/bnxt/bnxt_ethdev.c +0
-6- ret = -EEXIST ; - goto free_filter; - }else { - match->dst_id = vnic->fw_vnic_id; - ret = bnxt_hwrm_set_ntuple_filter(bp, - match-Quoted 1 line
dst_id,drivers/net/bnxt/bnxt_ethdev.c +0
-4- match); -STAILQ_REMOVE (&mvnic->filter, match, - bnxt_filter_info, next); - STAILQ_INSERT_TAIL(&vnic->filter, match,next);
drivers/net/bnxt/bnxt_ethdev.c +0
-2- PMD_DRV_LOG(ERR, - "Filter with matching patternexist\n");
drivers/net/bnxt/bnxt_ethdev.c +0
-46-PMD_DRV_LOG (ERR , -"Updated it to new destination q\n" ); - goto free_filter; - } - } -if (match ==NULL && filter_op ==RTE_ETH_FILTER_DELETE ) { -PMD_DRV_LOG (ERR ,"Flow does not exist.\n" ); - ret = -ENOENT ; - goto free_filter; - } - -if (filter_op ==RTE_ETH_FILTER_ADD ) { - ret =bnxt_hwrm_set_ntuple_filter (bp, - filter->dst_id, - filter); -if (ret) - goto free_filter; -STAILQ_INSERT_TAIL (&vnic->filter, filter, next); - }else { - ret =bnxt_hwrm_clear_ntuple_filter (bp, match); -STAILQ_REMOVE (&vnic->filter, match, - bnxt_filter_info, next); -bnxt_free_filter (bp, match); -bnxt_free_filter (bp, filter); - } -break ; -case RTE_ETH_FILTER_FLUSH : -for (i = bp->nr_vnics -1 ; i >=0 ; i--) { -struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; - - STAILQ_FOREACH(filter, &vnic->filter, next) { -if (filter->filter_type == -HWRM_CFA_NTUPLE_FILTER ) { - ret = -bnxt_hwrm_clear_ntuple_filter (bp, - filter); -STAILQ_REMOVE (&vnic->filter, filter, - bnxt_filter_info, next); - } - } - } -return ret; -case RTE_ETH_FILTER_UPDATE : -case RTE_ETH_FILTER_STATS : -case RTE_ETH_FILTER_INFO : - PMD_DRV_LOG(ERR, "operation %u not implemented",
filter_op);drivers/net/bnxt/bnxt_ethdev.c +0
-16-break ; -default : -PMD_DRV_LOG (ERR ,"unknown operation %u" , filter_op); - ret = -EINVAL ; -break ; - } -return ret; - -free_filter: -bnxt_free_filter (bp, filter); -return ret; -} - int bnxt_filter_ctrl_op(struct rte_eth_dev *dev, enum rte_filter_type filter_type,@@ -3409,9 +3016,6 @@ bnxt_filter_ctrl_op(struct rte_eth_dev *dev,return ret;switch (filter_type) { -case RTE_ETH_FILTER_FDIR : - ret =bnxt_fdir_filter (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_GENERIC :if (filter_op !=RTE_ETH_FILTER_GET )return -EINVAL ;drivers/net/enic/enic.h +0
-7@@ -394,12 +394,6 @@ enic_ring_incr(uint32_t n_descriptors, uint32_t idx) }int dev_is_enic (struct rte_eth_dev *dev); -void enic_fdir_stats_get (struct enic *enic, -struct rte_eth_fdir_stats *stats); -int enic_fdir_add_fltr (struct enic *enic, -struct rte_eth_fdir_filter *params); -int enic_fdir_del_fltr (struct enic *enic, -struct rte_eth_fdir_filter *params);void enic_free_wq (void *txq);int enic_alloc_intr_resources (struct enic *enic);int enic_setup_finish (struct enic *enic);@@ -464,7 +458,6 @@ bool enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev);void enic_pick_rx_handler (struct rte_eth_dev *eth_dev);void enic_pick_tx_handler (struct rte_eth_dev *eth_dev);void enic_fdir_info (struct enic *enic); -void enic_fdir_info_get (struct enic *enic,struct rte_eth_fdir_info *stats);int enic_vf_representor_init (struct rte_eth_dev *eth_dev,void *init_params);int
enic_vf_representor_uninit(struct rte_eth_dev *ethdev); intenic_fm_allocate_switch_domain(struct enic *pf);drivers/net/enic/enic_clsf.c +0
-168@@ -42,17 +42,6 @@ static void copy_fltr_v2(struct filter_v2 *fltr,const struct rte_eth_fdir_input *input, const struct rte_eth_fdir_masks *masks); -void enic_fdir_stats_get (struct enic *enic,struct rte_eth_fdir_stats *stats) -{ - *stats = enic->fdir.stats; -} - -void enic_fdir_info_get (struct enic *enic,struct rte_eth_fdir_info *info) -{ - info->mode = (enum rte_fdir_mode )enic->fdir.modes; - info->flow_types_mask[0 ] = enic->fdir.types_mask; -} -void enic_fdir_info (struct enic *enic) { enic->fdir.modes = (uint32_t )RTE_FDIR_MODE_PERFECT ;@@ -305,163 +294,6 @@ copy_fltr_v2(struct filter_v2 *fltr, const structrte_eth_fdir_input *input, } } -int enic_fdir_del_fltr (struct enic *enic,struct rte_eth_fdir_filter *params) -{ -int32_t pos; -struct enic_fdir_node *key; -/* See if the key is in the table */ - pos =rte_hash_del_key (enic->fdir.hash, params); -switch (pos) { -case -EINVAL : -case -ENOENT : - enic->fdir.stats.f_remove++; -return -EINVAL ; -default : -/* The entry is present in the table */ - key = enic->fdir.nodes[pos]; - -/* Delete the filter */ -vnic_dev_classifier (enic->vdev,CLSF_DEL , - &key->fltr_id,NULL ,NULL ); -rte_free (key); - enic->fdir.nodes[pos] =NULL ; - enic->fdir.stats.free++; - enic->fdir.stats.remove++; -break ; - } -return 0 ; -} - -int enic_fdir_add_fltr (struct enic *enic,struct rte_eth_fdir_filter *params) -{ -struct enic_fdir_node *key; -struct filter_v2 fltr; -int32_t pos; -uint8_t do_free =0 ; -uint16_t old_fltr_id =0 ; -uint32_t flowtype_supported; -uint16_t flex_bytes; -uint16_t queue; -struct filter_action_v2 action; - -memset (&fltr,0 ,sizeof (fltr)); -memset (&action,0 ,sizeof (action)); - flowtype_supported = enic->fdir.types_mask - & (1 << params->input.flow_type); - - flex_bytes = ((params->input.flow_ext.flexbytes[1 ] <<8 &0xFF00 ) | - (params->input.flow_ext.flexbytes[0 ] &0xFF )); - -if (!enic->fdir.hash || - (params->input.flow_ext.vlan_tci &0xFFF ) || - !flowtype_supported || flex_bytes || - params->action.behavior/* drop */ ) { - enic->fdir.stats.f_add++; -return -ENOTSUP ; - } - -/* Get the enicpmd RQ from the DPDK Rx queue */ - queue =enic_rte_rq_idx_to_sop_idx (params->action.rx_queue); - -if (!enic->rq[queue].in_use) -return -EINVAL ; - -/* See if the key is already there in the table */ - pos =rte_hash_del_key (enic->fdir.hash, params); -switch (pos) { -case -EINVAL : - enic->fdir.stats.f_add++; -return -EINVAL ; -case -ENOENT : -/* Add a new classifier entry */ -if (!enic->fdir.stats.free) { - enic->fdir.stats.f_add++; -return -ENOSPC ; - } - key =rte_zmalloc ("enic_fdir_node" , -sizeof (struct enic_fdir_node ),0 ); -if (!key) { - enic->fdir.stats.f_add++; -return -ENOMEM ; - } -break ; -default : -/* The entry is already present in the table. -* Check if there is a change in queue -*/ - key = enic->fdir.nodes[pos]; - enic->fdir.nodes[pos] =NULL ; -if (unlikely (key->rq_index == queue)) { -/* Nothing to be done */ - enic->fdir.stats.f_add++; - pos =rte_hash_add_key (enic->fdir.hash, params); -if (pos <0 ) { -dev_err (enic,"Add hash key failed\n" ); -return pos; - } - enic->fdir.nodes[pos] = key; -dev_warning (enic, -"FDIR rule is already present\n" ); -return 0 ; - } - -if (likely (enic->fdir.stats.free)) { -/* Add the filter and then delete the old one. -* This is to avoid packets from going into the -* default queue during the window between -* delete and add -*/ - do_free =1 ; - old_fltr_id = key->fltr_id; - }else { -/* No free slots in the classifier. -* Delete the filter and add the modified one later -*/ -vnic_dev_classifier (enic->vdev,CLSF_DEL , - &key->fltr_id,NULL ,NULL ); - enic->fdir.stats.free++; - } - -break ; - } - - key->filter = *params; - key->rq_index = queue; - - enic->fdir.copy_fltr_fn (&fltr, ¶ms->input, - &enic->rte_dev->data- >dev_conf.fdir_conf.mask); - action.type =FILTER_ACTION_RQ_STEERING ; - action.rq_idx = queue; - -if (!vnic_dev_classifier (enic->vdev,CLSF_ADD , &queue, &fltr, - &action)) { - key->fltr_id = queue; - }else { -dev_err (enic,"Add classifier entry failed\n" ); - enic->fdir.stats.f_add++; -rte_free (key); -return -1 ; - } - -if (do_free) -vnic_dev_classifier (enic->vdev,CLSF_DEL , &old_fltr_id,NULL , -NULL ); -else { - enic->fdir.stats.free--; - enic->fdir.stats.add++; - } - - pos =rte_hash_add_key (enic->fdir.hash, params); -if (pos <0 ) { - enic->fdir.stats.f_add++; -dev_err (enic,"Add hash key failed\n" ); -return pos; - } - - enic->fdir.nodes[pos] = key; -return 0 ; -} -void enic_clsf_destroy (struct enic *enic){
drivers/net/enic/enic_clsf.c +0
-0uint32_t index;drivers/net/enic/enic_ethdev.c +0
-48@@ -72,51 +72,6 @@ static const struct vic_speed_capa {RTE_LOG_REGISTER (enic_pmd_logtype, pmd.net.enic,INFO ); -static int -enicpmd_fdir_ctrl_func (struct rte_eth_dev *eth_dev, -enum rte_filter_op filter_op,void *arg) -{ -struct enic *enic =pmd_priv (eth_dev); -int ret =0 ; - -ENICPMD_FUNC_TRACE (); -if (filter_op ==RTE_ETH_FILTER_NOP ) -return 0 ; - -if (arg ==NULL && filter_op !=RTE_ETH_FILTER_FLUSH ) -return -EINVAL ; - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : -case RTE_ETH_FILTER_UPDATE : - ret =enic_fdir_add_fltr (enic, - (struct rte_eth_fdir_filter *)arg); -break ; - -case RTE_ETH_FILTER_DELETE : - ret =enic_fdir_del_fltr (enic, - (struct rte_eth_fdir_filter *)arg); -break ; - -case RTE_ETH_FILTER_STATS : -enic_fdir_stats_get (enic, (struct rte_eth_fdir_stats *)arg); -break ; - -case RTE_ETH_FILTER_FLUSH : -dev_warning (enic,"unsupported operation %u" , filter_op); - ret = -ENOTSUP ; -break ; -case RTE_ETH_FILTER_INFO : -enic_fdir_info_get (enic, (struct rte_eth_fdir_info *)arg); -break ; -default : -dev_err (enic,"unknown operation %u" , filter_op); - ret = -EINVAL ; -break ; - } -return ret; -} - static int enicpmd_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,@@ -143,9 +98,6 @@ enicpmd_dev_filter_ctrl(struct rte_eth_dev *dev,else *(const void **)arg = &enic_flow_ops;break ; -case RTE_ETH_FILTER_FDIR : - ret =enicpmd_fdir_ctrl_func (dev, filter_op, arg); -break ;default :dev_warning (enic,"Filter type (%d) not supported" , filter_type);drivers/net/i40e/i40e_ethdev.c +0
-73@@ -9685,89 +9685,6 @@ i40e_hash_filter_inset_select(struct i40e_hw *hw,return 0 ; } -int -i40e_fdir_filter_inset_select (struct i40e_pf *pf, -struct rte_eth_input_set_conf *conf) -{ -struct i40e_hw *hw =I40E_PF_TO_HW (pf); -enum i40e_filter_pctype pctype; -uint64_t input_set, inset_reg =0 ; -uint32_t mask_reg[I40E_INSET_MASK_NUM_REG ] = {0 }; -int ret, i, num; - -if (!hw || !conf) { -PMD_DRV_LOG (ERR ,"Invalid pointer" ); -return -EFAULT ; - } -if (conf->op !=RTE_ETH_INPUT_SET_SELECT && - conf->op !=RTE_ETH_INPUT_SET_ADD ) { -PMD_DRV_LOG (ERR ,"Unsupported input set operation" ); -return -EINVAL ; - } - - pctype =i40e_flowtype_to_pctype (pf->adapter, conf->flow_type); - -if (pctype ==I40E_FILTER_PCTYPE_INVALID ) { -PMD_DRV_LOG (ERR ,"invalid flow_type input." ); -return -EINVAL ; - } - - ret =i40e_parse_input_set (&input_set, pctype, conf->field, - conf->inset_size); -if (ret) { -PMD_DRV_LOG (ERR ,"Failed to parse input set" ); -return -EINVAL ; - } - -/* get inset value in register */ - inset_reg =i40e_read_rx_ctl (hw,I40E_PRTQF_FD_INSET (pctype,1 )); - inset_reg <<=I40E_32_BIT_WIDTH ; - inset_reg |=i40e_read_rx_ctl (hw,I40E_PRTQF_FD_INSET (pctype, 0)); - -/* Can not change the inset reg for flex payload for fdir, -* it is done by writing I40E_PRTQF_FD_FLXINSET -* in i40e_set_flex_mask_on_pctype. -*/ -if (conf->op ==RTE_ETH_INPUT_SET_SELECT ) - inset_reg &=I40E_REG_INSET_FLEX_PAYLOAD_WORDS ; -else - input_set |= pf->fdir.input_set[pctype]; - num =i40e_generate_inset_mask_reg (input_set, mask_reg, -I40E_INSET_MASK_NUM_REG ); -if (num <0 ) -return -EINVAL ; -if (pf->support_multi_driver && num >0 ) { -PMD_DRV_LOG (ERR ,"FDIR bit mask is not supported." ); -return -ENOTSUP ; - } - - inset_reg |=i40e_translate_input_set_reg (hw->mac.type, input_set); - -i40e_check_write_reg (hw,I40E_PRTQF_FD_INSET (pctype,0 ), - (uint32_t )(inset_reg &UINT32_MAX )); -i40e_check_write_reg (hw,I40E_PRTQF_FD_INSET (pctype,1 ), - (uint32_t )((inset_reg >> -I40E_32_BIT_WIDTH ) &UINT32_MAX )); - -if (!pf->support_multi_driver) { -for (i =0 ; i < num; i++) -i40e_check_write_global_reg (hw, -I40E_GLQF_FD_MSK (i, pctype), - mask_reg[i]); -/*clear unused mask registers of the pctype */ -for (i = num; i <I40E_INSET_MASK_NUM_REG ; i++) - i40e_check_write_global_reg(hw, - I40E_GLQF_FD_MSK(i,pctype),
drivers/net/i40e/i40e_ethdev.c +0
-13- 0); - }else { -PMD_DRV_LOG (ERR ,"FDIR bit mask is not supported." ); - } -I40E_WRITE_FLUSH (hw); - - pf->fdir.input_set[pctype] = input_set; -return 0 ; -} -/* Convert ethertype filter structure */ static int i40e_ethertype_filter_convert(const struct rte_eth_ethertype_filter *input,@@ -9945,9 +9862,6 @@ i40e_dev_filter_ctrl(struct rte_eth_dev *dev,return -EINVAL ;switch (filter_type) { -case RTE_ETH_FILTER_FDIR : - ret =i40e_fdir_ctrl_func (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_GENERIC :if (filter_op !=RTE_ETH_FILTER_GET )return -EINVAL ;drivers/net/i40e/i40e_ethdev.h +1
-10@@ -664,8 +664,7 @@ struct i40e_fdir_action { };/* A structure used to define the flow director filter entry by filter_ctrl API -* It supports RTE_ETH_FILTER_FDIR with RTE_ETH_FILTER_ADD and -* RTE_ETH_FILTER_DELETE operations. +* It supports RTE_ETH_FILTER_FDIR data representation. */ struct i40e_fdir_filter_conf {uint32_t soft_id;@@ -1368,17 +1367,12 @@ void i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir);void i40e_fdir_stats_get (struct rte_eth_dev *dev,struct rte_eth_fdir_stats *stat); -int i40e_fdir_ctrl_func (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg);int i40e_select_filter_input_set (struct i40e_hw *hw,struct rte_eth_input_set_conf *conf,enum rte_filter_type filter);void i40e_fdir_filter_restore (struct i40e_pf *pf);int i40e_hash_filter_inset_select (struct i40e_hw *hw,struct rte_eth_input_set_conf *conf); -int i40e_fdir_filter_inset_select (struct i40e_pf *pf, -struct rte_eth_input_set_conf *conf);int i40e_pf_host_send_msg_to_vf (struct i40e_pf_vf *vf,uint32_t opcode,uint32_t retval,uint8_t *msg,uint16_t msglen);@@ -1406,9 +1400,6 @@ uint64_t i40e_get_default_input_set(uint16_t pctype);int i40e_ethertype_filter_set (struct i40e_pf *pf,struct rte_eth_ethertype_filter *filter,bool add); -int i40e_add_del_fdir_filter (struct rte_eth_dev *dev, -const struct rte_eth_fdir_filter *filter, -bool add);struct rte_flow *i40e_fdir_entry_pool_get (struct i40e_fdir_info *fdir_info);void i40e_fdir_entry_pool_put(struct
i40e_fdir_info*fdir_info,drivers/net/i40e/i40e_fdir.c +0
-90@@ -85,10 +85,6 @@ (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER) | \ (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)) -static int i40e_fdir_filter_programming (struct i40e_pf *pf, -enum i40e_filter_pctype pctype, -const struct rte_eth_fdir_filter *filter, -bool add);static int i40e_fdir_filter_convert (const struct i40e_fdir_filter_conf *input,struct i40e_fdir_filter *filter); static struct i40e_fdir_filter *@@ -731,263 +727,6 @@ i40e_fdir_configure(struct rte_eth_dev *dev)return ret; } -static inline int -i40e_fdir_fill_eth_ip_head (const struct rte_eth_fdir_input *fdir_input, -unsigned char *raw_pkt, -bool vlan) -{ -static uint8_t vlan_frame[] = {0x81 ,0 ,0 ,0 }; -uint16_t *ether_type; -uint8_t len =2 *sizeof (struct rte_ether_addr ); -struct rte_ipv4_hdr *ip; -struct rte_ipv6_hdr *ip6; -static const uint8_t next_proto[] = { - [RTE_ETH_FLOW_FRAG_IPV4 ] =IPPROTO_IP , - [RTE_ETH_FLOW_NONFRAG_IPV4_TCP ] =IPPROTO_TCP , - [RTE_ETH_FLOW_NONFRAG_IPV4_UDP ] =IPPROTO_UDP , - [RTE_ETH_FLOW_NONFRAG_IPV4_SCTP ] =IPPROTO_SCTP , - [RTE_ETH_FLOW_NONFRAG_IPV4_OTHER ] =IPPROTO_IP , - [RTE_ETH_FLOW_FRAG_IPV6 ] =IPPROTO_NONE , - [RTE_ETH_FLOW_NONFRAG_IPV6_TCP ] =IPPROTO_TCP , - [RTE_ETH_FLOW_NONFRAG_IPV6_UDP ] =IPPROTO_UDP , - [RTE_ETH_FLOW_NONFRAG_IPV6_SCTP ] =IPPROTO_SCTP , - [RTE_ETH_FLOW_NONFRAG_IPV6_OTHER ] =IPPROTO_NONE , - }; - - raw_pkt +=2 *sizeof (struct rte_ether_addr ); -if (vlan && fdir_input->flow_ext.vlan_tci) { -rte_memcpy (raw_pkt, vlan_frame,sizeof (vlan_frame)); -rte_memcpy (raw_pkt +sizeof (uint16_t ), - &fdir_input->flow_ext.vlan_tci, -sizeof (uint16_t )); - raw_pkt +=sizeof (vlan_frame); - len +=sizeof (vlan_frame); - } - ether_type = (uint16_t *)raw_pkt; - raw_pkt +=sizeof (uint16_t ); - len +=sizeof (uint16_t ); - -switch (fdir_input->flow_type) { -case RTE_ETH_FLOW_L2_PAYLOAD : - *ether_type = fdir_input->flow.l2_flow.ether_type; -break ; -case RTE_ETH_FLOW_NONFRAG_IPV4_TCP : -case RTE_ETH_FLOW_NONFRAG_IPV4_UDP : -case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP : -case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER : -case RTE_ETH_FLOW_FRAG_IPV4 : - ip = (struct rte_ipv4_hdr *)raw_pkt; - - *ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPV4 ); - ip->version_ihl =I40E_FDIR_IP_DEFAULT_VERSION_IHL ; -/* set len to by default */ - ip->total_length =rte_cpu_to_be_16 (I40E_FDIR_IP_DEFAULT_LEN ); - ip->next_proto_id = fdir_input->flow.ip4_flow.proto ? - fdir_input->flow.ip4_flow.proto : - next_proto[fdir_input->flow_type]; - ip->time_to_live = fdir_input->flow.ip4_flow.ttl ? - fdir_input->flow.ip4_flow.ttl : -I40E_FDIR_IP_DEFAULT_TTL ; - ip->type_of_service = fdir_input->flow.ip4_flow.tos; -/* -* The source and destination fields in the transmitted packet -* need to be presented in a reversed order with respect -* to the expected received packets. -*/ - ip->src_addr = fdir_input->flow.ip4_flow.dst_ip; - ip->dst_addr = fdir_input->flow.ip4_flow.src_ip; - len +=sizeof (struct rte_ipv4_hdr ); -break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_TCP : -case RTE_ETH_FLOW_NONFRAG_IPV6_UDP : -case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP : -case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER : -case RTE_ETH_FLOW_FRAG_IPV6 : - ip6 = (struct rte_ipv6_hdr *)raw_pkt; - - *ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPV6 ); - ip6->vtc_flow = - rte_cpu_to_be_32(I40E_FDIR_IPv6_DEFAULT_VTC_FLOW | - (fdir_input->flow.ipv6_flow.tc << - I40E_FDIR_IPv6_TC_OFFSET)); - ip6->payload_len = -rte_cpu_to_be_16 (I40E_FDIR_IPv6_PAYLOAD_LEN); - ip6->proto = fdir_input->flow.ipv6_flow.proto ? - fdir_input->flow.ipv6_flow.proto : - next_proto[fdir_input->flow_type]; - ip6->hop_limits = fdir_input->flow.ipv6_flow.hop_limits ? - fdir_input-Quoted 1 line
flow.ipv6_flow.hop_limits :
-
I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;drivers/net/i40e/i40e_fdir.c +0
-39-/* -* The source and destination fields in the transmitted packet -* need to be presented in a reversed order with respect -* to the expected received packets. -*/ -rte_memcpy (&(ip6->src_addr), - &(fdir_input->flow.ipv6_flow.dst_ip), -IPV6_ADDR_LEN ); -rte_memcpy (&(ip6->dst_addr), - &(fdir_input->flow.ipv6_flow.src_ip), -IPV6_ADDR_LEN ); - len +=sizeof (struct rte_ipv6_hdr ); -break ; -default : -PMD_DRV_LOG (ERR ,"unknown flow type %u." , - fdir_input->flow_type); -return -1 ; - } -return len; -} - - -/* -* i40e_fdir_construct_pkt - construct packet based on fields in input -* @pf: board private structure -* @fdir_input: input set of the flow director entry -* @raw_pkt: a packet to be constructed -*/ -static int -i40e_fdir_construct_pkt (struct i40e_pf *pf, -const struct rte_eth_fdir_input *fdir_input, -unsigned char *raw_pkt) -{ -unsigned char *payload, *ptr; -struct rte_udp_hdr *udp; -struct rte_tcp_hdr *tcp; -struct rte_sctp_hdr *sctp; -uint8_t size, dst =0 ; -uint8_t i, pit_idx, set_idx =I40E_FLXPLD_L4_IDX ;/* use l4 by default*/
drivers/net/i40e/i40e_fdir.c +0
-21-int len; - -/* fill the ethernet and IP head */ - len =i40e_fdir_fill_eth_ip_head (fdir_input, raw_pkt, - !!fdir_input->flow_ext.vlan_tci); -if (len <0 ) -return -EINVAL ; - -/* fill the L4 head */ -switch (fdir_input->flow_type) { -case RTE_ETH_FLOW_NONFRAG_IPV4_UDP : - udp = (struct rte_udp_hdr *)(raw_pkt + len); - payload = (unsigned char *)udp +sizeof (struct rte_udp_hdr ); -/* -* The source and destination fields in the transmitted packet -* need to be presented in a reversed order with respect -* to the expected received packets. -*/ - udp->src_port = fdir_input->flow.udp4_flow.dst_port; - udp->dst_port = fdir_input->flow.udp4_flow.src_port; - udp->dgram_len =
rte_cpu_to_be_16(I40E_FDIR_UDP_DEFAULT_LEN);drivers/net/i40e/i40e_fdir.c +0
-45-break ; - -case RTE_ETH_FLOW_NONFRAG_IPV4_TCP : - tcp = (struct rte_tcp_hdr *)(raw_pkt + len); - payload = (unsigned char *)tcp +sizeof (struct rte_tcp_hdr ); -/* -* The source and destination fields in the transmitted packet -* need to be presented in a reversed order with respect -* to the expected received packets. -*/ - tcp->src_port = fdir_input->flow.tcp4_flow.dst_port; - tcp->dst_port = fdir_input->flow.tcp4_flow.src_port; - tcp->data_off =I40E_FDIR_TCP_DEFAULT_DATAOFF ; -break ; - -case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP : - sctp = (struct rte_sctp_hdr *)(raw_pkt + len); - payload = (unsigned char *)sctp +sizeof (struct rte_sctp_hdr ); -/* -* The source and destination fields in the transmitted packet -* need to be presented in a reversed order with respect -* to the expected received packets. -*/ - sctp->src_port = fdir_input->flow.sctp4_flow.dst_port; - sctp->dst_port = fdir_input->flow.sctp4_flow.src_port; - sctp->tag = fdir_input->flow.sctp4_flow.verify_tag; -break ; - -case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER : -case RTE_ETH_FLOW_FRAG_IPV4 : - payload = raw_pkt + len; - set_idx =I40E_FLXPLD_L3_IDX ; -break ; - -case RTE_ETH_FLOW_NONFRAG_IPV6_UDP : - udp = (struct rte_udp_hdr *)(raw_pkt + len); - payload = (unsigned char *)udp +sizeof (struct rte_udp_hdr ); -/* -* The source and destination fields in the transmitted packet -* need to be presented in a reversed order with respect -* to the expected received packets. -*/ - udp->src_port = fdir_input->flow.udp6_flow.dst_port; - udp->dst_port = fdir_input->flow.udp6_flow.src_port; - udp->dgram_len =
rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);drivers/net/i40e/i40e_fdir.c +0
-46-break ; - -case RTE_ETH_FLOW_NONFRAG_IPV6_TCP : - tcp = (struct rte_tcp_hdr *)(raw_pkt + len); - payload = (unsigned char *)tcp +sizeof (struct rte_tcp_hdr ); -/* -* The source and destination fields in the transmitted packet -* need to be presented in a reversed order with respect -* to the expected received packets. -*/ - tcp->data_off =I40E_FDIR_TCP_DEFAULT_DATAOFF ; - tcp->src_port = fdir_input->flow.udp6_flow.dst_port; - tcp->dst_port = fdir_input->flow.udp6_flow.src_port; -break ; - -case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP : - sctp = (struct rte_sctp_hdr *)(raw_pkt + len); - payload = (unsigned char *)sctp +sizeof (struct rte_sctp_hdr ); -/* -* The source and destination fields in the transmitted packet -* need to be presented in a reversed order with respect -* to the expected received packets. -*/ - sctp->src_port = fdir_input->flow.sctp6_flow.dst_port; - sctp->dst_port = fdir_input->flow.sctp6_flow.src_port; - sctp->tag = fdir_input->flow.sctp6_flow.verify_tag; -break ; - -case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER : -case RTE_ETH_FLOW_FRAG_IPV6 : - payload = raw_pkt + len; - set_idx =I40E_FLXPLD_L3_IDX ; -break ; -case RTE_ETH_FLOW_L2_PAYLOAD : - payload = raw_pkt + len; -/* -* ARP packet is a special case on which the payload -* starts after the whole ARP header -*/ -if (fdir_input->flow.l2_flow.ether_type == -rte_cpu_to_be_16 (RTE_ETHER_TYPE_ARP )) - payload +=sizeof (struct rte_arp_hdr ); - set_idx =I40E_FLXPLD_L2_IDX ; -break ; -default : - PMD_DRV_LOG(ERR, "unknown flow type %u.", fdir_input-Quoted 1 line
flow_type);drivers/net/i40e/i40e_fdir.c +0
-12-return -EINVAL ; - } - -/* fill the flexbytes to payload */ -for (i =0 ; i <I40E_MAX_FLXPLD_FIED ; i++) { - pit_idx = set_idx *I40E_MAX_FLXPLD_FIED + i; - size = pf->fdir.flex_set[pit_idx].size; -if (size ==0 ) -continue ; - dst = pf->fdir.flex_set[pit_idx].dst_offset *sizeof (uint16_t ); - ptr = payload + - pf->fdir.flex_set[pit_idx].src_offset *
sizeof(uint16_t);drivers/net/i40e/i40e_fdir.c +0
-25-rte_memcpy (ptr, - &fdir_input->flow_ext.flexbytes[dst], - size *sizeof (uint16_t )); - } - -return 0 ; -}static struct i40e_customized_pctype *i40e_flow_fdir_find_customized_pctype (struct i40e_pf *pf,uint8_t pctype)@@ -1703,68 +1442,6 @@ i40e_fdir_entry_pool_put(struct i40e_fdir_info *fdir_info,rte_bitmap_set (fdir_info->fdir_flow_pool.bitmap, f->idx); } -/* -* i40e_add_del_fdir_filter - add or remove a flow director filter. -* @pf: board private structure -* @filter: fdir filter entry -* @add: 0 - delete, 1 - add -*/ -int -i40e_add_del_fdir_filter (struct rte_eth_dev *dev, -const struct rte_eth_fdir_filter *filter, -bool add) -{ -struct i40e_hw *hw =I40E_DEV_PRIVATE_TO_HW (dev->data- >dev_private); -struct i40e_pf *pf =I40E_DEV_PRIVATE_TO_PF (dev->data- >dev_private); -unsigned char *pkt = (unsigned char *)pf->fdir.prg_pkt[0 ]; -enum i40e_filter_pctype pctype; -int ret =0 ; - - if (dev->data->dev_conf.fdir_conf.mode !=
RTE_FDIR_MODE_PERFECT) {drivers/net/i40e/i40e_fdir.c +0
-6-PMD_DRV_LOG (ERR ,"FDIR is not enabled, please" -" check the mode in fdir_conf." ); -return -ENOTSUP ; - } - - pctype = i40e_flowtype_to_pctype(pf->adapter, filter-Quoted 1 line
input.flow_type);
drivers/net/i40e/i40e_fdir.c +0
-31-if (pctype ==I40E_FILTER_PCTYPE_INVALID ) { -PMD_DRV_LOG (ERR ,"invalid flow_type input." ); -return -EINVAL ; - } -if (filter->action.rx_queue >= pf->dev_data->nb_rx_queues) { -PMD_DRV_LOG (ERR ,"Invalid queue ID" ); -return -EINVAL ; - } -if (filter->input.flow_ext.is_vf && - filter->input.flow_ext.dst_id >= pf->vf_num) { -PMD_DRV_LOG (ERR ,"Invalid VF ID" ); -return -EINVAL ; - } - -memset (pkt,0 ,I40E_FDIR_PKT_LEN ); - - ret =i40e_fdir_construct_pkt (pf, &filter->input, pkt); -if (ret <0 ) { -PMD_DRV_LOG (ERR ,"construct packet for fdir fails." ); -return ret; - } - -if (hw->mac.type ==I40E_MAC_X722 ) { -/* get translated pctype value in fd pctype register */ - pctype = (enum i40e_filter_pctype )i40e_read_rx_ctl ( - hw,I40E_GLQF_FD_PCTYPES ((int )pctype)); - } - - ret =i40e_fdir_filter_programming (pf, pctype, filter, add); -if (ret <0 ) { - PMD_DRV_LOG(ERR, "fdir programming fails forPCTYPE(%u).",
drivers/net/i40e/i40e_fdir.c +0
-38- pctype); -return ret; - } - -return ret; -} -static inline unsigned char *i40e_find_available_buffer (struct rte_eth_dev *dev) {@@ -1939,141 +1616,6 @@ i40e_flow_add_del_fdir_filter(structrte_eth_dev *dev, return ret; } -/* -* i40e_fdir_filter_programming - Program a flow director filter rule. -* Is done by Flow Director Programming Descriptor followed by packet -* structure that contains the filter fields need to match. -* @pf: board private structure -* @pctype: pctype -* @filter: fdir filter entry -* @add: 0 - delete, 1 - add -*/ -static int -i40e_fdir_filter_programming (struct i40e_pf *pf, -enum i40e_filter_pctype pctype, -const struct rte_eth_fdir_filter *filter, -bool add) -{ -struct i40e_tx_queue *txq = pf->fdir.txq; -struct i40e_rx_queue *rxq = pf->fdir.rxq; -const struct rte_eth_fdir_action *fdir_action = &filter->action; -volatile struct i40e_tx_desc *txdp; -volatile struct i40e_filter_program_desc *fdirdp; -uint32_t td_cmd; -uint16_t vsi_id, i; -uint8_t dest; - -PMD_DRV_LOG (INFO ,"filling filter programming descriptor." ); - fdirdp = (volatile struct i40e_filter_program_desc *) - (&(txq->tx_ring[txq->tx_tail])); - - fdirdp->qindex_flex_ptype_vsi = - rte_cpu_to_le_32((fdir_action->rx_queue << -
I40E_TXD_FLTR_QW0_QINDEX_SHIFT) &
-I40E_TXD_FLTR_QW0_QINDEX_MASK);drivers/net/i40e/i40e_fdir.c +0
-4- - fdirdp->qindex_flex_ptype_vsi |= - rte_cpu_to_le_32((fdir_action->flex_off << -
I40E_TXD_FLTR_QW0_FLEXOFF_SHIFT) &
-I40E_TXD_FLTR_QW0_FLEXOFF_MASK);drivers/net/i40e/i40e_fdir.c +0
-4- - fdirdp->qindex_flex_ptype_vsi |= - rte_cpu_to_le_32((pctype << -
I40E_TXD_FLTR_QW0_PCTYPE_SHIFT) &
-I40E_TXD_FLTR_QW0_PCTYPE_MASK);drivers/net/i40e/i40e_fdir.c +0
-13- -if (filter->input.flow_ext.is_vf) - vsi_id = pf->vfs[filter->input.flow_ext.dst_id].vsi->vsi_id; -else -/* Use LAN VSI Id by default */ - vsi_id = pf->main_vsi->vsi_id; - fdirdp->qindex_flex_ptype_vsi |= -rte_cpu_to_le_32 (((uint32_t )vsi_id << -I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT ) & -I40E_TXD_FLTR_QW0_DEST_VSI_MASK ); - - fdirdp->dtype_cmd_cntindex = -rte_cpu_to_le_32(I40E_TX_DESC_DTYPE_FILTER_PROG);drivers/net/i40e/i40e_fdir.c +0
-4- -if (add) - fdirdp->dtype_cmd_cntindex |= rte_cpu_to_le_32( -
I40E_FILTER_PROGRAM_DESC_PCMD_ADD_UPDATE<<drivers/net/i40e/i40e_fdir.c +0
-4- I40E_TXD_FLTR_QW1_PCMD_SHIFT); - else - fdirdp->dtype_cmd_cntindex |= rte_cpu_to_le_32( -
I40E_FILTER_PROGRAM_DESC_PCMD_REMOVE<<drivers/net/i40e/i40e_fdir.c +0
-6- I40E_TXD_FLTR_QW1_PCMD_SHIFT); - -if (fdir_action->behavior ==RTE_ETH_FDIR_REJECT ) - dest =I40E_FILTER_PROGRAM_DESC_DEST_DROP_PACKET ; -else if (fdir_action->behavior ==RTE_ETH_FDIR_ACCEPT ) - dest =
I40E_FILTER_PROGRAM_DESC_DEST_DIRECT_PACKET_QINDEX;drivers/net/i40e/i40e_fdir.c +0
-2-else if (fdir_action->behavior ==RTE_ETH_FDIR_PASSTHRU ) - dest =
I40E_FILTER_PROGRAM_DESC_DEST_DIRECT_PACKET_OTHER;drivers/net/i40e/i40e_fdir.c +0
-17-else { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" unsupported fdir behavior." ); -return -EINVAL ; - } - - fdirdp->dtype_cmd_cntindex |=rte_cpu_to_le_32 ((dest << -I40E_TXD_FLTR_QW1_DEST_SHIFT ) & -I40E_TXD_FLTR_QW1_DEST_MASK ); - - fdirdp->dtype_cmd_cntindex |= -rte_cpu_to_le_32 ((fdir_action->report_status<< -I40E_TXD_FLTR_QW1_FD_STATUS_SHIFT ) & -I40E_TXD_FLTR_QW1_FD_STATUS_MASK ); - - fdirdp->dtype_cmd_cntindex |= -rte_cpu_to_le_32(I40E_TXD_FLTR_QW1_CNT_ENA_MASK);drivers/net/i40e/i40e_fdir.c +0
-27- fdirdp->dtype_cmd_cntindex |= -rte_cpu_to_le_32 ( - ((uint32_t )pf->fdir.match_counter_index << -I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT ) & -I40E_TXD_FLTR_QW1_CNTINDEX_MASK ); - - fdirdp->fd_id =rte_cpu_to_le_32 (filter->soft_id); - -PMD_DRV_LOG (INFO ,"filling transmit descriptor." ); - txdp = &(txq->tx_ring[txq->tx_tail +1 ]); - txdp->buffer_addr =rte_cpu_to_le_64 (pf->fdir.dma_addr[0 ]); - td_cmd =I40E_TX_DESC_CMD_EOP | -I40E_TX_DESC_CMD_RS | -I40E_TX_DESC_CMD_DUMMY ; - - txdp->cmd_type_offset_bsz = -i40e_build_ctob (td_cmd,0 ,I40E_FDIR_PKT_LEN ,0 ); - - txq->tx_tail +=2 ;/* set 2 descriptors above, fdirdp and txdp */ -if (txq->tx_tail >= txq->nb_tx_desc) - txq->tx_tail =0 ; -/* Update the tx tail register */ -rte_wmb (); -I40E_PCI_REG_WRITE (txq->qtx_tail, txq->tx_tail); -for (i =0 ; i <I40E_FDIR_MAX_WAIT_US ; i++) { - if ((txdp->cmd_type_offset_bsz & -rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) == - rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE))drivers/net/i40e/i40e_fdir.c +0
-16-break ; -rte_delay_us (1 ); - } -if (i >=I40E_FDIR_MAX_WAIT_US ) { -PMD_DRV_LOG (ERR ,"Failed to program FDIR filter:" -" time out to get DD on tx queue." ); -return -ETIMEDOUT ; - } -/* totally delay 10 ms to check programming status*/ -for (; i <I40E_FDIR_MAX_WAIT_US ; i++) { -if (i40e_check_fdir_programming_status (rxq) >=0 ) -return 0 ; -rte_delay_us (1 ); - } - PMD_DRV_LOG(ERR, - "Failed to program FDIR filter: programming statusreported.");
drivers/net/i40e/i40e_fdir.c +0
-84-return -ETIMEDOUT ; -} -/* * i40e_flow_fdir_filter_programming - Program a flow director filter rule. * Is done by Flow Director Programming Descriptor followed by packet @@ -2401,87 +1943,6 @@ i40e_fdir_stats_get(struct rte_eth_dev *dev, struct rte_eth_fdir_stats *stat) I40E_PFQF_FDSTAT_BEST_CNT_SHIFT); } -static int -i40e_fdir_filter_set (struct rte_eth_dev *dev, -struct rte_eth_fdir_filter_info *info) -{ -struct i40e_pf *pf =I40E_DEV_PRIVATE_TO_PF (dev->data- >dev_private); -int ret =0 ; - -if (!info) { -PMD_DRV_LOG (ERR ,"Invalid pointer" ); -return -EFAULT ; - } - -switch (info->info_type) { -case RTE_ETH_FDIR_FILTER_INPUT_SET_SELECT : - ret =i40e_fdir_filter_inset_select (pf, - &(info->info.input_set_conf)); -break ; -default : -PMD_DRV_LOG (ERR ,"FD filter info type (%d) not supported" , - info->info_type); -return -EINVAL ; - } - -return ret; -} - -/* -* i40e_fdir_ctrl_func - deal with all operations on flow director. -* @pf: board private structure -* @filter_op:operation will be taken. -* @arg: a pointer to specific structure corresponding to the filter_op -*/ -int -i40e_fdir_ctrl_func (struct rte_eth_dev *dev, -enum rte_filter_op filter_op, -void *arg) -{ -struct i40e_pf *pf =I40E_DEV_PRIVATE_TO_PF (dev->data- >dev_private); -int ret =0 ; - -if ((pf->flags &I40E_FLAG_FDIR ) ==0 ) -return -ENOTSUP ; - -if (filter_op ==RTE_ETH_FILTER_NOP ) -return 0 ; - -if (arg ==NULL && filter_op !=RTE_ETH_FILTER_FLUSH ) -return -EINVAL ; - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : - ret =i40e_add_del_fdir_filter (dev, - (struct rte_eth_fdir_filter *)arg, - TRUE); -break ; -case RTE_ETH_FILTER_DELETE : - ret =i40e_add_del_fdir_filter (dev, - (struct rte_eth_fdir_filter *)arg, - FALSE); -break ; -case RTE_ETH_FILTER_FLUSH : - ret =i40e_fdir_flush (dev); -break ; -case RTE_ETH_FILTER_INFO : -i40e_fdir_info_get (dev, (struct rte_eth_fdir_info *)arg); -break ; -case RTE_ETH_FILTER_SET : - ret =i40e_fdir_filter_set (dev, - (struct rte_eth_fdir_filter_info *)arg); -break ; -case RTE_ETH_FILTER_STATS : -i40e_fdir_stats_get (dev, (struct rte_eth_fdir_stats *)arg); -break ; -default : -PMD_DRV_LOG (ERR ,"unknown operation %u." , filter_op); - ret = -EINVAL ; -break ; - } -return ret; -} -/* Restore flow director filter */
void
i40e_fdir_filter_restore(struct i40e_pf *pf)drivers/net/ixgbe/ixgbe_ethdev.c +1
-1@@ -6799,7 +6799,7 @@ ixgbe_add_del_ethertype_filter(struct rte_eth_dev *dev, } static int -ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev, +ixgbe_dev_filter_ctrl(__rte_unused struct rte_eth_dev *dev, enum rte_filter_type filter_type, enum rte_filter_op filter_op,drivers/net/ixgbe/ixgbe_ethdev.c +0
-3void *arg)@@ -6807,9 +6807,6 @@ ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev,int ret =0 ;switch (filter_type) { -case RTE_ETH_FILTER_FDIR : - ret =ixgbe_fdir_ctrl_func (dev, filter_op, arg); -break ;case RTE_ETH_FILTER_GENERIC :if (filter_op !=RTE_ETH_FILTER_GET )return -EINVAL ;drivers/net/ixgbe/ixgbe_ethdev.h +0
-2@@ -727,8 +727,6 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev);uint32_t ixgbe_convert_vm_rx_mask_to_val (uint16_t rx_mask,uint32_t orig_val); -int ixgbe_fdir_ctrl_func (struct rte_eth_dev *dev, -enum rte_filter_op filter_op,void *arg);void ixgbe_fdir_filter_restore (struct rte_eth_dev *dev);int
ixgbe_clear_all_fdir_filter(struct rte_eth_dev *dev);drivers/net/ixgbe/ixgbe_fdir.c +0
-4@@ -87,10 +87,6 @@ static int fdir_set_input_mask_x550(struct rte_eth_dev *dev);static int ixgbe_set_fdir_flex_conf (struct rte_eth_dev *dev,const struct rte_eth_fdir_flex_conf *conf,uint32_t *fdirctrl);static int fdir_enable_82599 (struct ixgbe_hw *hw,uint32_t fdirctrl); -static int ixgbe_fdir_filter_to_atr_input ( -const struct rte_eth_fdir_filter *fdir_filter, -union ixgbe_atr_input *input, -enum rte_fdir_mode mode); static uint32_t ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input,drivers/net/ixgbe/ixgbe_fdir.c +0
-4uint32_t key); static uint32_t atr_compute_sig_hash_82599(union ixgbe_atr_input *input,@@ -104,10 +100,6 @@ static int fdir_write_perfect_filter_82599(structixgbe_hw *hw, static int fdir_add_signature_filter_82599(struct ixgbe_hw *hw,union ixgbe_atr_input *input,u8 queue,uint32_t fdircmd,uint32_t fdirhash); -static int ixgbe_add_del_fdir_filter (struct rte_eth_dev *dev, -const struct rte_eth_fdir_filter *fdir_filter, -bool del, -bool update);static int ixgbe_fdir_flush (struct rte_eth_dev *dev);/**
drivers/net/ixgbe/ixgbe_fdir.c +0
-2@@ -679,114 +671,6 @@ ixgbe_fdir_configure(struct rte_eth_dev *dev)return 0 ; } -/* -* Convert DPDK rte_eth_fdir_filter struct to ixgbe_atr_input union that is used
- * by the IXGBE driver code.
- */drivers/net/ixgbe/ixgbe_fdir.c +0
-12-static int -ixgbe_fdir_filter_to_atr_input (const struct rte_eth_fdir_filter *fdir_filter, -union ixgbe_atr_input *input,enum rte_fdir_mode mode) -{ - input->formatted.vlan_id = fdir_filter->input.flow_ext.vlan_tci; - input->formatted.flex_bytes = (uint16_t )( - (fdir_filter->input.flow_ext.flexbytes[1 ] <<8 &0xFF00 ) | - (fdir_filter->input.flow_ext.flexbytes[0 ] &0xFF )); - -switch (fdir_filter->input.flow_type) { -case RTE_ETH_FLOW_NONFRAG_IPV4_UDP : - input->formatted.flow_type =
IXGBE_ATR_FLOW_TYPE_UDPV4;drivers/net/ixgbe/ixgbe_fdir.c +0
-3-break ; -case RTE_ETH_FLOW_NONFRAG_IPV4_TCP : - input->formatted.flow_type =
IXGBE_ATR_FLOW_TYPE_TCPV4;drivers/net/ixgbe/ixgbe_fdir.c +0
-3-break ; -case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP : - input->formatted.flow_type =
IXGBE_ATR_FLOW_TYPE_SCTPV4;drivers/net/ixgbe/ixgbe_fdir.c +0
-3-break ; -case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER : - input->formatted.flow_type =
IXGBE_ATR_FLOW_TYPE_IPV4;drivers/net/ixgbe/ixgbe_fdir.c +0
-3-break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_UDP : - input->formatted.flow_type =
IXGBE_ATR_FLOW_TYPE_UDPV6;drivers/net/ixgbe/ixgbe_fdir.c +0
-3-break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_TCP : - input->formatted.flow_type =
IXGBE_ATR_FLOW_TYPE_TCPV6;drivers/net/ixgbe/ixgbe_fdir.c +0
-3-break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP : - input->formatted.flow_type =
IXGBE_ATR_FLOW_TYPE_SCTPV6;drivers/net/ixgbe/ixgbe_fdir.c +0
-3-break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER : - input->formatted.flow_type =
IXGBE_ATR_FLOW_TYPE_IPV6;drivers/net/ixgbe/ixgbe_fdir.c +0
-47-break ; -default : -break ; - } - -switch (fdir_filter->input.flow_type) { -case RTE_ETH_FLOW_NONFRAG_IPV4_UDP : -case RTE_ETH_FLOW_NONFRAG_IPV4_TCP : - input->formatted.src_port = - fdir_filter->input.flow.udp4_flow.src_port; - input->formatted.dst_port = - fdir_filter->input.flow.udp4_flow.dst_port; -/* fall-through */ -/*for SCTP flow type, port and verify_tag are meaningless in ixgbe.*/ -case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP : -case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER : - input->formatted.src_ip[0 ] = - fdir_filter->input.flow.ip4_flow.src_ip; - input->formatted.dst_ip[0 ] = - fdir_filter->input.flow.ip4_flow.dst_ip; -break ; - -case RTE_ETH_FLOW_NONFRAG_IPV6_UDP : -case RTE_ETH_FLOW_NONFRAG_IPV6_TCP : - input->formatted.src_port = - fdir_filter->input.flow.udp6_flow.src_port; - input->formatted.dst_port = - fdir_filter->input.flow.udp6_flow.dst_port; -/* fall-through */ -/*for SCTP flow type, port and verify_tag are meaningless in ixgbe.*/ -case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP : -case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER : -rte_memcpy (input->formatted.src_ip, - fdir_filter->input.flow.ipv6_flow.src_ip, -sizeof (input->formatted.src_ip)); -rte_memcpy (input->formatted.dst_ip, - fdir_filter->input.flow.ipv6_flow.dst_ip, -sizeof (input->formatted.dst_ip)); -break ; -default : -break ; - } - -if (mode ==RTE_FDIR_MODE_PERFECT_MAC_VLAN ) { - rte_memcpy( - input->formatted.inner_mac, - fdir_filter-Quoted 1 line
input.flow.mac_vlan_flow.mac_addr.addr_bytes,
drivers/net/ixgbe/ixgbe_fdir.c +0
-5- sizeof(input->formatted.inner_mac)); - }else if (mode ==RTE_FDIR_MODE_PERFECT_TUNNEL ) { - rte_memcpy( - input->formatted.inner_mac, - fdir_filter-Quoted 1 line
input.flow.tunnel_flow.mac_addr.addr_bytes,
drivers/net/ixgbe/ixgbe_fdir.c +0
-11- sizeof(input->formatted.inner_mac)); -if (fdir_filter->input.flow.tunnel_flow.tunnel_type == -RTE_FDIR_TUNNEL_TYPE_VXLAN ) - input->formatted.tunnel_type = -IXGBE_FDIR_VXLAN_TUNNEL_TYPE ; -else if (fdir_filter->input.flow.tunnel_flow.tunnel_type == -RTE_FDIR_TUNNEL_TYPE_NVGRE ) - input->formatted.tunnel_type = -IXGBE_FDIR_NVGRE_TUNNEL_TYPE ; -else - PMD_DRV_LOG(ERR, " invalid tunnel typearguments.");
drivers/net/ixgbe/ixgbe_fdir.c +0
-8- - input->formatted.tni_vni = - fdir_filter->input.flow.tunnel_flow.tunnel_id >>8 ; - } - -return 0 ; -} -/* * The below function is taken from the FreeBSD IXGBE drivers release * 2.3.8. The only change is not to mask hash_result with
IXGBE_ATR_HASH_MASKdrivers/net/ixgbe/ixgbe_fdir.c +0
-25@@ -1194,31 +1078,6 @@ ixgbe_remove_fdir_filter(structixgbe_hw_fdir_info *fdir_info, return 0; } -static int -ixgbe_interpret_fdir_filter (struct rte_eth_dev *dev, -const struct rte_eth_fdir_filter *fdir_filter, -struct ixgbe_fdir_rule *rule) -{ -enum rte_fdir_mode fdir_mode = dev->data- >dev_conf.fdir_conf.mode; -int err; - -memset (rule,0 ,sizeof (struct ixgbe_fdir_rule )); - - err =ixgbe_fdir_filter_to_atr_input (fdir_filter, - &rule->ixgbe_fdir, - fdir_mode); -if (err) -return err; - - rule->mode = fdir_mode; -if (fdir_filter->action.behavior ==RTE_ETH_FDIR_REJECT ) - rule->fdirflags =IXGBE_FDIRCMD_DROP ; - rule->queue = fdir_filter->action.rx_queue; - rule->soft_id = fdir_filter->soft_id; - -return 0 ; -} -int ixgbe_fdir_filter_program(struct
rte_eth_dev*dev,drivers/net/ixgbe/ixgbe_fdir.c +0
-23struct ixgbe_fdir_rule *rule,@@ -1364,29 +1223,6 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev, return err; } -/* ixgbe_add_del_fdir_filter - add or remove a flow diretor filter. -* @dev: pointer to the structure rte_eth_dev -* @fdir_filter: fdir filter entry -* @del: 1 - delete, 0 - add -* @update: 1 - update -*/ -static int -ixgbe_add_del_fdir_filter (struct rte_eth_dev *dev, -const struct rte_eth_fdir_filter *fdir_filter, -bool del, -bool update) -{ -struct ixgbe_fdir_rule rule; -int err; - - err =ixgbe_interpret_fdir_filter (dev, fdir_filter, &rule); - -if (err) -return err; - -return ixgbe_fdir_filter_program (dev, &rule, del, update); -} -static int ixgbe_fdir_flush (struct rte_eth_dev *dev){
drivers/net/ixgbe/ixgbe_fdir.c +0
-0@@ -1524,62 +1360,6 @@ ixgbe_fdir_stats_get(struct rte_eth_dev *dev,struct
rte_eth_fdir_stats*fdir_st}
drivers/net/ixgbe/ixgbe_fdir.c +0
-11-/* -* ixgbe_fdir_ctrl_func - deal with all operations on flow director. -* @dev: pointer to the structure rte_eth_dev -* @filter_op:operation will be taken -* @arg: a pointer to specific structure corresponding to the filter_op -*/ -int -ixgbe_fdir_ctrl_func (struct rte_eth_dev *dev, -enum rte_filter_op filter_op,void *arg) -{ - struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data-Quoted 1 line
dev_private);drivers/net/ixgbe/ixgbe_fdir.c +0
-45-int ret =0 ; - -if (hw->mac.type != ixgbe_mac_82599EB && - hw->mac.type != ixgbe_mac_X540 && - hw->mac.type != ixgbe_mac_X550 && - hw->mac.type != ixgbe_mac_X550EM_x && - hw->mac.type != ixgbe_mac_X550EM_a) -return -ENOTSUP ; - -if (filter_op ==RTE_ETH_FILTER_NOP ) -return 0 ; - -if (arg ==NULL && filter_op !=RTE_ETH_FILTER_FLUSH ) -return -EINVAL ; - -switch (filter_op) { -case RTE_ETH_FILTER_ADD : - ret =ixgbe_add_del_fdir_filter (dev, - (struct rte_eth_fdir_filter *)arg, FALSE, FALSE); -break ; -case RTE_ETH_FILTER_UPDATE : - ret =ixgbe_add_del_fdir_filter (dev, - (struct rte_eth_fdir_filter *)arg, FALSE, TRUE); -break ; -case RTE_ETH_FILTER_DELETE : - ret =ixgbe_add_del_fdir_filter (dev, - (struct rte_eth_fdir_filter *)arg, TRUE, FALSE); -break ; -case RTE_ETH_FILTER_FLUSH : - ret =ixgbe_fdir_flush (dev); -break ; -case RTE_ETH_FILTER_INFO : -ixgbe_fdir_info_get (dev, (struct rte_eth_fdir_info *)arg); -break ; -case RTE_ETH_FILTER_STATS : -ixgbe_fdir_stats_get (dev, (struct rte_eth_fdir_stats *)arg); -break ; -default : -PMD_DRV_LOG (ERR ,"unknown operation %u" , filter_op); - ret = -EINVAL ; -break ; - } -return ret; -} -/* restore flow director filter */ void ixgbe_fdir_filter_restore (struct rte_eth_dev *dev)drivers/net/mlx5/mlx5.h +0
-1@@ -878,7 +878,6 @@ struct mlx5_priv {uint8_t skip_default_rss_reta;/* Skip configuration of default reta. */ uint8_t fdb_def_rule;/* Whether fdb jump to table 1 is configured. */ struct mlx5_mp_id mp_id;/* ID of a multi-process process */ - LIST_HEAD(fdir, mlx5_fdir_flow) fdir_flows; /* fdir flows. */ };#define
PORT_ID(priv)((priv)->dev_data->port_id)drivers/net/mlx5/mlx5_flow.c +0
-27@@ -557,32 +557,6 @@ static const struct rte_flow_ops mlx5_flow_ops = { .get_aged_flows = mlx5_flow_get_aged_flows, }; -/* Convert FDIR request to Generic flow. */ -struct mlx5_fdir { -struct rte_flow_attr attr; -struct rte_flow_item items[4 ]; -struct rte_flow_item_eth l2; -struct rte_flow_item_eth l2_mask; -union { -struct rte_flow_item_ipv4 ipv4; -struct rte_flow_item_ipv6 ipv6; - } l3; -union { -struct rte_flow_item_ipv4 ipv4; -struct rte_flow_item_ipv6 ipv6; - } l3_mask; -union { -struct rte_flow_item_udp udp; -struct rte_flow_item_tcp tcp; - } l4; -union { -struct rte_flow_item_udp udp; -struct rte_flow_item_tcp tcp; - } l4_mask; -struct rte_flow_action actions[2 ]; -struct rte_flow_action_queue queue; -}; -/* Tunnel information. */ struct mlx5_flow_tunnel_info {uint64_t tunnel;/**< Tunnel bit (see MLX5_FLOW_*). */ @@ -5310,7 +5284,6 @@ flow_list_destroy(struct rte_eth_dev *dev, uint32_t *list, uint32_t flow_idx) {struct mlx5_priv *priv = dev->data->dev_private; -struct mlx5_fdir_flow *priv_fdir_flow =NULL ; struct rte_flow *flow = mlx5_ipool_get(priv->sh->ipool [MLX5_IPOOL_RTE_FLOW],
flow_idx);drivers/net/mlx5/mlx5_flow.c +0
-11@@ -5330,17 +5303,6 @@ flow_list_destroy(struct rte_eth_dev *dev,uint32_t *list, ILIST_REMOVE(priv->sh->ipool[MLX5_IPOOL_RTE_FLOW],list ,flow_idx ,flow ,next );flow_mreg_del_copy_action (dev, flow); -if (flow->fdir) { - LIST_FOREACH(priv_fdir_flow, &priv->fdir_flows, next) { -if (priv_fdir_flow->rix_flow == flow_idx) -break ; - } -if (priv_fdir_flow) { -LIST_REMOVE (priv_fdir_flow, next); -mlx5_free (priv_fdir_flow->fdir); -mlx5_free (priv_fdir_flow); - } - } mlx5_ipool_free(priv->sh->ipool[MLX5_IPOOL_RTE_FLOW],
flow_idx);
}drivers/net/mlx5/mlx5_flow.c +0
-191@@ -5878,482 +5840,6 @@ mlx5_flow_query(struct rte_eth_dev *dev,return 0 ; } -/** -* Convert a flow director filter to a generic flow. -* -* @param dev -* Pointer to Ethernet device. -* @param fdir_filter -* Flow director filter to add. -* @param attributes -* Generic flow parameters structure. -* -* @return -* 0 on success, a negative errno value otherwise and rte_errno is set. -*/ -static int -flow_fdir_filter_convert (struct rte_eth_dev *dev, -const struct rte_eth_fdir_filter *fdir_filter, -struct mlx5_fdir *attributes) -{ -struct mlx5_priv *priv = dev->data->dev_private; -const struct rte_eth_fdir_input *input = &fdir_filter->input; -const struct rte_eth_fdir_masks *mask = - &dev->data->dev_conf.fdir_conf.mask; - -/* Validate queue number. */ -if (fdir_filter->action.rx_queue >= priv->rxqs_n) { -DRV_LOG (ERR ,"port %u invalid queue number %d" , - dev->data->port_id, fdir_filter->action.rx_queue); - rte_errno =EINVAL ; -return -rte_errno; - } - attributes->attr.ingress =1 ; - attributes->items[0 ] = (struct rte_flow_item ) { - .type =RTE_FLOW_ITEM_TYPE_ETH , - .spec = &attributes->l2, - .mask = &attributes->l2_mask, - }; -switch (fdir_filter->action.behavior) { -case RTE_ETH_FDIR_ACCEPT : - attributes->actions[0 ] = (struct rte_flow_action ){ - .type =RTE_FLOW_ACTION_TYPE_QUEUE , - .conf = &attributes->queue, - }; -break ; -case RTE_ETH_FDIR_REJECT : - attributes->actions[0 ] = (struct rte_flow_action ){ - .type =RTE_FLOW_ACTION_TYPE_DROP , - }; -break ; -default : -DRV_LOG (ERR ,"port %u invalid behavior %d" , - dev->data->port_id, - fdir_filter->action.behavior); - rte_errno =ENOTSUP ; -return -rte_errno; - } - attributes->queue.index = fdir_filter->action.rx_queue; -/* Handle L3. */ -switch (fdir_filter->input.flow_type) { -case RTE_ETH_FLOW_NONFRAG_IPV4_UDP : -case RTE_ETH_FLOW_NONFRAG_IPV4_TCP : -case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER : - attributes->l3.ipv4.hdr = (struct rte_ipv4_hdr ){ - .src_addr = input->flow.ip4_flow.src_ip, - .dst_addr = input->flow.ip4_flow.dst_ip, - .time_to_live = input->flow.ip4_flow.ttl, - .type_of_service = input->flow.ip4_flow.tos, - }; - attributes->l3_mask.ipv4.hdr = (struct rte_ipv4_hdr ){ - .src_addr = mask->ipv4_mask.src_ip, - .dst_addr = mask->ipv4_mask.dst_ip, - .time_to_live = mask->ipv4_mask.ttl, - .type_of_service = mask->ipv4_mask.tos, - .next_proto_id = mask->ipv4_mask.proto, - }; - attributes->items[1 ] = (struct rte_flow_item ){ - .type =RTE_FLOW_ITEM_TYPE_IPV4 , - .spec = &attributes->l3, - .mask = &attributes->l3_mask, - }; -break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_UDP : -case RTE_ETH_FLOW_NONFRAG_IPV6_TCP : -case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER : - attributes->l3.ipv6.hdr = (struct rte_ipv6_hdr ){ - .hop_limits = input->flow.ipv6_flow.hop_limits, - .proto = input->flow.ipv6_flow.proto, - }; - -memcpy (attributes->l3.ipv6.hdr.src_addr, - input->flow.ipv6_flow.src_ip, -RTE_DIM (attributes->l3.ipv6.hdr.src_addr)); -memcpy (attributes->l3.ipv6.hdr.dst_addr, - input->flow.ipv6_flow.dst_ip, -RTE_DIM (attributes->l3.ipv6.hdr.src_addr)); -memcpy (attributes->l3_mask.ipv6.hdr.src_addr, - mask->ipv6_mask.src_ip, -RTE_DIM (attributes->l3_mask.ipv6.hdr.src_addr)); -memcpy (attributes->l3_mask.ipv6.hdr.dst_addr, - mask->ipv6_mask.dst_ip, -RTE_DIM (attributes->l3_mask.ipv6.hdr.src_addr)); - attributes->items[1 ] = (struct rte_flow_item ){ - .type =RTE_FLOW_ITEM_TYPE_IPV6 , - .spec = &attributes->l3, - .mask = &attributes->l3_mask, - }; -break ; -default : -DRV_LOG (ERR ,"port %u invalid flow type%d" , - dev->data->port_id, fdir_filter->input.flow_type); - rte_errno =ENOTSUP ; -return -rte_errno; - } -/* Handle L4. */ -switch (fdir_filter->input.flow_type) { -case RTE_ETH_FLOW_NONFRAG_IPV4_UDP : - attributes->l4.udp.hdr = (struct rte_udp_hdr ){ - .src_port = input->flow.udp4_flow.src_port, - .dst_port = input->flow.udp4_flow.dst_port, - }; - attributes->l4_mask.udp.hdr = (struct rte_udp_hdr ){ - .src_port = mask->src_port_mask, - .dst_port = mask->dst_port_mask, - }; - attributes->items[2 ] = (struct rte_flow_item ){ - .type =RTE_FLOW_ITEM_TYPE_UDP , - .spec = &attributes->l4, - .mask = &attributes->l4_mask, - }; -break ; -case RTE_ETH_FLOW_NONFRAG_IPV4_TCP : - attributes->l4.tcp.hdr = (struct rte_tcp_hdr ){ - .src_port = input->flow.tcp4_flow.src_port, - .dst_port = input->flow.tcp4_flow.dst_port, - }; - attributes->l4_mask.tcp.hdr = (struct rte_tcp_hdr ){ - .src_port = mask->src_port_mask, - .dst_port = mask->dst_port_mask, - }; - attributes->items[2 ] = (struct rte_flow_item ){ - .type =RTE_FLOW_ITEM_TYPE_TCP , - .spec = &attributes->l4, - .mask = &attributes->l4_mask, - }; -break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_UDP : - attributes->l4.udp.hdr = (struct rte_udp_hdr ){ - .src_port = input->flow.udp6_flow.src_port, - .dst_port = input->flow.udp6_flow.dst_port, - }; - attributes->l4_mask.udp.hdr = (struct rte_udp_hdr ){ - .src_port = mask->src_port_mask, - .dst_port = mask->dst_port_mask, - }; - attributes->items[2 ] = (struct rte_flow_item ){ - .type =RTE_FLOW_ITEM_TYPE_UDP , - .spec = &attributes->l4, - .mask = &attributes->l4_mask, - }; -break ; -case RTE_ETH_FLOW_NONFRAG_IPV6_TCP : - attributes->l4.tcp.hdr = (struct rte_tcp_hdr ){ - .src_port = input->flow.tcp6_flow.src_port, - .dst_port = input->flow.tcp6_flow.dst_port, - }; - attributes->l4_mask.tcp.hdr = (struct rte_tcp_hdr ){ - .src_port = mask->src_port_mask, - .dst_port = mask->dst_port_mask, - }; - attributes->items[2 ] = (struct rte_flow_item ){ - .type =RTE_FLOW_ITEM_TYPE_TCP , - .spec = &attributes->l4, - .mask = &attributes->l4_mask, - }; -break ; -case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER : -case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER : -break ; -default : -DRV_LOG (ERR ,"port %u invalid flow type%d" , - dev->data->port_id, fdir_filter->input.flow_type); - rte_errno =ENOTSUP ; -return -rte_errno; - } -return 0 ; -} - -#define FLOW_FDIR_CMP (f1, f2, fld) \ - memcmp(&(f1)->fld, &(f2)->fld, sizeof(f1->fld)) - -/** -* Compare two FDIR flows. If items and actions are identical, the two flows are
- * regarded as same.
- *
- * @param dev
- * Pointer to Ethernet device.
- * @param f1
- * FDIR flow to compare.
- * @param f2
- * FDIR flow to compare.
- *
- * @return
- * Zero on match, 1 otherwise.
- */drivers/net/mlx5/mlx5_flow.c +0
-31-static int -flow_fdir_cmp (const struct mlx5_fdir *f1,const struct mlx5_fdir *f2) -{ - if (FLOW_FDIR_CMP(f1, f2, attr) || - FLOW_FDIR_CMP(f1, f2, l2) ||Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
*fdir_flow)drivers/net/mlx5/mlx5_flow.c +0
-64Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
flow_idx);drivers/net/mlx5/mlx5_flow.c +0
-97Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Quoted 1 line
rix_flow);drivers/net/mlx5/mlx5_flow.c +0
-15Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
*fdir_info)drivers/net/mlx5/mlx5_flow.c +0
-40Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
supported",
drivers/net/mlx5/mlx5_flow.c +0
-28Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
int
qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg);The rest of this diff is not shown. View the raw message.
Quoted 1 line
flow.udp4_flow.src_port;
drivers/net/qede/qede_filter.c +0
-2Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Quoted 1 line
flow.tcp4_flow.dst_port;
drivers/net/qede/qede_filter.c +0
-1Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Quoted 1 line
flow.tcp4_flow.src_port;
drivers/net/qede/qede_filter.c +0
-15Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
RTE_ETH_FLOW_NONFRAG_IPV6_UDP) {drivers/net/qede/qede_filter.c +0
-1Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Quoted 1 line
flow.udp6_flow.dst_port;
drivers/net/qede/qede_filter.c +0
-1Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Quoted 1 line
flow.udp6_flow.src_port;
drivers/net/qede/qede_filter.c +0
-2Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Quoted 1 line
flow.tcp6_flow.dst_port;
drivers/net/qede/qede_filter.c +0
-1Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Quoted 1 line
flow.tcp6_flow.src_port;
drivers/net/qede/qede_filter.c +0
-67Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
qede_arfs_construct_pkt(struct
rte_eth_dev*eth_dev,drivers/net/qede/qede_filter.c +0
-38Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
qede_tunnel_update(struct
qede_dev*qdev,drivers/net/qede/qede_filter.c +0
-2Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
DP_ERR(edev, "flowdir is not supported in 100G
mode\n");The rest of this diff is not shown. View the raw message.
drivers/net/sfc/sfc_ethdev.c +0
-0Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
operation.
- */lib/librte_ethdev/rte_eth_ctrl.h +0
-2Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
type */
lib/librte_ethdev/rte_eth_ctrl.h +0
-8Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
2.17.1
Part of the diff is not shown here. View the raw message.
Re: [dpdk-dev] [PATCH 12/14] ethdev: remove legacy FDIR filter type support
Quoted 20 lines · Jia
Quoted 20 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; John Daley <[email protected]>; Hyong Youb Kim <[email protected]>; Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Matan Azrad <[email protected]>; Shahaf Shuler <[email protected]>; Viacheslav Ovsiienko <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 12/14] ethdev: remove legacy FDIR filter type support
Quoted 4 lines
Quoted 2 lines
RTE flow API should be used for filtering.
The same as previous patch comment, please detail which part be remove and which part is reserve if have. Thanks.
I'm sorry, I don't understand what kind of details you're looking for. Could you explain, please.
Re: [dpdk-dev] [PATCH 12/14] ethdev: remove legacy FDIR filter type support
Quoted 43 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Thursday, October 22, 2020 12:18 AM
To: Guo, Jia <[email protected]>; Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; John Daley <[email protected]>; Hyong Youb Kim <[email protected]>; Wang, Haiyue <[email protected]>; Matan Azrad <[email protected]>; Shahaf Shuler <[email protected]>; Viacheslav Ovsiienko <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 12/14] ethdev: remove legacy FDIR filter type supportQuoted 10 lines · Jia
Quoted 10 lines
-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Sunday, October 18, 2020 10:09 PM
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; John Daley <[email protected]>;Hyong
Quoted 4 lines
Quoted 4 lines
Youb Kim <[email protected]>; Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Matan Azrad <[email protected]>; Shahaf Shuler <[email protected]>; Viacheslav Ovsiienko <[email protected]>; Rasesh Mody <[email protected]>;
Shahed
Quoted 6 lines
Quoted 6 lines
Shaikh <[email protected]>; Andrew Rybchenko <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]
Subject: [PATCH 12/14] ethdev: remove legacy FDIR filter type support
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
RTE flow API should be used for filtering.
The same as previous patch comment, please detail which part be remove
and which part is reserve if have. Thanks.
I'm sorry, I don't understand what kind of details you're looking for. Could you explain, please.
The answer is the same as the reply on [PATCH 1/14], I don't looking for more detail just mention which type of filter will be removed in description.
PATCH 13/14 app/testpmd: remove flow_director_flex_mask command
In reply to Andrew RybchenkoThe command uses FDIR filter information get API which is not supported any more.
--- app/test-pmd/cmdline.c | 124 ----------------------------------------- 1 file changed, 124 deletions(-)
app/test-pmd/cmdline.c +0 -124
@@ -981,12 +981,6 @@ static void cmd_help_long_parsed(void *parsed_result," tunnel-id (tunnel_id_value)\n" " Set flow director Tunnel mask.\n\n" -"flow_director_flex_mask (port_id)" -" flow (none|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|" -"ipv6-other|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|l2_payload|all)" -" (mask)\n" -" Configure mask of flex payload.\n\n" -"flow_director_flex_payload (port_id)" " (raw|l2|l3|l4) (config)\n" " Configure flex payload selection.\n\n"
@@ -10551,123 +10545,6 @@ cmdline_parse_inst_t cmd_set_flow_director_tunnel_mask = { }, }; -/* *** deal with flow director mask on flexible payload *** */ -struct cmd_flow_director_flex_mask_result { -cmdline_fixed_string_t flow_director_flexmask; -portid_t port_id; -cmdline_fixed_string_t flow; -cmdline_fixed_string_t flow_type; -cmdline_fixed_string_t mask; -}; - -static void -cmd_flow_director_flex_mask_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_flow_director_flex_mask_result *res = parsed_result; -struct rte_eth_fdir_info fdir_info; -struct rte_eth_fdir_flex_mask flex_mask; -struct rte_port *port; -uint64_t flow_type_mask; -uint16_t i; -int ret; - - port = &ports[res->port_id]; -/** Check if the port is not started **/ -if (port->port_status !=RTE_PORT_STOPPED ) { -printf ("Please stop port %d first\n" , res->port_id); -return ; - } - -memset (&flex_mask,0 ,sizeof (struct rte_eth_fdir_flex_mask )); - ret =parse_flexbytes (res->mask, - flex_mask.mask, -RTE_ETH_FDIR_MAX_FLEXLEN ); -if (ret <0 ) { -printf ("error: Cannot parse mask input.\n" ); -return ; - } - -memset (&fdir_info,0 ,sizeof (fdir_info)); - ret =rte_eth_dev_filter_ctrl (res->port_id,RTE_ETH_FILTER_FDIR , -RTE_ETH_FILTER_INFO , &fdir_info); -if (ret <0 ) { -printf ("Cannot get FDir filter info\n" ); -return ; - } - -if (!strcmp (res->flow_type,"none" )) { -/* means don't specify the flow type */ - flex_mask.flow_type =RTE_ETH_FLOW_UNKNOWN ; -for (i =0 ; i <RTE_ETH_FLOW_MAX ; i++) -memset (&port->dev_conf.fdir_conf.flex_conf.flex_mask[i], -0 ,sizeof (struct rte_eth_fdir_flex_mask )); - port->dev_conf.fdir_conf.flex_conf.nb_flexmasks =1 ; -rte_memcpy (&port->dev_conf.fdir_conf.flex_conf.flex_mask[0 ], - &flex_mask, -sizeof (struct rte_eth_fdir_flex_mask )); -cmd_reconfig_device_queue (res->port_id,1 ,1 ); -return ; - } - flow_type_mask = fdir_info.flow_types_mask[0 ]; -if (!strcmp (res->flow_type,"all" )) { -if (!flow_type_mask) { -printf ("No flow type supported\n" ); -return ; - } -for (i =RTE_ETH_FLOW_UNKNOWN ; i <RTE_ETH_FLOW_MAX ; i++) { -if (flow_type_mask & (1ULL << i)) { - flex_mask.flow_type = i; -fdir_set_flex_mask (res->port_id, &flex_mask); - } - } -cmd_reconfig_device_queue (res->port_id,1 ,1 ); -return ; - } - flex_mask.flow_type =str2flowtype (res->flow_type); -if (!(flow_type_mask & (1ULL << flex_mask.flow_type))) { -printf ("Flow type %s not supported on port %d\n" , - res->flow_type, res->port_id); -return ; - } -fdir_set_flex_mask (res->port_id, &flex_mask); -cmd_reconfig_device_queue (res->port_id,1 ,1 ); -} - -cmdline_parse_token_string_t cmd_flow_director_flexmask = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_flex_mask_result, - flow_director_flexmask, -"flow_director_flex_mask" ); -cmdline_parse_token_num_t cmd_flow_director_flexmask_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_flow_director_flex_mask_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_flow_director_flexmask_flow = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_flex_mask_result, - flow,"flow" ); -cmdline_parse_token_string_t cmd_flow_director_flexmask_flow_type = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_flex_mask_result, - flow_type,"none#ipv4-other#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#" -"ipv6-other#ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#l2_payload#all" ); -cmdline_parse_token_string_t cmd_flow_director_flexmask_mask = - TOKEN_STRING_INITIALIZER(struct cmd_flow_director_flex_mask_result, - mask,NULL ); - -cmdline_parse_inst_t cmd_set_flow_director_flex_mask = { - .f = cmd_flow_director_flex_mask_parsed, - .data =NULL , - .help_str ="flow_director_flex_mask ... : " -"Set flow director's flex mask on NIC" , - .tokens = { - (void *)&cmd_flow_director_flexmask, - (void *)&cmd_flow_director_flexmask_port_id, - (void *)&cmd_flow_director_flexmask_flow, - (void *)&cmd_flow_director_flexmask_flow_type, - (void *)&cmd_flow_director_flexmask_mask, -NULL , - }, -}; -/* *** deal with flow director flexible payload configuration *** */ struct cmd_flow_director_flexpayload_result {cmdline_fixed_string_t flow_director_flexpayload;
@@ -17659,7 +17536,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_set_flow_director_ip_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_mac_vlan_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_tunnel_mask, - (cmdline_parse_inst_t *)&cmd_set_flow_director_flex_mask, (cmdline_parse_inst_t *)&cmd_set_flow_director_flex_payload, (cmdline_parse_inst_t *)&cmd_flow, (cmdline_parse_inst_t *)&cmd_show_port_meter_cap,
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 13/14] app/testpmd: remove flow_director_flex_mask command
Quoted 5 lines · Andrew Rybchenko
The command uses FDIR filter information get API which is not supported any more.
Signed-off-by Andrew Rybchenko <[email protected]>
Build error on parse_flexbytes():
FAILED: app/a172ced@@dpdk-testpmd@exe/test-pmd_cmdline.c.o ccache clang -Iapp/a172ced@@dpdk-testpmd@exe -Iapp -I../../dpdk/app -Ilib/librte_ethdev -I../../dpdk/lib/librte_ethdev -I. -I../../dpdk/ -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -Ilib/librte_telemetry/../librte_metrics -I../../dpdk/lib/librte_telemetry/../librte_metrics -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -Ilib/librte_net -I../../dpdk/lib/librte_net -Ilib/librte_mbuf -I../../dpdk/lib/librte_mbuf -Ilib/librte_mempool -I../../dpdk/lib/librte_mempool -Ilib/librte_ring -I../../dpdk/lib/librte_ring -Ilib/librte_meter -I../../dpdk/lib/librte_meter -Ilib/librte_gro -I../../dpdk/lib/librte_gro -Ilib/librte_gso -I../../dpdk/lib/librte_gso -Ilib/librte_cmdline -I../../dpdk/lib/librte_cmdline -Ilib/librte_metrics/../librte_telemetry -I../../dpdk/lib/librte_metrics/../librte_telemetry -Ilib/librte_metrics -I../../dpdk/lib/librte_metrics -Idrivers/bus/pci -I../../dpdk/drivers/bus/pci -I../../dpdk/drivers/bus/pci/linux -Ilib/librte_pci -I../../dpdk/lib/librte_pci -Ilib/librte_bitratestats -I../../dpdk/lib/librte_bitratestats -Ilib/librte_pdump -I../../dpdk/lib/librte_pdump -Ilib/librte_latencystats -I../../dpdk/lib/librte_latencystats -Idrivers/crypto/scheduler -I../../dpdk/drivers/crypto/scheduler -Ilib/librte_cryptodev -I../../dpdk/lib/librte_cryptodev -Idrivers/bus/vdev -I../../dpdk/drivers/bus/vdev -Ilib/librte_reorder -I../../dpdk/lib/librte_reorder -Idrivers/net/bonding -I../../dpdk/drivers/net/bonding -Ilib/librte_sched -I../../dpdk/lib/librte_sched -Ilib/librte_ip_frag -I../../dpdk/lib/librte_ip_frag -Ilib/librte_hash -I../../dpdk/lib/librte_hash -Idrivers/net/bnxt -I../../dpdk/drivers/net/bnxt -I../../dpdk/drivers/net/bnxt/tf_ulp -I../../dpdk/drivers/net/bnxt/tf_core -Idrivers/net/i40e -I../../dpdk/drivers/net/i40e -Idrivers/net/i40e/base -I../../dpdk/drivers/net/i40e/base -Idrivers/net/ixgbe -I../../dpdk/drivers/net/ixgbe -Idrivers/net/ixgbe/base -I../../dpdk/drivers/net/ixgbe/base -Ilib/librte_security -I../../dpdk/lib/librte_security -Idrivers/bus/dpaa -I../../dpdk/drivers/bus/dpaa -I../../dpdk/drivers/bus/dpaa/include -I../../dpdk/drivers/bus/dpaa/base/qbman -Idrivers/common/dpaax -I../../dpdk/drivers/common/dpaax -I../../dpdk/drivers/common/dpaax/caamflib -Ilib/librte_eventdev -I../../dpdk/lib/librte_eventdev -Ilib/librte_timer -I../../dpdk/lib/librte_timer -Idrivers/mempool/dpaa -I../../dpdk/drivers/mempool/dpaa -Idrivers/net/dpaa -I../../dpdk/drivers/net/dpaa -Ilib/librte_bpf -I../../dpdk/lib/librte_bpf -I/home/dmarchan/intel-ipsec-mb/install/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-missing-field-initializers -D_GNU_SOURCE -march=native -DALLOW_EXPERIMENTAL_API -Wno-deprecated-declarations -MD -MQ 'app/a172ced@@dpdk-testpmd@exe/test-pmd_cmdline.c.o' -MF 'app/a172ced@@dpdk-testpmd@exe/test-pmd_cmdline.c.o.d' -o 'app/a172ced@@dpdk-testpmd@exe/test-pmd_cmdline.c.o' -c ../../dpdk/app/test-pmd/cmdline.c ../../dpdk/app/test-pmd/cmdline.c:10098:1: error: unused function 'parse_flexbytes' [-Werror,-Wunused-function] parse_flexbytes(const char *q_arg, uint8_t *flexbytes, uint16_t max_num) ^
1 error generated.
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 13/14] app/testpmd: remove flow_director_flex_mask command
Quoted 73 lines · David Marchand
Quoted 5 lines · Andrew Rybchenko
The command uses FDIR filter information get API which is not supported any more.
Signed-off-by Andrew Rybchenko <[email protected]>Build error on
parse_flexbytes():FAILED:
app/a172ced@@dpdk-testpmd@exe/test-pmd_cmdline.c.occache clang -Iapp/a172ced@@dpdk-testpmd@exe -Iapp -I../../dpdk/app(quoted diff) +0
-60-Ilib/librte_ethdev -I../../dpdk/lib/librte_ethdev -I. -I../../dpdk/ -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -Ilib/librte_telemetry/../librte_metrics -I../../dpdk/lib/librte_telemetry/../librte_metrics -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -Ilib/librte_net -I../../dpdk/lib/librte_net -Ilib/librte_mbuf -I../../dpdk/lib/librte_mbuf -Ilib/librte_mempool -I../../dpdk/lib/librte_mempool -Ilib/librte_ring -I../../dpdk/lib/librte_ring -Ilib/librte_meter -I../../dpdk/lib/librte_meter -Ilib/librte_gro -I../../dpdk/lib/librte_gro -Ilib/librte_gso -I../../dpdk/lib/librte_gso -Ilib/librte_cmdline -I../../dpdk/lib/librte_cmdline -Ilib/librte_metrics/../librte_telemetry -I../../dpdk/lib/librte_metrics/../librte_telemetry -Ilib/librte_metrics -I../../dpdk/lib/librte_metrics -Idrivers/bus/pci -I../../dpdk/drivers/bus/pci -I../../dpdk/drivers/bus/pci/linux -Ilib/librte_pci -I../../dpdk/lib/librte_pci -Ilib/librte_bitratestats -I../../dpdk/lib/librte_bitratestats -Ilib/librte_pdump -I../../dpdk/lib/librte_pdump -Ilib/librte_latencystats -I../../dpdk/lib/librte_latencystats -Idrivers/crypto/scheduler -I../../dpdk/drivers/crypto/scheduler -Ilib/librte_cryptodev -I../../dpdk/lib/librte_cryptodev -Idrivers/bus/vdev -I../../dpdk/drivers/bus/vdev -Ilib/librte_reorder -I../../dpdk/lib/librte_reorder -Idrivers/net/bonding -I../../dpdk/drivers/net/bonding -Ilib/librte_sched -I../../dpdk/lib/librte_sched -Ilib/librte_ip_frag -I../../dpdk/lib/librte_ip_frag -Ilib/librte_hash -I../../dpdk/lib/librte_hash -Idrivers/net/bnxt -I../../dpdk/drivers/net/bnxt -I../../dpdk/drivers/net/bnxt/tf_ulp -I../../dpdk/drivers/net/bnxt/tf_core -Idrivers/net/i40e -I../../dpdk/drivers/net/i40e -Idrivers/net/i40e/base -I../../dpdk/drivers/net/i40e/base -Idrivers/net/ixgbe -I../../dpdk/drivers/net/ixgbe -Idrivers/net/ixgbe/base -I../../dpdk/drivers/net/ixgbe/base -Ilib/librte_security -I../../dpdk/lib/librte_security -Idrivers/bus/dpaa -I../../dpdk/drivers/bus/dpaa -I../../dpdk/drivers/bus/dpaa/include -I../../dpdk/drivers/bus/dpaa/base/qbman -Idrivers/common/dpaax -I../../dpdk/drivers/common/dpaax -I../../dpdk/drivers/common/dpaax/caamflib -Ilib/librte_eventdev -I../../dpdk/lib/librte_eventdev -Ilib/librte_timer -I../../dpdk/lib/librte_timer -Idrivers/mempool/dpaa -I../../dpdk/drivers/mempool/dpaa -Idrivers/net/dpaa -I../../dpdk/drivers/net/dpaa -Ilib/librte_bpf -I../../dpdk/lib/librte_bpf -I/home/dmarchan/intel-ipsec-mb/install/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-missing-field-initializers -D_GNU_SOURCE -march=native -DALLOW_EXPERIMENTAL_API -Wno-deprecated-declarations -MD -MQ'
app/a172ced@@dpdk-testpmd@exe/test-pmd_cmdline.c.o' -MF
Quoted 8 lines
'app/a172ced@@dpdk-testpmd@exe/test-pmd_cmdline.c.o.d' -o '
app/a172ced@@dpdk-testpmd@exe/test-pmd_cmdline.c.o' -c../../dpdk/app/test-pmd/cmdline.c../../dpdk/app/test-pmd/cmdline.c:10098:1: error: unused function 'parse_flexbytes' [-Werror,-Wunused-function]parse_flexbytes(const char *q_arg, uint8_t *flexbytes, uint16_t max_num)^
1 error generated.
Thanks, will be fixed in v2.
PATCH 14/14 ethdev: remove legacy filter API functions
In reply to Andrew RybchenkoThe legacy filter API, including rte_eth_dev_filter_supported() and rte_eth_dev_filter_ctrl() is removed. Flow API should be used.
examples/tep_termination build is broken.
--- doc/guides/rel_notes/deprecation.rst | 6 ---- doc/guides/rel_notes/release_20_11.rst | 3 ++ drivers/net/dpaa2/dpaa2_ethdev.c | 4 --- lib/librte_ethdev/rte_eth_ctrl.h | 12 +------ lib/librte_ethdev/rte_ethdev.c | 28 ---------------- lib/librte_ethdev/rte_ethdev.h | 41 ------------------------ lib/librte_ethdev/rte_ethdev_version.map | 2 -- 7 files changed, 4 insertions(+), 92 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -6
@@ -106,12 +106,6 @@ Deprecation Notices while evaluating performance gains of a better use of the first cache line. -* ethdev: the legacy filter API, including - ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` - is superseded by the generic flow API (rte_flow) in - PMDs that implement the latter. - The legacy API will be removed in DPDK 20.11. - * ethdev: The flow director API, including ``rte_eth_conf.fdir_conf`` field, and the related structures (``rte_fdir_*`` and ``rte_eth_fdir_*``), will be removed in DPDK 20.11.
doc/guides/rel_notes/release_20_11.rst +3 -0
@@ -452,6 +452,9 @@ API Changes * ethdev: Added fields rx_seg and rx_nseg to rte_eth_rxconf structure to provide extended description of the receiving buffer. +* ethdev: Removed the legacy filter API, including + ``rte_eth_dev_filter_supported()`` and ``rte_eth_dev_filter_ctrl()``. + * vhost: Moved vDPA APIs from experimental to stable. * vhost: Add a new function ``rte_vhost_crypto_driver_start`` to be called
drivers/net/dpaa2/dpaa2_ethdev.c +0 -4
@@ -91,10 +91,6 @@ static const struct rte_dpaa2_xstats_name_off dpaa2_xstats_strings[] = { };static const enum rte_filter_op dpaa2_supported_filter_ops[] = { -RTE_ETH_FILTER_ADD , -RTE_ETH_FILTER_DELETE , -RTE_ETH_FILTER_UPDATE , -RTE_ETH_FILTER_FLUSH ,RTE_ETH_FILTER_GET };
lib/librte_ethdev/rte_eth_ctrl.h +1 -11
@@ -43,17 +43,7 @@ enum rte_filter_type {* Generic operations on filters */ enum rte_filter_op { -/** used to check whether the type filter is supported */ -RTE_ETH_FILTER_NOP =0 , -RTE_ETH_FILTER_ADD ,/**< add filter entry */ -RTE_ETH_FILTER_UPDATE ,/**< update filter entry */ -RTE_ETH_FILTER_DELETE ,/**< delete filter entry */ -RTE_ETH_FILTER_FLUSH ,/**< flush all entries */ -RTE_ETH_FILTER_GET ,/**< get filter entry */ -RTE_ETH_FILTER_SET ,/**< configurations */ -RTE_ETH_FILTER_INFO ,/**< retrieve information */ -RTE_ETH_FILTER_STATS ,/**< retrieve statistics */ -RTE_ETH_FILTER_OP_MAX +RTE_ETH_FILTER_GET ,/**< get flow API ops */ };/**
lib/librte_ethdev/rte_ethdev.c +0 -28
@@ -4758,34 +4758,6 @@ rte_eth_dev_rx_intr_disable(uint16_t port_id, } -int -rte_eth_dev_filter_supported (uint16_t port_id, -enum rte_filter_type filter_type) -{ -struct rte_eth_dev *dev; - -RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); - - dev = &rte_eth_devices[port_id]; -RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->filter_ctrl, -ENOTSUP ); -return (*dev->dev_ops->filter_ctrl)(dev, filter_type, -RTE_ETH_FILTER_NOP ,NULL ); -} - -int -rte_eth_dev_filter_ctrl (uint16_t port_id,enum rte_filter_type filter_type, -enum rte_filter_op filter_op,void *arg) -{ -struct rte_eth_dev *dev; - -RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); - - dev = &rte_eth_devices[port_id]; -RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->filter_ctrl, -ENOTSUP ); -return eth_err (port_id, (*dev->dev_ops->filter_ctrl)(dev, filter_type, - filter_op, arg)); -} -const struct rte_eth_rxtx_callback *rte_eth_add_rx_callback (uint16_t port_id,uint16_t queue_id,rte_rx_callback_fn fn,void *user_param)
lib/librte_ethdev/rte_ethdev.h +0 -41
47 lines not on this page · raw message
lib/librte_ethdev/rte_ethdev_version.map +0 -2
@@ -15,8 +15,6 @@ DPDK_21 { rte_eth_dev_count_avail; rte_eth_dev_count_total; rte_eth_dev_default_mac_addr_set; - rte_eth_dev_filter_ctrl; - rte_eth_dev_filter_supported; rte_eth_dev_flow_ctrl_get; rte_eth_dev_flow_ctrl_set; rte_eth_dev_fw_version_get;
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 14/14] ethdev: remove legacy filter API functions
Quoted 5 lines · Andrew Rybchenko
doc/guides/rel_notes/deprecation.rst +0
-0
doc/guides/rel_notes/deprecation.rst Deprecation Notices · line 114
Quoted 9 lines
doc/guides/rel_notes/deprecation.rst +0
-6@@ -106,12 +106,6 @@ Deprecation Notices while evaluating performance gains of a better use of the first cache line. -* ethdev: the legacy filter API, including - ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` - is superseded by the generic flow API (rte_flow) in - PMDs that implement the latter. - The legacy API will be removed in DPDK 20.11. -
Nit: we have a double empty line before this block, that was forgotten in a previous cleanup.
It could be dropped as part of this change.
Quoted 3 lines
doc/guides/rel_notes/deprecation.rst +0
-0* ethdev: The flow director API, including ``rte_eth_conf.fdir_conf`` field, and the related structures (``rte_fdir_*`` and ``rte_eth_fdir_*``), will be removed in DPDK 20.11.
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 14/14] ethdev: remove legacy filter API functions
In reply to Andrew RybchenkoQuoted 6 lines · Andrew Rybchenko
The legacy filter API, including
rte_eth_dev_filter_supported()andrte_eth_dev_filter_ctrl()is removed. Flow API should be used.examples/tep_termination build is broken.
Signed-off-by Andrew Rybchenko <[email protected]>
<...>
Quoted 9 lines
lib/librte_ethdev/rte_eth_ctrl.h +0
-3@@ -43,17 +43,7 @@ enum rte_filter_type {* Generic operations on filters */ enum rte_filter_op { -/** used to check whether the type filter is supported */ -RTE_ETH_FILTER_NOP =0 , -RTE_ETH_FILTER_ADD ,/**< add filter entry */
lib/librte_ethdev/rte_eth_ctrl.h enum rte_filter_type { · line 47
Quoted 10 lines
lib/librte_ethdev/rte_eth_ctrl.h +1
-8-RTE_ETH_FILTER_UPDATE ,/**< update filter entry */ -RTE_ETH_FILTER_DELETE ,/**< delete filter entry */ -RTE_ETH_FILTER_FLUSH ,/**< flush all entries */ -RTE_ETH_FILTER_GET ,/**< get filter entry */ -RTE_ETH_FILTER_SET ,/**< configurations */ -RTE_ETH_FILTER_INFO ,/**< retrieve information */ -RTE_ETH_FILTER_STATS ,/**< retrieve statistics */ - RTE_ETH_FILTER_OP_MAX + RTE_ETH_FILTER_GET, /**< get flow API ops */ };
Thanks Andrew working on this,
It would be nice to have it in -rc1 to be tested better but it was received late for it. I suspect there will be more cleanup here or there by time.
Since there will be a new version,
What do you thinks creating a new dev_ops, like '.flow_ops_get' and replace '.filter_ctrl' in this patchset?
This makes the naming/logic more clear, also allows removing a above 'RTE_ETH_FILTER_GET'.
Re: [dpdk-dev] [PATCH 14/14] ethdev: remove legacy filter API functions
Quoted 36 lines · Ferruh Yigit
Quoted 6 lines · Andrew Rybchenko
The legacy filter API, including
rte_eth_dev_filter_supported()andrte_eth_dev_filter_ctrl()is removed. Flow API should be used.examples/tep_termination build is broken.
Signed-off-by Andrew Rybchenko <[email protected]><...>
Quoted 9 lines
lib/librte_ethdev/rte_eth_ctrl.h +0
-3@@ -43,17 +43,7 @@ enum rte_filter_type {* Generic operations on filters */ enum rte_filter_op { - /** used to check whether the type filter is supported */ - RTE_ETH_FILTER_NOP = 0, - RTE_ETH_FILTER_ADD, /**< add filter entry */lib/librte_ethdev/rte_eth_ctrl.h enum rte_filter_type { · line 47
Quoted 10 lines
lib/librte_ethdev/rte_eth_ctrl.h +1
-8- RTE_ETH_FILTER_UPDATE, /**< update filter entry */ - RTE_ETH_FILTER_DELETE, /**< delete filter entry */ - RTE_ETH_FILTER_FLUSH, /**< flush all entries */ - RTE_ETH_FILTER_GET, /**< get filter entry */ - RTE_ETH_FILTER_SET, /**< configurations */ - RTE_ETH_FILTER_INFO, /**< retrieve information */ - RTE_ETH_FILTER_STATS, /**< retrieve statistics */ - RTE_ETH_FILTER_OP_MAX + RTE_ETH_FILTER_GET, /**< get flow API ops */ };Thanks Andrew working on this,
It would be nice to have it in -rc1 to be tested better but it was received late for it.
I suspect there will be more cleanup here or there by time.
Quoted 6 lines
Since there will be a new version,
What do you thinks creating a newdev_ops, like '.flow_ops_get' and replace '.filter_ctrl' in this patchset?This makes the naming/logic more clear, also allows removing a above '
RTE_ETH_FILTER_GET'.
I fully agree, but I'm not sure that I can find time to do it right now. I will move rte_filter_{type,op} enums to ethdev internal interface in v2 and the cleanup could be done any time later.
Re: [dpdk-dev] [PATCH 14/14] ethdev: remove legacy filter API functions
Quoted 41 lines · Andrew Rybchenko
Quoted 40 lines · Ferruh Yigit
Quoted 6 lines · Andrew Rybchenko
The legacy filter API, including
rte_eth_dev_filter_supported()andrte_eth_dev_filter_ctrl()is removed. Flow API should be used.examples/tep_termination build is broken.
Signed-off-by Andrew Rybchenko <[email protected]><...>
Quoted 9 lines
lib/librte_ethdev/rte_eth_ctrl.h +0
-3@@ -43,17 +43,7 @@ enum rte_filter_type {* Generic operations on filters */ enum rte_filter_op { - /** used to check whether the type filter is supported */ - RTE_ETH_FILTER_NOP = 0, - RTE_ETH_FILTER_ADD, /**< add filter entry */lib/librte_ethdev/rte_eth_ctrl.h enum rte_filter_type { · line 47
Quoted 10 lines
lib/librte_ethdev/rte_eth_ctrl.h +1
-8- RTE_ETH_FILTER_UPDATE, /**< update filter entry */ - RTE_ETH_FILTER_DELETE, /**< delete filter entry */ - RTE_ETH_FILTER_FLUSH, /**< flush all entries */ - RTE_ETH_FILTER_GET, /**< get filter entry */ - RTE_ETH_FILTER_SET, /**< configurations */ - RTE_ETH_FILTER_INFO, /**< retrieve information */ - RTE_ETH_FILTER_STATS, /**< retrieve statistics */ - RTE_ETH_FILTER_OP_MAX + RTE_ETH_FILTER_GET, /**< get flow API ops */ };Thanks Andrew working on this,
It would be nice to have it in -rc1 to be tested better but it was received late for it.
I suspect there will be more cleanup here or there by time.Since there will be a new version,
What do you thinks creating a newdev_ops, like '.flow_ops_get' and replace '.filter_ctrl' in this patchset?
Quoted 5 lines
Quoted 2 lines
This makes the naming/logic more clear, also allows removing a above '
RTE_ETH_FILTER_GET'.I fully agree, but I'm not sure that I can find time to do it right now.
Got it, it is nice to have if you have time, OK to postpone.
Quoted 2 lines
I will move rte_filter_{type,op} enums to ethdev
internal interface in v2
+1
Quoted 2 lines
and the cleanup could be done any time later.
Yes it can be done later, thanks.
v2 cover ethdev: remove legacy filter API
In reply to Andrew RybchenkoRemoval is aggressive and tries to cleanup all dead code from drivers.
tep_termination example still uses TUNNEL filters. Functionality is broken when TUNNEL filter is removed and finally even build of the example is broken when API is removed. It is assumed that the example will be removed before the patch series applied.
v2:
- cleanup testpmd user guide
- try to improve descriptions a bit
- remove example/tep_termination mentions from patches description
- fix broken build because of unused static function left
- other chagnes are documented in specific patches
Andrew Rybchenko (14):
ethdev: remove legacy MACVLAN filter type support
ethdev: move MAC filter type to i40e driver
ethdev: remove legacy EtherType filter type support
ethdev: remove legacy flexible filter type support
ethdev: move flexible filter type to e1000 driver
ethdev: remove legacy SYN filter type support
ethdev: remove legacy N-tuple filter type support
ethdev: remove legacy TUNNEL filter type support
ethdev: remove legacy HASH filter type support
ethdev: remove legacy L2_TUNNEL filter type support
ethdev: remove legacy global filter configuration support
ethdev: remove legacy FDIR filter type support app/testpmd: remove command to set FDIR flexible filter mask
ethdev: remove legacy filter API functions
app/test-pmd/cmdline.c | 2819 +------------------ app/test-pmd/config.c | 15 +- app/test-pmd/testpmd.h | 2 + doc/guides/nics/i40e.rst | 16 +- doc/guides/rel_notes/deprecation.rst | 8 - doc/guides/rel_notes/release_20_11.rst | 3 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 461 +-- drivers/net/bnxt/bnxt_ethdev.c | 802 ------ drivers/net/dpaa2/dpaa2_ethdev.c | 4 - drivers/net/e1000/e1000_ethdev.h | 22 +- drivers/net/e1000/igb_ethdev.c | 391 +-- drivers/net/e1000/igb_flow.c | 36 +- drivers/net/enic/enic.h | 7 - drivers/net/enic/enic_clsf.c | 168 -- drivers/net/enic/enic_ethdev.c | 48 - drivers/net/hinic/hinic_pmd_ethdev.h | 1 + drivers/net/hns3/hns3_ethdev.h | 1 + drivers/net/i40e/i40e_ethdev.c | 828 +----- drivers/net/i40e/i40e_ethdev.h | 26 +- drivers/net/i40e/i40e_fdir.c | 539 ---- drivers/net/i40e/i40e_pf.c | 2 +- drivers/net/i40e/rte_pmd_i40e.c | 30 +- drivers/net/igc/igc_filter.h | 1 + drivers/net/ixgbe/ixgbe_ethdev.c | 305 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 - drivers/net/ixgbe/ixgbe_fdir.c | 220 -- drivers/net/mlx5/mlx5.h | 1 - drivers/net/mlx5/mlx5_flow.c | 516 ---- drivers/net/mlx5/mlx5_flow.h | 8 - drivers/net/qede/qede_ethdev.h | 5 - drivers/net/qede/qede_filter.c | 498 ---- drivers/net/sfc/sfc_ethdev.c | 27 - lib/librte_ethdev/rte_eth_ctrl.h | 263 +- lib/librte_ethdev/rte_ethdev.c | 28 - lib/librte_ethdev/rte_ethdev.h | 41 - lib/librte_ethdev/rte_ethdev_driver.h | 108 + lib/librte_ethdev/version.map | 2 - 37 files changed, 351 insertions(+), 7903 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/14 ethdev: remove legacy MACVLAN filter type support
Instead of MACVLAN filter RTE flow API should be used.
--- app/test-pmd/cmdline.c | 110 ------------------- doc/guides/rel_notes/deprecation.rst | 2 +- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 -- drivers/net/i40e/i40e_ethdev.c | 116 -------------------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 11 -- 7 files changed, 1 insertion(+), 250 deletions(-)
app/test-pmd/cmdline.c +0 -110
@@ -559,11 +559,6 @@ static void cmd_help_long_parsed(void *parsed_result,"set port (port_id) vf (vf_id) rx|tx on|off\n" " Enable/Disable a VF receive/tranmit from a port\n\n" -"set port (port_id) vf (vf_id) (mac_addr)" -" (exact-mac#exact-mac-vlan#hashmac|hashmac-vlan) on|off\n" -" Add/Remove unicast or multicast MAC addr filter" -" for a VF.\n\n" -"set port (port_id) vf (vf_id) rxmode (AUPE|ROPE|BAM" "|MPE) (on|off)\n" " AUPE:accepts untagged VLAN;"
@@ -8757,110 +8752,6 @@ cmdline_parse_inst_t cmd_set_uc_all_hash_filter = { }, }; -/* *** CONFIGURE MACVLAN FILTER FOR VF(s) *** */ -struct cmd_set_vf_macvlan_filter { -cmdline_fixed_string_t set; -cmdline_fixed_string_t port; -portid_t port_id; -cmdline_fixed_string_t vf; -uint8_t vf_id; -struct rte_ether_addr address; -cmdline_fixed_string_t filter_type; -cmdline_fixed_string_t mode; -}; - -static void -cmd_set_vf_macvlan_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -int is_on, ret =0 ; -struct cmd_set_vf_macvlan_filter *res = parsed_result; -struct rte_eth_mac_filter filter; - -memset (&filter,0 ,sizeof (struct rte_eth_mac_filter )); - -rte_memcpy (&filter.mac_addr, &res->address,RTE_ETHER_ADDR_LEN ); - -/* set VF MAC filter */ - filter.is_vf =1 ; - -/* set VF ID */ - filter.dst_id = res->vf_id; - -if (!strcmp (res->filter_type,"exact-mac" )) - filter.filter_type =RTE_MAC_PERFECT_MATCH ; -else if (!strcmp (res->filter_type,"exact-mac-vlan" )) - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; -else if (!strcmp (res->filter_type,"hashmac" )) - filter.filter_type =RTE_MAC_HASH_MATCH ; -else if (!strcmp (res->filter_type,"hashmac-vlan" )) - filter.filter_type =RTE_MACVLAN_HASH_MATCH ; - - is_on = (strcmp (res->mode,"on" ) ==0 ) ?1 :0 ; - -if (is_on) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_MACVLAN , -RTE_ETH_FILTER_ADD , - &filter); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_MACVLAN , -RTE_ETH_FILTER_DELETE , - &filter); - -if (ret <0 ) -printf ("bad set MAC hash parameter, return code = %d\n" , ret); - -} - -cmdline_parse_token_string_t cmd_set_vf_macvlan_set = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - set,"set" ); -cmdline_parse_token_string_t cmd_set_vf_macvlan_port = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - port,"port" ); -cmdline_parse_token_num_t cmd_set_vf_macvlan_portid = - TOKEN_NUM_INITIALIZER(struct cmd_set_vf_macvlan_filter, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_set_vf_macvlan_vf = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - vf,"vf" ); -cmdline_parse_token_num_t cmd_set_vf_macvlan_vf_id = - TOKEN_NUM_INITIALIZER(struct cmd_set_vf_macvlan_filter, - vf_id,UINT8 ); -cmdline_parse_token_etheraddr_t cmd_set_vf_macvlan_mac = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_vf_macvlan_filter, - address); -cmdline_parse_token_string_t cmd_set_vf_macvlan_filter_type = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - filter_type,"exact-mac#exact-mac-vlan" -"#hashmac#hashmac-vlan" ); -cmdline_parse_token_string_t cmd_set_vf_macvlan_mode = - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, - mode,"on#off" ); - -cmdline_parse_inst_t cmd_set_vf_macvlan_filter = { - .f = cmd_set_vf_macvlan_parsed, - .data =NULL , - .help_str ="set port <port_id> vf <vf_id> <mac_addr> " -"exact-mac|exact-mac-vlan|hashmac|hashmac-vlan on|off: " -"Exact match rule: exact match of MAC or MAC and VLAN; " -"hash match rule: hash match of MAC and exact match of VLAN" , - .tokens = { - (void *)&cmd_set_vf_macvlan_set, - (void *)&cmd_set_vf_macvlan_port, - (void *)&cmd_set_vf_macvlan_portid, - (void *)&cmd_set_vf_macvlan_vf, - (void *)&cmd_set_vf_macvlan_vf_id, - (void *)&cmd_set_vf_macvlan_mac, - (void *)&cmd_set_vf_macvlan_filter_type, - (void *)&cmd_set_vf_macvlan_mode, -NULL , - }, -}; -/* *** CONFIGURE VF TRAFFIC CONTROL *** */ struct cmd_set_vf_traffic {cmdline_fixed_string_t set;
@@ -20041,7 +19932,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_set_uc_hash_filter, (cmdline_parse_inst_t *)&cmd_set_uc_all_hash_filter, (cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter, - (cmdline_parse_inst_t *)&cmd_set_vf_macvlan_filter, (cmdline_parse_inst_t *)&cmd_queue_rate_limit, (cmdline_parse_inst_t *)&cmd_tunnel_filter, (cmdline_parse_inst_t *)&cmd_tunnel_udp_config,
doc/guides/rel_notes/deprecation.rst +1 -1
@@ -97,7 +97,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types MACVLAN, ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, + as filter types ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.
doc/guides/testpmd_app_ug/testpmd_funcs.rst +0 -8
@@ -1622,14 +1622,6 @@ Set VF receive/transmit from a port:: testpmd> set port (port_id) vf (vf_id) (rx|tx) (on|off) -set port - mac address filter (for VF) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Add/Remove unicast or multicast MAC addr filter for a VF:: - - testpmd> set port (port_id) vf (vf_id) (mac_addr) \ - (exact-mac|exact-mac-vlan|hashmac|hashmac-vlan) (on|off) - set port - rx mode(for VF) ~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/i40e/i40e_ethdev.c +0 -116
128 lines not on this page · raw message
drivers/net/qede/qede_filter.c +0 -1
@@ -1561,7 +1561,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops;return 0 ; -case RTE_ETH_FILTER_MACVLAN :case RTE_ETH_FILTER_ETHERTYPE :case RTE_ETH_FILTER_FLEXIBLE :case RTE_ETH_FILTER_SYN :
drivers/net/sfc/sfc_ethdev.c +0 -3
@@ -1755,9 +1755,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,case RTE_ETH_FILTER_NONE :sfc_err (sa,"Global filters configuration not supported" );break ; -case RTE_ETH_FILTER_MACVLAN : -sfc_err (sa,"MACVLAN filters not supported" ); -break ;case RTE_ETH_FILTER_ETHERTYPE :sfc_err (sa,"EtherType filters not supported" );break ;
lib/librte_ethdev/rte_eth_ctrl.h +0 -11
@@ -27,7 +27,6 @@ extern "C" {*/ enum rte_filter_type {RTE_ETH_FILTER_NONE =0 , -RTE_ETH_FILTER_MACVLAN ,RTE_ETH_FILTER_ETHERTYPE ,RTE_ETH_FILTER_FLEXIBLE ,RTE_ETH_FILTER_SYN ,
@@ -68,16 +67,6 @@ enum rte_mac_filter_type { RTE_MACVLAN_HASH_MATCH, }; -/** -* MAC filter info -*/ -struct rte_eth_mac_filter { -uint8_t is_vf;/**< 1 for VF, 0 for port dev */ -uint16_t dst_id;/**< VF ID, available when is_vf is 1*/ -enum rte_mac_filter_type filter_type;/**< MAC filter type */ -struct rte_ether_addr mac_addr; -}; -/** * Define all structures for Ethertype Filter type. */
Signature · 1 line
2.17.1
PATCH v2 2/14 ethdev: move MAC filter type to i40e driver
In reply to Andrew Rybchenkonet/i40e driver is the only user of the enum rte_mac_filter_type. Move the define to the driver and use i40e_ prefix instead of rte_.
--- drivers/net/i40e/i40e_ethdev.c | 58 ++++++++++++++++---------------- drivers/net/i40e/i40e_ethdev.h | 15 +++++++-- drivers/net/i40e/i40e_pf.c | 2 +- drivers/net/i40e/rte_pmd_i40e.c | 30 ++++++++--------- lib/librte_ethdev/rte_eth_ctrl.h | 11 ------ 5 files changed, 58 insertions(+), 58 deletions(-)
drivers/net/i40e/i40e_ethdev.c +29 -29
@@ -4329,9 +4329,9 @@ i40e_macaddr_add(struct rte_eth_dev *dev,rte_memcpy (&mac_filter.mac_addr, mac_addr,RTE_ETHER_ADDR_LEN );if (rxmode->offloads &DEV_RX_OFFLOAD_VLAN_FILTER ) - mac_filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + mac_filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;else - mac_filter.filter_type =RTE_MAC_PERFECT_MATCH ; + mac_filter.filter_type =I40E_MAC_PERFECT_MATCH ;if (pool ==0 ) vsi = pf->main_vsi;
@@ -5537,7 +5537,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) mac = &f->mac_info.mac_addr;rte_memcpy (&mac->addr_bytes, hw->mac.perm_addr,ETH_ADDR_LEN ); - f->mac_info.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + f->mac_info.filter_type =I40E_MACVLAN_PERFECT_MATCH ;TAILQ_INSERT_TAIL (&vsi->mac_list, f, next); vsi->mac_num++;
@@ -5545,7 +5545,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) }rte_memcpy (&filter.mac_addr, (struct rte_ether_addr *)(hw->mac.perm_addr),ETH_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;return i40e_vsi_add_mac (vsi, &filter); }
@@ -6011,7 +6011,7 @@ i40e_vsi_setup(struct i40e_pf *pf,/* MAC/VLAN configuration */ rte_memcpy (&filter.mac_addr, &broadcast,RTE_ETHER_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ; ret =i40e_vsi_add_mac (vsi, &filter);if (ret !=I40E_SUCCESS ) {
@@ -6039,15 +6039,15 @@ i40e_vsi_config_vlan_filter(struct i40e_vsi *vsi, bool on)struct i40e_mac_filter *f;void *temp;struct i40e_mac_filter_info *mac_filter; -enum rte_mac_filter_type desired_filter; +enum i40e_mac_filter_type desired_filter;int ret =I40E_SUCCESS ;if (on) {/* Filter to match MAC and VLAN */ - desired_filter =RTE_MACVLAN_PERFECT_MATCH ; + desired_filter =I40E_MACVLAN_PERFECT_MATCH ; }else {/* Filter to match only MAC */ - desired_filter =RTE_MAC_PERFECT_MATCH ; + desired_filter =I40E_MAC_PERFECT_MATCH ; } num = vsi->mac_num;
@@ -6990,18 +6990,18 @@ i40e_add_macvlan_filters(struct i40e_vsi *vsi,rte_cpu_to_le_16 (filter[num + i].vlan_id);switch (filter[num + i].filter_type) { -case RTE_MAC_PERFECT_MATCH : +case I40E_MAC_PERFECT_MATCH : flags =I40E_AQC_MACVLAN_ADD_PERFECT_MATCH |I40E_AQC_MACVLAN_ADD_IGNORE_VLAN ;break ; -case RTE_MACVLAN_PERFECT_MATCH : +case I40E_MACVLAN_PERFECT_MATCH : flags =I40E_AQC_MACVLAN_ADD_PERFECT_MATCH ;break ; -case RTE_MAC_HASH_MATCH : +case I40E_MAC_HASH_MATCH : flags =I40E_AQC_MACVLAN_ADD_HASH_MATCH |I40E_AQC_MACVLAN_ADD_IGNORE_VLAN ;break ; -case RTE_MACVLAN_HASH_MATCH : +case I40E_MACVLAN_HASH_MATCH : flags =I40E_AQC_MACVLAN_ADD_HASH_MATCH ;break ;default :
@@ -7065,18 +7065,18 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi,rte_cpu_to_le_16 (filter[num + i].vlan_id);switch (filter[num + i].filter_type) { -case RTE_MAC_PERFECT_MATCH : +case I40E_MAC_PERFECT_MATCH : flags =I40E_AQC_MACVLAN_DEL_PERFECT_MATCH |I40E_AQC_MACVLAN_DEL_IGNORE_VLAN ;break ; -case RTE_MACVLAN_PERFECT_MATCH : +case I40E_MACVLAN_PERFECT_MATCH : flags =I40E_AQC_MACVLAN_DEL_PERFECT_MATCH ;break ; -case RTE_MAC_HASH_MATCH : +case I40E_MAC_HASH_MATCH : flags =I40E_AQC_MACVLAN_DEL_HASH_MATCH |I40E_AQC_MACVLAN_DEL_IGNORE_VLAN ;break ; -case RTE_MACVLAN_HASH_MATCH : +case I40E_MACVLAN_HASH_MATCH : flags =I40E_AQC_MACVLAN_DEL_HASH_MATCH ;break ;default :
@@ -7421,8 +7421,8 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter) f =i40e_find_mac_filter (vsi, &mac_filter->mac_addr);if (f !=NULL )return I40E_SUCCESS ; -if ((mac_filter->filter_type ==RTE_MACVLAN_PERFECT_MATCH ) || - (mac_filter->filter_type ==RTE_MACVLAN_HASH_MATCH )) { +if (mac_filter->filter_type ==I40E_MACVLAN_PERFECT_MATCH || + mac_filter->filter_type ==I40E_MACVLAN_HASH_MATCH ) {/** * If vlan_num is 0, that's the first time to add mac,
@@ -7433,8 +7433,8 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter) vsi->vlan_num =1 ; } vlan_num = vsi->vlan_num; - }else if ((mac_filter->filter_type ==RTE_MAC_PERFECT_MATCH ) || - (mac_filter->filter_type ==RTE_MAC_HASH_MATCH )) + }else if (mac_filter->filter_type ==I40E_MAC_PERFECT_MATCH || + mac_filter->filter_type ==I40E_MAC_HASH_MATCH ) vlan_num =1 ; mv_f =rte_zmalloc ("macvlan_data" , vlan_num *sizeof (*mv_f),0 );
@@ -7449,8 +7449,8 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter) ETH_ADDR_LEN); } -if (mac_filter->filter_type ==RTE_MACVLAN_PERFECT_MATCH || - mac_filter->filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (mac_filter->filter_type ==I40E_MACVLAN_PERFECT_MATCH || + mac_filter->filter_type ==I40E_MACVLAN_HASH_MATCH ) { ret =i40e_find_all_vlan_for_mac (vsi, mv_f, vlan_num, &mac_filter->mac_addr);if (ret !=I40E_SUCCESS )
@@ -7487,7 +7487,7 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr)struct i40e_mac_filter *f;struct i40e_macvlan_filter *mv_f;int i, vlan_num; -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;int ret =I40E_SUCCESS ;/* Can't find it, return an error */
@@ -7497,14 +7497,14 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr) vlan_num = vsi->vlan_num; filter_type = f->mac_info.filter_type; -if (filter_type ==RTE_MACVLAN_PERFECT_MATCH || - filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || + filter_type ==I40E_MACVLAN_HASH_MATCH ) {if (vlan_num ==0 ) {PMD_DRV_LOG (ERR ,"VLAN number shouldn't be 0" );return I40E_ERR_PARAM ; } - }else if (filter_type ==RTE_MAC_PERFECT_MATCH || - filter_type ==RTE_MAC_HASH_MATCH ) + }else if (filter_type ==I40E_MAC_PERFECT_MATCH || + filter_type ==I40E_MAC_HASH_MATCH ) vlan_num =1 ; mv_f =rte_zmalloc ("macvlan_data" , vlan_num *sizeof (*mv_f),0 );
@@ -7518,8 +7518,8 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr)rte_memcpy (&mv_f[i].macaddr, &f->mac_info.mac_addr,ETH_ADDR_LEN ); } -if (filter_type ==RTE_MACVLAN_PERFECT_MATCH || - filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || + filter_type ==I40E_MACVLAN_HASH_MATCH ) { ret =i40e_find_all_vlan_for_mac (vsi, mv_f, vlan_num, addr);if (ret !=I40E_SUCCESS ) goto DONE;
drivers/net/i40e/i40e_ethdev.h +13 -2
@@ -288,11 +288,22 @@ struct rte_flow {struct i40e_adapter ;struct rte_pci_driver ; +/** +* MAC filter type +*/ +enum i40e_mac_filter_type { +I40E_MAC_PERFECT_MATCH =1 ,/**< exact match of MAC addr. */ +I40E_MACVLAN_PERFECT_MATCH ,/**< exact match of MAC addr and VLAN ID. */ +I40E_MAC_HASH_MATCH ,/**< hash match of MAC addr. */ +/** hash match of MAC addr and exact match of VLAN ID. */ +I40E_MACVLAN_HASH_MATCH , +}; +/** * MAC filter structure */ struct i40e_mac_filter_info { -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;struct rte_ether_addr mac_addr; };
@@ -347,7 +358,7 @@ struct i40e_veb {/* i40e MACVLAN filter structure */ struct i40e_macvlan_filter {struct rte_ether_addr macaddr; -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;uint16_t vlan_id; };
drivers/net/i40e/i40e_pf.c +1 -1
@@ -844,7 +844,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf,for (i =0 ; i < addr_list->num_elements; i++) { mac = (struct rte_ether_addr *)(addr_list->list[i].addr);rte_memcpy (&filter.mac_addr, mac,RTE_ETHER_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;if (rte_is_zero_ether_addr (mac) ||i40e_vsi_add_mac (vf->vsi, &filter)) { ret =I40E_ERR_INVALID_MAC_ADDR ;
drivers/net/i40e/rte_pmd_i40e.c +15 -15
@@ -211,7 +211,7 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi)struct i40e_mac_filter *f;struct i40e_macvlan_filter *mv_f;int i, vlan_num; -enum rte_mac_filter_type filter_type; +enum i40e_mac_filter_type filter_type;int ret =I40E_SUCCESS ;void *temp;
@@ -219,14 +219,14 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi) TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) { vlan_num = vsi->vlan_num; filter_type = f->mac_info.filter_type; -if (filter_type ==RTE_MACVLAN_PERFECT_MATCH || - filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || + filter_type ==I40E_MACVLAN_HASH_MATCH ) {if (vlan_num ==0 ) {PMD_DRV_LOG (ERR ,"VLAN number shouldn't be 0" );return I40E_ERR_PARAM ; } - }else if (filter_type ==RTE_MAC_PERFECT_MATCH || - filter_type ==RTE_MAC_HASH_MATCH ) + }else if (filter_type ==I40E_MAC_PERFECT_MATCH || + filter_type ==I40E_MAC_HASH_MATCH ) vlan_num =1 ; mv_f =rte_zmalloc ("macvlan_data" , vlan_num *sizeof (*mv_f),0 );
@@ -241,8 +241,8 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi) &f->mac_info.mac_addr, ETH_ADDR_LEN); } -if (filter_type ==RTE_MACVLAN_PERFECT_MATCH || - filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (filter_type ==I40E_MACVLAN_PERFECT_MATCH || + filter_type ==I40E_MACVLAN_HASH_MATCH ) { ret =i40e_find_all_vlan_for_mac (vsi, mv_f, vlan_num, &f->mac_info.mac_addr);if (ret !=I40E_SUCCESS ) {
@@ -275,8 +275,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi)/* restore all the MACs */ TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) { -if ((f->mac_info.filter_type ==RTE_MACVLAN_PERFECT_MATCH ) || - (f->mac_info.filter_type ==RTE_MACVLAN_HASH_MATCH )) { +if (f->mac_info.filter_type ==I40E_MACVLAN_PERFECT_MATCH || + f->mac_info.filter_type ==I40E_MACVLAN_HASH_MATCH ) {/** * If vlan_num is 0, that's the first time to add mac, * set mask for vlan_id 0.
@@ -286,8 +286,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi) vsi->vlan_num =1 ; } vlan_num = vsi->vlan_num; - }else if ((f->mac_info.filter_type ==RTE_MAC_PERFECT_MATCH ) || - (f->mac_info.filter_type ==RTE_MAC_HASH_MATCH )) + }else if (f->mac_info.filter_type ==I40E_MAC_PERFECT_MATCH || + f->mac_info.filter_type ==I40E_MAC_HASH_MATCH ) vlan_num =1 ; mv_f =rte_zmalloc ("macvlan_data" , vlan_num *sizeof (*mv_f),0 );
@@ -303,8 +303,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi) ETH_ADDR_LEN); } -if (f->mac_info.filter_type ==RTE_MACVLAN_PERFECT_MATCH || - f->mac_info.filter_type ==RTE_MACVLAN_HASH_MATCH ) { +if (f->mac_info.filter_type ==I40E_MACVLAN_PERFECT_MATCH || + f->mac_info.filter_type ==I40E_MACVLAN_HASH_MATCH ) { ret =i40e_find_all_vlan_for_mac (vsi, mv_f, vlan_num, &f->mac_info.mac_addr);if (ret !=I40E_SUCCESS ) {
@@ -768,7 +768,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id,if (on) {rte_memcpy (&filter.mac_addr, &broadcast,RTE_ETHER_ADDR_LEN ); - filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ; ret =i40e_vsi_add_mac (vsi, &filter); }else { ret =i40e_vsi_delete_mac (vsi, &broadcast);
@@ -2388,7 +2388,7 @@ rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,return -EINVAL ; } - mac_filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; + mac_filter.filter_type =I40E_MACVLAN_PERFECT_MATCH ;rte_ether_addr_copy (mac_addr, &mac_filter.mac_addr); ret =i40e_vsi_add_mac (vsi, &mac_filter);if (ret !=I40E_SUCCESS ) {
lib/librte_ethdev/rte_eth_ctrl.h +0 -11
@@ -56,17 +56,6 @@ enum rte_filter_op { RTE_ETH_FILTER_OP_MAX }; -/** -* MAC filter type -*/ -enum rte_mac_filter_type { -RTE_MAC_PERFECT_MATCH =1 ,/**< exact match of MAC addr. */ -RTE_MACVLAN_PERFECT_MATCH ,/**< exact match of MAC addr and VLAN ID. */ -RTE_MAC_HASH_MATCH ,/**< hash match of MAC addr. */ -/** hash match of MAC addr and exact match of VLAN ID. */ -RTE_MACVLAN_HASH_MATCH , -}; -/** * Define all structures for Ethertype Filter type. */
Signature · 1 line
2.17.1
PATCH v2 3/14 ethdev: remove legacy EtherType filter type support
In reply to Andrew RybchenkoInstead of EtherType filter RTE flow API should be used.
Move corresponding definitions to ethdev internal driver API since it is used by drivers internally.
Preserve RTE_ETH_FILTER_ETHERTYPE because of it as well.
---
v2:
- cleanup testpmd user guide
- cleanup i40e documentation (please, review carefully)
app/test-pmd/cmdline.c | 115 -------------- doc/guides/nics/i40e.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 2 +- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 32 ---- drivers/net/bnxt/bnxt_ethdev.c | 157 -------------------- drivers/net/e1000/igb_ethdev.c | 85 ----------- drivers/net/hinic/hinic_pmd_ethdev.h | 1 + drivers/net/i40e/i40e_ethdev.c | 45 ------ drivers/net/ixgbe/ixgbe_ethdev.c | 85 ----------- drivers/net/qede/qede_filter.c | 1 - drivers/net/sfc/sfc_ethdev.c | 3 - lib/librte_ethdev/rte_eth_ctrl.h | 19 --- lib/librte_ethdev/rte_ethdev_driver.h | 23 +++ 13 files changed, 27 insertions(+), 545 deletions(-)
app/test-pmd/cmdline.c +0 -115
@@ -976,11 +976,6 @@ static void cmd_help_long_parsed(void *parsed_result,"filters:\n" "--------\n\n" -"ethertype_filter (port_id) (add|del)" -" (mac_addr|mac_ignr) (mac_address) ethertype" -" (ether_type) (drop|fwd) queue (queue_id)\n" -" Add/Del an ethertype filter.\n\n" -"2tuple_filter (port_id) (add|del)" " dst_port (dst_port_value) protocol (protocol_value)" " mask (mask_value) tcp_flags (tcp_flags_value)"
@@ -11069,115 +11064,6 @@ cmdline_parse_inst_t cmd_flex_filter = {/* *** Filters Control *** */ -/* *** deal with ethertype filter *** */ -struct cmd_ethertype_filter_result { -cmdline_fixed_string_t filter; -portid_t port_id; -cmdline_fixed_string_t ops; -cmdline_fixed_string_t mac; -struct rte_ether_addr mac_addr; -cmdline_fixed_string_t ethertype; -uint16_t ethertype_value; -cmdline_fixed_string_t drop; -cmdline_fixed_string_t queue; -uint16_t queue_id; -}; - -cmdline_parse_token_string_t cmd_ethertype_filter_filter = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - filter,"ethertype_filter" ); -cmdline_parse_token_num_t cmd_ethertype_filter_port_id = - TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result, - port_id,UINT16 ); -cmdline_parse_token_string_t cmd_ethertype_filter_ops = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - ops,"add#del" ); -cmdline_parse_token_string_t cmd_ethertype_filter_mac = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - mac,"mac_addr#mac_ignr" ); -cmdline_parse_token_etheraddr_t cmd_ethertype_filter_mac_addr = - TOKEN_ETHERADDR_INITIALIZER(struct cmd_ethertype_filter_result, - mac_addr); -cmdline_parse_token_string_t cmd_ethertype_filter_ethertype = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - ethertype,"ethertype" ); -cmdline_parse_token_num_t cmd_ethertype_filter_ethertype_value = - TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result, - ethertype_value,UINT16 ); -cmdline_parse_token_string_t cmd_ethertype_filter_drop = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - drop,"drop#fwd" ); -cmdline_parse_token_string_t cmd_ethertype_filter_queue = - TOKEN_STRING_INITIALIZER(struct cmd_ethertype_filter_result, - queue,"queue" ); -cmdline_parse_token_num_t cmd_ethertype_filter_queue_id = - TOKEN_NUM_INITIALIZER(struct cmd_ethertype_filter_result, - queue_id,UINT16 ); - -static void -cmd_ethertype_filter_parsed (void *parsed_result, - __rte_unused struct cmdline *cl, - __rte_unused void *data) -{ -struct cmd_ethertype_filter_result *res = parsed_result; -struct rte_eth_ethertype_filter filter; -int ret =0 ; - - ret =rte_eth_dev_filter_supported (res->port_id, -RTE_ETH_FILTER_ETHERTYPE ); -if (ret <0 ) { -printf ("ethertype filter is not supported on port %u.\n" , - res->port_id); -return ; - } - -memset (&filter,0 ,sizeof (filter)); -if (!strcmp (res->mac,"mac_addr" )) { - filter.flags |=RTE_ETHTYPE_FLAGS_MAC ; -rte_memcpy (&filter.mac_addr, &res->mac_addr, -sizeof (struct rte_ether_addr )); - } -if (!strcmp (res->drop,"drop" )) - filter.flags |=RTE_ETHTYPE_FLAGS_DROP ; - filter.ether_type = res->ethertype_value; - filter.queue = res->queue_id; - -if (!strcmp (res->ops,"add" )) - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_ETHERTYPE , -RTE_ETH_FILTER_ADD , - &filter); -else - ret =rte_eth_dev_filter_ctrl (res->port_id, -RTE_ETH_FILTER_ETHERTYPE , -RTE_ETH_FILTER_DELETE , - &filter); -if (ret <0 ) -printf ("ethertype filter programming error: (%s)\n" , -strerror (-ret)); -} - -cmdline_parse_inst_t cmd_ethertype_filter = { - .f = cmd_ethertype_filter_parsed, - .data =NULL , - .help_str ="ethertype_filter <port_id> add|del mac_addr|mac_ignr " -"<mac_addr> ethertype <value> drop|fw queue <queue_id>: " -"Add or delete an ethertype filter entry" , - .tokens = { - (void *)&cmd_ethertype_filter_filter, - (void *)&cmd_ethertype_filter_port_id, - (void *)&cmd_ethertype_filter_ops, - (void *)&cmd_ethertype_filter_mac, - (void *)&cmd_ethertype_filter_mac_addr, - (void *)&cmd_ethertype_filter_ethertype, - (void *)&cmd_ethertype_filter_ethertype_value, - (void *)&cmd_ethertype_filter_drop, - (void *)&cmd_ethertype_filter_queue, - (void *)&cmd_ethertype_filter_queue_id, -NULL , - }, -}; -/* *** deal with flow director filter *** */ struct cmd_flow_director_result {cmdline_fixed_string_t flow_director_filter;
@@ -19944,7 +19830,6 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_config_rss_hash_key, (cmdline_parse_inst_t *)&cmd_dump, (cmdline_parse_inst_t *)&cmd_dump_one, - (cmdline_parse_inst_t *)&cmd_ethertype_filter, (cmdline_parse_inst_t *)&cmd_syn_filter, (cmdline_parse_inst_t *)&cmd_2tuple_filter, (cmdline_parse_inst_t *)&cmd_5tuple_filter,
doc/guides/nics/i40e.rst +2 -2
@@ -635,8 +635,8 @@ L2 Payload flow type in flow director cannot be used to classify MPLS packet as with previous firmware versions. Meanwhile, the Ethertype filter can be used to classify MPLS packet by using a command in testpmd like: - testpmd> ethertype_filter 0 add mac_ignr 00:00:00:00:00:00 ethertype \ - 0x8847 fwd queue <M> + testpmd> flow create 0 ingress pattern eth type is 0x8847 / end \ + actions queue index <M> / end 16 Byte RX Descriptor setting on DPDK VF ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
doc/guides/rel_notes/deprecation.rst +1 -1
@@ -97,7 +97,7 @@ Deprecation Notices * ethdev: the legacy filter API, including ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as well - as filter types ETHERTYPE, FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, + as filter types FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded by the generic flow API (rte_flow) in PMDs that implement the latter. The legacy API will be removed in DPDK 20.11.
doc/guides/testpmd_app_ug/testpmd_funcs.rst +0 -32
@@ -3276,38 +3276,6 @@ This section details the available filter functions that are available. Note these functions interface the deprecated legacy filtering framework, superseded by *rte_flow*. See `Flow rules management`_. -ethertype_filter -~~~~~~~~~~~~~~~~~~~~ - -Add or delete a L2 Ethertype filter, which identify packets by their L2 Ethertype mainly assign them to a receive queue:: - - ethertype_filter (port_id) (add|del) (mac_addr|mac_ignr) (mac_address) \ - ethertype (ether_type) (drop|fwd) queue (queue_id) - -The available information parameters are: - -* ``port_id``: The port which the Ethertype filter assigned on. - -* ``mac_addr``: Compare destination mac address. - -* ``mac_ignr``: Ignore destination mac address match. - -* ``mac_address``: Destination mac address to match. - -* ``ether_type``: The EtherType value want to match, - for example 0x0806 for ARP packet. 0x0800 (IPv4) and 0x86DD (IPv6) are invalid. - -* ``queue_id``: The receive queue associated with this EtherType filter. - It is meaningless when deleting or dropping. - -Example, to add/remove an ethertype filter rule:: - - testpmd> ethertype_filter 0 add mac_ignr 00:11:22:33:44:55 \ - ethertype 0x0806 fwd queue 3 - - testpmd> ethertype_filter 0 del mac_ignr 00:11:22:33:44:55 \ - ethertype 0x0806 fwd queue 3 - 2tuple_filter ~~~~~~~~~~~~~~~~~
drivers/net/bnxt/bnxt_ethdev.c +0 -157
169 lines not on this page · raw message
drivers/net/e1000/igb_ethdev.c +0 -85
103 lines not on this page · raw message
drivers/net/hinic/hinic_pmd_ethdev.h +1 -0
@@ -7,6 +7,7 @@#include <rte_ethdev.h> #include <rte_ethdev_core.h> +#include <rte_ethdev_driver.h> #include "base/hinic_compat.h" #include "base/hinic_pmd_cfg.h"
drivers/net/i40e/i40e_ethdev.c +0 -45
63 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_ethdev.c +0 -85
103 lines not on this page · raw message
drivers/net/qede/qede_filter.c +0 -1
@@ -1561,7 +1561,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev *eth_dev, *(const void **)arg = &qede_flow_ops;return 0 ; -case RTE_ETH_FILTER_ETHERTYPE :case RTE_ETH_FILTER_FLEXIBLE :case RTE_ETH_FILTER_SYN :case RTE_ETH_FILTER_HASH :
drivers/net/sfc/sfc_ethdev.c +0 -3
@@ -1755,9 +1755,6 @@ sfc_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type,case RTE_ETH_FILTER_NONE :sfc_err (sa,"Global filters configuration not supported" );break ; -case RTE_ETH_FILTER_ETHERTYPE : -sfc_err (sa,"EtherType filters not supported" ); -break ;case RTE_ETH_FILTER_FLEXIBLE :sfc_err (sa,"Flexible filters not supported" );break ;
lib/librte_ethdev/rte_eth_ctrl.h +0 -19
@@ -56,25 +56,6 @@ enum rte_filter_op { RTE_ETH_FILTER_OP_MAX }; -/** -* Define all structures for Ethertype Filter type. -*/ - -#define RTE_ETHTYPE_FLAGS_MAC 0x0001/**< If set, compare mac */ -#define RTE_ETHTYPE_FLAGS_DROP 0x0002/**< If set, drop packet when match */ - -/** -* A structure used to define the ethertype filter entry -* to support RTE_ETH_FILTER_ETHERTYPE with RTE_ETH_FILTER_ADD, -* RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations. -*/ -struct rte_eth_ethertype_filter { -struct rte_ether_addr mac_addr;/**< Mac address to match. */ -uint16_t ether_type;/**< Ether type to match */ -uint16_t flags;/**< Flags from RTE_ETHTYPE_FLAGS_* */ -uint16_t queue;/**< Queue assigned to when match*/ -}; -#define RTE_FLEX_FILTER_MAXLEN 128/**< bytes to use in flex filter. */ #define RTE_FLEX_FILTER_MASK_SIZE \ (RTE_ALIGN(RTE_FLEX_FILTER_MAXLEN, CHAR_BIT) / CHAR_BIT)
lib/librte_ethdev/rte_ethdev_driver.h +23 -0
@@ -1342,6 +1342,29 @@ int rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue, uint32_t direction); + +/* +* Legacy ethdev API used internally by drivers. +*/ + +/** +* Define all structures for Ethertype Filter type. +*/ + +#define RTE_ETHTYPE_FLAGS_MAC 0x0001/**< If set, compare mac */ +#define RTE_ETHTYPE_FLAGS_DROP 0x0002/**< If set, drop packet when match */ + +/** +* A structure used to define the ethertype filter entry +* to support RTE_ETH_FILTER_ETHERTYPE data representation. +*/ +struct rte_eth_ethertype_filter { +struct rte_ether_addr mac_addr;/**< Mac address to match. */ +uint16_t ether_type;/**< Ether type to match */ +uint16_t flags;/**< Flags from RTE_ETHTYPE_FLAGS_* */ +uint16_t queue;/**< Queue assigned to when match*/ +}; + #ifdef __cplusplus }#endif
Signature · 1 line
2.17.1