svn commit: r339628 - head/sys/dev/cxgbe

Navdeep Parhar np at FreeBSD.org
Mon Oct 22 23:58:01 UTC 2018


Author: np
Date: Mon Oct 22 23:57:59 2018
New Revision: 339628
URL: https://svnweb.freebsd.org/changeset/base/339628

Log:
  cxgbe(4): improve the accuracy of various TSO limits reported to the kernel.
  
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Mon Oct 22 23:33:48 2018	(r339627)
+++ head/sys/dev/cxgbe/adapter.h	Mon Oct 22 23:57:59 2018	(r339628)
@@ -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
 };
 

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Mon Oct 22 23:33:48 2018	(r339627)
+++ head/sys/dev/cxgbe/t4_main.c	Mon Oct 22 23:57:59 2018	(r339628)
@@ -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


More information about the svn-src-all mailing list