svn commit: r346928 - stable/11/sys/dev/cxgbe
Navdeep Parhar
np at FreeBSD.org
Mon Apr 29 21:34:25 UTC 2019
Author: np
Date: Mon Apr 29 21:34:24 2019
New Revision: 346928
URL: https://svnweb.freebsd.org/changeset/base/346928
Log:
MFC r339628, r339965
r339628:
cxgbe(4): improve the accuracy of various TSO limits reported to the kernel.
Sponsored by: Chelsio Communications
r339965:
cxgbe(4): Report a reasonable non-zero if_hw_tsomaxsegsize to the
kernel.
This reverts an accidental change that snuck in with r339628.
Sponsored by: Chelsio Communications
Modified:
stable/11/sys/dev/cxgbe/adapter.h
stable/11/sys/dev/cxgbe/t4_main.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/cxgbe/adapter.h
==============================================================================
--- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 20:53:20 2019 (r346927)
+++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 21:34:24 2019 (r346928)
@@ -114,6 +114,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
};
Modified: stable/11/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 20:53:20 2019 (r346927)
+++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 21:34:24 2019 (r346928)
@@ -60,6 +60,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>
@@ -1607,8 +1609,12 @@ 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_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 = 65536;
ether_ifattach(ifp, vi->hw_addr);
More information about the svn-src-stable
mailing list