cxgbe(4): improve the accuracy of various TSO limits reported to the kernel.

Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2018-10-22 23:57:59 +00:00
parent db2380870c
commit 17e81b7863
2 changed files with 10 additions and 3 deletions
sys/dev/cxgbe

@ -113,6 +113,7 @@ enum {
SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in desc */
TX_SGL_SEGS = 39,
TX_SGL_SEGS_TSO = 38,
TX_SGL_SEGS_EO_TSO = 30, /* XXX: lower for IPv6. */
TX_WR_FLITS = SGE_MAX_WR_LEN / 8
};

@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$");
#ifdef RSS
#include <net/rss_config.h>
#endif
#include <netinet/in.h>
#include <netinet/ip.h>
#if defined(__i386__) || defined(__amd64__)
#include <machine/md_var.h>
#include <machine/cputypes.h>
@ -1535,9 +1537,13 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO |
CSUM_UDP_IPV6 | CSUM_TCP_IPV6;
ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN);
ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS;
ifp->if_hw_tsomaxsegsize = 65536;
ifp->if_hw_tsomax = IP_MAXPACKET;
ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_TSO;
#ifdef RATELIMIT
if (is_ethoffload(vi->pi->adapter) && vi->nofldtxq != 0)
ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_EO_TSO;
#endif
ifp->if_hw_tsomaxsegsize = 0;
ether_ifattach(ifp, vi->hw_addr);
#ifdef DEV_NETMAP