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 1F033A04EF; Wed, 3 Jun 2020 11:34:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 601911D127; Wed, 3 Jun 2020 11:33:46 +0200 (CEST) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id 1CD041B53 for ; Wed, 3 Jun 2020 11:33:43 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A1185C3BC5D784D830E3 for ; Wed, 3 Jun 2020 17:33:40 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Wed, 3 Jun 2020 17:33:30 +0800 From: "Wei Hu (Xavier)" To: CC: Date: Wed, 3 Jun 2020 17:32:01 +0800 Message-ID: <1591176721-46875-5-git-send-email-xavier.huwei@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591176721-46875-1-git-send-email-xavier.huwei@huawei.com> References: <1591176721-46875-1-git-send-email-xavier.huwei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v 4/4] net/hns3: add checking tso segsz when sending TSO packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hongbo Zheng Base on hns3 network engine, when the rte_eth_tx_burst API is called by Upper Level Process, if PKT_TX_TCP_SEG flag is set and tso_segsz is 0 in the input parameter structure rte_mbuf, hns3 PMD driver will process this packet as an non-TSO packet, otherwise hardware will enter an abnormal state. Fixes: 6dca716c9e1d ("net/hns3: support TSO") Cc: stable@dpdk.org Signed-off-by: Hongbo Zheng Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_rxtx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index d870d51..2ce9bf4 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1850,6 +1850,12 @@ hns3_tso_proc_tunnel(struct hns3_desc *desc, uint64_t ol_flags, return 0; } +static inline bool +hns3_pkt_is_tso(struct rte_mbuf *m) +{ + return (m->tso_segsz != 0 && m->ol_flags & PKT_TX_TCP_SEG); +} + static void hns3_set_tso(struct hns3_desc *desc, uint64_t ol_flags, struct rte_mbuf *rxm) @@ -1858,7 +1864,7 @@ hns3_set_tso(struct hns3_desc *desc, uint32_t tmp; uint8_t l2_len = rxm->l2_len; - if (!(ol_flags & PKT_TX_TCP_SEG)) + if (!hns3_pkt_is_tso(rxm)) return; if (hns3_tso_proc_tunnel(desc, ol_flags, rxm, &l2_len)) @@ -2307,12 +2313,6 @@ hns3_outer_header_cksum_prepare(struct rte_mbuf *m) } } -static inline bool -hns3_pkt_is_tso(struct rte_mbuf *m) -{ - return (m->tso_segsz != 0 && m->ol_flags & PKT_TX_TCP_SEG); -} - static int hns3_check_tso_pkt_valid(struct rte_mbuf *m) { -- 2.7.4