From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D4AFAA00E6 for ; Tue, 16 Apr 2019 16:38:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 003CB1B4EB; Tue, 16 Apr 2019 16:38:40 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 7E9461B4EB for ; Tue, 16 Apr 2019 16:38:38 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E162BC07585F; Tue, 16 Apr 2019 14:38:37 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-214.ams2.redhat.com [10.36.117.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id D21981001E92; Tue, 16 Apr 2019 14:38:36 +0000 (UTC) From: Kevin Traynor To: Vishal Kulkarni Cc: Rahul Lakkireddy , dpdk stable Date: Tue, 16 Apr 2019 15:36:56 +0100 Message-Id: <20190416143719.21601-38-ktraynor@redhat.com> In-Reply-To: <20190416143719.21601-1-ktraynor@redhat.com> References: <20190416143719.21601-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 16 Apr 2019 14:38:37 +0000 (UTC) Subject: [dpdk-stable] patch 'net/cxgbe: fix missing checksum flags and packet type' has been queued to LTS release 18.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 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 Signed-off-by: Rahul Lakkireddy --- 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 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@dpdk.org Signed-off-by: Vishal Kulkarni Signed-off-by: Rahul Lakkireddy @@ -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) {