patch 'net/iavf: fix function pointer in multi-process' has been queued to stable release 20.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Mar 9 17:30:27 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/11/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/63030f8b7bf946181e2ae40d0e4ded4306066839

Thanks.

Luca Boccassi

---
>From 63030f8b7bf946181e2ae40d0e4ded4306066839 Mon Sep 17 00:00:00 2001
From: Steve Yang <stevex.yang at intel.com>
Date: Mon, 28 Feb 2022 09:48:59 +0000
Subject: [PATCH] net/iavf: fix function pointer in multi-process

[ upstream commit 0ed16e01313e1f8930dc6a52b22159b20269d4e0 ]

This patch uses the index value to call the function, instead of the
function pointer assignment to save the selection of Receive Flex
Descriptor profile ID.

Otherwise the secondary process will run with wrong function address
from primary process.

Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")

Signed-off-by: Steve Yang <stevex.yang at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 36 +++++++++++++++++++-----------------
 drivers/net/iavf/iavf_rxtx.h |  2 --
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index c2a9c4f37b..6243199f2a 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -439,48 +439,50 @@ iavf_rxd_to_pkt_fields_by_comms_aux_v2(struct iavf_rx_queue *rxq,
 #endif
 }
 
+static const
+iavf_rxd_to_pkt_fields_t rxd_to_pkt_fields_ops[] = {
+	[IAVF_RXDID_COMMS_AUX_VLAN] = iavf_rxd_to_pkt_fields_by_comms_aux_v1,
+	[IAVF_RXDID_COMMS_AUX_IPV4] = iavf_rxd_to_pkt_fields_by_comms_aux_v1,
+	[IAVF_RXDID_COMMS_AUX_IPV6] = iavf_rxd_to_pkt_fields_by_comms_aux_v1,
+	[IAVF_RXDID_COMMS_AUX_IPV6_FLOW] =
+		iavf_rxd_to_pkt_fields_by_comms_aux_v1,
+	[IAVF_RXDID_COMMS_AUX_TCP] = iavf_rxd_to_pkt_fields_by_comms_aux_v1,
+	[IAVF_RXDID_COMMS_AUX_IP_OFFSET] =
+		iavf_rxd_to_pkt_fields_by_comms_aux_v2,
+	[IAVF_RXDID_COMMS_OVS_1] = iavf_rxd_to_pkt_fields_by_comms_ovs,
+};
+
 static void
 iavf_select_rxd_to_pkt_fields_handler(struct iavf_rx_queue *rxq, uint32_t rxdid)
 {
+	rxq->rxdid = rxdid;
+
 	switch (rxdid) {
 	case IAVF_RXDID_COMMS_AUX_VLAN:
 		rxq->xtr_ol_flag = rte_pmd_ifd_dynflag_proto_xtr_vlan_mask;
-		rxq->rxd_to_pkt_fields =
-			iavf_rxd_to_pkt_fields_by_comms_aux_v1;
 		break;
 	case IAVF_RXDID_COMMS_AUX_IPV4:
 		rxq->xtr_ol_flag = rte_pmd_ifd_dynflag_proto_xtr_ipv4_mask;
-		rxq->rxd_to_pkt_fields =
-			iavf_rxd_to_pkt_fields_by_comms_aux_v1;
 		break;
 	case IAVF_RXDID_COMMS_AUX_IPV6:
 		rxq->xtr_ol_flag = rte_pmd_ifd_dynflag_proto_xtr_ipv6_mask;
-		rxq->rxd_to_pkt_fields =
-			iavf_rxd_to_pkt_fields_by_comms_aux_v1;
 		break;
 	case IAVF_RXDID_COMMS_AUX_IPV6_FLOW:
 		rxq->xtr_ol_flag =
 			rte_pmd_ifd_dynflag_proto_xtr_ipv6_flow_mask;
-		rxq->rxd_to_pkt_fields =
-			iavf_rxd_to_pkt_fields_by_comms_aux_v1;
 		break;
 	case IAVF_RXDID_COMMS_AUX_TCP:
 		rxq->xtr_ol_flag = rte_pmd_ifd_dynflag_proto_xtr_tcp_mask;
-		rxq->rxd_to_pkt_fields =
-			iavf_rxd_to_pkt_fields_by_comms_aux_v1;
 		break;
 	case IAVF_RXDID_COMMS_AUX_IP_OFFSET:
 		rxq->xtr_ol_flag =
 			rte_pmd_ifd_dynflag_proto_xtr_ip_offset_mask;
-		rxq->rxd_to_pkt_fields =
-			iavf_rxd_to_pkt_fields_by_comms_aux_v2;
 		break;
 	case IAVF_RXDID_COMMS_OVS_1:
-		rxq->rxd_to_pkt_fields = iavf_rxd_to_pkt_fields_by_comms_ovs;
 		break;
 	default:
 		/* update this according to the RXDID for FLEX_DESC_NONE */
-		rxq->rxd_to_pkt_fields = iavf_rxd_to_pkt_fields_by_comms_ovs;
+		rxq->rxdid = IAVF_RXDID_COMMS_OVS_1;
 		break;
 	}
 
@@ -1304,7 +1306,7 @@ iavf_recv_pkts_flex_rxd(void *rx_queue,
 		rxm->packet_type = ptype_tbl[IAVF_RX_FLEX_DESC_PTYPE_M &
 			rte_le_to_cpu_16(rxd.wb.ptype_flex_flags0)];
 		iavf_flex_rxd_to_vlan_tci(rxm, &rxd);
-		rxq->rxd_to_pkt_fields(rxq, rxm, &rxd);
+		rxd_to_pkt_fields_ops[rxq->rxdid](rxq, rxm, &rxd);
 		pkt_flags = iavf_flex_rxd_error_to_pkt_flags(rx_stat_err0);
 		rxm->ol_flags |= pkt_flags;
 
@@ -1446,7 +1448,7 @@ iavf_recv_scattered_pkts_flex_rxd(void *rx_queue, struct rte_mbuf **rx_pkts,
 		first_seg->packet_type = ptype_tbl[IAVF_RX_FLEX_DESC_PTYPE_M &
 			rte_le_to_cpu_16(rxd.wb.ptype_flex_flags0)];
 		iavf_flex_rxd_to_vlan_tci(first_seg, &rxd);
-		rxq->rxd_to_pkt_fields(rxq, first_seg, &rxd);
+		rxd_to_pkt_fields_ops[rxq->rxdid](rxq, first_seg, &rxd);
 		pkt_flags = iavf_flex_rxd_error_to_pkt_flags(rx_stat_err0);
 
 		first_seg->ol_flags |= pkt_flags;
@@ -1702,7 +1704,7 @@ iavf_rx_scan_hw_ring_flex_rxd(struct iavf_rx_queue *rxq)
 			mb->packet_type = ptype_tbl[IAVF_RX_FLEX_DESC_PTYPE_M &
 				rte_le_to_cpu_16(rxdp[j].wb.ptype_flex_flags0)];
 			iavf_flex_rxd_to_vlan_tci(mb, &rxdp[j]);
-			rxq->rxd_to_pkt_fields(rxq, mb, &rxdp[j]);
+			rxd_to_pkt_fields_ops[rxq->rxdid](rxq, mb, &rxdp[j]);
 			stat_err0 = rte_le_to_cpu_16(rxdp[j].wb.status_error0);
 			pkt_flags = iavf_flex_rxd_error_to_pkt_flags(stat_err0);
 
diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h
index decfe3ad4c..5b24d2ca29 100644
--- a/drivers/net/iavf/iavf_rxtx.h
+++ b/drivers/net/iavf/iavf_rxtx.h
@@ -193,8 +193,6 @@ struct iavf_rx_queue {
 	uint8_t proto_xtr; /* protocol extraction type */
 	uint64_t xtr_ol_flag;
 		/* flexible descriptor metadata extraction offload flag */
-	iavf_rxd_to_pkt_fields_t rxd_to_pkt_fields;
-				/* handle flexible descriptor by RXDID */
 };
 
 struct iavf_tx_entry {
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-03-09 16:30:08.950282970 +0000
+++ 0011-net-iavf-fix-function-pointer-in-multi-process.patch	2022-03-09 16:30:08.511024348 +0000
@@ -1 +1 @@
-From 0ed16e01313e1f8930dc6a52b22159b20269d4e0 Mon Sep 17 00:00:00 2001
+From 63030f8b7bf946181e2ae40d0e4ded4306066839 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0ed16e01313e1f8930dc6a52b22159b20269d4e0 ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
- drivers/net/iavf/iavf_rxtx.c | 40 +++++++++++++++++++-----------------
+ drivers/net/iavf/iavf_rxtx.c | 36 +++++++++++++++++++-----------------
@@ -21 +22 @@
- 2 files changed, 21 insertions(+), 21 deletions(-)
+ 2 files changed, 19 insertions(+), 19 deletions(-)
@@ -24 +25 @@
-index ca54c70dd0..cb779879cb 100644
+index c2a9c4f37b..6243199f2a 100644
@@ -27 +28 @@
-@@ -475,54 +475,56 @@ iavf_rxd_to_pkt_fields_by_comms_aux_v2(struct iavf_rx_queue *rxq,
+@@ -439,48 +439,50 @@ iavf_rxd_to_pkt_fields_by_comms_aux_v2(struct iavf_rx_queue *rxq,
@@ -41,2 +41,0 @@
-+	[IAVF_RXDID_COMMS_IPSEC_CRYPTO] =
-+		iavf_rxd_to_pkt_fields_by_comms_aux_v2,
@@ -84,6 +82,0 @@
- 	case IAVF_RXDID_COMMS_IPSEC_CRYPTO:
- 		rxq->xtr_ol_flag =
- 			rte_pmd_ifd_dynflag_proto_xtr_ipsec_crypto_said_mask;
--		rxq->rxd_to_pkt_fields =
--			iavf_rxd_to_pkt_fields_by_comms_aux_v2;
- 		break;
@@ -100 +93,3 @@
-@@ -1483,7 +1485,7 @@ iavf_recv_pkts_flex_rxd(void *rx_queue,
+@@ -1304,7 +1306,7 @@ iavf_recv_pkts_flex_rxd(void *rx_queue,
+ 		rxm->packet_type = ptype_tbl[IAVF_RX_FLEX_DESC_PTYPE_M &
+ 			rte_le_to_cpu_16(rxd.wb.ptype_flex_flags0)];
@@ -102,2 +96,0 @@
- 		iavf_flex_rxd_to_ipsec_crypto_status(rxm, &rxd,
- 				&rxq->stats.ipsec_crypto);
@@ -109 +102,3 @@
-@@ -1627,7 +1629,7 @@ iavf_recv_scattered_pkts_flex_rxd(void *rx_queue, struct rte_mbuf **rx_pkts,
+@@ -1446,7 +1448,7 @@ iavf_recv_scattered_pkts_flex_rxd(void *rx_queue, struct rte_mbuf **rx_pkts,
+ 		first_seg->packet_type = ptype_tbl[IAVF_RX_FLEX_DESC_PTYPE_M &
+ 			rte_le_to_cpu_16(rxd.wb.ptype_flex_flags0)];
@@ -111,2 +105,0 @@
- 		iavf_flex_rxd_to_ipsec_crypto_status(first_seg, &rxd,
- 				&rxq->stats.ipsec_crypto);
@@ -118 +111,3 @@
-@@ -1885,7 +1887,7 @@ iavf_rx_scan_hw_ring_flex_rxd(struct iavf_rx_queue *rxq)
+@@ -1702,7 +1704,7 @@ iavf_rx_scan_hw_ring_flex_rxd(struct iavf_rx_queue *rxq)
+ 			mb->packet_type = ptype_tbl[IAVF_RX_FLEX_DESC_PTYPE_M &
+ 				rte_le_to_cpu_16(rxdp[j].wb.ptype_flex_flags0)];
@@ -120,2 +114,0 @@
- 			iavf_flex_rxd_to_ipsec_crypto_status(mb, &rxdp[j],
- 				&rxq->stats.ipsec_crypto);
@@ -128 +121 @@
-index b610176b30..bf8aebbce8 100644
+index decfe3ad4c..5b24d2ca29 100644
@@ -131 +124 @@
-@@ -217,8 +217,6 @@ struct iavf_rx_queue {
+@@ -193,8 +193,6 @@ struct iavf_rx_queue {
@@ -137,2 +129,0 @@
- 	struct iavf_rx_queue_stats stats;
- 	uint64_t offloads;
@@ -139,0 +131,2 @@
+ 
+ struct iavf_tx_entry {


More information about the stable mailing list