patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH v1 1/1] net/hinic: fix TSO problem
       [not found] <cover.1589975173.git.cloud.wangxiaoyun@huawei.com>
@ 2020-05-20 11:52 ` Xiaoyun wang
  2020-05-21 15:16   ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Xiaoyun wang @ 2020-05-20 11:52 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, bluca, luoxianjun, luoxingyu, zhouguoyang,
	yin.yinshi, david.yangxiaoliang, zhaohui8, zhengjingzhou,
	Xiaoyun wang, stable

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 <cloud.wangxiaoyun@huawei.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH v1 1/1] net/hinic: fix TSO problem
  2020-05-20 11:52 ` [dpdk-stable] [PATCH v1 1/1] net/hinic: fix TSO problem Xiaoyun wang
@ 2020-05-21 15:16   ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2020-05-21 15:16 UTC (permalink / raw)
  To: Xiaoyun wang, dev
  Cc: bluca, luoxianjun, luoxingyu, zhouguoyang, yin.yinshi,
	david.yangxiaoliang, zhaohui8, zhengjingzhou, stable

On 5/20/2020 12:52 PM, Xiaoyun wang wrote:
> 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 <cloud.wangxiaoyun@huawei.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1589975173.git.cloud.wangxiaoyun@huawei.com>
2020-05-20 11:52 ` [dpdk-stable] [PATCH v1 1/1] net/hinic: fix TSO problem Xiaoyun wang
2020-05-21 15:16   ` Ferruh Yigit

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox