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 BB8D7A0093; Wed, 20 May 2020 13:29:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E2601C29A; Wed, 20 May 2020 13:29:36 +0200 (CEST) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id E08E81C295; Wed, 20 May 2020 13:29:34 +0200 (CEST) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id EE0302B8D7C7383AC4CE; Wed, 20 May 2020 19:29:31 +0800 (CST) Received: from tester.localdomain (10.175.119.39) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Wed, 20 May 2020 19:29:23 +0800 From: Xiaoyun wang To: CC: , , , , , , , , , Xiaoyun wang , Date: Wed, 20 May 2020 19:52:59 +0800 Message-ID: <377183c949056a95cf9357a0a06eec341d49b224.1589975173.git.cloud.wangxiaoyun@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.119.39] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v1 1/1] net/hinic: fix TSO problem 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" When TSO mss is smaller than 80, and the sum length of continus sge num is larger than a mss, which may cause hardware failed, so in this scenarios pmd driver should adjust the tso_segsz with the same with the value of hardware supported. Fixes: 076221c8fe1d ("net/hinic: add Rx/Tx") Cc: stable@dpdk.org Signed-off-by: Xiaoyun wang --- drivers/net/hinic/hinic_pmd_tx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/hinic/hinic_pmd_tx.c b/drivers/net/hinic/hinic_pmd_tx.c index bd39f93..4d99967 100644 --- a/drivers/net/hinic/hinic_pmd_tx.c +++ b/drivers/net/hinic/hinic_pmd_tx.c @@ -455,7 +455,7 @@ static inline bool hinic_is_tso_sge_valid(struct rte_mbuf *mbuf, *poff_info, struct hinic_wqe_info *sqe_info) { - u32 total_len, limit_len, checked_len, left_len; + u32 total_len, limit_len, checked_len, left_len, adjust_mss; u32 i, first_mss_sges, left_sges; struct rte_mbuf *mbuf_head, *mbuf_pre; @@ -465,7 +465,9 @@ static inline bool hinic_is_tso_sge_valid(struct rte_mbuf *mbuf, /* tso sge number validation */ if (unlikely(left_sges >= HINIC_NONTSO_PKT_MAX_SGE)) { checked_len = 0; - limit_len = mbuf->tso_segsz + poff_info->payload_offset; + adjust_mss = mbuf->tso_segsz >= TX_MSS_MIN ? + mbuf->tso_segsz : TX_MSS_MIN; + limit_len = adjust_mss + poff_info->payload_offset; first_mss_sges = HINIC_NONTSO_PKT_MAX_SGE; /* each continues 17 mbufs segmust do one check */ @@ -479,7 +481,7 @@ static inline bool hinic_is_tso_sge_valid(struct rte_mbuf *mbuf, mbuf_pre = mbuf; mbuf = mbuf->next; if (total_len >= limit_len) { - limit_len = mbuf_head->tso_segsz; + limit_len = adjust_mss; break; } } -- 1.8.3.1