Skip to contentSkip to conversation

net/enic: remove deprecated FDIR code

PATCH Applied John Daley 2 participants 2 messages Dec 17, 2020 – Jan 11, 2021

Subsystems (2)
lore
Share & tools
lore

John Daley

author
#0 lore raw

PATCH 1/1 net/enic: remove deprecated FDIR code

The Flow Director (FDIR) API was removed in release 20.11. This patch removes the remainder of the FDIR code in the PMD.

---
 drivers/net/enic/enic.h               |  23 --
 drivers/net/enic/enic_clsf.c          | 334 --------------------------
 drivers/net/enic/enic_flow.c          |   5 +-
 drivers/net/enic/enic_fm_flow.c       |   4 +
 drivers/net/enic/enic_main.c          |   7 -
 drivers/net/enic/enic_rxtx_vec_avx2.c |   5 -
 drivers/net/enic/meson.build          |   1 -
 7 files changed, 8 insertions(+), 371 deletions(-)
 delete mode 100644 drivers/net/enic/enic_clsf.c
drivers/net/enic/enic.h +0 -23
index 079f194275..4ee75253cc 100644
@@ -51,8 +51,6 @@
 /* Special Filter id for non-specific packet flagging. Don't change value */
 #define ENIC_MAGIC_FILTER_ID 0xffff
 
-#define ENICPMD_FDIR_MAX           64
-
 /*
  * Interrupt 0: LSC and errors
  * Interrupt 1: rx queue 0
@@ -62,23 +60,6 @@
 #define ENICPMD_LSC_INTR_OFFSET 0
 #define ENICPMD_RXQ_INTR_OFFSET 1
 
-struct enic_fdir_node {
-	struct rte_eth_fdir_filter filter;
-	uint16_t fltr_id;
-	uint16_t rq_index;
-};
-
-struct enic_fdir {
-	struct rte_eth_fdir_stats stats;
-	struct rte_hash *hash;
-	struct enic_fdir_node *nodes[ENICPMD_FDIR_MAX];
-	uint32_t modes;
-	uint32_t types_mask;
-	void (*copy_fltr_fn)(struct filter_v2 *filt,
-			     const struct rte_eth_fdir_input *input,
-			     const struct rte_eth_fdir_masks *masks);
-};
-
 struct enic_soft_stats {
 	rte_atomic64_t rx_nombuf;
 	rte_atomic64_t rx_packet_errors;
@@ -120,7 +101,6 @@ struct enic {
 	bool overlay_offload;
 	struct rte_eth_dev *rte_dev;
 	struct rte_eth_dev_data *dev_data;
-	struct enic_fdir fdir;
 	char bdf_name[ENICPMD_BDF_LENGTH];
 	int dev_fd;
 	int iommu_group_fd;
@@ -431,8 +411,6 @@ void enic_send_pkt(struct enic *enic, struct vnic_wq *wq,
 
 void enic_post_wq_index(struct vnic_wq *wq);
 int enic_probe(struct enic *enic);
-int enic_clsf_init(struct enic *enic);
-void enic_clsf_destroy(struct enic *enic);
 int enic_fm_init(struct enic *enic);
 void enic_fm_destroy(struct enic *enic);
 void *enic_alloc_consistent(void *priv, size_t size, dma_addr_t *dma_handle,
@@ -457,7 +435,6 @@ int enic_link_update(struct rte_eth_dev *eth_dev);
 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);
 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 deleted +0 -334

334 lines not on this page · raw message

drivers/net/enic/enic_flow.c +4 -1
index cebca7d55a..1eec96abca 100644
@@ -1208,7 +1208,8 @@ enic_copy_action_v2(struct enic *enic,
 			const struct rte_flow_action_mark *mark =
 				(const struct rte_flow_action_mark *)
 				actions->conf;
-
+			if (enic->use_noscatter_vec_rx_handler)
+				return ENOTSUP;
 			if (overlap & MARK)
 				return ENOTSUP;
 			overlap |= MARK;
@@ -1228,6 +1229,8 @@ enic_copy_action_v2(struct enic *enic,
 			break;
 		}
 		case RTE_FLOW_ACTION_TYPE_FLAG: {
+			if (enic->use_noscatter_vec_rx_handler)
+				return ENOTSUP;
 			if (overlap & MARK)
 				return ENOTSUP;
 			overlap |= MARK;
drivers/net/enic/enic_fm_flow.c +4 -0
index 86b91ed8b1..ad1e89a581 100644
@@ -1314,6 +1314,8 @@ enic_fm_copy_action(struct enic_flowman *fm,
 			const struct rte_flow_action_mark *mark =
 				actions->conf;
 
+			if (enic->use_noscatter_vec_rx_handler)
+				goto unsupported;
 			if (mark->id >= ENIC_MAGIC_FILTER_ID - 1)
 				return rte_flow_error_set(error, EINVAL,
 					RTE_FLOW_ERROR_TYPE_ACTION,
@@ -1327,6 +1329,8 @@ enic_fm_copy_action(struct enic_flowman *fm,
 			break;
 		}
 		case RTE_FLOW_ACTION_TYPE_FLAG: {
+			if (enic->use_noscatter_vec_rx_handler)
+				goto unsupported;
 			/* ENIC_MAGIC_FILTER_ID is reserved for flagging */
 			memset(&fm_op, 0, sizeof(fm_op));
 			fm_op.fa_op = FMOP_MARK;
