git: 7f82047ec961 - stable/13 - cxgbei: Round up the maximum PDU data length by the MSS for TXDATAPLEN_MAX.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 29 Oct 2021 23:58:26 UTC
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=7f82047ec961383a0f8c11f9943522831f590f97

commit 7f82047ec961383a0f8c11f9943522831f590f97
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2021-07-29 21:17:45 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2021-10-29 23:15:44 +0000

    cxgbei: Round up the maximum PDU data length by the MSS for TXDATAPLEN_MAX.
    
    Recent firmware versions round down the value passed here by the MSS
    and subsequently mishandle transmitted PDUs larger than the rounded
    down value.
    
    Reported by:    Jithesh Arakkan @ Chelsio
    Sponsored by:   Chelsio Communications
    
    (cherry picked from commit d0d631d5f4437223664f7bbdfdb421ec05cf9657)
---
 sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
index 4a6cf0a19d44..7d8ebd1e040f 100644
--- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
+++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
@@ -826,7 +826,8 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd)
 		toep->params.ulp_mode = ULP_MODE_ISCSI;
 		toep->ulpcb = icc;
 
-		send_iscsi_flowc_wr(icc->sc, toep, ci->max_tx_pdu_len);
+		send_iscsi_flowc_wr(icc->sc, toep, roundup(ci->max_tx_pdu_len,
+		    tp->t_maxseg));
 		set_ulp_mode_iscsi(icc->sc, toep, icc->ulp_submode);
 		error = 0;
 	}