[dpdk-dev] [PATCH 08/14] ethdev: remove legacy TUNNEL filter type support

Li, Xiaoyun xiaoyun.li at intel.com
Mon Oct 19 10:01:08 CEST 2020


Hi

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

> -----Original Message-----
> From: Andrew Rybchenko <arybchenko at solarflare.com>
> Sent: Sunday, October 18, 2020 22:09
> To: Lu, Wenzhuo <wenzhuo.lu at intel.com>; Xing, Beilei <beilei.xing at intel.com>;
> Iremonger, Bernard <bernard.iremonger at intel.com>; Ray Kinsella
> <mdr at ashroe.eu>; Neil Horman <nhorman at tuxdriver.com>; Ajit Khaparde
> <ajit.khaparde at broadcom.com>; Somnath Kotur
> <somnath.kotur at broadcom.com>; Guo, Jia <jia.guo at intel.com>; Rasesh Mody
> <rmody at marvell.com>; Shahed Shaikh <shshaikh at marvell.com>; Andrew
> Rybchenko <andrew.rybchenko at oktetlabs.ru>
> Cc: dev at dpdk.org; Li, Xiaoyun <xiaoyun.li at intel.com>
> Subject: [PATCH 08/14] ethdev: remove legacy TUNNEL filter type support
> 
> RTE 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?
> 
> Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
> ---
>  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(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 1fdab5f026..f7169c7b9e 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -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, diff --git
> a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index a531edc88c..a807cb9ad9 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -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.
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index 2de8d003d2..8b68b5fe76 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -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;
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index aa87ad8dd5..2badd024f1 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -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_WORD0 0x48
>  #define I40E_TR_VXLAN_GRE_KEY_MASK		0x4
>  #define I40E_TR_GENEVE_KEY_MASK			0x8
> @@ -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 & ETH_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 & ETH_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(struct rte_eth_dev
> *dev,
>  	case 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;
> diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c
> index 0c47407edd..ba4e4d9e16 100644
> --- a/drivers/net/qede/qede_filter.c
> +++ b/drivers/net/qede/qede_filter.c
> @@ -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,
>  		      struct 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 & ETH_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:
> diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index
> 4291a932e8..51d33f3710 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_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



More information about the dev mailing list