drivers/net/enic/enic_main.c +0 -7
index d0d41035fd..755c0bf164 100644
@@ -603,9 +603,6 @@ int enic_enable(struct enic *enic)
 	err = enic_rxq_intr_init(enic);
 	if (err)
 		return err;
-	if (enic_clsf_init(enic))
-		dev_warning(enic, "Init of hash table for clsf failed."\
-			"Flow director feature will not work\n");
 
 	/* Initialize flowman if not already initialized during probe */
 	if (enic->fm == NULL && enic_fm_init(enic))
@@ -1102,7 +1099,6 @@ int enic_disable(struct enic *enic)
 
 	vnic_dev_disable(enic->vdev);
 
-	enic_clsf_destroy(enic);
 	enic_fm_destroy(enic);
 
 	if (!enic_is_sriov_vf(enic))
@@ -1753,9 +1749,6 @@ static int enic_dev_init(struct enic *enic)
 		return -1;
 	}
 
-	/* Get the supported filters */
-	enic_fdir_info(enic);
-
 	eth_dev->data->mac_addrs = rte_zmalloc("enic_mac_addr",
 					sizeof(struct rte_ether_addr) *
 					ENIC_UNICAST_PERFECT_FILTERS, 0);
drivers/net/enic/enic_rxtx_vec_avx2.c +0 -5
index d39021f30c..f0bea33423 100644
@@ -810,7 +810,6 @@ bool
 enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev)
 {
 	struct enic *enic = pmd_priv(eth_dev);
-	struct rte_fdir_conf *fconf;
 
 	/* User needs to request for the avx2 handler */
 	if (!enic->enable_avx2_rx)
@@ -818,10 +817,6 @@ enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev)
 	/* Do not support scatter Rx */
 	if (!(enic->rq_count > 0 && enic->rq[0].data_queue_enable == 0))
 		return false;
-	/* Do not support fdir/flow */
-	fconf = &eth_dev->data->dev_conf.fdir_conf;
-	if (fconf->mode != RTE_FDIR_MODE_NONE)
-		return false;
 	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) &&
 			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256) {
 		ENICPMD_LOG(DEBUG, " use the non-scatter avx2 Rx handler");
drivers/net/enic/meson.build +0 -1
index 86ef2a8a28..32c3312e80 100644
@@ -7,7 +7,6 @@ sources = files(
 	'base/vnic_intr.c',
 	'base/vnic_rq.c',
 	'base/vnic_wq.c',
-	'enic_clsf.c',
 	'enic_ethdev.c',
 	'enic_flow.c',
 	'enic_fm_flow.c',
Signature · 1 line
2.26.2