svn commit: r352912 - in releng/12.1/sys: dev/ixgbe net

Eric Joyner erj at FreeBSD.org
Mon Sep 30 18:22:35 UTC 2019


Author: erj
Date: Mon Sep 30 18:22:33 2019
New Revision: 352912
URL: https://svnweb.freebsd.org/changeset/base/352912

Log:
  MFC r352910 and r352911
  
  MFC r352910: iflib: Remove redundant VLAN events deregistration
  MFC r352911: ix/ixv: Read MSI-X bar from device config
  
  These fix an issue with a kernel panic on unload with an iflib-using
  driver and allow certain HP-branded Intel 10G cards to use MSI-X,
  respectively.
  
  Approved by:	re@ (gjb@)
  Sponsored by:	Intel Corporation

Modified:
  releng/12.1/sys/dev/ixgbe/if_ix.c
  releng/12.1/sys/dev/ixgbe/if_ixv.c
  releng/12.1/sys/dev/ixgbe/ixgbe.h
  releng/12.1/sys/net/iflib.c
Directory Properties:
  releng/12.1/   (props changed)

Modified: releng/12.1/sys/dev/ixgbe/if_ix.c
==============================================================================
--- releng/12.1/sys/dev/ixgbe/if_ix.c	Mon Sep 30 17:36:49 2019	(r352911)
+++ releng/12.1/sys/dev/ixgbe/if_ix.c	Mon Sep 30 18:22:33 2019	(r352912)
@@ -1011,12 +1011,13 @@ ixgbe_if_attach_pre(if_ctx_t ctx)
 	    CSUM_IP6_TCP | CSUM_IP6_UDP | CSUM_IP6_TSO;
 	if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
 		scctx->isc_tx_nsegments = IXGBE_82598_SCATTER;
-		scctx->isc_msix_bar = PCIR_BAR(MSIX_82598_BAR);
 	} else {
 		scctx->isc_tx_csum_flags |= CSUM_SCTP |CSUM_IP6_SCTP;
 		scctx->isc_tx_nsegments = IXGBE_82599_SCATTER;
-		scctx->isc_msix_bar = PCIR_BAR(MSIX_82599_BAR);
 	}
+
+	scctx->isc_msix_bar = pci_msix_table_bar(dev);
+
 	scctx->isc_tx_tso_segments_max = scctx->isc_tx_nsegments;
 	scctx->isc_tx_tso_size_max = IXGBE_TSO_SIZE;
 	scctx->isc_tx_tso_segsize_max = PAGE_SIZE;

Modified: releng/12.1/sys/dev/ixgbe/if_ixv.c
==============================================================================
--- releng/12.1/sys/dev/ixgbe/if_ixv.c	Mon Sep 30 17:36:49 2019	(r352911)
+++ releng/12.1/sys/dev/ixgbe/if_ixv.c	Mon Sep 30 18:22:33 2019	(r352912)
@@ -495,7 +495,7 @@ ixv_if_attach_pre(if_ctx_t ctx)
 	scctx->isc_tx_csum_flags = CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_TSO |
 	    CSUM_IP6_TCP | CSUM_IP6_UDP | CSUM_IP6_TSO;
 	scctx->isc_tx_nsegments = IXGBE_82599_SCATTER;
-	scctx->isc_msix_bar = PCIR_BAR(MSIX_82598_BAR);
+	scctx->isc_msix_bar = pci_msix_table_bar(dev);
 	scctx->isc_tx_tso_segments_max = scctx->isc_tx_nsegments;
 	scctx->isc_tx_tso_size_max = IXGBE_TSO_SIZE;
 	scctx->isc_tx_tso_segsize_max = PAGE_SIZE;

Modified: releng/12.1/sys/dev/ixgbe/ixgbe.h
==============================================================================
--- releng/12.1/sys/dev/ixgbe/ixgbe.h	Mon Sep 30 17:36:49 2019	(r352911)
+++ releng/12.1/sys/dev/ixgbe/ixgbe.h	Mon Sep 30 18:22:33 2019	(r352912)
@@ -189,8 +189,6 @@
 #define MAX_NUM_MULTICAST_ADDRESSES     128
 #define IXGBE_82598_SCATTER             100
 #define IXGBE_82599_SCATTER             32
-#define MSIX_82598_BAR                  3
-#define MSIX_82599_BAR                  4
 #define IXGBE_TSO_SIZE                  262140
 #define IXGBE_RX_HDR                    128
 #define IXGBE_VFTA_SIZE                 128

Modified: releng/12.1/sys/net/iflib.c
==============================================================================
--- releng/12.1/sys/net/iflib.c	Mon Sep 30 17:36:49 2019	(r352911)
+++ releng/12.1/sys/net/iflib.c	Mon Sep 30 18:22:33 2019	(r352912)
@@ -4260,6 +4260,9 @@ iflib_vlan_register(void *arg, if_t ifp, uint16_t vtag
 	if ((vtag == 0) || (vtag > 4095))
 		return;
 
+	if (iflib_in_detach(ctx))
+		return;
+
 	CTX_LOCK(ctx);
 	IFDI_VLAN_REGISTER(ctx, vtag);
 	/* Re-init to load the changes */
@@ -5024,12 +5027,6 @@ iflib_device_deregister(if_ctx_t ctx)
 	CTX_LOCK(ctx);
 	iflib_stop(ctx);
 	CTX_UNLOCK(ctx);
-
-	/* Unregister VLAN events */
-	if (ctx->ifc_vlan_attach_event != NULL)
-		EVENTHANDLER_DEREGISTER(vlan_config, ctx->ifc_vlan_attach_event);
-	if (ctx->ifc_vlan_detach_event != NULL)
-		EVENTHANDLER_DEREGISTER(vlan_unconfig, ctx->ifc_vlan_detach_event);
 
 	iflib_netmap_detach(ifp);
 	ether_ifdetach(ifp);


More information about the svn-src-releng mailing list