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 11F96A034C for ; Mon, 17 Aug 2020 11:26:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 054031C124; Mon, 17 Aug 2020 11:26:30 +0200 (CEST) Received: from mail.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id DA2801C12F for ; Mon, 17 Aug 2020 11:26:21 +0200 (CEST) Received: from localhost.localdomain (120.133.139.157) by INCCAS001.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Mon, 17 Aug 2020 17:25:43 +0800 From: "Wei Hu (Xavier)" To: CC: Date: Mon, 17 Aug 2020 17:25:20 +0800 Message-ID: <20200817092532.59530-13-huwei013@chinasoftinc.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200817092532.59530-1-huwei013@chinasoftinc.com> References: <20200817092532.59530-1-huwei013@chinasoftinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [120.133.139.157] Subject: [dpdk-stable] [PATCH 12/24] net/hns3: check TSO segment size during Tx 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" From: Hongbo Zheng [ upstream commit b68259f775b749ae860dfa4e170dd01774bf30d7 ] 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 972dc7101..db07fc459 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1902,6 +1902,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) @@ -1910,7 +1916,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)) @@ -2359,12 +2365,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.27.0