From 8bf3090312c3aae1fe2deff3e48149b154bedeba Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Fri, 23 Aug 2019 22:22:34 +0000 Subject: [PATCH] cxgbe(4): Use the same buffer size for TOE rx queues as the NIC rx queues. This is a minor simplification. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_sge.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 395036e3bf6..64b68500318 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -1112,26 +1112,12 @@ t4_teardown_adapter_queues(struct adapter *sc) /* Maximum payload that can be delivered with a single iq descriptor */ static inline int -mtu_to_max_payload(struct adapter *sc, int mtu, const int toe) +mtu_to_max_payload(struct adapter *sc, int mtu) { - int payload; -#ifdef TCP_OFFLOAD - if (toe) { - int rxcs = G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2)); - - /* Note that COP can set rx_coalesce on/off per connection. */ - payload = max(mtu, rxcs); - } else { -#endif - /* large enough even when hw VLAN extraction is disabled */ - payload = sc->params.sge.fl_pktshift + ETHER_HDR_LEN + - ETHER_VLAN_ENCAP_LEN + mtu; -#ifdef TCP_OFFLOAD - } -#endif - - return (payload); + /* large enough even when hw VLAN extraction is disabled */ + return (sc->params.sge.fl_pktshift + ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + mtu); } int @@ -1201,7 +1187,7 @@ t4_setup_vi_queues(struct vi_info *vi) * Allocate rx queues first because a default iqid is required when * creating a tx queue. */ - maxp = mtu_to_max_payload(sc, mtu, 0); + maxp = mtu_to_max_payload(sc, mtu); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "rxq", CTLFLAG_RD, NULL, "rx queues"); for_each_rxq(vi, i, rxq) { @@ -1223,7 +1209,6 @@ t4_setup_vi_queues(struct vi_info *vi) intr_idx = saved_idx + max(vi->nrxq, vi->nnmrxq); #endif #ifdef TCP_OFFLOAD - maxp = mtu_to_max_payload(sc, mtu, 1); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_rxq", CTLFLAG_RD, NULL, "rx queues for offloaded TCP connections"); for_each_ofld_rxq(vi, i, ofld_rxq) { @@ -2194,7 +2179,7 @@ t4_update_fl_bufsize(struct ifnet *ifp) struct sge_fl *fl; int i, maxp, mtu = ifp->if_mtu; - maxp = mtu_to_max_payload(sc, mtu, 0); + maxp = mtu_to_max_payload(sc, mtu); for_each_rxq(vi, i, rxq) { fl = &rxq->fl; @@ -2203,7 +2188,6 @@ t4_update_fl_bufsize(struct ifnet *ifp) FL_UNLOCK(fl); } #ifdef TCP_OFFLOAD - maxp = mtu_to_max_payload(sc, mtu, 1); for_each_ofld_rxq(vi, i, ofld_rxq) { fl = &ofld_rxq->fl;