DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wei Hu (Xavier)" <huwei013@chinasoftinc.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 3/7] net/hns3: fix packets's offload features flags in Rx
Date: Tue, 17 Mar 2020 17:12:02 +0800	[thread overview]
Message-ID: <20200317091206.34928-4-huwei013@chinasoftinc.com> (raw)
In-Reply-To: <20200317091206.34928-1-huwei013@chinasoftinc.com>

From: Chengwen Feng <fengchengwen@huawei.com>

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")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 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 ec6d19f58..0c965b1b8 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)
 		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->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)
 								  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(rxd.rx.vlan_tag);
-- 
2.23.0


  parent reply	other threads:[~2020-03-17  9:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17  9:11 [dpdk-dev] [PATCH 0/7] misc updates for hns3 PMD driver Wei Hu (Xavier)
2020-03-17  9:12 ` [dpdk-dev] [PATCH 1/7] net/hns3: remove redundant MAC addr check when setting MAC Wei Hu (Xavier)
2020-03-17  9:12 ` [dpdk-dev] [PATCH 2/7] net/hns3: modify inappropriate names Wei Hu (Xavier)
2020-03-17  9:12 ` Wei Hu (Xavier) [this message]
2020-03-17  9:12 ` [dpdk-dev] [PATCH 4/7] net/hns3: fix default error code of command interface Wei Hu (Xavier)
2020-03-17  9:12 ` [dpdk-dev] [PATCH 5/7] net/hns3: fix crash when flushing RSS flow rules with FLR Wei Hu (Xavier)
2020-03-17  9:12 ` [dpdk-dev] [PATCH 6/7] net/hns3: fix configuring illeagl VLAN pvid Wei Hu (Xavier)
2020-03-17  9:12 ` [dpdk-dev] [PATCH 7/7] net/hns3: fix abnormal status after reset occurs repeatedly Wei Hu (Xavier)
2020-03-19  9:08 ` [dpdk-dev] [PATCH 0/7] misc updates for hns3 PMD driver Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200317091206.34928-4-huwei013@chinasoftinc.com \
    --to=huwei013@chinasoftinc.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).