mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
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
This commit is contained in:
parent
d9cacf605e
commit
8bf3090312
1 changed files with 6 additions and 22 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue