[dpdk-stable] patch 'net/cxgbe: fix missing checksum flags and packet type' has been queued to LTS release 18.11.2

Kevin Traynor ktraynor at redhat.com
Tue Apr 16 16:36:56 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/24/19. 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.

Thanks.

Kevin Traynor

---
>From 7beb36406df7b38890c4aaef03b6bdf81f0ba87a Mon Sep 17 00:00:00 2001
From: Vishal Kulkarni <vishal at chelsio.com>
Date: Wed, 20 Mar 2019 17:18:21 +0530
Subject: [PATCH] net/cxgbe: fix missing checksum flags and packet type

[ upstream commit df68e75a79a4d0f86d0ebea2d43775759e066a2a ]

Checksum good offload flags are not being set and some of the
packet type flags are missing on received packets. So, rework
Rx path to set proper ol_flags and packet_type in mbufs.

Fixes: 78fc1a716ae8 ("cxgbe: improve Rx performance")

Signed-off-by: Vishal Kulkarni <vishal at chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy at chelsio.com>
---
 drivers/net/cxgbe/sge.c | 78 +++++++++++++++++++++++++----------------
 1 file changed, 48 insertions(+), 30 deletions(-)

diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index f9d2d48a0..663c0a796 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -1605,4 +1605,50 @@ static inline void rspq_next(struct sge_rspq *q)
 }
 
