From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA8E1A00BE for ; Tue, 19 May 2020 15:06:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A4D261D610; Tue, 19 May 2020 15:06:02 +0200 (CEST) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 39C201D607 for ; Tue, 19 May 2020 15:06:02 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id l18so15835982wrn.6 for ; Tue, 19 May 2020 06:06:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NShzg8jbg60ZsuNdOQhk2Tvt53hAaflKAHaJkT2bZCw=; b=rdY3LdhzKTTkJ6+g9mIzDRtlhiOabw99DqV3pF1YNUyWh14YkDaCEFbl8xGdj/zBnq pa62GXgpemb5SYt2IOnPFBRErpGBo34adSqS5wd5MxVu2Ihn/CV9pkff7Qvzim+MuQjX 1+ODq+h/Ck/KW/MbiMDoawhUz77iZA8PqFw/Il/ztnsMItfHbAKwRyV3oB2S1lqLo//v vVtVeoGK3sVXDcexXMaj3nhPgkkVmo5uYZmpLCVVtHx2qkIDRaurdrePi6EdaVHkGH9A AoKUVeryFGXTK3c32Q4WNgaVQxeEIiXckhI5xhqYEwHdvNUE95xfaPwUr/tBApSHLneS qh3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NShzg8jbg60ZsuNdOQhk2Tvt53hAaflKAHaJkT2bZCw=; b=Mh8M0pBt8c4XnNw9A+Rd1ngnrZV74UT+P/DM4f9BQ6YU0o4AcAjz0hv/H1QCs8tMNm JmsEVAt42gsW4ADKY3XRRHWk0OEUlirK056wYJPUvwUiaru+kVYJE5JQPduRKLIr+cCa uJv4+5S/ctwfBXmrLOnEEBNJOlr2US2PcTodCb7IZloHdluNz/z92UVefFI8RWxnTQiY GofuzwjgCxlGh+qf5rSMASFkyDab3PVIVXU22boieYhYtLpe6BTJHIb8b2uWazVU9T4I Ht1Ig8hHIw3I6JN9fCQWsjqpYHbA/96qfzX/7ODAn96iXJNuVM5svS3Q3rWgG3u8fAu+ sMkg== X-Gm-Message-State: AOAM533qD75LpOHoYvqp/Q24I/9iBZxEGsPIsX+No+N/URz0F7OXMi51 o+ztHS+koPnUI7q9XbQF49U= X-Google-Smtp-Source: ABdhPJw5PIYHzI7XfWvvhvoP489haEf75WW06/NX2TQ78xuRanDV78GsfSVf7pQCV+PApd3B8fGBxQ== X-Received: by 2002:a5d:490d:: with SMTP id x13mr20768518wrq.199.1589893561889; Tue, 19 May 2020 06:06:01 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id k13sm3641876wmj.40.2020.05.19.06.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:06:01 -0700 (PDT) From: luca.boccassi@gmail.com To: Chengwen Feng Cc: Wei Hu , dpdk stable Date: Tue, 19 May 2020 14:02:19 +0100 Message-Id: <20200519130549.112823-4-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix packets offload features flags in Rx' has been queued to stable release 19.11.3 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 stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/20. 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. Luca Boccassi --- >From e9248b23b39115946d3e7082ba1e81c7211a6b77 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Tue, 17 Mar 2020 17:12:02 +0800 Subject: [PATCH] net/hns3: fix packets offload features flags in Rx [ upstream commit af531efa4b4e14a87f6fe45dfec732ea7434e4e9 ] Currently there is a certain probability of the unexpected ol_flag of the Rx packets's rte_mbuf when receiving packets. The root cause as below: 1. The member variable named ol_flag of the structure named rte_mbuf is not properly initialized to zero in the '.rx_pkt_burst' ops implementation function named hns3_recv_pkts. 2. When multi-segment rte_mbufs are needed for long packet in Rx operation, the driver should assign value to the ol_flag of the first segment, not to the ol_flag of the last segment. This patch fixes it with the following modification in the '.rx_pkt_burst' ops implementation function named hns3_recv_pkts. 1. Where the first write operation in the '.rx_pkt_burst' ops implementation function, assign PKT_RX_RSS_HASH to ol_flags directly using '=' operation instead of '|=' operation. 2. In the static function named hns3_rx_set_cksum_flag, the last rte_mbuf's ol_flags should be assigned when processing multi-segment. We fix it by passing first_seg variable to the function instead of rxm(the last segment's address). Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations") Fixes: ad7cf94823e8 ("net/hns3: fix offload flag for RSS hash") Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_rxtx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index 8166447131..e0f64f0d0b 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -977,7 +977,7 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) first_seg->pkt_len = pkt_len; first_seg->port = rxq->port_id; first_seg->hash.rss = rte_le_to_cpu_32(rxdp->rx.rss_hash); - first_seg->ol_flags |= PKT_RX_RSS_HASH; + first_seg->ol_flags = PKT_RX_RSS_HASH; if (unlikely(hns3_get_bit(bd_base_info, HNS3_RXD_LUM_B))) { first_seg->hash.fdir.hi = rte_le_to_cpu_32(rxdp->rx.fd_id); @@ -994,7 +994,8 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) ol_info); if (bd_base_info & BIT(HNS3_RXD_L3L4P_B)) - hns3_rx_set_cksum_flag(rxm, first_seg->packet_type, + hns3_rx_set_cksum_flag(first_seg, + first_seg->packet_type, cksum_err); first_seg->vlan_tci = rte_le_to_cpu_16(rxdp->rx.vlan_tag); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:44.769070698 +0100 +++ 0004-net-hns3-fix-packets-offload-features-flags-in-Rx.patch 2020-05-19 14:04:44.048645327 +0100 @@ -1,8 +1,10 @@ -From af531efa4b4e14a87f6fe45dfec732ea7434e4e9 Mon Sep 17 00:00:00 2001 +From e9248b23b39115946d3e7082ba1e81c7211a6b77 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Tue, 17 Mar 2020 17:12:02 +0800 Subject: [PATCH] net/hns3: fix packets offload features flags in Rx +[ upstream commit af531efa4b4e14a87f6fe45dfec732ea7434e4e9 ] + Currently there is a certain probability of the unexpected ol_flag of the Rx packets's rte_mbuf when receiving packets. @@ -26,7 +28,6 @@ Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations") Fixes: ad7cf94823e8 ("net/hns3: fix offload flag for RSS hash") -Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) @@ -35,19 +36,19 @@ 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c -index ec6d19f58f..0c965b1b83 100644 +index 8166447131..e0f64f0d0b 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c -@@ -1582,7 +1582,7 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) +@@ -977,7 +977,7 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) first_seg->pkt_len = pkt_len; first_seg->port = rxq->port_id; - first_seg->hash.rss = rte_le_to_cpu_32(rxd.rx.rss_hash); + first_seg->hash.rss = rte_le_to_cpu_32(rxdp->rx.rss_hash); - first_seg->ol_flags |= PKT_RX_RSS_HASH; + first_seg->ol_flags = PKT_RX_RSS_HASH; if (unlikely(hns3_get_bit(bd_base_info, HNS3_RXD_LUM_B))) { first_seg->hash.fdir.hi = - rte_le_to_cpu_32(rxd.rx.fd_id); -@@ -1599,7 +1599,8 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) + rte_le_to_cpu_32(rxdp->rx.fd_id); +@@ -994,7 +994,8 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) ol_info); if (bd_base_info & BIT(HNS3_RXD_L3L4P_B)) @@ -56,7 +57,7 @@ + first_seg->packet_type, cksum_err); - first_seg->vlan_tci = rte_le_to_cpu_16(rxd.rx.vlan_tag); + first_seg->vlan_tci = rte_le_to_cpu_16(rxdp->rx.vlan_tag); -- 2.20.1