Date: Fri, 23 Aug 2019 22:22:34 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351444 - head/sys/dev/cxgbe Message-ID: <201908232222.x7NMMYwm017214@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Fri Aug 23 22:22:34 2019 New Revision: 351444 URL: https://svnweb.freebsd.org/changeset/base/351444 Log: 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 Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Aug 23 22:17:36 2019 (r351443) +++ head/sys/dev/cxgbe/t4_sge.c Fri Aug 23 22:22:34 2019 (r351444) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908232222.x7NMMYwm017214>