+static inline void cxgbe_set_mbuf_info(struct rte_mbuf *pkt, uint32_t ptype,
+				       uint64_t ol_flags)
+{
+	pkt->packet_type |= ptype;
+	pkt->ol_flags |= ol_flags;
+}
+
+static inline void cxgbe_fill_mbuf_info(struct adapter *adap,
+					const struct cpl_rx_pkt *cpl,
+					struct rte_mbuf *pkt)
+{
+	bool csum_ok;
+	u16 err_vec;
+
+	if (adap->params.tp.rx_pkt_encap)
+		err_vec = G_T6_COMPR_RXERR_VEC(ntohs(cpl->err_vec));
+	else
+		err_vec = ntohs(cpl->err_vec);
+
+	csum_ok = cpl->csum_calc && !err_vec;
+
+	if (cpl->vlan_ex)
+		cxgbe_set_mbuf_info(pkt, RTE_PTYPE_L2_ETHER_VLAN,
+				    PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED);
+	else
+		cxgbe_set_mbuf_info(pkt, RTE_PTYPE_L2_ETHER, 0);
+
+	if (cpl->l2info & htonl(F_RXF_IP))
+		cxgbe_set_mbuf_info(pkt, RTE_PTYPE_L3_IPV4,
+				    csum_ok ? PKT_RX_IP_CKSUM_GOOD :
+					      PKT_RX_IP_CKSUM_BAD);
+	else if (cpl->l2info & htonl(F_RXF_IP6))
+		cxgbe_set_mbuf_info(pkt, RTE_PTYPE_L3_IPV6,
+				    csum_ok ? PKT_RX_IP_CKSUM_GOOD :
+					      PKT_RX_IP_CKSUM_BAD);
+
+	if (cpl->l2info & htonl(F_RXF_TCP))
+		cxgbe_set_mbuf_info(pkt, RTE_PTYPE_L4_TCP,
+				    csum_ok ? PKT_RX_L4_CKSUM_GOOD :
+					      PKT_RX_L4_CKSUM_BAD);
+	else if (cpl->l2info & htonl(F_RXF_UDP))
+		cxgbe_set_mbuf_info(pkt, RTE_PTYPE_L4_UDP,
+				    csum_ok ? PKT_RX_L4_CKSUM_GOOD :
+					      PKT_RX_L4_CKSUM_BAD);
+}
+
 /**
  * process_responses - process responses from an SGE response queue
@@ -1656,6 +1702,4 @@ static int process_responses(struct sge_rspq *q, int budget,
 				struct rte_mbuf *pkt, *npkt;
 				u32 len, bufsz;
-				bool csum_ok;
-				u16 err_vec;
 
 				rc = (const struct rsp_ctrl *)
@@ -1674,14 +1718,4 @@ static int process_responses(struct sge_rspq *q, int budget,
 				pkt->pkt_len = len;
 
-				/* Compressed error vector is enabled for
-				 * T6 only
-				 */
-				if (q->adapter->params.tp.rx_pkt_encap)
-					err_vec = G_T6_COMPR_RXERR_VEC(
-							ntohs(cpl->err_vec));
-				else
-					err_vec = ntohs(cpl->err_vec);
-				csum_ok = cpl->csum_calc && !err_vec;
-
 				/* Chain mbufs into len if necessary */
 				while (len) {
@@ -1701,18 +1735,5 @@ static int process_responses(struct sge_rspq *q, int budget,
 				pkt->nb_segs--;
 
-				if (cpl->l2info & htonl(F_RXF_IP)) {
-					pkt->packet_type = RTE_PTYPE_L3_IPV4;
-					if (unlikely(!csum_ok))
-						pkt->ol_flags |=
-							PKT_RX_IP_CKSUM_BAD;
-
-					if ((cpl->l2info &
-					     htonl(F_RXF_UDP | F_RXF_TCP)) &&
-					    !csum_ok)
-						pkt->ol_flags |=
-							PKT_RX_L4_CKSUM_BAD;
-				} else if (cpl->l2info & htonl(F_RXF_IP6)) {
-					pkt->packet_type = RTE_PTYPE_L3_IPV6;
-				}
+				cxgbe_fill_mbuf_info(q->adapter, cpl, pkt);
 
 				if (!rss_hdr->filter_tid &&
@@ -1723,9 +1744,6 @@ static int process_responses(struct sge_rspq *q, int budget,
 				}
 
-				if (cpl->vlan_ex) {
-					pkt->ol_flags |= PKT_RX_VLAN |
-							 PKT_RX_VLAN_STRIPPED;
+				if (cpl->vlan_ex)
 					pkt->vlan_tci = ntohs(cpl->vlan);
-				}
 
 				rte_pktmbuf_adj(pkt, s->pktshift);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-04-16 15:34:26.886556791 +0100
+++ 0038-net-cxgbe-fix-missing-checksum-flags-and-packet-type.patch	2019-04-16 15:34:25.192179684 +0100
@@ -1,14 +1,15 @@
-From df68e75a79a4d0f86d0ebea2d43775759e066a2a Mon Sep 17 00:00:00 2001
+From 7beb36406df7b38890c4aaef03b6bdf81f0ba87a Mon Sep 17 00:00:00 2001
 From: Vishal Kulkarni <vishal at chelsio.com>
 Date: Wed, 20 Mar 2019 17:18:21 +0530
 Subject: [PATCH] net/cxgbe: fix missing checksum flags and packet type
 
+[ upstream commit df68e75a79a4d0f86d0ebea2d43775759e066a2a ]
+
 Checksum good offload flags are not being set and some of the
 packet type flags are missing on received packets. So, rework
 Rx path to set proper ol_flags and packet_type in mbufs.
 
 Fixes: 78fc1a716ae8 ("cxgbe: improve Rx performance")
-Cc: stable at dpdk.org
 
 Signed-off-by: Vishal Kulkarni <vishal at chelsio.com>
 Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy at chelsio.com>
@@ -17,10 +18,10 @@
  1 file changed, 48 insertions(+), 30 deletions(-)
 
 diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
-index bfb90a33c..3a0eba5df 100644
+index f9d2d48a0..663c0a796 100644
 --- a/drivers/net/cxgbe/sge.c
 +++ b/drivers/net/cxgbe/sge.c
-@@ -1514,4 +1514,50 @@ static inline void rspq_next(struct sge_rspq *q)
+@@ -1605,4 +1605,50 @@ static inline void rspq_next(struct sge_rspq *q)
  }
  
 +static inline void cxgbe_set_mbuf_info(struct rte_mbuf *pkt, uint32_t ptype,
@@ -71,14 +72,14 @@
 +
  /**
   * process_responses - process responses from an SGE response queue
-@@ -1565,6 +1611,4 @@ static int process_responses(struct sge_rspq *q, int budget,
+@@ -1656,6 +1702,4 @@ static int process_responses(struct sge_rspq *q, int budget,
  				struct rte_mbuf *pkt, *npkt;
  				u32 len, bufsz;
 -				bool csum_ok;
 -				u16 err_vec;
  
  				rc = (const struct rsp_ctrl *)
-@@ -1583,14 +1627,4 @@ static int process_responses(struct sge_rspq *q, int budget,
+@@ -1674,14 +1718,4 @@ static int process_responses(struct sge_rspq *q, int budget,
  				pkt->pkt_len = len;
  
 -				/* Compressed error vector is enabled for
@@ -93,7 +94,7 @@
 -
  				/* Chain mbufs into len if necessary */
  				while (len) {
-@@ -1610,18 +1644,5 @@ static int process_responses(struct sge_rspq *q, int budget,
+@@ -1701,18 +1735,5 @@ static int process_responses(struct sge_rspq *q, int budget,
  				pkt->nb_segs--;
  
 -				if (cpl->l2info & htonl(F_RXF_IP)) {
@@ -113,7 +114,7 @@
 +				cxgbe_fill_mbuf_info(q->adapter, cpl, pkt);
  
  				if (!rss_hdr->filter_tid &&
-@@ -1632,9 +1653,6 @@ static int process_responses(struct sge_rspq *q, int budget,
+@@ -1723,9 +1744,6 @@ static int process_responses(struct sge_rspq *q, int budget,
  				}
  
 -				if (cpl->vlan_ex) {


More information about the stable mailing list