Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 May 2017 21:53:47 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r318825 - stable/11/sys/dev/cxgbe
Message-ID:  <201705242153.v4OLrlSh040591@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Wed May 24 21:53:47 2017
New Revision: 318825
URL: https://svnweb.freebsd.org/changeset/base/318825

Log:
  MFC r309725:
  
  cxgbe(4): netmap does not set IFCAP_NETMAP in an ifnet's if_capabilities
  any more (since r307394).  Do it in the driver instead.
  
  Sponsored by:	Chelsio Communications

Modified:
  stable/11/sys/dev/cxgbe/t4_main.c
  stable/11/sys/dev/cxgbe/t4_netmap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/11/sys/dev/cxgbe/t4_main.c	Wed May 24 21:52:20 2017	(r318824)
+++ stable/11/sys/dev/cxgbe/t4_main.c	Wed May 24 21:53:47 2017	(r318825)
@@ -1444,6 +1444,10 @@ cxgbe_vi_attach(device_t dev, struct vi_
 	if (vi->nofldrxq != 0)
 		ifp->if_capabilities |= IFCAP_TOE;
 #endif
+#ifdef DEV_NETMAP
+	if (vi->nnmrxq != 0)
+		ifp->if_capabilities |= IFCAP_NETMAP;
+#endif
 	ifp->if_capenable = T4_CAP_ENABLE;
 	ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO |
 	    CSUM_UDP_IPV6 | CSUM_TCP_IPV6;
@@ -1462,7 +1466,7 @@ cxgbe_vi_attach(device_t dev, struct vi_
 
 	ether_ifattach(ifp, vi->hw_addr);
 #ifdef DEV_NETMAP
-	if (vi->nnmrxq != 0)
+	if (ifp->if_capabilities & IFCAP_NETMAP)
 		cxgbe_nm_attach(vi);
 #endif
 	sb = sbuf_new_auto();

Modified: stable/11/sys/dev/cxgbe/t4_netmap.c
==============================================================================
--- stable/11/sys/dev/cxgbe/t4_netmap.c	Wed May 24 21:52:20 2017	(r318824)
+++ stable/11/sys/dev/cxgbe/t4_netmap.c	Wed May 24 21:53:47 2017	(r318825)
@@ -870,7 +870,7 @@ cxgbe_nm_attach(struct vi_info *vi)
 	na.nm_register = cxgbe_netmap_reg;
 	na.num_tx_rings = vi->nnmtxq;
 	na.num_rx_rings = vi->nnmrxq;
-	netmap_attach(&na);	/* This adds IFCAP_NETMAP to if_capabilities */
+	netmap_attach(&na);
 }
 
 void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705242153.v4OLrlSh040591>