From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1085DA04DD; Wed, 21 Oct 2020 05:32:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4A30BAC88; Wed, 21 Oct 2020 05:31:49 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 40B2AAC85 for ; Wed, 21 Oct 2020 05:31:47 +0200 (CEST) IronPort-SDR: OszNQd0YE1UTCwkE5RJL5yjeNLBpKGXX8cowndYdga0JAO6bGyUj3nexH0ilNSCu8fupUUtzHY iayeKbm592FA== X-IronPort-AV: E=McAfee;i="6000,8403,9780"; a="252006314" X-IronPort-AV: E=Sophos;i="5.77,400,1596524400"; d="scan'208";a="252006314" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2020 20:31:44 -0700 IronPort-SDR: kbr4pJ9L/44tTfqTRSgPMT16kgoG0Ib1Xmdj9++M3DW20/wlUi3MfiIU2Ztv8BBPLOl+UoXNC0 F5pqC1qIdAtA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,400,1596524400"; d="scan'208";a="348442748" Received: from irsmsx606.ger.corp.intel.com ([163.33.146.139]) by orsmga008.jf.intel.com with ESMTP; 20 Oct 2020 20:31:41 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by IRSMSX606.ger.corp.intel.com (163.33.146.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 21 Oct 2020 04:31:40 +0100 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Wed, 21 Oct 2020 11:31:38 +0800 From: "Guo, Jia" To: Andrew Rybchenko , "Lu, Wenzhuo" , "Xing, Beilei" , "Iremonger, Bernard" , Ray Kinsella , "Neil Horman" , Rasesh Mody , "Shahed Shaikh" , Andrew Rybchenko , Thomas Monjalon , "Yigit, Ferruh" CC: "dev@dpdk.org" Thread-Topic: [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support Thread-Index: AQHWpVhOPHcTDZ0OR0udPt0czRTQh6mhaZsw Date: Wed, 21 Oct 2020 03:31:38 +0000 Message-ID: References: <1603030152-13451-1-git-send-email-arybchenko@solarflare.com> <1603030152-13451-2-git-send-email-arybchenko@solarflare.com> In-Reply-To: <1603030152-13451-2-git-send-email-arybchenko@solarflare.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Andrew Rybchenko > Sent: Sunday, October 18, 2020 10:09 PM > To: Lu, Wenzhuo ; Xing, Beilei > ; Iremonger, Bernard > ; Ray Kinsella ; Neil > Horman ; Guo, Jia ; Rasesh > Mody ; Shahed Shaikh ; > Andrew Rybchenko ; Thomas Monjalon > ; Yigit, Ferruh > Cc: dev@dpdk.org > Subject: [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support >=20 > RTE flow API should be used for filtering. Look like each patch in the patch set remove one specific legacy filter, s= o 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. >=20 > Signed-off-by: Andrew Rybchenko > --- > 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(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > 07ee4e4e13..bb0be8cf42 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -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" >=20 > - "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 =3D { > }, > }; >=20 > -/* *** 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 =3D 0; > - struct cmd_set_vf_macvlan_filter *res =3D 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 =3D 1; > - > - /* set VF ID */ > - filter.dst_id =3D res->vf_id; > - > - if (!strcmp(res->filter_type, "exact-mac")) > - filter.filter_type =3D RTE_MAC_PERFECT_MATCH; > - else if (!strcmp(res->filter_type, "exact-mac-vlan")) > - filter.filter_type =3D RTE_MACVLAN_PERFECT_MATCH; > - else if (!strcmp(res->filter_type, "hashmac")) > - filter.filter_type =3D RTE_MAC_HASH_MATCH; > - else if (!strcmp(res->filter_type, "hashmac-vlan")) > - filter.filter_type =3D RTE_MACVLAN_HASH_MATCH; > - > - is_on =3D (strcmp(res->mode, "on") =3D=3D 0) ? 1 : 0; > - > - if (is_on) > - ret =3D rte_eth_dev_filter_ctrl(res->port_id, > - RTE_ETH_FILTER_MACVLAN, > - RTE_ETH_FILTER_ADD, > - &filter); > - else > - ret =3D 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 =3D %d\n", > ret); > - > -} > - > -cmdline_parse_token_string_t cmd_set_vf_macvlan_set =3D > - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, > - set, "set"); > -cmdline_parse_token_string_t cmd_set_vf_macvlan_port =3D > - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, > - port, "port"); > -cmdline_parse_token_num_t cmd_set_vf_macvlan_portid =3D > - TOKEN_NUM_INITIALIZER(struct cmd_set_vf_macvlan_filter, > - port_id, UINT16); > -cmdline_parse_token_string_t cmd_set_vf_macvlan_vf =3D > - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, > - vf, "vf"); > -cmdline_parse_token_num_t cmd_set_vf_macvlan_vf_id =3D > - TOKEN_NUM_INITIALIZER(struct cmd_set_vf_macvlan_filter, > - vf_id, UINT8); > -cmdline_parse_token_etheraddr_t cmd_set_vf_macvlan_mac =3D > - TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_vf_macvlan_filter, > - address); > -cmdline_parse_token_string_t cmd_set_vf_macvlan_filter_type =3D > - 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 =3D > - TOKEN_STRING_INITIALIZER(struct cmd_set_vf_macvlan_filter, > - mode, "on#off"); > - > -cmdline_parse_inst_t cmd_set_vf_macvlan_filter =3D { > - .f =3D cmd_set_vf_macvlan_parsed, > - .data =3D NULL, > - .help_str =3D "set port vf " > - "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 =3D { > - (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[] =3D { > (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.rst > b/doc/guides/rel_notes/deprecation.rst > index ff39243f32..223ff7661f 100644 > --- a/doc/guides/rel_notes/deprecation.rst > +++ b/doc/guides/rel_notes/deprecation.rst > @@ -108,7 +108,7 @@ Deprecation Notices >=20 > * ethdev: the legacy filter API, including > ``rte_eth_dev_filter_supported()``, ``rte_eth_dev_filter_ctrl()`` as w= ell > - 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) i= n > PMDs that implement the latter. > The legacy API will be removed in DPDK 20.11. > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 4778aaf299..217a7bbbd8 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -4386,119 +4386,6 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, > uint32_t index) > } > } >=20 > -/* Set perfect match or hash match of MAC and VLAN for a VF */ -static i= nt - > 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 =3D NULL; > - uint16_t vf_id; > - int ret; > - > - if (pf =3D=3D NULL) { > - PMD_DRV_LOG(ERR, "Invalid PF argument."); > - return -EINVAL; > - } > - hw =3D I40E_PF_TO_HW(pf); > - > - if (filter =3D=3D NULL) { > - PMD_DRV_LOG(ERR, "Invalid mac filter argument."); > - return -EINVAL; > - } > - > - new_mac =3D &filter->mac_addr; > - > - if (rte_is_zero_ether_addr(new_mac)) { > - PMD_DRV_LOG(ERR, "Invalid ethernet address."); > - return -EINVAL; > - } > - > - vf_id =3D filter->dst_id; > - > - if (vf_id > pf->vf_num - 1 || !pf->vfs) { > - PMD_DRV_LOG(ERR, "Invalid argument."); > - return -EINVAL; > - } > - vf =3D &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); > - 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 =3D filter->filter_type; > - ret =3D i40e_vsi_add_mac(vf->vsi, &mac_filter); > - if (ret !=3D 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 =3D i40e_vsi_delete_mac(vf->vsi, &filter->mac_addr); > - if (ret !=3D 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)); > - } > - > - return 0; > -} > - > -/* MAC filter handle */ > -static int > -i40e_mac_filter_handle(struct rte_eth_dev *dev, enum rte_filter_op > filter_op, > - void *arg) > -{ > - struct i40e_pf *pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data- > >dev_private); > - struct rte_eth_mac_filter *filter; > - struct i40e_hw *hw =3D I40E_PF_TO_HW(pf); > - int ret =3D I40E_NOT_SUPPORTED; > - > - filter =3D (struct rte_eth_mac_filter *)(arg); > - > - switch (filter_op) { > - case RTE_ETH_FILTER_NOP: > - ret =3D I40E_SUCCESS; > - break; > - case RTE_ETH_FILTER_ADD: > - i40e_pf_disable_irq0(hw); > - if (filter->is_vf) > - ret =3D 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 =3D 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 =3D 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, > case RTE_ETH_FILTER_HASH: > ret =3D i40e_hash_filter_ctrl(dev, filter_op, arg); > break; > - case RTE_ETH_FILTER_MACVLAN: > - ret =3D i40e_mac_filter_handle(dev, filter_op, arg); > - break; > case RTE_ETH_FILTER_ETHERTYPE: > ret =3D i40e_ethertype_filter_handle(dev, filter_op, arg); > break; > diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filte= r.c > index 86a2e0dc9a..2e1646fe89 100644 > --- a/drivers/net/qede/qede_filter.c > +++ b/drivers/net/qede/qede_filter.c > @@ -1561,7 +1561,6 @@ int qede_dev_filter_ctrl(struct rte_eth_dev > *eth_dev, >=20 > *(const void **)arg =3D &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: > diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c > index c0672083ec..1abf05a80c 100644 > --- a/drivers/net/sfc/sfc_ethdev.c > +++ b/drivers/net/sfc/sfc_ethdev.c > @@ -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; > diff --git a/lib/librte_ethdev/rte_eth_ctrl.h > b/lib/librte_ethdev/rte_eth_ctrl.h > index 1416c371fb..bbb94eccce 100644 > --- a/lib/librte_ethdev/rte_eth_ctrl.h > +++ b/lib/librte_ethdev/rte_eth_ctrl.h > @@ -27,7 +27,6 @@ extern "C" { > */ > enum rte_filter_type { > RTE_ETH_FILTER_NONE =3D 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, > }; >=20 > -/** > - * 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