Module Name:    src
Committed By:   snj
Date:           Thu Jul 26 23:21:54 UTC 2018

Modified Files:
        src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c ixgbe_82599.c ixgbe_api.c
            ixgbe_type.h ixgbe_x540.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #935):
        sys/dev/pci/ixgbe/ixgbe.c: revision 1.162
        sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.20
        sys/dev/pci/ixgbe/ixgbe_api.c: revision 1.21
        sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.35
        sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.16
Apply changes of FreeBSD ix-3.2.18.tgz:
  - Add IXGBE_DEV_ID_82599_LS(0x154f) support.
  - Increase timeout for newer than ixgbe_mac_X550 (i.e. Xeon-D and Denverton)
    in ixgbe_acquire_swfw_sync_X540().
  - Add some unused macros (IXGBE_FW_LESM_*).
--
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.88.2.20 -r1.88.2.21 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.14.8.3 -r1.14.8.4 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.15.8.3 -r1.15.8.4 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.22.2.5 -r1.22.2.6 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.9.6.3 -r1.9.6.4 src/sys/dev/pci/ixgbe/ixgbe_x540.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.88.2.20 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.21
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.20	Sat Jun  9 14:59:43 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Jul 26 23:21:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.20 2018/06/09 14:59:43 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.21 2018/07/26 23:21:54 snj Exp $ */
 
 /******************************************************************************
 
@@ -392,9 +392,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 *);
@@ -929,21 +926,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");
@@ -5956,7 +5938,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;
 		}
 	}

Index: src/sys/dev/pci/ixgbe/ixgbe_82599.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.14.8.3 src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.14.8.4
--- src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.14.8.3	Sat Apr 14 10:25:11 2018
+++ src/sys/dev/pci/ixgbe/ixgbe_82599.c	Thu Jul 26 23:21:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_82599.c,v 1.14.8.3 2018/04/14 10:25:11 martin Exp $ */
+/* $NetBSD: ixgbe_82599.c,v 1.14.8.4 2018/07/26 23:21:54 snj Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -566,6 +566,9 @@ enum ixgbe_media_type ixgbe_get_media_ty
 	case IXGBE_DEV_ID_82599_T3_LOM:
 		media_type = ixgbe_media_type_copper;
 		break;
+	case IXGBE_DEV_ID_82599_LS:
+		media_type = ixgbe_media_type_fiber_lco;
+		break;
 	case IXGBE_DEV_ID_82599_QSFP_SF_QP:
 		media_type = ixgbe_media_type_fiber_qsfp;
 		break;

Index: src/sys/dev/pci/ixgbe/ixgbe_api.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_api.c:1.15.8.3 src/sys/dev/pci/ixgbe/ixgbe_api.c:1.15.8.4
--- src/sys/dev/pci/ixgbe/ixgbe_api.c:1.15.8.3	Sat Apr 14 10:25:11 2018
+++ src/sys/dev/pci/ixgbe/ixgbe_api.c	Thu Jul 26 23:21:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_api.c,v 1.15.8.3 2018/04/14 10:25:11 martin Exp $ */
+/* $NetBSD: ixgbe_api.c,v 1.15.8.4 2018/07/26 23:21:54 snj Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -173,6 +173,7 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw *
 	case IXGBE_DEV_ID_82599_SFP_SF_QP:
 	case IXGBE_DEV_ID_82599_QSFP_SF_QP:
 	case IXGBE_DEV_ID_82599EN_SFP:
+	case IXGBE_DEV_ID_82599_LS:
 	case IXGBE_DEV_ID_82599_CX4:
 	case IXGBE_DEV_ID_82599_BYPASS:
 	case IXGBE_DEV_ID_82599_T3_LOM:

Index: src/sys/dev/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.22.2.5 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.22.2.6
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.22.2.5	Sat Apr 14 10:25:11 2018
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Thu Jul 26 23:21:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_type.h,v 1.22.2.5 2018/04/14 10:25:11 martin Exp $ */
+/* $NetBSD: ixgbe_type.h,v 1.22.2.6 2018/07/26 23:21:54 snj Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -131,6 +131,7 @@
 #define IXGBE_SUBDEV_ID_82599EN_SFP_OCP1	0x0001
 #define IXGBE_DEV_ID_82599_XAUI_LOM		PCI_PRODUCT_INTEL_82599_XAUI_LOM
 #define IXGBE_DEV_ID_82599_T3_LOM		0x151C
+#define IXGBE_DEV_ID_82599_LS			0x154F
 #define IXGBE_DEV_ID_82599_VF			0x10ED
 #define IXGBE_DEV_ID_82599_VF_HV		0x152E
 #define IXGBE_DEV_ID_82599_BYPASS		0x155D
@@ -2466,6 +2467,16 @@ enum {
 #define IXGBE_FW_LESM_PARAMETERS_PTR		0x2
 #define IXGBE_FW_LESM_STATE_1			0x1
 #define IXGBE_FW_LESM_STATE_ENABLED		0x8000 /* LESM Enable bit */
+#define IXGBE_FW_LESM_2_STATES_ENABLED_MASK	0x1F
+#define IXGBE_FW_LESM_2_STATES_ENABLED		0x12
+#define IXGBE_FW_LESM_STATE0_10G_ENABLED	0x6FFF
+#define IXGBE_FW_LESM_STATE1_10G_ENABLED	0x4FFF
+#define IXGBE_FW_LESM_STATE0_10G_DISABLED	0x0FFF
+#define IXGBE_FW_LESM_STATE1_10G_DISABLED	0x2FFF
+#define IXGBE_FW_LESM_PORT0_STATE0_OFFSET	0x2
+#define IXGBE_FW_LESM_PORT0_STATE1_OFFSET	0x3
+#define IXGBE_FW_LESM_PORT1_STATE0_OFFSET	0x6
+#define IXGBE_FW_LESM_PORT1_STATE1_OFFSET	0x7
 #define IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR	0x4
 #define IXGBE_FW_PATCH_VERSION_4		0x7
 #define IXGBE_FCOE_IBA_CAPS_BLK_PTR		0x33 /* iSCSI/FCOE block */
@@ -3748,6 +3759,7 @@ enum ixgbe_media_type {
 	ixgbe_media_type_fiber,
 	ixgbe_media_type_fiber_fixed,
 	ixgbe_media_type_fiber_qsfp,
+	ixgbe_media_type_fiber_lco,
 	ixgbe_media_type_copper,
 	ixgbe_media_type_backplane,
 	ixgbe_media_type_cx4,

Index: src/sys/dev/pci/ixgbe/ixgbe_x540.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_x540.c:1.9.6.3 src/sys/dev/pci/ixgbe/ixgbe_x540.c:1.9.6.4
--- src/sys/dev/pci/ixgbe/ixgbe_x540.c:1.9.6.3	Sat Apr 14 10:25:12 2018
+++ src/sys/dev/pci/ixgbe/ixgbe_x540.c	Thu Jul 26 23:21:54 2018
@@ -790,7 +790,7 @@ s32 ixgbe_acquire_swfw_sync_X540(struct 
 
 	swmask |= swi2c_mask;
 	fwmask |= swi2c_mask << 2;
-	if (hw->mac.type == ixgbe_mac_X550)
+	if (hw->mac.type >= ixgbe_mac_X550)
 		timeout = 1000;
 
 	for (i = 0; i < timeout; i++) {

Reply via email to