Module Name:    src
Committed By:   msaitoh
Date:           Tue Jul  3 04:02:07 UTC 2018

Modified Files:
        src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
 Remove nmbclusters check. We don't use the mbuf cluster. The old code also had
a bug that ixgbe_total_ports adds two every port and never decrement in
the detach path. Found by hikaru@.

 The code was removed in FreeBSD when it switched to use iflib and OpenBSD
removed the code 8 years ago.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.161 src/sys/dev/pci/ixgbe/ixgbe.c:1.162
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.161	Wed Jun  6 20:02:31 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Jul  3 04:02:06 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.161 2018/06/06 20:02:31 kamil Exp $ */
+/* $NetBSD: ixgbe.c,v 1.162 2018/07/03 04:02:06 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -394,9 +394,6 @@ static int ixgbe_enable_rss = 1;
 SYSCTL_INT(_hw_ix, OID_AUTO, enable_rss, CTLFLAG_RDTUN, &ixgbe_enable_rss, 0,
     "Enable Receive-Side Scaling (RSS)");
 
-/* Keep running tab on them for sanity check */
-static int ixgbe_total_ports;
-
 #if 0
 static int (*ixgbe_start_locked)(struct ifnet *, struct tx_ring *);
 static int (*ixgbe_ring_empty)(struct ifnet *, pcq_t *);
@@ -931,21 +928,6 @@ ixgbe_attach(device_t parent, device_t d
 	} else
 		adapter->num_tx_desc = ixgbe_txd;
 
-	/*
-	 * With many RX rings it is easy to exceed the
-	 * system mbuf allocation. Tuning nmbclusters
-	 * can alleviate this.
-	 */
-	if (nmbclusters > 0) {
-		int s;
-		s = (ixgbe_rxd * adapter->num_queues) * ixgbe_total_ports;
-		if (s > nmbclusters) {
-			aprint_error_dev(dev, "RX Descriptors exceed "
-			    "system mbuf max, using default instead!\n");
-			ixgbe_rxd = DEFAULT_RXD;
-		}
-	}
-
 	if (((ixgbe_rxd * sizeof(union ixgbe_adv_rx_desc)) % DBA_ALIGN) != 0 ||
 	    ixgbe_rxd < MIN_RXD || ixgbe_rxd > MAX_RXD) {
 		aprint_error_dev(dev, "RXD config issue, using default!\n");
@@ -5958,7 +5940,6 @@ ixgbe_lookup(const struct pci_attach_arg
 			(ent->subvendor_id == 0)) &&
 		    ((PCI_SUBSYS_ID(subid) == ent->subdevice_id) ||
 			(ent->subdevice_id == 0))) {
-			++ixgbe_total_ports;
 			return ent;
 		}
 	}

Reply via email to