DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Beilei Xing <beilei.xing@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>,
	Ray Kinsella <mdr@ashroe.eu>, Neil Horman <nhorman@tuxdriver.com>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>,
	Somnath Kotur <somnath.kotur@broadcom.com>,
	Jeff Guo <jia.guo@intel.com>, Haiyue Wang <haiyue.wang@intel.com>,
	"Ziyang Xuan" <xuanziyang2@huawei.com>,
	Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>,
	Guoyang Zhou <zhouguoyang@huawei.com>,
	Rasesh Mody <rmody@marvell.com>,
	Shahed Shaikh <shshaikh@marvell.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 03/14] ethdev: remove legacy EtherType filter type support
Date: Sun, 18 Oct 2020 15:09:00 +0100
Message-ID: <1603030152-13451-4-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1603030152-13451-1-git-send-email-arybchenko@solarflare.com>

RTE 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.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 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(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index bb0be8cf42..f0fe97fb9c 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -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,
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 223ff7661f..f655fc06ac 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 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.
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6c1236953a..12bc3288e5 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -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;
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index ac4b8f1123..8b18f1cb28 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -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;
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.h b/drivers/net/hinic/hinic_pmd_ethdev.h
index 3f2d51d752..c7338d83be 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.h
+++ b/drivers/net/hinic/hinic_pmd_ethdev.h
@@ -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"
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index e298d7aee6..aa87ad8dd5 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -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;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 14a254ab74..28a088a71b 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -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;
diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c
index 2e1646fe89..4d31db09fd 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,
 
 		*(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:
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 1abf05a80c..75f3a2f3d3 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_ETHERTYPE:
-		sfc_err(sa, "EtherType filters not supported");
-		break;
 	case RTE_ETH_FILTER_FLEXIBLE:
 		sfc_err(sa, "Flexible filters not supported");
 		break;
diff --git a/lib/librte_ethdev/rte_eth_ctrl.h b/lib/librte_ethdev/rte_eth_ctrl.h
index a3d49e0913..5690f8111a 100644
--- a/lib/librte_ethdev/rte_eth_ctrl.h
+++ b/lib/librte_ethdev/rte_eth_ctrl.h
@@ -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)
diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h
index c63b9f7eb7..67a83dacc7 100644
--- a/lib/librte_ethdev/rte_ethdev_driver.h
+++ b/lib/librte_ethdev/rte_ethdev_driver.h
@@ -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


  parent reply	other threads:[~2020-10-18 14:10 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-18 14:08 [dpdk-dev] [PATCH 00/14] ethdev: remove legacy filter API Andrew Rybchenko
2020-10-18 14:08 ` [dpdk-dev] [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support Andrew Rybchenko
2020-10-20 11:07   ` David Marchand
2020-10-21 16:34     ` Andrew Rybchenko
2020-10-21  3:31   ` Guo, Jia
2020-10-21 16:05     ` Andrew Rybchenko
2020-10-22  1:59       ` Guo, Jia
2020-10-18 14:08 ` [dpdk-dev] [PATCH 02/14] ethdev: move MAC filter type to i40e driver Andrew Rybchenko
2020-10-21  4:01   ` Guo, Jia
2020-10-21 16:09     ` Andrew Rybchenko
2020-10-22  2:58       ` Guo, Jia
2020-10-22  7:19         ` Andrew Rybchenko
2020-10-18 14:09 ` Andrew Rybchenko [this message]
2020-10-18 22:13   ` [dpdk-dev] [PATCH 03/14] ethdev: remove legacy EtherType filter type support Ajit Khaparde
2020-10-19  6:40   ` Wang, Haiyue
     [not found]   ` <BYAPR11MB3493BE2EB0D5B91DDDCD99758C1C0@BYAPR11MB3493.namprd11.prod.outlook.com>
2020-10-21  5:38     ` Guo, Jia
2020-10-21 16:12       ` Andrew Rybchenko
2020-10-18 14:09 ` [dpdk-dev] [PATCH 04/14] ethdev: remove legacy flexible " Andrew Rybchenko
2020-10-19  6:29   ` Wang, Haiyue
2020-10-18 14:09 ` [dpdk-dev] [PATCH 05/14] ethdev: move flexible filter type to e1000 driver Andrew Rybchenko
2020-10-19  6:20   ` Wang, Haiyue
2020-10-18 14:09 ` [dpdk-dev] [PATCH 06/14] ethdev: remove legacy SYN filter type support Andrew Rybchenko
2020-10-19  6:45   ` Wang, Haiyue
2020-10-18 14:09 ` [dpdk-dev] [PATCH 07/14] ethdev: remove legacy N-tuple " Andrew Rybchenko
2020-10-18 22:13   ` Ajit Khaparde
2020-10-19  6:47   ` Wang, Haiyue
2020-10-18 14:09 ` [dpdk-dev] [PATCH 08/14] ethdev: remove legacy TUNNEL " Andrew Rybchenko
2020-10-18 22:14   ` Ajit Khaparde
2020-10-19  8:01   ` Li, Xiaoyun
2020-10-18 14:09 ` [dpdk-dev] [PATCH 09/14] ethdev: remove legacy HASH " Andrew Rybchenko
2020-10-18 14:09 ` [dpdk-dev] [PATCH 10/14] ethdev: remove legacy L2_TUNNEL " Andrew Rybchenko
2020-10-19  6:42   ` Wang, Haiyue
2020-10-18 14:09 ` [dpdk-dev] [PATCH 11/14] ethdev: remove legacy global filter configuration support Andrew Rybchenko
2020-10-21  5:42   ` Guo, Jia
2020-10-18 14:09 ` [dpdk-dev] [PATCH 12/14] ethdev: remove legacy FDIR filter type support Andrew Rybchenko
2020-10-18 22:15   ` Ajit Khaparde
2020-10-19  6:53   ` Wang, Haiyue
2020-10-21  5:45   ` Guo, Jia
2020-10-21 16:17     ` Andrew Rybchenko
2020-10-22  2:45       ` Guo, Jia
2020-10-18 14:09 ` [dpdk-dev] [PATCH 13/14] app/testpmd: remove flow_director_flex_mask command Andrew Rybchenko
2020-10-20 10:53   ` David Marchand
2020-10-22  9:01     ` Andrew Rybchenko
2020-10-18 14:09 ` [dpdk-dev] [PATCH 14/14] ethdev: remove legacy filter API functions Andrew Rybchenko
2020-10-20 10:47   ` David Marchand
2020-10-20 14:52   ` Ferruh Yigit
2020-10-22  9:12     ` Andrew Rybchenko
2020-10-22  9:33       ` Ferruh Yigit
2020-10-22  9:42 ` [dpdk-dev] [PATCH v2 00/14] ethdev: remove legacy filter API Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 01/14] ethdev: remove legacy MACVLAN filter type support Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 02/14] ethdev: move MAC filter type to i40e driver Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 03/14] ethdev: remove legacy EtherType filter type support Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 04/14] ethdev: remove legacy flexible " Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 05/14] ethdev: move flexible filter type to e1000 driver Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 06/14] ethdev: remove legacy SYN filter type support Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 07/14] ethdev: remove legacy N-tuple " Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 08/14] ethdev: remove legacy TUNNEL " Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 09/14] ethdev: remove legacy HASH " Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 10/14] ethdev: remove legacy L2_TUNNEL " Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 11/14] ethdev: remove legacy global filter configuration support Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 12/14] ethdev: remove legacy FDIR filter type support Andrew Rybchenko
2020-10-23  3:32     ` Hyong Youb Kim (hyonkim)
2020-10-23  6:41       ` Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 13/14] app/testpmd: remove command to set FDIR flexible filter mask Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 14/14] ethdev: remove legacy filter API functions Andrew Rybchenko
2020-10-23 16:03   ` [dpdk-dev] [PATCH v2 00/14] ethdev: remove legacy filter API Ferruh Yigit
2020-10-29 21:36     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1603030152-13451-4-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=beilei.xing@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=cloud.wangxiaoyun@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=haiyue.wang@intel.com \
    --cc=jia.guo@intel.com \
    --cc=mdr@ashroe.eu \
    --cc=nhorman@tuxdriver.com \
    --cc=rmody@marvell.com \
    --cc=shshaikh@marvell.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@intel.com \
    --cc=xuanziyang2@huawei.com \
    --cc=zhouguoyang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git