CVS commit: src/sys/dev/pci/ixgbe

2017-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 25 07:49:23 UTC 2017

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

Log Message:
Remove debug printf()s.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 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.64 src/sys/dev/pci/ixgbe/ixgbe.c:1.65
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.64	Wed Jan 25 07:46:53 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Jan 25 07:49:23 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.64 2017/01/25 07:46:53 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.65 2017/01/25 07:49:23 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -3961,7 +3961,7 @@ ixgbe_handle_mod(void *context)
 	u32 err;
 
 	IXGBE_CORE_LOCK(adapter);
-	printf("%s: called\n", __func__);
+
 	/* Check to see if the PHY type changed */
 	if (hw->phy.ops.identify) {
 		hw->phy.type = ixgbe_phy_unknown;
@@ -4036,7 +4036,6 @@ ixgbe_handle_msf(void *context)
 	bool negotiate;
 
 	IXGBE_CORE_LOCK(adapter);
-	printf("%s: called\n", __func__);
 	/* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */
 	adapter->phy_layer = ixgbe_get_supported_physical_layer(hw);
 



CVS commit: src/sys/dev/pci/ixgbe

2017-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 25 07:49:23 UTC 2017

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

Log Message:
Remove debug printf()s.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 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.



CVS commit: src/sys/dev/pci/ixgbe

2017-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 25 07:46:53 UTC 2017

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

Log Message:
 Fix SFP+ insersion or replacement stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/ixgbe/ixgbe.h

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.63 src/sys/dev/pci/ixgbe/ixgbe.c:1.64
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.63	Thu Jan 19 09:42:08 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Jan 25 07:46:53 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.63 2017/01/19 09:42:08 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.64 2017/01/25 07:46:53 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1799,12 +1799,12 @@ ixgbe_msix_link(void *arg)
 		mod_mask = IXGBE_EICR_GPI_SDP2_BY_MAC(hw);
 
 	if (ixgbe_is_sfp(hw)) {
-		if (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw)) {
-			IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
-			softint_schedule(adapter->msf_si);
-		} else if (reg_eicr & mod_mask) {
+		if (reg_eicr & mod_mask) {
 			IXGBE_WRITE_REG(hw, IXGBE_EICR, mod_mask);
 			softint_schedule(adapter->mod_si);
+		} else if (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw)) {
+			IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw));
+			softint_schedule(adapter->msf_si);
 		}
 	}
 
@@ -3961,7 +3961,7 @@ ixgbe_handle_mod(void *context)
 	u32 err;
 
 	IXGBE_CORE_LOCK(adapter);
-
+	printf("%s: called\n", __func__);
 	/* Check to see if the PHY type changed */
 	if (hw->phy.ops.identify) {
 		hw->phy.type = ixgbe_phy_unknown;
@@ -3996,8 +3996,6 @@ ixgbe_handle_mod(void *context)
 		"Setup failure - unsupported SFP+ module type.\n");
 		goto out;
 	}
-	if (hw->phy.multispeed_fiber)
-		softint_schedule(adapter->msf_si);
 out:
 	/* Update media type */
 	switch (hw->mac.ops.get_media_type(hw)) {
@@ -4015,6 +4013,12 @@ out:
 			break;
 	}
 
+	/* Adjust media types shown in ifconfig */
+	ifmedia_removeall(>media);
+	ixgbe_add_media_types(adapter);
+	ifmedia_set(>media, IFM_ETHER | IFM_AUTO);
+
+	softint_schedule(adapter->msf_si);
 	IXGBE_CORE_UNLOCK(adapter);
 	return;
 }
@@ -4032,6 +4036,7 @@ ixgbe_handle_msf(void *context)
 	bool negotiate;
 
 	IXGBE_CORE_LOCK(adapter);
+	printf("%s: called\n", __func__);
 	/* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */
 	adapter->phy_layer = ixgbe_get_supported_physical_layer(hw);
 
@@ -4043,9 +4048,6 @@ ixgbe_handle_msf(void *context)
 	if (hw->mac.ops.setup_link)
 		hw->mac.ops.setup_link(hw, autoneg, TRUE);
 
-	/* Adjust media types shown in ifconfig */
-	ifmedia_removeall(>media);
-	ixgbe_add_media_types(adapter);
 	IXGBE_CORE_UNLOCK(adapter);
 	return;
 }

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.19 src/sys/dev/pci/ixgbe/ixgbe.h:1.20
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.19	Wed Jan 18 10:18:40 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Wed Jan 25 07:46:53 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.h 303890 2016-08-09 19:32:06Z dumbbell $*/
-/*$NetBSD: ixgbe.h,v 1.19 2017/01/18 10:18:40 msaitoh Exp $*/
+/*$NetBSD: ixgbe.h,v 1.20 2017/01/25 07:46:53 msaitoh Exp $*/
 
 
 #ifndef _IXGBE_H_
@@ -698,14 +698,20 @@ ixgbe_is_sfp(struct ixgbe_hw *hw)
 	case ixgbe_phy_sfp_unknown:
 	case ixgbe_phy_sfp_passive_tyco:
 	case ixgbe_phy_sfp_passive_unknown:
+	case ixgbe_phy_sfp_unsupported:
 	case ixgbe_phy_qsfp_passive_unknown:
 	case ixgbe_phy_qsfp_active_unknown:
 	case ixgbe_phy_qsfp_intel:
 	case ixgbe_phy_qsfp_unknown:
 		return TRUE;
 	default:
-		return FALSE;
+		break;
 	}
+
+	if (hw->phy.sfp_type == ixgbe_sfp_type_not_present)
+		return TRUE;
+
+	return FALSE;
 }
 
 /* Workaround to make 8.0 buildable */



CVS commit: src/sys/dev/pci/ixgbe

2017-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 25 07:46:53 UTC 2017

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

Log Message:
 Fix SFP+ insersion or replacement stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/ixgbe/ixgbe.h

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



CVS commit: src/sys/dev/pci/ixgbe

2017-01-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 19 09:42:08 UTC 2017

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

Log Message:
Reduce diff against FreeBSD. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/ixgbe/ixv.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.62 src/sys/dev/pci/ixgbe/ixgbe.c:1.63
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.62	Wed Jan 18 10:22:09 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Jan 19 09:42:08 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.62 2017/01/18 10:22:09 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.63 2017/01/19 09:42:08 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -161,6 +161,7 @@ static int  ixgbe_allocate_legacy(st
 static int	ixgbe_setup_msix(struct adapter *);
 static void	ixgbe_free_pci_resources(struct adapter *);
 static void	ixgbe_local_timer(void *);
+static void	ixgbe_local_timer1(void *);
 static int	ixgbe_setup_interface(device_t, struct adapter *);
 static void	ixgbe_config_gpie(struct adapter *);
 static void	ixgbe_config_dmac(struct adapter *);
@@ -436,7 +437,6 @@ ixgbe_lookup(const struct pci_attach_arg
 	return NULL;
 }
 
-
 /*
  *  Device initialization routine
  *
@@ -2219,6 +2219,16 @@ ixgbe_mc_array_itr(struct ixgbe_hw *hw, 
  **/
 
 static void
+ixgbe_local_timer(void *arg)
+{
+	struct adapter *adapter = arg;
+
+	IXGBE_CORE_LOCK(adapter);
+	ixgbe_local_timer1(adapter);
+	IXGBE_CORE_UNLOCK(adapter);
+}
+
+static void
 ixgbe_local_timer1(void *arg)
 {
 	struct adapter	*adapter = arg;
@@ -2269,6 +2279,7 @@ ixgbe_local_timer1(void *arg)
 		}
 
 	}
+
 	/* Only truely watchdog if all queues show hung */
 	if (hung == adapter->num_queues)
 		goto watchdog;
@@ -2287,16 +2298,6 @@ watchdog:
 	ixgbe_init_locked(adapter);
 }
 
-static void
-ixgbe_local_timer(void *arg)
-{
-	struct adapter *adapter = arg;
-
-	IXGBE_CORE_LOCK(adapter);
-	ixgbe_local_timer1(adapter);
-	IXGBE_CORE_UNLOCK(adapter);
-}
-
 
 /*
 ** Note: this routine updates the OS on the link state
@@ -5577,6 +5578,30 @@ ixgbe_disable_rx_drop(struct adapter *ad
 #endif
 }
 
+static void
+ixgbe_rearm_queues(struct adapter *adapter, u64 queues)
+{
+	u32 mask;
+
+	switch (adapter->hw.mac.type) {
+	case ixgbe_mac_82598EB:
+		mask = (IXGBE_EIMS_RTX_QUEUE & queues);
+		IXGBE_WRITE_REG(>hw, IXGBE_EICS, mask);
+		break;
+	case ixgbe_mac_82599EB:
+	case ixgbe_mac_X540:
+	case ixgbe_mac_X550:
+	case ixgbe_mac_X550EM_x:
+		mask = (queues & 0x);
+		IXGBE_WRITE_REG(>hw, IXGBE_EICS_EX(0), mask);
+		mask = (queues >> 32);
+		IXGBE_WRITE_REG(>hw, IXGBE_EICS_EX(1), mask);
+		break;
+	default:
+		break;
+	}
+}
+
 #ifdef PCI_IOV
 
 /*
@@ -6295,26 +6320,3 @@ ixgbe_add_vf(device_t dev, u16 vfnum, co
 	return (0);
 }
 #endif /* PCI_IOV */
-static void
-ixgbe_rearm_queues(struct adapter *adapter, u64 queues)
-{
-	u32 mask;
-
-	switch (adapter->hw.mac.type) {
-	case ixgbe_mac_82598EB:
-		mask = (IXGBE_EIMS_RTX_QUEUE & queues);
-		IXGBE_WRITE_REG(>hw, IXGBE_EICS, mask);
-		break;
-	case ixgbe_mac_82599EB:
-	case ixgbe_mac_X540:
-	case ixgbe_mac_X550:
-	case ixgbe_mac_X550EM_x:
-		mask = (queues & 0x);
-		IXGBE_WRITE_REG(>hw, IXGBE_EICS_EX(0), mask);
-		mask = (queues >> 32);
-		IXGBE_WRITE_REG(>hw, IXGBE_EICS_EX(1), mask);
-		break;
-	default:
-		break;
-	}
-}

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.32 src/sys/dev/pci/ixgbe/ixv.c:1.33
--- src/sys/dev/pci/ixgbe/ixv.c:1.32	Wed Jan 18 10:22:09 2017
+++ src/sys/dev/pci/ixgbe/ixv.c	Thu Jan 19 09:42:08 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.32 2017/01/18 10:22:09 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.33 2017/01/19 09:42:08 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1521,7 +1521,6 @@ map_err:
 
 	/* Pick up the tuneable queues */
 	adapter->num_queues = ixv_num_queues;
-
 	adapter->hw.back = adapter;
 
 	/*



CVS commit: src/sys/dev/pci/ixgbe

2017-01-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 19 09:42:08 UTC 2017

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

Log Message:
Reduce diff against FreeBSD. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2017-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 19 06:56:33 UTC 2017

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe_common.c ixgbe_phy.c
ixgbe_type.h ixgbe_x540.c ixgbe_x550.c

Log Message:
 Reduce diff against FreeBSD. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ixgbe/ixgbe_x550.c

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



CVS commit: src/sys/dev/pci/ixgbe

2017-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 19 06:56:33 UTC 2017

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe_common.c ixgbe_phy.c
ixgbe_type.h ixgbe_x540.c ixgbe_x550.c

Log Message:
 Reduce diff against FreeBSD. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ixgbe/ixgbe_x550.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.15 src/sys/dev/pci/ixgbe/ix_txrx.c:1.16
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.15	Wed Jan 18 08:15:22 2017
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Jan 19 06:56:33 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 301538 2016-06-07 04:51:50Z sephe $*/
-/*$NetBSD: ix_txrx.c,v 1.15 2017/01/18 08:15:22 msaitoh Exp $*/
+/*$NetBSD: ix_txrx.c,v 1.16 2017/01/19 06:56:33 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -516,6 +516,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m
 	return 0;
 }
 
+
 /*
  *
  *  Allocate memory for tx_buffer structures. The tx_buffer stores all
@@ -2396,4 +2397,3 @@ tx_fail:
 fail:
 	return (error);
 }
-

Index: src/sys/dev/pci/ixgbe/ixgbe_common.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_common.c:1.11 src/sys/dev/pci/ixgbe/ixgbe_common.c:1.12
--- src/sys/dev/pci/ixgbe/ixgbe_common.c:1.11	Mon Dec  5 08:50:29 2016
+++ src/sys/dev/pci/ixgbe/ixgbe_common.c	Thu Jan 19 06:56:33 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 299200 2016-05-06 22:54:56Z pfg $*/
-/*$NetBSD: ixgbe_common.c,v 1.11 2016/12/05 08:50:29 msaitoh Exp $*/
+/*$NetBSD: ixgbe_common.c,v 1.12 2017/01/19 06:56:33 msaitoh Exp $*/
 
 #include "ixgbe_common.h"
 #include "ixgbe_phy.h"
@@ -201,7 +201,7 @@ bool ixgbe_device_supports_autoneg_fc(st
 	}
 
 	if (!supported) {
-	ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED,
+		ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED,
 		  "Device %x does not support flow control autoneg",
 		  hw->device_id);
 	}

Index: src/sys/dev/pci/ixgbe/ixgbe_phy.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.10 src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.11
--- src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.10	Mon Dec  5 08:50:29 2016
+++ src/sys/dev/pci/ixgbe/ixgbe_phy.c	Thu Jan 19 06:56:33 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.c 303032 2016-07-19 17:31:48Z sbruno $*/
-/*$NetBSD: ixgbe_phy.c,v 1.10 2016/12/05 08:50:29 msaitoh Exp $*/
+/*$NetBSD: ixgbe_phy.c,v 1.11 2017/01/19 06:56:33 msaitoh Exp $*/
 
 #include "ixgbe_api.h"
 #include "ixgbe_common.h"
@@ -1535,7 +1535,7 @@ s32 ixgbe_identify_sfp_module_generic(st
 hw->phy.type = ixgbe_phy_sfp_intel;
 break;
 			default:
-	hw->phy.type = ixgbe_phy_sfp_unknown;
+hw->phy.type = ixgbe_phy_sfp_unknown;
 break;
 			}
 		}

Index: src/sys/dev/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.17 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.18
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.17	Mon Dec  5 08:50:29 2016
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Thu Jan 19 06:56:33 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 299200 2016-05-06 22:54:56Z pfg $*/
-/*$NetBSD: ixgbe_type.h,v 1.17 2016/12/05 08:50:29 msaitoh Exp $*/
+/*$NetBSD: ixgbe_type.h,v 1.18 2017/01/19 06:56:33 msaitoh Exp $*/
 
 #ifndef _IXGBE_TYPE_H_
 #define _IXGBE_TYPE_H_
@@ -121,10 +121,10 @@
 #define IXGBE_SUBDEV_ID_82599_SFP_LOM		0x06EE
 #define IXGBE_DEV_ID_82599_BACKPLANE_FCOE	0x152A
 #define IXGBE_DEV_ID_82599_SFP_FCOE		0x1529
+#define IXGBE_DEV_ID_82599_SFP_EM		0x1507
 #define IXGBE_DEV_ID_82599_SFP_SF2		0x154D
 #define IXGBE_DEV_ID_82599_SFP_SF_QP		0x154A
 #define IXGBE_DEV_ID_82599_QSFP_SF_QP		0x1558
-#define IXGBE_DEV_ID_82599_SFP_EM		0x1507
 #define IXGBE_DEV_ID_82599EN_SFP		0x1557
 #define IXGBE_SUBDEV_ID_82599EN_SFP_OCP1	0x0001
 #define IXGBE_DEV_ID_82599_XAUI_LOM		PCI_PRODUCT_INTEL_82599_XAUI_LOM

Index: src/sys/dev/pci/ixgbe/ixgbe_x540.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_x540.c:1.8 src/sys/dev/pci/ixgbe/ixgbe_x540.c:1.9
--- src/sys/dev/pci/ixgbe/ixgbe_x540.c:1.8	Mon Dec  5 08:50:29 2016
+++ src/sys/dev/pci/ixgbe/ixgbe_x540.c	Thu Jan 19 06:56:33 2017
@@ -82,7 +82,7 @@ s32 ixgbe_init_ops_X540(struct ixgbe_hw 
 	/* PHY */
 	phy->ops.init = 

CVS commit: src/sys/dev/pci/ixgbe

2017-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 10:22:09 UTC 2017

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_osdep.h ixv.c

Log Message:
 Now we can use multiqueue. It's default on ixg(4). Not yet for ixv(4).


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2017-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 10:22:09 UTC 2017

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_osdep.h ixv.c

Log Message:
 Now we can use multiqueue. It's default on ixg(4). Not yet for ixv(4).


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/ixgbe/ixv.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.61 src/sys/dev/pci/ixgbe/ixgbe.c:1.62
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.61	Wed Jan 18 10:18:40 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Jan 18 10:22:09 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.61 2017/01/18 10:18:40 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.62 2017/01/18 10:22:09 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -337,7 +337,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix
  * number of cpus with a max of 8. This
  * can be overriden manually here.
  */
-static int ixgbe_num_queues = 1;
+static int ixgbe_num_queues = 0;
 SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, _num_queues, 0,
 "Number of queues to configure, 0 indicates autoconfigure");
 
@@ -2702,19 +2702,19 @@ ixgbe_allocate_msix(struct adapter *adap
 		aprint_normal_dev(dev, "for TX/RX, interrupting at %s",
 		intrstr);
 		if (error == 0) {
-#ifdef IXGBE_DEBUG
+#if 1 /* def IXGBE_DEBUG */
 #ifdef	RSS
 			aprintf_normal(
-			", bound RSS bucket %d to CPU %d\n",
+			", bound RSS bucket %d to CPU %d",
 			i, cpu_id);
 #else
 			aprint_normal(
-			", bound queue %d to cpu %d\n",
+			", bound queue %d to cpu %d",
 			i, cpu_id);
 #endif
 #endif /* IXGBE_DEBUG */
-		} else
-			aprint_normal("\n");
+		}
+		aprint_normal("\n");
 #ifndef IXGBE_LEGACY_TX
 		txr->txq_si = softint_establish(SOFTINT_NET,
 		ixgbe_deferred_mq_start, txr);
@@ -2795,7 +2795,8 @@ ixgbe_setup_msix(struct adapter *adapter
 
 	/* First try MSI/X */
 	msgs = pci_msix_count(adapter->osdep.pc, adapter->osdep.tag);
-	if (msgs < IXG_MSIX_NINTR)
+	msgs = MIN(msgs, IXG_MAX_NINTR);
+	if (msgs < 2)
 		goto msi;
 
 	adapter->msix_mem = (void *)1; /* XXX */

Index: src/sys/dev/pci/ixgbe/ixgbe_osdep.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.16 src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.17
--- src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.16	Mon Dec  5 10:05:11 2016
+++ src/sys/dev/pci/ixgbe/ixgbe_osdep.h	Wed Jan 18 10:22:09 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.h 294734 2016-01-25 16:18:53Z smh $*/
-/*$NetBSD: ixgbe_osdep.h,v 1.16 2016/12/05 10:05:11 msaitoh Exp $*/
+/*$NetBSD: ixgbe_osdep.h,v 1.17 2017/01/18 10:22:09 msaitoh Exp $*/
 
 #ifndef _IXGBE_OS_H_
 #define _IXGBE_OS_H_
@@ -149,14 +149,8 @@ typedef uint64_t	u64;
 
 #define le16_to_cpu 
 
-/*
- * This device driver divides interrupt to TX, RX and link state.
- * Each MSI-X vector indexes are below.
- */
-#define IXG_MSIX_NINTR		2
-#define IXG_MSIX_TXRXINTR_IDX	0
-#define IXG_MSIX_LINKINTR_IDX	1
-#define IXG_MAX_NINTR		IXG_MSIX_NINTR
+/* This device driver's max interrupt numbers. */
+#define IXG_MAX_NINTR		64
 
 #if __FreeBSD_version < 80
 #if defined(__i386__) || defined(__amd64__)

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.31 src/sys/dev/pci/ixgbe/ixv.c:1.32
--- src/sys/dev/pci/ixgbe/ixv.c:1.31	Thu Jan  5 05:53:23 2017
+++ src/sys/dev/pci/ixgbe/ixv.c	Wed Jan 18 10:22:09 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.31 2017/01/05 05:53:23 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.32 2017/01/18 10:22:09 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1348,7 +1348,7 @@ ixv_allocate_msix(struct adapter *adapte
 	tag = adapter->osdep.tag;
 
 	if (pci_msix_alloc_exact(pa,
-		>osdep.intrs, IXG_MSIX_NINTR) != 0)
+		>osdep.intrs, IXG_MAX_NINTR) != 0)
 		return (ENXIO);
 
 	kcpuset_create(, false);
@@ -1457,16 +1457,24 @@ ixv_setup_msix(struct adapter *adapter)
 	device_t dev = adapter->dev;
 	int want, msgs;
 
-	/*
-	** Want two vectors: one for a queue,
-	** plus an additional for mailbox.
-	*/
+	/* Must have at least 2 MSIX vectors */
 	msgs = pci_msix_count(adapter->osdep.pc, adapter->osdep.tag);
-	if (msgs < IXG_MSIX_NINTR) {
+	if (msgs < 2) {
 		aprint_error_dev(dev,"MSIX config error\n");
 		return (ENXIO);
 	}
-	want = MIN(msgs, IXG_MSIX_NINTR);
+	msgs = MIN(msgs, IXG_MAX_NINTR);
+
+	/*
+	** Want vectors for the queues,
+	** plus an additional for mailbox.
+	*/
+	want = 

CVS commit: src/sys/dev/pci/ixgbe

2017-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 10:18:40 UTC 2017

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

Log Message:
 Fix sysctl stuff. Make the top sysctl node and keep the pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/ixgbe/ixgbe.h

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.60 src/sys/dev/pci/ixgbe/ixgbe.c:1.61
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.60	Wed Jan 18 08:23:03 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Jan 18 10:18:40 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.60 2017/01/18 08:23:03 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.61 2017/01/18 10:18:40 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -4437,6 +4437,9 @@ ixgbe_sysctl_instance(struct adapter *ad
 	int rc;
 	const struct sysctlnode *rnode;
 
+	if (adapter->sysctltop != NULL)
+		return adapter->sysctltop;
+
 	log = >sysctllog;
 	dvname = device_xname(adapter->dev);
 

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.18 src/sys/dev/pci/ixgbe/ixgbe.h:1.19
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.18	Mon Dec  5 08:50:29 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Wed Jan 18 10:18:40 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.h 303890 2016-08-09 19:32:06Z dumbbell $*/
-/*$NetBSD: ixgbe.h,v 1.18 2016/12/05 08:50:29 msaitoh Exp $*/
+/*$NetBSD: ixgbe.h,v 1.19 2017/01/18 10:18:40 msaitoh Exp $*/
 
 
 #ifndef _IXGBE_H_
@@ -617,6 +617,7 @@ struct adapter {
 	u64			noproto;
 #endif
 	struct sysctllog	*sysctllog;
+	const struct sysctlnode *sysctltop;
 	ixgbe_extmem_head_t jcl_head;
 };
 



CVS commit: src/sys/dev/pci/ixgbe

2017-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 10:18:40 UTC 2017

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

Log Message:
 Fix sysctl stuff. Make the top sysctl node and keep the pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/ixgbe/ixgbe.h

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



CVS commit: src/sys/dev/pci/ixgbe

2017-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 08:23:03 UTC 2017

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

Log Message:
 Use 64bit DMA tag. If not, a lot of bounce buffer is allocated.
Fixes PR#49968 reported by Hauke.

XXX pullup-[67].


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 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.



CVS commit: src/sys/dev/pci/ixgbe

2017-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 08:23:03 UTC 2017

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

Log Message:
 Use 64bit DMA tag. If not, a lot of bounce buffer is allocated.
Fixes PR#49968 reported by Hauke.

XXX pullup-[67].


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 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.59 src/sys/dev/pci/ixgbe/ixgbe.c:1.60
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.59	Thu Jan  5 05:53:23 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Jan 18 08:23:03 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.59 2017/01/05 05:53:23 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.60 2017/01/18 08:23:03 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -466,7 +466,10 @@ ixgbe_attach(device_t parent, device_t d
 	hw = >hw;
 	adapter->osdep.pc = pa->pa_pc;
 	adapter->osdep.tag = pa->pa_tag;
-	adapter->osdep.dmat = pa->pa_dmat;
+	if (pci_dma64_available(pa))
+		adapter->osdep.dmat = pa->pa_dmat64;
+	else
+		adapter->osdep.dmat = pa->pa_dmat;
 	adapter->osdep.attached = false;
 
 	ent = ixgbe_lookup(pa);



CVS commit: src/sys/dev/pci/ixgbe

2017-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 08:15:22 UTC 2017

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

Log Message:
 Call ixgbe_free_transmit_buffers instead of ixgbe_free_transmit_structures()
in ixgbe_allocate_transmit_buffers()...


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/ixgbe/ix_txrx.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.14 src/sys/dev/pci/ixgbe/ix_txrx.c:1.15
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.14	Thu Jan  5 05:53:23 2017
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed Jan 18 08:15:22 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 301538 2016-06-07 04:51:50Z sephe $*/
-/*$NetBSD: ix_txrx.c,v 1.14 2017/01/05 05:53:23 msaitoh Exp $*/
+/*$NetBSD: ix_txrx.c,v 1.15 2017/01/18 08:15:22 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -567,7 +567,11 @@ ixgbe_allocate_transmit_buffers(struct t
 	return 0;
 fail:
 	/* We free all, it handles case where we are in the middle */
+#if 0 /* XXX was FreeBSD */
 	ixgbe_free_transmit_structures(adapter);
+#else
+	ixgbe_free_transmit_buffers(txr);
+#endif
 	return (error);
 }
 



CVS commit: src/sys/dev/pci/ixgbe

2017-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 08:15:22 UTC 2017

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

Log Message:
 Call ixgbe_free_transmit_buffers instead of ixgbe_free_transmit_structures()
in ixgbe_allocate_transmit_buffers()...


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

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



CVS commit: src/sys/dev/pci/ixgbe

2017-01-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan  5 05:53:23 UTC 2017

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

Log Message:
 Fix INIT_DEBUGOUT() messages.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/ixgbe/ixv.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.13 src/sys/dev/pci/ixgbe/ix_txrx.c:1.14
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.13	Fri Dec 16 08:24:40 2016
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Jan  5 05:53:23 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 301538 2016-06-07 04:51:50Z sephe $*/
-/*$NetBSD: ix_txrx.c,v 1.13 2016/12/16 08:24:40 msaitoh Exp $*/
+/*$NetBSD: ix_txrx.c,v 1.14 2017/01/05 05:53:23 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -693,7 +693,7 @@ ixgbe_free_transmit_buffers(struct tx_ri
 	struct ixgbe_tx_buf *tx_buffer;
 	int i;
 
-	INIT_DEBUGOUT("ixgbe_free_transmit_ring: begin");
+	INIT_DEBUGOUT("ixgbe_free_transmit_buffers: begin");
 
 	if (txr->tx_buffers == NULL)
 		return;

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.58 src/sys/dev/pci/ixgbe/ixgbe.c:1.59
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.58	Wed Dec 28 09:29:35 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Jan  5 05:53:23 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.58 2016/12/28 09:29:35 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.59 2017/01/05 05:53:23 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -413,7 +413,7 @@ ixgbe_lookup(const struct pci_attach_arg
 	pcireg_t subid;
 	ixgbe_vendor_info_t *ent;
 
-	INIT_DEBUGOUT("ixgbe_probe: begin");
+	INIT_DEBUGOUT("ixgbe_lookup: begin");
 
 	if (PCI_VENDOR(pa->pa_id) != IXGBE_INTEL_VENDOR_ID)
 		return NULL;

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.30 src/sys/dev/pci/ixgbe/ixv.c:1.31
--- src/sys/dev/pci/ixgbe/ixv.c:1.30	Fri Dec 16 08:30:20 2016
+++ src/sys/dev/pci/ixgbe/ixv.c	Thu Jan  5 05:53:23 2017
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.30 2016/12/16 08:30:20 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.31 2017/01/05 05:53:23 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -253,7 +253,7 @@ ixv_lookup(const struct pci_attach_args 
 	pcireg_t subid;
 	ixgbe_vendor_info_t *ent;
 
-	INIT_DEBUGOUT("ixv_probe: begin");
+	INIT_DEBUGOUT("ixv_lookup: begin");
 
 	if (PCI_VENDOR(pa->pa_id) != IXGBE_INTEL_VENDOR_ID)
 		return NULL;



CVS commit: src/sys/dev/pci/ixgbe

2017-01-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan  5 05:53:23 UTC 2017

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

Log Message:
 Fix INIT_DEBUGOUT() messages.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 28 09:29:35 UTC 2016

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

Log Message:
 Fix a bug that hw.ixgN.wol_enable=0 doesn't work correctly. Clear the WUC
and WUFC register if wol_enable is 0. ixgbe_setup_low_power_mode() calls
ixgbe_stop() and it resets the chip. The reset change WUC and WUFC registers to
the default, so clearing WUC and WUFC should be done after ixgbe_stop().


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 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.57 src/sys/dev/pci/ixgbe/ixgbe.c:1.58
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.57	Wed Dec 28 07:05:11 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Dec 28 09:29:35 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.57 2016/12/28 07:05:11 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.58 2016/12/28 09:29:35 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -4157,12 +4157,27 @@ ixgbe_setup_low_power_mode(struct adapte
 
 	KASSERT(mutex_owned(>core_mtx));
 
-	if (!hw->wol_enabled)
-		ixgbe_set_phy_power(hw, FALSE);
-
 	/* Limit power management flow to X550EM baseT */
 	if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T
 	&& hw->phy.ops.enter_lplu) {
+		/* X550EM baseT adapters need a special LPLU flow */
+		hw->phy.reset_disable = true;
+		ixgbe_stop(adapter);
+		error = hw->phy.ops.enter_lplu(hw);
+		if (error)
+			device_printf(dev,
+			"Error entering LPLU: %d\n", error);
+		hw->phy.reset_disable = false;
+	} else {
+		/* Just stop for other adapters */
+		ixgbe_stop(adapter);
+	}
+
+	if (!hw->wol_enabled) {
+		ixgbe_set_phy_power(hw, FALSE);
+		IXGBE_WRITE_REG(hw, IXGBE_WUFC, 0);
+		IXGBE_WRITE_REG(hw, IXGBE_WUC, 0);
+	} else {
 		/* Turn off support for APM wakeup. (Using ACPI instead) */
 		IXGBE_WRITE_REG(hw, IXGBE_GRC,
 		IXGBE_READ_REG(hw, IXGBE_GRC) & ~(u32)2);
@@ -4183,17 +4198,6 @@ ixgbe_setup_low_power_mode(struct adapte
 		IXGBE_WRITE_REG(hw, IXGBE_WUC,
 		IXGBE_WUC_WKEN | IXGBE_WUC_PME_EN);
 
-		/* X550EM baseT adapters need a special LPLU flow */
-		hw->phy.reset_disable = true;
-		ixgbe_stop(adapter);
-		error = hw->phy.ops.enter_lplu(hw);
-		if (error)
-			device_printf(dev,
-			"Error entering LPLU: %d\n", error);
-		hw->phy.reset_disable = false;
-	} else {
-		/* Just stop for other adapters */
-		ixgbe_stop(adapter);
 	}
 
 	return error;



CVS commit: src/sys/dev/pci/ixgbe

2016-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 28 09:29:35 UTC 2016

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

Log Message:
 Fix a bug that hw.ixgN.wol_enable=0 doesn't work correctly. Clear the WUC
and WUFC register if wol_enable is 0. ixgbe_setup_low_power_mode() calls
ixgbe_stop() and it resets the chip. The reset change WUC and WUFC registers to
the default, so clearing WUC and WUFC should be done after ixgbe_stop().


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 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.



CVS commit: src/sys/dev/pci/ixgbe

2016-12-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 28 07:05:11 UTC 2016

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

Log Message:
 Allow 0 as the defalut of hw.ixgN.advertise_speed sysctl.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 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.56 src/sys/dev/pci/ixgbe/ixgbe.c:1.57
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.56	Tue Dec 27 10:01:39 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Dec 28 07:05:11 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.56 2016/12/27 10:01:39 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.57 2016/12/28 07:05:11 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -4998,6 +4998,7 @@ ixgbe_set_flowcntl(struct adapter *adapt
 /*
 ** Control advertised link speed:
 **	Flags:
+**	0x0 - Default (all capable link speed)
 **	0x1 - advertise 100 Mb
 **	0x2 - advertise 1G
 **	0x4 - advertise 10G
@@ -5044,26 +5045,26 @@ ixgbe_set_advertise(struct adapter *adap
 		return (EINVAL);
 	}
 
-	if (advertise < 0x1 || advertise > 0x7) {
+	if (advertise < 0x0 || advertise > 0x7) {
 		device_printf(dev,
-		"Invalid advertised speed; valid modes are 0x1 through 0x7\n");
-		return (EINVAL);
-	}
-
-	if ((advertise & 0x1)
-	&& (hw->mac.type != ixgbe_mac_X540)
-	&& (hw->mac.type != ixgbe_mac_X550)) {
-		device_printf(dev, "Set Advertise: 100Mb on X540/X550 only\n");
+		"Invalid advertised speed; valid modes are 0x0 through 0x7\n");
 		return (EINVAL);
 	}
 
 	/* Set new value and report new advertised mode */
 	speed = 0;
-	if (advertise & 0x1)
+	if ((hw->mac.type != ixgbe_mac_X540)
+	&& (hw->mac.type != ixgbe_mac_X550)) {
+		if (advertise & 0x1) {
+			device_printf(dev,
+			"Set Advertise: 100Mb on X540/X550 only\n");
+			return (EINVAL);
+		}
+	} else if ((advertise & 0x1) || (advertise == 0))
 		speed |= IXGBE_LINK_SPEED_100_FULL;
-	if (advertise & 0x2)
+	if ((advertise & 0x2) || (advertise == 0))
 		speed |= IXGBE_LINK_SPEED_1GB_FULL;
-	if (advertise & 0x4)
+	if ((advertise & 0x4) || (advertise == 0))
 		speed |= IXGBE_LINK_SPEED_10GB_FULL;
 	adapter->advertise = advertise;
 



CVS commit: src/sys/dev/pci/ixgbe

2016-12-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 28 07:05:11 UTC 2016

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

Log Message:
 Allow 0 as the defalut of hw.ixgN.advertise_speed sysctl.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 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.



CVS commit: src/sys/dev/pci/ixgbe

2016-12-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Dec 27 11:17:51 UTC 2016

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

Log Message:
 Fix DEBUGFUNC() output in ixgbe_disable_rx_x550().


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/ixgbe/ixgbe_x550.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_x550.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.3 src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.4
--- src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.3	Mon Dec  5 08:50:29 2016
+++ src/sys/dev/pci/ixgbe/ixgbe_x550.c	Tue Dec 27 11:17:51 2016
@@ -2645,7 +2645,7 @@ void ixgbe_disable_rx_x550(struct ixgbe_
 	s32 status;
 	struct ixgbe_hic_disable_rxen fw_cmd;
 
-	DEBUGFUNC("ixgbe_enable_rx_dma_x550");
+	DEBUGFUNC("ixgbe_disable_rx_dma_x550");
 
 	rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL);
 	if (rxctrl & IXGBE_RXCTRL_RXEN) {



CVS commit: src/sys/dev/pci/ixgbe

2016-12-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Dec 27 11:17:51 UTC 2016

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

Log Message:
 Fix DEBUGFUNC() output in ixgbe_disable_rx_x550().


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

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Dec 27 10:01:39 UTC 2016

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

Log Message:
  Fix flow control setting sysctl. I don't know why disabling autonego when
the flow control parameter is changed. Now the ixgN.fc sysctl works as
expected.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 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.55 src/sys/dev/pci/ixgbe/ixgbe.c:1.56
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.55	Fri Dec 16 08:41:01 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Dec 27 10:01:39 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.55 2016/12/16 08:41:01 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.56 2016/12/27 10:01:39 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -4987,8 +4987,10 @@ ixgbe_set_flowcntl(struct adapter *adapt
 			return (EINVAL);
 	}
 	adapter->fc = fc;
+#if 0 /* XXX NetBSD */
 	/* Don't autoneg if forcing a value */
 	adapter->hw.fc.disable_fc_autoneg = TRUE;
+#endif
 	ixgbe_fc_enable(>hw);
 	return (0);
 }



CVS commit: src/sys/dev/pci/ixgbe

2016-12-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Dec 27 10:01:39 UTC 2016

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

Log Message:
  Fix flow control setting sysctl. I don't know why disabling autonego when
the flow control parameter is changed. Now the ixgN.fc sysctl works as
expected.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 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.



CVS commit: src/sys/dev/pci/ixgbe

2016-12-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 16 08:41:01 UTC 2016

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

Log Message:
Add missing IFM_FDX.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 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.



CVS commit: src/sys/dev/pci/ixgbe

2016-12-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 16 08:41:01 UTC 2016

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

Log Message:
Add missing IFM_FDX.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 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.54 src/sys/dev/pci/ixgbe/ixgbe.c:1.55
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.54	Fri Dec 16 08:30:20 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Dec 16 08:41:01 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.54 2016/12/16 08:30:20 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.55 2016/12/16 08:41:01 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -3038,67 +3038,98 @@ ixgbe_add_media_types(struct adapter *ad
 
 	layer = adapter->phy_layer;
 
+#define	ADD(mm, dd)			\
+	ifmedia_add(>media, IFM_ETHER | (mm), (dd), NULL);
+
 	/* Media types with matching NetBSD media defines */
-	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T)
-		ifmedia_add(>media, IFM_ETHER | IFM_10G_T, 0, NULL);
-	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_T)
-		ifmedia_add(>media, IFM_ETHER | IFM_1000_T, 0, NULL);
-	if (layer & IXGBE_PHYSICAL_LAYER_100BASE_TX)
-		ifmedia_add(>media, IFM_ETHER | IFM_100_TX, 0, NULL);
-	
+	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) {
+		ADD(IFM_10G_T, 0);
+		ADD(IFM_10G_T | IFM_FDX, 0);
+	}
+	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_T) {
+		ADD(IFM_1000_T, 0);
+		ADD(IFM_1000_T | IFM_FDX, 0);
+	}
+	if (layer & IXGBE_PHYSICAL_LAYER_100BASE_TX) {
+		ADD(IFM_100_TX, 0);
+		ADD(IFM_100_TX | IFM_FDX, 0);
+	}
+
 	if (layer & IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU ||
-	layer & IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA)
-		ifmedia_add(>media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL);
+	layer & IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA) {
+		ADD(IFM_10G_TWINAX, 0);
+		ADD(IFM_10G_TWINAX | IFM_FDX, 0);
+	}
 
 	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_LR) {
-		ifmedia_add(>media, IFM_ETHER | IFM_10G_LR, 0, NULL);
-		if (hw->phy.multispeed_fiber)
-			ifmedia_add(>media, IFM_ETHER | IFM_1000_LX, 0, NULL);
+		ADD(IFM_10G_LR, 0);
+		ADD(IFM_10G_LR | IFM_FDX, 0);
+		if (hw->phy.multispeed_fiber) {
+			ADD(IFM_1000_LX, 0);
+			ADD(IFM_1000_LX | IFM_FDX, 0);
+		}
 	}
 	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_SR) {
-		ifmedia_add(>media, IFM_ETHER | IFM_10G_SR, 0, NULL);
-		if (hw->phy.multispeed_fiber)
-			ifmedia_add(>media, IFM_ETHER | IFM_1000_SX, 0, NULL);
-	} else if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX)
-		ifmedia_add(>media, IFM_ETHER | IFM_1000_SX, 0, NULL);
-	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_CX4)
-		ifmedia_add(>media, IFM_ETHER | IFM_10G_CX4, 0, NULL);
+		ADD(IFM_10G_SR, 0);
+		ADD(IFM_10G_SR | IFM_FDX, 0);
+		if (hw->phy.multispeed_fiber) {
+			ADD(IFM_1000_SX, 0);
+			ADD(IFM_1000_SX | IFM_FDX, 0);
+		}
+	} else if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) {
+		ADD(IFM_1000_SX, 0);
+		ADD(IFM_1000_SX | IFM_FDX, 0);
+	}
+	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_CX4) {
+		ADD(IFM_10G_CX4, 0);
+		ADD(IFM_10G_CX4 | IFM_FDX, 0);
+	}
 
 #ifdef IFM_ETH_XTYPE
-	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR)
-		ifmedia_add(>media, IFM_ETHER | IFM_10G_KR, 0, NULL);
-	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4)
-		ifmedia_add(>media, IFM_ETHER | IFM_10G_KX4, 0, NULL);
-	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX)
-		ifmedia_add(>media, IFM_ETHER | IFM_1000_KX, 0, NULL);
+	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) {
+		ADD(IFM_10G_KR, 0);
+		ADD(IFM_10G_KR | IFM_FDX, 0);
+	}
+	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4) {
+		ADD(AIFM_10G_KX4, 0);
+		ADD(AIFM_10G_KX4 | IFM_FDX, 0);
+	}
+	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) {
+		ADD(IFM_1000_KX, 0);
+		ADD(IFM_1000_KX | IFM_FDX, 0);
+	}
 #else
 	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) {
 		device_printf(dev, "Media supported: 10GbaseKR\n");
 		device_printf(dev, "10GbaseKR mapped to 10GbaseSR\n");
-		ifmedia_add(>media, IFM_ETHER | IFM_10G_SR, 0, NULL);
+		ADD(IFM_10G_SR, 0);
+		ADD(IFM_10G_SR | IFM_FDX, 0);
 	}
 	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4) {
 		device_printf(dev, "Media supported: 10GbaseKX4\n");
 		device_printf(dev, "10GbaseKX4 mapped to 10GbaseCX4\n");
-		ifmedia_add(>media, IFM_ETHER | IFM_10G_CX4, 0, NULL);
+		ADD(IFM_10G_CX4, 0);
+		ADD(IFM_10G_CX4 | IFM_FDX, 0);
 	}
 	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) {
 		device_printf(dev, "Media supported: 1000baseKX\n");
 		device_printf(dev, "1000baseKX mapped to 1000baseCX\n");
-		ifmedia_add(>media, IFM_ETHER | IFM_1000_CX, 0, NULL);
+		ADD(IFM_1000_CX, 0);
+		ADD(IFM_1000_CX | IFM_FDX, 0);
 	}
 #endif
 	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX)
 		device_printf(dev, "Media supported: 1000baseBX\n");
+	/* XXX no ifmedia_set? */
 	
 	if (hw->device_id == IXGBE_DEV_ID_82598AT) {
-		

CVS commit: src/sys/dev/pci/ixgbe

2016-12-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 16 08:30:20 UTC 2016

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

Log Message:
Remove extra newline in debug printfs. ixgbe's *DEBUGOUT* macros automatically
add newline.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pci/ixgbe/ixv.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.53 src/sys/dev/pci/ixgbe/ixgbe.c:1.54
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.53	Mon Dec  5 10:05:11 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Dec 16 08:30:20 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.53 2016/12/05 10:05:11 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.54 2016/12/16 08:30:20 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1028,7 +1028,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
 		IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)");
 		break;
 	default:
-		IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command);
+		IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)", (int)command);
 		break;
 	}
 

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.29 src/sys/dev/pci/ixgbe/ixv.c:1.30
--- src/sys/dev/pci/ixgbe/ixv.c:1.29	Mon Dec  5 08:50:29 2016
+++ src/sys/dev/pci/ixgbe/ixv.c	Fri Dec 16 08:30:20 2016
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.29 2016/12/05 08:50:29 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.30 2016/12/16 08:30:20 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -637,7 +637,7 @@ ixv_ioctl(struct ifnet * ifp, u_long com
 		IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)");
 		break;
 	default:
-		IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command);
+		IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)", (int)command);
 		break;
 	}
 



CVS commit: src/sys/dev/pci/ixgbe

2016-12-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 16 08:30:20 UTC 2016

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

Log Message:
Remove extra newline in debug printfs. ixgbe's *DEBUGOUT* macros automatically
add newline.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 16 08:24:41 UTC 2016

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

Log Message:
 The rx_bytes event counter is cleared when if_init() is called, but not for
rx_packets. It's inconsistent. It makes rx_packets is bigger than rx_bytes.
IMHO, it's not required to clear them. At least the above comment says
"/* Setup our descriptor indices */". It's not descriptor indice...


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ix_txrx.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.12 src/sys/dev/pci/ixgbe/ix_txrx.c:1.13
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.12	Thu Dec 15 09:28:05 2016
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Dec 16 08:24:40 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 301538 2016-06-07 04:51:50Z sephe $*/
-/*$NetBSD: ix_txrx.c,v 1.12 2016/12/15 09:28:05 ozaki-r Exp $*/
+/*$NetBSD: ix_txrx.c,v 1.13 2016/12/16 08:24:40 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1573,7 +1573,12 @@ ixgbe_setup_receive_ring(struct rx_ring 
 	rxr->next_to_refresh = 0;
 	rxr->lro_enabled = FALSE;
 	rxr->rx_copies.ev_count = 0;
+#if 0 /* NetBSD */
 	rxr->rx_bytes.ev_count = 0;
+#if 1	/* Fix inconsistency */
+	rxr->rx_packets.ev_count = 0;
+#endif
+#endif
 	rxr->vtag_strip = FALSE;
 
 	ixgbe_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map,



CVS commit: src/sys/dev/pci/ixgbe

2016-12-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 16 08:24:41 UTC 2016

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

Log Message:
 The rx_bytes event counter is cleared when if_init() is called, but not for
rx_packets. It's inconsistent. It makes rx_packets is bigger than rx_bytes.
IMHO, it's not required to clear them. At least the above comment says
"/* Setup our descriptor indices */". It's not descriptor indice...


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

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 14 10:46:12 UTC 2016

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

Log Message:
Fix ip[46]csum-tx doesn't work other than TCP and UDP.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ix_txrx.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.10 src/sys/dev/pci/ixgbe/ix_txrx.c:1.11
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.10	Mon Dec  5 08:50:29 2016
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed Dec 14 10:46:12 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 301538 2016-06-07 04:51:50Z sephe $*/
-/*$NetBSD: ix_txrx.c,v 1.10 2016/12/05 08:50:29 msaitoh Exp $*/
+/*$NetBSD: ix_txrx.c,v 1.11 2016/12/14 10:46:12 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -840,6 +840,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
 		break;
 #endif
 	default:
+		offload = false;
 		break;
 	}
 
@@ -863,6 +864,9 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
 			else
 offload = false;
 			break;
+		default:
+			offload = false;
+			break;
 	}
 
 	if (offload) /* Insert L4 checksum into data descriptors */



CVS commit: src/sys/dev/pci/ixgbe

2016-12-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 14 10:46:12 UTC 2016

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

Log Message:
Fix ip[46]csum-tx doesn't work other than TCP and UDP.


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

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Dec  5 10:05:11 UTC 2016

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

Log Message:
- Fix wol_enable, fc and wufc sysctls to work correctly.
- Fix RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ixgbe/ixgbe_osdep.h

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Dec  5 10:05:11 UTC 2016

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

Log Message:
- Fix wol_enable, fc and wufc sysctls to work correctly.
- Fix RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ixgbe/ixgbe_osdep.h

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.52 src/sys/dev/pci/ixgbe/ixgbe.c:1.53
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.52	Mon Dec  5 08:50:29 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Dec  5 10:05:11 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.52 2016/12/05 08:50:29 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.53 2016/12/05 10:05:11 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -4537,7 +4537,7 @@ ixgbe_add_device_sysctls(struct adapter 
 	/* for WoL-capable devices */
 	if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) {
 		if (sysctl_createv(log, 0, , ,
-		CTLFLAG_READWRITE, CTLTYPE_INT,
+		CTLFLAG_READWRITE, CTLTYPE_BOOL,
 		"wol_enable", SYSCTL_DESCR("Enable/Disable Wake on LAN"),
 		ixgbe_sysctl_wol_enable, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL) != 0)
 			aprint_error_dev(dev, "could not create sysctl\n");
@@ -4921,9 +4921,8 @@ ixgbe_sysctl_flowcntl(SYSCTLFN_ARGS)
 	struct sysctlnode node = *rnode;
 	struct adapter *adapter = (struct adapter *)node.sysctl_data;
 
-	node.sysctl_data = >fc;
 	fc = adapter->fc;
-
+	node.sysctl_data = 
 	error = sysctl_lookup(SYSCTLFN_CALL());
 	if (error != 0 || newp == NULL)
 		return error;
@@ -5261,18 +5260,18 @@ ixgbe_sysctl_wol_enable(SYSCTLFN_ARGS)
 	struct sysctlnode node = *rnode;
 	struct adapter *adapter = (struct adapter *)node.sysctl_data;
 	struct ixgbe_hw *hw = >hw;
-	int new_wol_enabled;
+	bool new_wol_enabled;
 	int error = 0;
 
 	new_wol_enabled = hw->wol_enabled;
+	node.sysctl_data = _wol_enabled;
 	error = sysctl_lookup(SYSCTLFN_CALL());
 	if ((error) || (newp == NULL))
 		return (error);
-	new_wol_enabled = !!(new_wol_enabled);
 	if (new_wol_enabled == hw->wol_enabled)
 		return (0);
 
-	if (new_wol_enabled > 0 && !adapter->wol_support)
+	if (new_wol_enabled && !adapter->wol_support)
 		return (ENODEV);
 	else
 		hw->wol_enabled = new_wol_enabled;
@@ -5415,7 +5414,7 @@ ixgbe_sysctl_wufc(SYSCTLFN_ARGS)
 	u32 new_wufc;
 
 	new_wufc = adapter->wufc;
-
+	node.sysctl_data = _wufc;
 	error = sysctl_lookup(SYSCTLFN_CALL());
 	if ((error) || (newp == NULL))
 		return (error);

Index: src/sys/dev/pci/ixgbe/ixgbe_osdep.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.15 src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.16
--- src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.15	Mon Dec  5 08:50:29 2016
+++ src/sys/dev/pci/ixgbe/ixgbe_osdep.h	Mon Dec  5 10:05:11 2016
@@ -30,7 +30,8 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 **/
-/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.h 294734 2016-01-25 16:18:53Z smh $*//*$NetBSD: ixgbe_osdep.h,v 1.15 2016/12/05 08:50:29 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.h 294734 2016-01-25 16:18:53Z smh $*/
+/*$NetBSD: ixgbe_osdep.h,v 1.16 2016/12/05 10:05:11 msaitoh Exp $*/
 
 #ifndef _IXGBE_OS_H_
 #define _IXGBE_OS_H_



CVS commit: src/sys/dev/pci/ixgbe

2016-12-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Dec  5 08:50:29 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_api.c
ixgbe_common.c ixgbe_mbx.c ixgbe_osdep.h ixgbe_phy.c ixgbe_type.h
ixgbe_x540.c ixgbe_x550.c ixv.c

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r303890:
- Configure ixgbe phy & gbic power.
  Setup phy and gbic power as per Linux 4.3.13 driver.
  This fixes link not detected on X540-AT2 after booting to Linux which
  turns the phy power off on detach. (FreeBSD r295093)
- Fixup DA cable detection routine. (FreeBSD r303032)
- Some minor changes


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ix_txrx.c \
src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/ixgbe/ixgbe_api.c \
src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_mbx.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/ixgbe/ixv.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.9 src/sys/dev/pci/ixgbe/ix_txrx.c:1.10
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.9	Fri Dec  2 12:14:37 2016
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Mon Dec  5 08:50:29 2016
@@ -58,8 +58,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 292751 2015-12-26 17:27:48Z bz $*/
-/*$NetBSD: ix_txrx.c,v 1.9 2016/12/02 12:14:37 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 301538 2016-06-07 04:51:50Z sephe $*/
+/*$NetBSD: ix_txrx.c,v 1.10 2016/12/05 08:50:29 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -433,7 +433,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m
 	}
 
 	/* Make certain there are enough descriptors */
-	if (map->dm_nsegs > txr->tx_avail - 2) {
+	if (txr->tx_avail < (map->dm_nsegs + 2)) {
 		txr->no_desc_avail.ev_count++;
 		ixgbe_dmamap_unload(txr->txtag, txbuf->map);
 		return EAGAIN;
@@ -1804,7 +1804,6 @@ ixgbe_rxeof(struct ix_queue *que)
 	struct ifnet		*ifp = adapter->ifp;
 #ifdef LRO
 	struct lro_ctrl		*lro = >lro;
-	struct lro_entry	*queued;
 #endif /* LRO */
 	int			i, nextp, processed = 0;
 	u32			staterr = 0;
@@ -2026,7 +2025,7 @@ ixgbe_rxeof(struct ix_queue *que)
 #endif
 default:
 M_HASHTYPE_SET(sendmp,
-M_HASHTYPE_OPAQUE);
+M_HASHTYPE_OPAQUE_HASH);
 }
 } else {
 sendmp->m_pkthdr.flowid = que->msix;
@@ -2066,10 +2065,7 @@ next_desc:
 	/*
 	 * Flush any outstanding LRO work
 	 */
-	while ((queued = SLIST_FIRST(>lro_active)) != NULL) {
-		SLIST_REMOVE_HEAD(>lro_active, next);
-		tcp_lro_flush(lro, queued);
-	}
+	tcp_lro_flush_all(lro);
 #endif /* LRO */
 
 	IXGBE_RX_UNLOCK(rxr);
Index: src/sys/dev/pci/ixgbe/ixgbe_phy.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.9 src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.10
--- src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.9	Fri Dec  2 10:42:04 2016
+++ src/sys/dev/pci/ixgbe/ixgbe_phy.c	Mon Dec  5 08:50:29 2016
@@ -30,8 +30,8 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 **/
-/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.c 292674 2015-12-23 22:45:17Z sbruno $*/
-/*$NetBSD: ixgbe_phy.c,v 1.9 2016/12/02 10:42:04 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.c 303032 2016-07-19 17:31:48Z sbruno $*/
+/*$NetBSD: ixgbe_phy.c,v 1.10 2016/12/05 08:50:29 msaitoh Exp $*/
 
 #include "ixgbe_api.h"
 #include "ixgbe_common.h"
@@ -1535,13 +1535,6 @@ s32 ixgbe_identify_sfp_module_generic(st
 hw->phy.type = ixgbe_phy_sfp_intel;
 break;
 			default:
-if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
-	hw->phy.type =
-		 ixgbe_phy_sfp_passive_unknown;
-else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE)
-	hw->phy.type =
-		ixgbe_phy_sfp_active_unknown;
-else
 	hw->phy.type = ixgbe_phy_sfp_unknown;
 break;
 			}
@@ -1550,6 +1543,10 @@ s32 ixgbe_identify_sfp_module_generic(st
 		/* Allow any DA cable vendor */
 		if (cable_tech & (IXGBE_SFF_DA_PASSIVE_CABLE |
 		IXGBE_SFF_DA_ACTIVE_CABLE)) {
+			if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
+hw->phy.type = ixgbe_phy_sfp_passive_unknown;
+			else if (cable_tech & IXGBE_SFF_DA_ACTIVE_CABLE)
+

CVS commit: src/sys/dev/pci/ixgbe

2016-12-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Dec  5 08:50:29 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_api.c
ixgbe_common.c ixgbe_mbx.c ixgbe_osdep.h ixgbe_phy.c ixgbe_type.h
ixgbe_x540.c ixgbe_x550.c ixv.c

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r303890:
- Configure ixgbe phy & gbic power.
  Setup phy and gbic power as per Linux 4.3.13 driver.
  This fixes link not detected on X540-AT2 after booting to Linux which
  turns the phy power off on detach. (FreeBSD r295093)
- Fixup DA cable detection routine. (FreeBSD r303032)
- Some minor changes


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ix_txrx.c \
src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/ixgbe/ixgbe_api.c \
src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_mbx.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 12:14:37 UTC 2016

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

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r294578:
- Fixup SFP module insertion on the 82599 when insertion happens after
  the system is booted and running. Add PHY detection logic to
  ixgbe_handle_mod() and add locking to ixgbe_handle_msf() as well.
  FreeBSD r293334.
- Fix ix advertise value after media change. When ifconfig sets media then the
  values displayed by the advertise_speed value are invalidated.
  Fix this by setting the bits correctly including setting advertise to 0 for
  media = auto. FreeBSD r294578.
- Some others (e.g. LRO(not used by NetBSD)).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/ixgbe/ixv.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.8 src/sys/dev/pci/ixgbe/ix_txrx.c:1.9
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.8	Fri Dec  2 10:42:04 2016
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Dec  2 12:14:37 2016
@@ -58,8 +58,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 292674 2015-12-23 22:45:17Z sbruno $*/
-/*$NetBSD: ix_txrx.c,v 1.8 2016/12/02 10:42:04 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 292751 2015-12-26 17:27:48Z bz $*/
+/*$NetBSD: ix_txrx.c,v 1.9 2016/12/02 12:14:37 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -821,6 +821,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
 		l3d = mtod(mp, char *) + ehdrlen;
 
 	switch (etype) {
+#ifdef INET
 	case ETHERTYPE_IP:
 		ip = (struct ip *)(l3d);
 		ip_hlen = ip->ip_hl << 2;
@@ -829,12 +830,15 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
 		KASSERT((mp->m_pkthdr.csum_flags & M_CSUM_IPv4) == 0 ||
 		ip->ip_sum == 0);
 		break;
+#endif
+#ifdef INET6
 	case ETHERTYPE_IPV6:
 		ip6 = (struct ip6_hdr *)(l3d);
 		ip_hlen = sizeof(struct ip6_hdr);
 		ipproto = ip6->ip6_nxt;
 		type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6;
 		break;
+#endif
 	default:
 		break;
 	}

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.50 src/sys/dev/pci/ixgbe/ixgbe.c:1.51
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.50	Fri Dec  2 11:56:55 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Dec  2 12:14:37 2016
@@ -58,8 +58,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 292674 2015-12-23 22:45:17Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.50 2016/12/02 11:56:55 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 294578 2016-01-22 17:03:32Z smh $*/
+/*$NetBSD: ixgbe.c,v 1.51 2016/12/02 12:14:37 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -2033,10 +2033,16 @@ ixgbe_media_change(struct ifnet * ifp)
 
 	hw->mac.autotry_restart = TRUE;
 	hw->mac.ops.setup_link(hw, speed, TRUE);
-	adapter->advertise =
-		((speed & IXGBE_LINK_SPEED_10GB_FULL) << 2) |
-		((speed & IXGBE_LINK_SPEED_1GB_FULL) << 1) |
-		((speed & IXGBE_LINK_SPEED_100_FULL) << 0);
+	if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO) {
+		adapter->advertise = 0;
+	} else {
+		if ((speed & IXGBE_LINK_SPEED_10GB_FULL) != 0)
+			adapter->advertise |= 1 << 2;
+		if ((speed & IXGBE_LINK_SPEED_1GB_FULL) != 0)
+			adapter->advertise |= 1 << 1;
+		if ((speed & IXGBE_LINK_SPEED_100_FULL) != 0)
+			adapter->advertise |= 1 << 0;
+	}
 
 	return (0);
 
@@ -3066,18 +3072,8 @@ ixgbe_config_link(struct adapter *adapte
 	sfp = ixgbe_is_sfp(hw);
 
 	if (sfp) { 
-		void *ip;
-
-		if (hw->phy.multispeed_fiber) {
-			hw->mac.ops.setup_sfp(hw);
-			ixgbe_enable_tx_laser(hw);
-			ip = adapter->msf_si;
-		} else {
-			ip = adapter->mod_si;
-		}
-
 		kpreempt_disable();
-		softint_schedule(ip);
+		softint_schedule(adapter->mod_si);
 		kpreempt_enable();
 	} else {
 		if (hw->mac.ops.check_link)
@@ -3885,23 +3881,66 @@ ixgbe_handle_mod(void *context)
 {
 	struct adapter  *adapter = context;
 	struct ixgbe_hw *hw = >hw;
+	enum ixgbe_phy_type orig_type = hw->phy.type;
 	device_t	dev = adapter->dev;
 	u32 err;
 
+	IXGBE_CORE_LOCK(adapter);
+
+	/* Check to see if the PHY type changed */
+	if (hw->phy.ops.identify) {
+		hw->phy.type = ixgbe_phy_unknown;
+		hw->phy.ops.identify(hw);
+	}
+
+	if (hw->phy.type != orig_type) {
+		device_printf(dev, "Detected phy_type %d\n", hw->phy.type);
+
+		if (hw->phy.type == ixgbe_phy_none) {
+			hw->phy.sfp_type = ixgbe_sfp_type_unknown;
+			goto out;
+		}
+
+		/* Try to do the initialization that was skipped before */
+		if (hw->phy.ops.init)
+			hw->phy.ops.init(hw);
+		if (hw->phy.ops.reset)
+			hw->phy.ops.reset(hw);
+	}
+
 	err = 

CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 12:14:37 UTC 2016

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

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r294578:
- Fixup SFP module insertion on the 82599 when insertion happens after
  the system is booted and running. Add PHY detection logic to
  ixgbe_handle_mod() and add locking to ixgbe_handle_msf() as well.
  FreeBSD r293334.
- Fix ix advertise value after media change. When ifconfig sets media then the
  values displayed by the advertise_speed value are invalidated.
  Fix this by setting the bits correctly including setting advertise to 0 for
  media = auto. FreeBSD r294578.
- Some others (e.g. LRO(not used by NetBSD)).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 11:56:55 UTC 2016

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

Log Message:
Fix ix{gbe,v}_set_sysctlvalue().


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 11:56:55 UTC 2016

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

Log Message:
Fix ix{gbe,v}_set_sysctlvalue().


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/ixgbe/ixv.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.49 src/sys/dev/pci/ixgbe/ixgbe.c:1.50
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.49	Fri Dec  2 10:46:58 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Dec  2 11:56:55 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 292674 2015-12-23 22:45:17Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.49 2016/12/02 10:46:58 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.50 2016/12/02 11:56:55 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -4816,9 +4816,9 @@ ixgbe_set_sysctl_value(struct adapter *a
 		return;
 	}
 	if (sysctl_createv(log, 0, , ,
-	CTLFLAG_READWRITE|CTLFLAG_IMMEDIATE, CTLTYPE_INT,
+	CTLFLAG_READWRITE, CTLTYPE_INT,
 	name, SYSCTL_DESCR(description),
-		NULL, value, limit, 0, CTL_CREATE, CTL_EOL) != 0)
+		NULL, 0, limit, 0, CTL_CREATE, CTL_EOL) != 0)
 		aprint_error_dev(dev, "could not create sysctl\n");
 	*limit = value;
 }

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.26 src/sys/dev/pci/ixgbe/ixv.c:1.27
--- src/sys/dev/pci/ixgbe/ixv.c:1.26	Fri Dec  2 10:42:04 2016
+++ src/sys/dev/pci/ixgbe/ixv.c	Fri Dec  2 11:56:55 2016
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 292674 2015-12-23 22:45:17Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.26 2016/12/02 10:42:04 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.27 2016/12/02 11:56:55 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -2194,9 +2194,9 @@ ixv_set_sysctl_value(struct adapter *ada
 		return;
 	}
 	if (sysctl_createv(log, 0, , ,
-	CTLFLAG_READWRITE|CTLFLAG_IMMEDIATE, CTLTYPE_INT,
+	CTLFLAG_READWRITE, CTLTYPE_INT,
 	name, SYSCTL_DESCR(description),
-	NULL, 0, limit, CTL_CREATE, CTL_EOL) != 0)
+	NULL, 0, limit, 0, CTL_CREATE, CTL_EOL) != 0)
 		aprint_error_dev(dev, "could not create sysctl\n");
 	*limit = value;
 }



CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 10:46:58 UTC 2016

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

Log Message:
- Add missing pmf_device_deregister() in ixgbe_detach()
- Remove extra newline from an sysctl description.
- Fix dmesg output when the number of PCIe lane can't get.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/ixgbe/ixgbe.h

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 10:46:58 UTC 2016

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

Log Message:
- Add missing pmf_device_deregister() in ixgbe_detach()
- Remove extra newline from an sysctl description.
- Fix dmesg output when the number of PCIe lane can't get.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/ixgbe/ixgbe.h

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.48 src/sys/dev/pci/ixgbe/ixgbe.c:1.49
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.48	Fri Dec  2 10:42:04 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Dec  2 10:46:58 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 292674 2015-12-23 22:45:17Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.48 2016/12/02 10:42:04 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.49 2016/12/02 10:46:58 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -700,6 +700,8 @@ ixgbe_detach(device_t dev, int flags)
 	}
 #endif /* PCI_IOV */
 
+	pmf_device_deregister(dev);
+
 	ether_ifdetach(adapter->ifp);
 	/* Stop the adapter */
 	IXGBE_CORE_LOCK(adapter);
@@ -3706,13 +3708,13 @@ ixgbe_get_slot_info(struct adapter *adap
 	mac->ops.set_lan_id(hw);
 
 display:
-	device_printf(dev,"PCI Express Bus: Speed %s %s\n",
+	device_printf(dev,"PCI Express Bus: Speed %s Width %s\n",
 	((hw->bus.speed == ixgbe_bus_speed_8000) ? "8.0GT/s":
 	(hw->bus.speed == ixgbe_bus_speed_5000) ? "5.0GT/s":
 	(hw->bus.speed == ixgbe_bus_speed_2500) ? "2.5GT/s":"Unknown"),
-	(hw->bus.width == ixgbe_bus_width_pcie_x8) ? "Width x8" :
-	(hw->bus.width == ixgbe_bus_width_pcie_x4) ? "Width x4" :
-	(hw->bus.width == ixgbe_bus_width_pcie_x1) ? "Width x1" :
+	(hw->bus.width == ixgbe_bus_width_pcie_x8) ? "x8" :
+	(hw->bus.width == ixgbe_bus_width_pcie_x4) ? "x4" :
+	(hw->bus.width == ixgbe_bus_width_pcie_x1) ? "x1" :
 	("Unknown"));
 
 	if ((hw->device_id != IXGBE_DEV_ID_82599_SFP_SF_QP) &&

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.16 src/sys/dev/pci/ixgbe/ixgbe.h:1.17
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.16	Fri Dec  2 10:42:04 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Fri Dec  2 10:46:58 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.h 292674 2015-12-23 22:45:17Z sbruno $*/
-/*$NetBSD: ixgbe.h,v 1.16 2016/12/02 10:42:04 msaitoh Exp $*/
+/*$NetBSD: ixgbe.h,v 1.17 2016/12/02 10:46:58 msaitoh Exp $*/
 
 
 #ifndef _IXGBE_H_
@@ -677,7 +677,7 @@ struct adapter {
 	"\t0x1 - advertise 100M\n" \
 	"\t0x2 - advertise 1G\n" \
 	"\t0x4 - advertise 10G\n\n" \
-	"\t100M is only supported on certain 10GBaseT adapters.\n"
+	"\t100M is only supported on certain 10GBaseT adapters."
 
 #define IXGBE_SYSCTL_DESC_SET_FC \
 	"\nSet flow control mode using these values:\n" \



CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 10:42:04 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_82598.c
ixgbe_82599.c ixgbe_api.c ixgbe_api.h ixgbe_common.c ixgbe_dcb.c
ixgbe_mbx.h ixgbe_osdep.h ixgbe_phy.c ixgbe_phy.h ixgbe_type.h
ixgbe_vf.c ixgbe_x540.c ixgbe_x550.c ixgbe_x550.h ixv.c
Added Files:
src/sys/dev/pci/ixgbe: ixgbe_osdep.c
Removed Files:
src/sys/dev/pci/ixgbe: LICENSE README

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r292674:
- Add X552 SFP+ and X550T single port.
- Bug fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/sys/dev/pci/ixgbe/LICENSE
cvs rdiff -u -r1.2 -r0 src/sys/dev/pci/ixgbe/README
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ix_txrx.c \
src/sys/dev/pci/ixgbe/ixgbe_82598.c src/sys/dev/pci/ixgbe/ixgbe_phy.h
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ixgbe/ixgbe.h \
src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ixgbe_82599.c \
src/sys/dev/pci/ixgbe/ixgbe_api.c src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_api.h \
src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_common.c \
src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/ixgbe/ixgbe_dcb.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/ixgbe/ixgbe_osdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ixgbe/ixgbe_x550.c \
src/sys/dev/pci/ixgbe/ixgbe_x550.h
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/ixgbe/ixv.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.7 src/sys/dev/pci/ixgbe/ix_txrx.c:1.8
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.7	Fri Dec  2 10:34:23 2016
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Dec  2 10:42:04 2016
@@ -58,8 +58,11 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 289238 2015-10-13 17:34:18Z sbruno $*/
-/*$NetBSD: ix_txrx.c,v 1.7 2016/12/02 10:34:23 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 292674 2015-12-23 22:45:17Z sbruno $*/
+/*$NetBSD: ix_txrx.c,v 1.8 2016/12/02 10:42:04 msaitoh Exp $*/
+
+#include "opt_inet.h"
+#include "opt_inet6.h"
 
 #include "ixgbe.h"
 
@@ -98,48 +101,6 @@ static bool ixgbe_rsc_enable = FALSE;
 static int atr_sample_rate = 20;
 #endif
 
-/* Shared PCI config read/write */
-u16
-ixgbe_read_pci_cfg(struct ixgbe_hw *hw, u32 reg)
-{
-	switch (reg % 4) {
-	case 0:
-		return pci_conf_read(hw->back->pc, hw->back->tag, reg) &
-		__BITS(15, 0);
-	case 2:
-		return __SHIFTOUT(pci_conf_read(hw->back->pc, hw->back->tag,
-		reg - 2), __BITS(31, 16));
-	default:
-		panic("%s: invalid register (%" PRIx32, __func__, reg); 
-		break;
-	}
-}
-
-void
-ixgbe_write_pci_cfg(struct ixgbe_hw *hw, u32 reg, u16 value)
-{
-	pcireg_t old;
-
-	switch (reg % 4) {
-	case 0:
-		old = pci_conf_read(hw->back->pc, hw->back->tag, reg) &
-		__BITS(31, 16);
-		pci_conf_write(hw->back->pc, hw->back->tag, reg, value | old);
-		break;
-	case 2:
-		old = pci_conf_read(hw->back->pc, hw->back->tag, reg - 2) &
-		__BITS(15, 0);
-		pci_conf_write(hw->back->pc, hw->back->tag, reg - 2,
-		__SHIFTIN(value, __BITS(31, 16)) | old);
-		break;
-	default:
-		panic("%s: invalid register (%" PRIx32, __func__, reg); 
-		break;
-	}
-
-	return;
-}
-
 /*
  *  Local Function prototypes
  */
@@ -246,8 +207,8 @@ ixgbe_start(struct ifnet *ifp)
 #else /* ! IXGBE_LEGACY_TX */
 
 /*
-** Multiqueue Transmit driver
-**
+** Multiqueue Transmit Entry Point
+** (if_transmit function)
 */
 int
 ixgbe_mq_start(struct ifnet *ifp, struct mbuf *m)
@@ -267,13 +228,22 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 	 * If everything is setup correctly, it should be the
 	 * same bucket that the current CPU we're on is.
 	 */
+#if __FreeBSD_version < 1100054
+	if (m->m_flags & M_FLOWID) {
+#else
 	if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) {
+#endif
 #ifdef	RSS
 		if (rss_hash2bucket(m->m_pkthdr.flowid,
-		M_HASHTYPE_GET(m), _id) == 0)
+		M_HASHTYPE_GET(m), _id) == 0) {
 			/* TODO: spit out something if bucket_id > num_queues? */
 			i = bucket_id % adapter->num_queues;
-		else
+#ifdef IXGBE_DEBUG
+			if (bucket_id > adapter->num_queues)
+if_printf(ifp, "bucket_id (%d) > num_queues "
+"(%d)\n", bucket_id, adapter->num_queues);
+#endif
+		} else
 #endif
 			i = m->m_pkthdr.flowid % adapter->num_queues;
 	} else
@@ -489,6 +459,7 @@ 

CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 10:42:04 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_82598.c
ixgbe_82599.c ixgbe_api.c ixgbe_api.h ixgbe_common.c ixgbe_dcb.c
ixgbe_mbx.h ixgbe_osdep.h ixgbe_phy.c ixgbe_phy.h ixgbe_type.h
ixgbe_vf.c ixgbe_x540.c ixgbe_x550.c ixgbe_x550.h ixv.c
Added Files:
src/sys/dev/pci/ixgbe: ixgbe_osdep.c
Removed Files:
src/sys/dev/pci/ixgbe: LICENSE README

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r292674:
- Add X552 SFP+ and X550T single port.
- Bug fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/sys/dev/pci/ixgbe/LICENSE
cvs rdiff -u -r1.2 -r0 src/sys/dev/pci/ixgbe/README
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ix_txrx.c \
src/sys/dev/pci/ixgbe/ixgbe_82598.c src/sys/dev/pci/ixgbe/ixgbe_phy.h
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ixgbe/ixgbe.h \
src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ixgbe_82599.c \
src/sys/dev/pci/ixgbe/ixgbe_api.c src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_api.h \
src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_common.c \
src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/ixgbe/ixgbe_dcb.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/ixgbe/ixgbe_osdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ixgbe/ixgbe_x550.c \
src/sys/dev/pci/ixgbe/ixgbe_x550.h
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 10:34:23 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_mbx.h ixgbe_vf.c
ixv.c

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r289238:
- Add support for sysctl knobs to live tune the per interrupt rx/tx packet
  processing limits in ixgbe(4)
- Some others (netmap, etc.)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 10:34:23 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_mbx.h ixgbe_vf.c
ixv.c

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r289238:
- Add support for sysctl knobs to live tune the per interrupt rx/tx packet
  processing limits in ixgbe(4)
- Some others (netmap, etc.)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/ixgbe/ixv.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.6 src/sys/dev/pci/ixgbe/ix_txrx.c:1.7
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.6	Fri Dec  2 10:24:31 2016
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Dec  2 10:34:23 2016
@@ -58,8 +58,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 285528 2015-07-14 09:13:18Z hiren $*/
-/*$NetBSD: ix_txrx.c,v 1.6 2016/12/02 10:24:31 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 289238 2015-10-13 17:34:18Z sbruno $*/
+/*$NetBSD: ix_txrx.c,v 1.7 2016/12/02 10:34:23 msaitoh Exp $*/
 
 #include "ixgbe.h"
 
@@ -267,11 +267,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 	 * If everything is setup correctly, it should be the
 	 * same bucket that the current CPU we're on is.
 	 */
-#if __FreeBSD_version < 1100054
-	if (m->m_flags & M_FLOWID) {
-#else
 	if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) {
-#endif
 #ifdef	RSS
 		if (rss_hash2bucket(m->m_pkthdr.flowid,
 		M_HASHTYPE_GET(m), _id) == 0)
@@ -1028,7 +1024,7 @@ ixgbe_txeof(struct tx_ring *txr)
 	struct adapter		*adapter = txr->adapter;
 	struct ifnet		*ifp = adapter->ifp;
 	u32			work, processed = 0;
-	u16			limit = txr->process_limit;
+	u32			limit = adapter->tx_process_limit;
 	struct ixgbe_tx_buf	*buf;
 	union ixgbe_adv_tx_desc *txd;
 
@@ -1818,7 +1814,7 @@ ixgbe_rxeof(struct ix_queue *que)
 #endif /* LRO */
 	int			i, nextp, processed = 0;
 	u32			staterr = 0;
-	u16			count = rxr->process_limit;
+	u32			count = adapter->rx_process_limit;
 	union ixgbe_adv_rx_desc	*cur;
 	struct ixgbe_rx_buf	*rbuf, *nbuf;
 #ifdef RSS

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.46 src/sys/dev/pci/ixgbe/ixgbe.c:1.47
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.46	Fri Dec  2 10:24:31 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Dec  2 10:34:23 2016
@@ -58,8 +58,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 285590 2015-07-15 00:35:50Z pkelsey $*/
-/*$NetBSD: ixgbe.c,v 1.46 2016/12/02 10:24:31 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 289238 2015-10-13 17:34:18Z sbruno $*/
+/*$NetBSD: ixgbe.c,v 1.47 2016/12/02 10:34:23 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -198,6 +198,8 @@ static void	ixgbe_add_device_sysctls(str
 static void ixgbe_add_hw_stats(struct adapter *);
 
 /* Sysctl handlers */
+static void	ixgbe_set_sysctl_value(struct adapter *, const char *,
+		const char *, int *, int);
 static int	ixgbe_set_flowcntl(SYSCTLFN_PROTO);
 static int	ixgbe_set_advertise(SYSCTLFN_PROTO);
 static int	ixgbe_sysctl_thermal_test(SYSCTLFN_PROTO);
@@ -449,6 +451,11 @@ ixgbe_attach(device_t parent, device_t d
 	aprint_normal(": %s, Version - %s\n",
 	ixgbe_strings[ent->index], ixgbe_driver_version);
 
+#ifdef DEV_NETMAP
+	adapter->init_locked = ixgbe_init_locked;
+	adapter->stop_locked = ixgbe_stop;
+#endif
+
 	/* Core Lock Init*/
 	IXGBE_CORE_LOCK_INIT(adapter, device_xname(dev));
 
@@ -465,6 +472,15 @@ ixgbe_attach(device_t parent, device_t d
 		goto err_out;
 	}
 
+	/* Sysctls for limiting the amount of work done in the taskqueues */
+	ixgbe_set_sysctl_value(adapter, "rx_processing_limit",
+	"max number of rx packets to process",
+	>rx_process_limit, ixgbe_rx_process_limit);
+
+	ixgbe_set_sysctl_value(adapter, "tx_processing_limit",
+	"max number of tx packets to process",
+	>tx_process_limit, ixgbe_tx_process_limit);
+
 	/* Do descriptor calc and sanity checks */
 	if (((ixgbe_txd * sizeof(union ixgbe_adv_tx_desc)) % DBA_ALIGN) != 0 ||
 	ixgbe_txd < MIN_TXD || ixgbe_txd > MAX_TXD) {
@@ -687,6 +703,8 @@ ixgbe_detach(device_t dev, int flags)
 	}
 #endif /* PCI_IOV */
 
+	pmf_device_deregister(dev);
+
 	/* Stop the adapter */
 	IXGBE_CORE_LOCK(adapter);
 	ixgbe_setup_low_power_mode(adapter);
@@ -3033,9 +3051,6 @@ ixgbe_initialize_transmit_units(struct a
 		/* Cache the tail address */
 		txr->tail = 

CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 10:24:31 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_mbx.h ixgbe_vf.c
ixv.c

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r285590:
- Fix igxbe SRIOV VF (if_ixv) initialization bugs.  The MAC address for
  an if_ixv instance can now set at creation time, and the receive ring
  tail pointer is correctly initialized (previously, things still worked
  because the receive ring tail pointer was being fixed up as a side
  effect of other activity).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/ixgbe/ixv.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.5 src/sys/dev/pci/ixgbe/ix_txrx.c:1.6
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.5	Fri Dec  2 10:21:43 2016
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Dec  2 10:24:31 2016
@@ -58,8 +58,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 283881 2015-06-01 17:15:25Z jfv $*/
-/*$NetBSD: ix_txrx.c,v 1.5 2016/12/02 10:21:43 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 285528 2015-07-14 09:13:18Z hiren $*/
+/*$NetBSD: ix_txrx.c,v 1.6 2016/12/02 10:24:31 msaitoh Exp $*/
 
 #include "ixgbe.h"
 
@@ -1985,52 +1985,62 @@ ixgbe_rxeof(struct ix_queue *que)
 ixgbe_rx_checksum(staterr, sendmp, ptype,
    >stats.pf);
 			}
-#if __FreeBSD_version >= 80
-#ifdef RSS
-			sendmp->m_pkthdr.flowid =
-			le32toh(cur->wb.lower.hi_dword.rss);
-#if __FreeBSD_version < 1100054
-			sendmp->m_flags |= M_FLOWID;
-#endif
-			switch (pkt_info & IXGBE_RXDADV_RSSTYPE_MASK) {
-			case IXGBE_RXDADV_RSSTYPE_IPV4_TCP:
-M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV4);
-break;
-			case IXGBE_RXDADV_RSSTYPE_IPV4:
-M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV4);
-break;
-			case IXGBE_RXDADV_RSSTYPE_IPV6_TCP:
-M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV6);
-break;
-			case IXGBE_RXDADV_RSSTYPE_IPV6_EX:
-M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV6_EX);
-break;
-			case IXGBE_RXDADV_RSSTYPE_IPV6:
-M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV6);
-break;
-			case IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX:
-M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV6_EX);
-break;
-			case IXGBE_RXDADV_RSSTYPE_IPV4_UDP:
-M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV4);
-break;
-			case IXGBE_RXDADV_RSSTYPE_IPV6_UDP:
-M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV6);
-break;
-			case IXGBE_RXDADV_RSSTYPE_IPV6_UDP_EX:
-M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV6_EX);
-break;
-			default:
+#if 0 /* FreeBSD */
+/*
+ * In case of multiqueue, we have RXCSUM.PCSD bit set
+ * and never cleared. This means we have RSS hash
+ * available to be used.   
+ */
+if (adapter->num_queues > 1) {
+sendmp->m_pkthdr.flowid =
+le32toh(cur->wb.lower.hi_dword.rss);
+switch (pkt_info & IXGBE_RXDADV_RSSTYPE_MASK) {  
+case IXGBE_RXDADV_RSSTYPE_IPV4:
+M_HASHTYPE_SET(sendmp,
+M_HASHTYPE_RSS_IPV4);
+break;
+case IXGBE_RXDADV_RSSTYPE_IPV4_TCP:
+M_HASHTYPE_SET(sendmp,
+M_HASHTYPE_RSS_TCP_IPV4);
+break;
+case IXGBE_RXDADV_RSSTYPE_IPV6:
+M_HASHTYPE_SET(sendmp,
+M_HASHTYPE_RSS_IPV6);
+break;
+case IXGBE_RXDADV_RSSTYPE_IPV6_TCP:
+M_HASHTYPE_SET(sendmp,
+M_HASHTYPE_RSS_TCP_IPV6);
+break;
+case IXGBE_RXDADV_RSSTYPE_IPV6_EX:
+M_HASHTYPE_SET(sendmp,
+M_HASHTYPE_RSS_IPV6_EX);
+break;
+case 

CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 10:24:31 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_mbx.h ixgbe_vf.c
ixv.c

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r285590:
- Fix igxbe SRIOV VF (if_ixv) initialization bugs.  The MAC address for
  an if_ixv instance can now set at creation time, and the receive ring
  tail pointer is correctly initialized (previously, things still worked
  because the receive ring tail pointer was being fixed up as a side
  effect of other activity).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 10:21:43 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_mbx.h ixgbe_vf.c
ixv.c

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r283881:
- SRIOV support (not enabled because NetBSD doesn't support it).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/ixgbe/ixv.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.4 src/sys/dev/pci/ixgbe/ix_txrx.c:1.5
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.4	Thu Dec  1 06:56:28 2016
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Dec  2 10:21:43 2016
@@ -58,8 +58,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 282289 2015-04-30 22:53:27Z erj $*/
-/*$NetBSD: ix_txrx.c,v 1.4 2016/12/01 06:56:28 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 283881 2015-06-01 17:15:25Z jfv $*/
+/*$NetBSD: ix_txrx.c,v 1.5 2016/12/02 10:21:43 msaitoh Exp $*/
 
 #include "ixgbe.h"
 
@@ -614,7 +614,6 @@ ixgbe_setup_transmit_ring(struct tx_ring
 {
 	struct adapter *adapter = txr->adapter;
 	struct ixgbe_tx_buf *txbuf;
-	int i;
 #ifdef DEV_NETMAP
 	struct netmap_adapter *na = NA(adapter->ifp);
 	struct netmap_slot *slot;
@@ -637,7 +636,7 @@ ixgbe_setup_transmit_ring(struct tx_ring
 
 	/* Free any existing tx buffers. */
 txbuf = txr->tx_buffers;
-	for (i = 0; i < txr->num_desc; i++, txbuf++) {
+	for (int i = 0; i < txr->num_desc; i++, txbuf++) {
 		if (txbuf->m_head != NULL) {
 			bus_dmamap_sync(txr->txtag->dt_dmat, txbuf->map,
 			0, txbuf->m_head->m_pkthdr.len,
@@ -659,7 +658,8 @@ ixgbe_setup_transmit_ring(struct tx_ring
 		 */
 		if (slot) {
 			int si = netmap_idx_n2k(>tx_rings[txr->me], i);
-			netmap_load_map(na, txr->txtag, txbuf->map, NMB(na, slot + si));
+			netmap_load_map(na, txr->txtag,
+			txbuf->map, NMB(na, slot + si));
 		}
 #endif /* DEV_NETMAP */
 		/* Clear the EOP descriptor pointer */
@@ -812,8 +812,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
 	if ((mtag = VLAN_OUTPUT_TAG(ec, mp)) != NULL) {
 		vtag = htole16(VLAN_TAG_VALUE(mtag) & 0x);
 		vlan_macip_lens |= (vtag << IXGBE_ADVTXD_VLAN_SHIFT);
-	}
-	else if (!IXGBE_IS_X550VF(adapter) && (offload == FALSE))
+	} else if (!IXGBE_IS_X550VF(adapter) && (offload == FALSE))
 		return (0);
 
 	/*
@@ -1415,7 +1414,7 @@ ixgbe_allocate_receive_buffers(struct rx
 	struct	adapter 	*adapter = rxr->adapter;
 	device_t 		dev = adapter->dev;
 	struct ixgbe_rx_buf 	*rxbuf;
-	int 	i, bsize, error;
+	int 	bsize, error;
 
 	bsize = sizeof(struct ixgbe_rx_buf) * rxr->num_desc;
 	if (!(rxr->rx_buffers =
@@ -1437,7 +1436,7 @@ ixgbe_allocate_receive_buffers(struct rx
 		goto fail;
 	}
 
-	for (i = 0; i < rxr->num_desc; i++, rxbuf++) {
+	for (int i = 0; i < rxr->num_desc; i++, rxbuf++) {
 		rxbuf = >rx_buffers[i];
 		error = ixgbe_dmamap_create(rxr->ptag, 0, >pmap);
 		if (error) {
@@ -1459,9 +1458,8 @@ static void 
 ixgbe_free_receive_ring(struct rx_ring *rxr)
 { 
 	struct ixgbe_rx_buf   *rxbuf;
-	int i;
 
-	for (i = 0; i < rxr->num_desc; i++) {
+	for (int i = 0; i < rxr->num_desc; i++) {
 		rxbuf = >rx_buffers[i];
 		if (rxbuf->buf != NULL) {
 			bus_dmamap_sync(rxr->ptag->dt_dmat, rxbuf->pmap,
@@ -2231,6 +2229,9 @@ ixgbe_allocate_queues(struct adapter *ad
 	struct rx_ring	*rxr;
 	int rsize, tsize, error = IXGBE_SUCCESS;
 	int txconf = 0, rxconf = 0;
+#ifdef PCI_IOV
+	enum ixgbe_iov_mode iov_mode;
+#endif
 
 /* First allocate the top level queue structs */
 if (!(adapter->queues =
@@ -2263,6 +2264,12 @@ ixgbe_allocate_queues(struct adapter *ad
 	tsize = roundup2(adapter->num_tx_desc *
 	sizeof(union ixgbe_adv_tx_desc), DBA_ALIGN);
 
+#ifdef PCI_IOV
+	iov_mode = ixgbe_get_iov_mode(adapter);
+	adapter->pool = ixgbe_max_vfs(iov_mode);
+#else
+	adapter->pool = 0;
+#endif
 	/*
 	 * Now set up the TX queues, txconf is needed to handle the
 	 * possibility that things fail midcourse and we need to
@@ -2272,7 +2279,11 @@ ixgbe_allocate_queues(struct adapter *ad
 		/* Set up some basics */
 		txr = >tx_rings[i];
 		txr->adapter = adapter;
+#ifdef PCI_IOV
+		txr->me = ixgbe_pf_que_index(iov_mode, i);
+#else
 		txr->me = i;
+#endif
 		txr->num_desc = adapter->num_tx_desc;
 
 		/* Initialize the TX side lock */
@@ -2319,7 +2330,11 @@ ixgbe_allocate_queues(struct adapter *ad
 		rxr = >rx_rings[i];
 		/* Set up some basics */
 		rxr->adapter = adapter;
+#ifdef PCI_IOV
+		rxr->me = 

CVS commit: src/sys/dev/pci/ixgbe

2016-12-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  2 10:21:43 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixgbe.h ixgbe_mbx.h ixgbe_vf.c
ixv.c

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r283881:
- SRIOV support (not enabled because NetBSD doesn't support it).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-11-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec  1 07:44:58 UTC 2016

Added Files:
src/sys/dev/pci/ixgbe: ixgbe_x550.c ixgbe_x550.h

Log Message:
Add forgotten ixgbe_x550.c and ixgbe_x550.h.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/ixgbe/ixgbe_x550.c \
src/sys/dev/pci/ixgbe/ixgbe_x550.h

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



CVS commit: src/sys/dev/pci/ixgbe

2016-11-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec  1 07:44:58 UTC 2016

Added Files:
src/sys/dev/pci/ixgbe: ixgbe_x550.c ixgbe_x550.h

Log Message:
Add forgotten ixgbe_x550.c and ixgbe_x550.h.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/ixgbe/ixgbe_x550.c \
src/sys/dev/pci/ixgbe/ixgbe_x550.h

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

Added files:

Index: src/sys/dev/pci/ixgbe/ixgbe_x550.c
diff -u /dev/null src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.1
--- /dev/null	Thu Dec  1 07:44:58 2016
+++ src/sys/dev/pci/ixgbe/ixgbe_x550.c	Thu Dec  1 07:44:58 2016
@@ -0,0 +1,3191 @@
+/**
+
+  Copyright (c) 2001-2015, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+  this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+  notice, this list of conditions and the following disclaimer in the 
+  documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+  contributors may be used to endorse or promote products derived from 
+  this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+**/
+/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x550.c 282289 2015-04-30 22:53:27Z erj $*/
+
+#include "ixgbe_x550.h"
+#include "ixgbe_x540.h"
+#include "ixgbe_type.h"
+#include "ixgbe_api.h"
+#include "ixgbe_common.h"
+#include "ixgbe_phy.h"
+
+static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed);
+
+/**
+ *  ixgbe_init_ops_X550 - Inits func ptrs and MAC type
+ *  @hw: pointer to hardware structure
+ *
+ *  Initialize the function pointers and assign the MAC type for X550.
+ *  Does not touch the hardware.
+ **/
+s32 ixgbe_init_ops_X550(struct ixgbe_hw *hw)
+{
+	struct ixgbe_mac_info *mac = >mac;
+	struct ixgbe_eeprom_info *eeprom = >eeprom;
+	s32 ret_val;
+
+	DEBUGFUNC("ixgbe_init_ops_X550");
+
+	ret_val = ixgbe_init_ops_X540(hw);
+	mac->ops.dmac_config = ixgbe_dmac_config_X550;
+	mac->ops.dmac_config_tcs = ixgbe_dmac_config_tcs_X550;
+	mac->ops.dmac_update_tcs = ixgbe_dmac_update_tcs_X550;
+	mac->ops.setup_eee = ixgbe_setup_eee_X550;
+	mac->ops.set_source_address_pruning =
+			ixgbe_set_source_address_pruning_X550;
+	mac->ops.set_ethertype_anti_spoofing =
+			ixgbe_set_ethertype_anti_spoofing_X550;
+
+	mac->ops.get_rtrup2tc = ixgbe_dcb_get_rtrup2tc_generic;
+	eeprom->ops.init_params = ixgbe_init_eeprom_params_X550;
+	eeprom->ops.calc_checksum = ixgbe_calc_eeprom_checksum_X550;
+	eeprom->ops.read = ixgbe_read_ee_hostif_X550;
+	eeprom->ops.read_buffer = ixgbe_read_ee_hostif_buffer_X550;
+	eeprom->ops.write = ixgbe_write_ee_hostif_X550;
+	eeprom->ops.write_buffer = ixgbe_write_ee_hostif_buffer_X550;
+	eeprom->ops.update_checksum = ixgbe_update_eeprom_checksum_X550;
+	eeprom->ops.validate_checksum = ixgbe_validate_eeprom_checksum_X550;
+
+	mac->ops.disable_mdd = ixgbe_disable_mdd_X550;
+	mac->ops.enable_mdd = ixgbe_enable_mdd_X550;
+	mac->ops.mdd_event = ixgbe_mdd_event_X550;
+	mac->ops.restore_mdd_vf = ixgbe_restore_mdd_vf_X550;
+	mac->ops.disable_rx = ixgbe_disable_rx_x550;
+	if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) {
+		hw->mac.ops.led_on = ixgbe_led_on_t_X550em;
+		hw->mac.ops.led_off = ixgbe_led_off_t_X550em;
+	}
+	return ret_val;
+}
+
+/**
+ * ixgbe_read_cs4227 - Read CS4227 register
+ * @hw: pointer to hardware structure
+ * @reg: register number to write
+ * @value: pointer to receive value read
+ *
+ * Returns status code
+ **/
+static s32 ixgbe_read_cs4227(struct ixgbe_hw *hw, u16 reg, u16 *value)
+{
+	return ixgbe_read_i2c_combined_unlocked(hw, IXGBE_CS4227, reg, value);
+}
+
+/**
+ * ixgbe_write_cs4227 - Write CS4227 register
+ * 

CVS commit: src/sys/dev/pci/ixgbe

2016-11-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec  1 06:29:39 UTC 2016

Removed Files:
src/sys/dev/pci/ixgbe: ixv.h

Log Message:
ixv.h is no more.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r0 src/sys/dev/pci/ixgbe/ixv.h

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



CVS commit: src/sys/dev/pci/ixgbe

2016-11-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec  1 06:29:39 UTC 2016

Removed Files:
src/sys/dev/pci/ixgbe: ixv.h

Log Message:
ixv.h is no more.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r0 src/sys/dev/pci/ixgbe/ixv.h

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



CVS commit: src/sys/dev/pci/ixgbe

2016-11-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec  1 06:27:18 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: LICENSE ix_txrx.c ixgbe.c ixgbe.h ixgbe_82598.c
ixgbe_82598.h ixgbe_82599.c ixgbe_82599.h ixgbe_api.c ixgbe_api.h
ixgbe_common.c ixgbe_common.h ixgbe_dcb.c ixgbe_dcb.h
ixgbe_dcb_82598.c ixgbe_dcb_82598.h ixgbe_dcb_82599.c
ixgbe_dcb_82599.h ixgbe_mbx.c ixgbe_mbx.h ixgbe_netbsd.c
ixgbe_netbsd.h ixgbe_osdep.h ixgbe_phy.c ixgbe_phy.h ixgbe_type.h
ixgbe_vf.c ixgbe_vf.h ixgbe_x540.c ixgbe_x540.h ixv.c

Log Message:
Update ixg(4) and ixv(4) up to FreeBSD r280197:
- Add support for 82599_QSFP_SF_QP and X540T1.
- Add partial support for X55x. It's required to sync with FreeBSD r282299
  to support X55x.
- Bugfixes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/ixgbe/LICENSE \
src/sys/dev/pci/ixgbe/ix_txrx.c src/sys/dev/pci/ixgbe/ixgbe_82599.h
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_common.h src/sys/dev/pci/ixgbe/ixgbe_phy.h \
src/sys/dev/pci/ixgbe/ixgbe_vf.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/ixgbe/ixgbe_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_mbx.c src/sys/dev/pci/ixgbe/ixgbe_netbsd.c \
src/sys/dev/pci/ixgbe/ixgbe_netbsd.h src/sys/dev/pci/ixgbe/ixgbe_x540.h
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixgbe_82599.c \
src/sys/dev/pci/ixgbe/ixgbe_api.c src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_api.h \
src/sys/dev/pci/ixgbe/ixgbe_phy.c src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ixgbe/ixgbe_dcb.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb.h src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.h
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ixgbe/ixgbe_mbx.h \
src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-11-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 30 05:30:28 UTC 2016

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

Log Message:
 Extra "buf->map = NULL;"s in ixgbe_txeof() were removed in FreeBSD r282299.
This was fixed in NetBSD's ixgbe.c rev. 1.28. Remove our comment.


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

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



CVS commit: src/sys/dev/pci/ixgbe

2016-11-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 30 05:30:28 UTC 2016

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

Log Message:
 Extra "buf->map = NULL;"s in ixgbe_txeof() were removed in FreeBSD r282299.
This was fixed in NetBSD's ixgbe.c rev. 1.28. Remove our comment.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ixgbe/ix_txrx.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.1 src/sys/dev/pci/ixgbe/ix_txrx.c:1.2
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.1	Mon Nov 28 02:23:33 2016
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed Nov 30 05:30:28 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 279805 2015-03-09 10:29:15Z araujo $*/
-/*$NetBSD: ix_txrx.c,v 1.1 2016/11/28 02:23:33 msaitoh Exp $*/
+/*$NetBSD: ix_txrx.c,v 1.2 2016/11/30 05:30:28 msaitoh Exp $*/
 
 #include "ixgbe.h"
 
@@ -1017,10 +1017,6 @@ ixgbe_txeof(struct tx_ring *txr)
 			buf->map);
 			m_freem(buf->m_head);
 			buf->m_head = NULL;
-			/*
-			 * NetBSD: Don't override buf->map with NULL here.
-			 * It'll panic when a ring runs one lap around.
-			 */
 		}
 		buf->eop = NULL;
 		++txr->tx_avail;
@@ -1047,11 +1043,6 @@ ixgbe_txeof(struct tx_ring *txr)
 buf->map);
 m_freem(buf->m_head);
 buf->m_head = NULL;
-/*
- * NetBSD: Don't override buf->map with NULL
- * here. It'll panic when a ring runs one lap
- * around.
- */
 			}
 			++txr->tx_avail;
 			buf->eop = NULL;



CVS commit: src/sys/dev/pci/ixgbe

2016-11-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 28 08:31:18 UTC 2016

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

Log Message:
Fix vlan check bug in ixv_setup_vlan_support().


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

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



CVS commit: src/sys/dev/pci/ixgbe

2016-11-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 28 08:31:18 UTC 2016

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

Log Message:
Fix vlan check bug in ixv_setup_vlan_support().


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/ixgbe/ixv.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/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.19 src/sys/dev/pci/ixgbe/ixv.c:1.20
--- src/sys/dev/pci/ixgbe/ixv.c:1.19	Mon Nov 28 06:09:19 2016
+++ src/sys/dev/pci/ixgbe/ixv.c	Mon Nov 28 08:31:17 2016
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixv.c 275358 2014-12-01 11:45:24Z hselasky $*/
-/*$NetBSD: ixv.c,v 1.19 2016/11/28 06:09:19 knakahara Exp $*/
+/*$NetBSD: ixv.c,v 1.20 2016/11/28 08:31:17 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -3708,7 +3708,7 @@ ixv_setup_vlan_support(struct adapter *a
 	** the VFTA and other state, so if there
 	** have been no vlan's registered do nothing.
 	*/
-	if (adapter->num_vlans == 0)
+	if (!VLAN_ATTACHED(>osdep.ec))
 		return;
 
 	/* Enable the queues */



CVS commit: src/sys/dev/pci/ixgbe

2016-11-27 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Nov 28 06:09:19 UTC 2016

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

Log Message:
fix build of ixv enabled NO_PCI_MSI_MSIX option.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/ixgbe/ixv.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/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.18 src/sys/dev/pci/ixgbe/ixv.c:1.19
--- src/sys/dev/pci/ixgbe/ixv.c:1.18	Fri Nov 25 13:33:24 2016
+++ src/sys/dev/pci/ixgbe/ixv.c	Mon Nov 28 06:09:19 2016
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixv.c 275358 2014-12-01 11:45:24Z hselasky $*/
-/*$NetBSD: ixv.c,v 1.18 2016/11/25 13:33:24 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.19 2016/11/28 06:09:19 knakahara Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -264,9 +264,9 @@ static int ixv_total_ports;
 static int
 ixv_probe(device_t dev, cfdata_t cf, void *aux)
 {
+#ifdef __HAVE_PCI_MSI_MSIX
 	const struct pci_attach_args *pa = aux;
 
-#ifdef __HAVE_PCI_MSI_MSIX
 	return (ixv_lookup(pa) != NULL) ? 1 : 0;
 #else
 	return 0;



CVS commit: src/sys/dev/pci/ixgbe

2016-11-27 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Nov 28 06:09:19 UTC 2016

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

Log Message:
fix build of ixv enabled NO_PCI_MSI_MSIX option.


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

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



CVS commit: src/sys/dev/pci/ixgbe

2016-11-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov 25 13:33:24 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_osdep.h ixv.c

Log Message:
 Remove #ifdef NETBSD_MSI_OR_MSIX to be simple. ixv(4) isn't attached if
__HAVE_PCI_MSI_MSIX isn't set because MSI-X must be used.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/ixgbe/ixv.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.40 src/sys/dev/pci/ixgbe/ixgbe.c:1.41
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.40	Thu Oct 13 20:05:06 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Nov 25 13:33:24 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 279805 2015-03-09 10:29:15Z araujo $*/
-/*$NetBSD: ixgbe.c,v 1.40 2016/10/13 20:05:06 jdolecek Exp $*/
+/*$NetBSD: ixgbe.c,v 1.41 2016/11/25 13:33:24 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -230,11 +230,9 @@ static void	ixgbe_setup_optics(struct ad
 /* Legacy (single vector interrupt handler */
 static int	ixgbe_legacy_irq(void *);
 
-#if defined(NETBSD_MSI_OR_MSIX)
 /* The MSI/X Interrupt handlers */
 static int	ixgbe_msix_que(void *);
 static int	ixgbe_msix_link(void *);
-#endif
 
 /* Software interrupts for deferred work */
 static void	ixgbe_handle_que(void *);
@@ -310,7 +308,6 @@ static int ixgbe_smart_speed = ixgbe_sma
 static int ixgbe_enable_msix = 1;
 SYSCTL_INT("hw.ixgbe.enable_msix", _enable_msix);
 
-#if defined(NETBSD_MSI_OR_MSIX)
 /*
  * Number of Queues, can be set to 0,
  * it then autoconfigures based on the
@@ -319,7 +316,6 @@ SYSCTL_INT("hw.ixgbe.enable_msix", 
  */
 static int ixgbe_num_queues = 1;
 SYSCTL_INT("hw.ixgbe.num_queues", _num_queues);
-#endif
 
 /*
 ** Number of TX descriptors per ring,
@@ -512,7 +508,7 @@ ixgbe_attach(device_t parent, device_t d
 	u16		csum;
 	u32		ctrl_ext;
 	ixgbe_vendor_info_t *ent;
-	const struct pci_attach_args *pa = aux;
+	struct pci_attach_args *pa = aux;
 
 	INIT_DEBUGOUT("ixgbe_attach: begin");
 
@@ -1693,7 +1689,6 @@ ixgbe_legacy_irq(void *arg)
 }
 
 
-#if defined(NETBSD_MSI_OR_MSIX)
 /*
  *
  *  MSIX Queue Interrupt Service routine
@@ -1862,7 +1857,6 @@ ixgbe_msix_link(void *arg)
 	IXGBE_WRITE_REG(>hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
 	return 1;
 }
-#endif
 
 /*
  *
@@ -2498,27 +2492,11 @@ ixgbe_allocate_legacy(struct adapter *ad
 #ifndef IXGBE_LEGACY_TX
 	struct tx_ring		*txr = adapter->tx_rings;
 #endif
-#ifndef NETBSD_MSI_OR_MSIX
-	pci_intr_handle_t	ih;
-#else
 	int		counts[PCI_INTR_TYPE_SIZE];
 	pci_intr_type_t intr_type, max_type;
-#endif
 	char intrbuf[PCI_INTRSTR_LEN];
 	const char	*intrstr = NULL;
  
-#ifndef NETBSD_MSI_OR_MSIX
-	/* We allocate a single interrupt resource */
- 	if (pci_intr_map(pa, ) != 0) {
-		aprint_error_dev(dev, "unable to map interrupt\n");
-		return ENXIO;
-	} else {
-		intrstr = pci_intr_string(adapter->osdep.pc, ih, intrbuf,
-		sizeof(intrbuf));
-	}
-	adapter->osdep.ihs[0] = pci_intr_establish_xname(adapter->osdep.pc, ih,
-	IPL_NET, ixgbe_legacy_irq, que, device_xname(dev));
-#else
 	/* Allocation settings */
 	max_type = PCI_INTR_TYPE_MSI;
 	counts[PCI_INTR_TYPE_MSIX] = 0;
@@ -2554,14 +2532,11 @@ alloc_retry:
 			break;
 		}
 	}
-#endif
 	if (adapter->osdep.ihs[0] == NULL) {
 		aprint_error_dev(dev,
 		"couldn't establish interrupt%s%s\n",
 		intrstr ? " at " : "", intrstr ? intrstr : "");
-#ifdef NETBSD_MSI_OR_MSIX
 		pci_intr_release(adapter->osdep.pc, adapter->osdep.intrs, 1);
-#endif
 		return ENXIO;
 	}
 	aprint_normal_dev(dev, "interrupting at %s\n", intrstr);
@@ -2614,9 +2589,6 @@ alloc_retry:
 static int
 ixgbe_allocate_msix(struct adapter *adapter, const struct pci_attach_args *pa)
 {
-#if !defined(NETBSD_MSI_OR_MSIX)
-	return 0;
-#else
 	device_tdev = adapter->dev;
 	struct 		ix_queue *que = adapter->queues;
 	struct  	tx_ring *txr = adapter->tx_rings;
@@ -2778,7 +2750,6 @@ ixgbe_allocate_msix(struct adapter *adap
 
 	kcpuset_destroy(affinity);
 	return (0);
-#endif
 }
 
 /*
@@ -2787,9 +2758,6 @@ ixgbe_allocate_msix(struct adapter *adap
 static int
 ixgbe_setup_msix(struct adapter *adapter)
 {
-#if !defined(NETBSD_MSI_OR_MSIX)
-	return 0;
-#else
 	device_t dev = adapter->dev;
 	int want, queues, msgs;
 
@@ -2849,7 +2817,6 @@ msi:
	msgs = 1;
 	aprint_normal_dev(dev,"Using an MSI interrupt\n");
 	return (msgs);
-#endif
 }
 
 
@@ -2904,12 +2871,9 @@ map_err:
 static void
 ixgbe_free_pci_resources(struct adapter * adapter)
 {
-#if defined(NETBSD_MSI_OR_MSIX)
 	struct 		ix_queue *que = adapter->queues;
-#endif
 	int		rid;
 
-#if 

CVS commit: src/sys/dev/pci/ixgbe

2016-11-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov 25 13:33:24 UTC 2016

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_osdep.h ixv.c

Log Message:
 Remove #ifdef NETBSD_MSI_OR_MSIX to be simple. ixv(4) isn't attached if
__HAVE_PCI_MSI_MSIX isn't set because MSI-X must be used.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-02-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb  6 02:40:49 UTC 2016

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

Log Message:
Avoid shadowing global `min'.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_common.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_api.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_api.c:1.10 src/sys/dev/pci/ixgbe/ixgbe_api.c:1.11
--- src/sys/dev/pci/ixgbe/ixgbe_api.c:1.10	Sat Feb  6 02:39:18 2016
+++ src/sys/dev/pci/ixgbe/ixgbe_api.c	Sat Feb  6 02:40:49 2016
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 251964 2013-06-18 21:28:19Z jfv $*/
-/*$NetBSD: ixgbe_api.c,v 1.10 2016/02/06 02:39:18 riastradh Exp $*/
+/*$NetBSD: ixgbe_api.c,v 1.11 2016/02/06 02:40:49 riastradh Exp $*/
 
 #include "ixgbe_api.h"
 #include "ixgbe_common.h"
@@ -1006,7 +1006,7 @@ s32 ixgbe_fc_enable(struct ixgbe_hw *hw)
  * ixgbe_set_fw_drv_ver - Try to send the driver version number FW
  * @hw: pointer to hardware structure
  * @maj: driver major number to be sent to firmware
- * @min: driver minor number to be sent to firmware
+ * @minr: driver minor number to be sent to firmware
  * @build: driver build number to be sent to firmware
  * @ver: driver version number to be sent to firmware
  **/

Index: src/sys/dev/pci/ixgbe/ixgbe_common.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_common.c:1.6 src/sys/dev/pci/ixgbe/ixgbe_common.c:1.7
--- src/sys/dev/pci/ixgbe/ixgbe_common.c:1.6	Wed Aug  5 04:08:44 2015
+++ src/sys/dev/pci/ixgbe/ixgbe_common.c	Sat Feb  6 02:40:49 2016
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 251964 2013-06-18 21:28:19Z jfv $*/
-/*$NetBSD: ixgbe_common.c,v 1.6 2015/08/05 04:08:44 msaitoh Exp $*/
+/*$NetBSD: ixgbe_common.c,v 1.7 2016/02/06 02:40:49 riastradh Exp $*/
 
 #include "ixgbe_common.h"
 #include "ixgbe_phy.h"
@@ -4407,7 +4407,7 @@ out:
  *  ixgbe_set_fw_drv_ver_generic - Sends driver version to firmware
  *  @hw: pointer to the HW structure
  *  @maj: driver version major number
- *  @min: driver version minor number
+ *  @minr: driver version minor number
  *  @build: driver version build number
  *  @sub: driver version sub build number
  *
@@ -4416,7 +4416,7 @@ out:
  *  else returns IXGBE_ERR_SWFW_SYNC when encountering an error acquiring
  *  semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.
  **/
-s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,
+s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 minr,
  u8 build, u8 sub)
 {
 	struct ixgbe_hic_drv_info fw_cmd;
@@ -4436,7 +4436,7 @@ s32 ixgbe_set_fw_drv_ver_generic(struct 
 	fw_cmd.hdr.cmd_or_resp.cmd_resv = FW_CEM_CMD_RESERVED;
 	fw_cmd.port_num = (u8)hw->bus.func;
 	fw_cmd.ver_maj = maj;
-	fw_cmd.ver_min = min;
+	fw_cmd.ver_min = minr;
 	fw_cmd.ver_build = build;
 	fw_cmd.ver_sub = sub;
 	fw_cmd.hdr.checksum = 0;



CVS commit: src/sys/dev/pci/ixgbe

2016-02-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb  6 02:39:51 UTC 2016

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

Log Message:
Convert bool to target type before shift.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_vf.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_vf.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_vf.c:1.5 src/sys/dev/pci/ixgbe/ixgbe_vf.c:1.6
--- src/sys/dev/pci/ixgbe/ixgbe_vf.c:1.5	Wed Aug  5 04:08:44 2015
+++ src/sys/dev/pci/ixgbe/ixgbe_vf.c	Sat Feb  6 02:39:51 2016
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_vf.c 251964 2013-06-18 21:28:19Z jfv $*/
-/*$NetBSD: ixgbe_vf.c,v 1.5 2015/08/05 04:08:44 msaitoh Exp $*/
+/*$NetBSD: ixgbe_vf.c,v 1.6 2016/02/06 02:39:51 riastradh Exp $*/
 
 
 #include "ixgbe_api.h"
@@ -384,7 +384,7 @@ s32 ixgbe_set_vfta_vf(struct ixgbe_hw *h
 	msgbuf[0] = IXGBE_VF_SET_VLAN;
 	msgbuf[1] = vlan;
 	/* Setting the 8 bit field MSG INFO to TRUE indicates "add" */
-	msgbuf[0] |= vlan_on << IXGBE_VT_MSGINFO_SHIFT;
+	msgbuf[0] |= (u32)vlan_on << IXGBE_VT_MSGINFO_SHIFT;
 
 	ret_val = mbx->ops.write_posted(hw, msgbuf, 2, 0);
 	if (!ret_val)



CVS commit: src/sys/dev/pci/ixgbe

2016-02-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb  6 02:40:49 UTC 2016

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

Log Message:
Avoid shadowing global `min'.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_common.c

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



CVS commit: src/sys/dev/pci/ixgbe

2016-02-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb  6 02:39:18 UTC 2016

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

Log Message:
Avoid shadowing global `min'.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_api.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_api.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_api.c:1.9 src/sys/dev/pci/ixgbe/ixgbe_api.c:1.10
--- src/sys/dev/pci/ixgbe/ixgbe_api.c:1.9	Thu Aug 13 10:03:38 2015
+++ src/sys/dev/pci/ixgbe/ixgbe_api.c	Sat Feb  6 02:39:18 2016
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 251964 2013-06-18 21:28:19Z jfv $*/
-/*$NetBSD: ixgbe_api.c,v 1.9 2015/08/13 10:03:38 msaitoh Exp $*/
+/*$NetBSD: ixgbe_api.c,v 1.10 2016/02/06 02:39:18 riastradh Exp $*/
 
 #include "ixgbe_api.h"
 #include "ixgbe_common.h"
@@ -1010,10 +1010,10 @@ s32 ixgbe_fc_enable(struct ixgbe_hw *hw)
  * @build: driver build number to be sent to firmware
  * @ver: driver version number to be sent to firmware
  **/
-s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build,
+s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 minr, u8 build,
 			 u8 ver)
 {
-	return ixgbe_call_func(hw, hw->mac.ops.set_fw_drv_ver, (hw, maj, min,
+	return ixgbe_call_func(hw, hw->mac.ops.set_fw_drv_ver, (hw, maj, minr,
 			   build, ver), IXGBE_NOT_IMPLEMENTED);
 }
 



CVS commit: src/sys/dev/pci/ixgbe

2016-02-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb  6 02:39:18 UTC 2016

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

Log Message:
Avoid shadowing global `min'.


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

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



CVS commit: src/sys/dev/pci/ixgbe

2016-02-05 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Feb  6 02:39:51 UTC 2016

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

Log Message:
Convert bool to target type before shift.


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

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



CVS commit: src/sys/dev/pci/ixgbe

2015-08-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 14 06:05:40 UTC 2015

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

Log Message:
 - Fix uninitialized data.
 - include vlan.h and check NVLAN.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixv.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/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.12 src/sys/dev/pci/ixgbe/ixv.c:1.13
--- src/sys/dev/pci/ixgbe/ixv.c:1.12	Thu Aug 13 10:03:38 2015
+++ src/sys/dev/pci/ixgbe/ixv.c	Fri Aug 14 06:05:40 2015
@@ -31,12 +31,13 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixv.c 275358 2014-12-01 11:45:24Z hselasky $*/
-/*$NetBSD: ixv.c,v 1.12 2015/08/13 10:03:38 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.13 2015/08/14 06:05:40 msaitoh Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
 
 #include ixv.h
+#include vlan.h
 
 /*
  *  Driver version
@@ -366,6 +367,10 @@ ixv_attach(device_t parent, device_t dev
 	adapter = device_private(dev);
 	adapter-dev = adapter-osdep.dev = dev;
 	hw = adapter-hw;
+	adapter-osdep.pc = pa-pa_pc;
+	adapter-osdep.tag = pa-pa_tag;
+	adapter-osdep.dmat = pa-pa_dmat;
+	adapter-osdep.attached = false;
 
 	ent = ixv_lookup(pa);
 
@@ -469,6 +474,7 @@ ixv_attach(device_t parent, device_t dev
 #endif
 
 	INIT_DEBUGOUT(ixv_attach: end);
+	adapter-osdep.attached = true;
 	return;
 
 err_late:
@@ -497,7 +503,10 @@ ixv_detach(device_t dev, int flags)
 	struct ix_queue *que = adapter-queues;
 
 	INIT_DEBUGOUT(ixv_detach: begin);
+	if (adapter-osdep.attached == false)
+		return 0;
 
+#if NVLAN  0
 	/* Make sure VLANS are not using driver */
 	if (!VLAN_ATTACHED(adapter-osdep.ec))
 		;	/* nothing to do: no VLANs */ 
@@ -507,6 +516,7 @@ ixv_detach(device_t dev, int flags)
 		aprint_error_dev(dev, VLANs in use\n);
 		return EBUSY;
 	}
+#endif
 
 	IXV_CORE_LOCK(adapter);
 	ixv_stop(adapter);
@@ -1784,7 +1794,6 @@ ixv_setup_msix(struct adapter *adapter)
 	device_t dev = adapter-dev;
 	int want, msgs;
 
-
 	/*
 	** Want two vectors: one for a queue,
 	** plus an additional for mailbox.
@@ -1794,6 +1803,7 @@ ixv_setup_msix(struct adapter *adapter)
 		aprint_error_dev(dev,MSIX config error\n);
 		return (ENXIO);
 	}
+	want = MIN(msgs, IXG_MSIX_NINTR);
 
 	adapter-msix_mem = (void *)1; /* XXX */
 	aprint_normal_dev(dev,



CVS commit: src/sys/dev/pci/ixgbe

2015-08-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 14 06:05:40 UTC 2015

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

Log Message:
 - Fix uninitialized data.
 - include vlan.h and check NVLAN.


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

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



CVS commit: src/sys/dev/pci/ixgbe

2015-08-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 14 15:27:28 UTC 2015

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

Log Message:
Make it compilable without DIAGNOSTIC


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

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



CVS commit: src/sys/dev/pci/ixgbe

2015-08-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 14 15:27:28 UTC 2015

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

Log Message:
Make it compilable without DIAGNOSTIC


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/ixgbe/ixv.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/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.13 src/sys/dev/pci/ixgbe/ixv.c:1.14
--- src/sys/dev/pci/ixgbe/ixv.c:1.13	Fri Aug 14 06:05:40 2015
+++ src/sys/dev/pci/ixgbe/ixv.c	Fri Aug 14 15:27:28 2015
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixv.c 275358 2014-12-01 11:45:24Z hselasky $*/
-/*$NetBSD: ixv.c,v 1.13 2015/08/14 06:05:40 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.14 2015/08/14 15:27:28 martin Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -2497,7 +2497,7 @@ ixv_tx_ctx_setup(struct tx_ring *txr, st
 	struct ip6_hdr ip6;
 	int  ehdrlen, ip_hlen = 0;
 	u16	etype;
-	u8	ipproto = 0;
+	u8	ipproto __diagused = 0;
 	bool	offload;
 	int ctxd = txr-next_avail_desc;
 	u16 vtag = 0;



CVS commit: src/sys/dev/pci/ixgbe

2015-08-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug 13 10:03:38 UTC 2015

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_api.c ixgbe_api.h ixgbe_type.h
ixv.c

Log Message:
 Reduce diff against FreeBSD r280181.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_api.h
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixv.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.34 src/sys/dev/pci/ixgbe/ixgbe.c:1.35
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.34	Thu Aug 13 04:56:43 2015
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Aug 13 10:03:37 2015
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 279805 2015-03-09 10:29:15Z araujo $*/
-/*$NetBSD: ixgbe.c,v 1.34 2015/08/13 04:56:43 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.35 2015/08/13 10:03:37 msaitoh Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -136,15 +136,15 @@ static int  ixgbe_detach(device_t, i
 #if 0
 static int  ixgbe_shutdown(device_t);
 #endif
-#if IXGBE_LEGACY_TX
+#ifdef IXGBE_LEGACY_TX
 static void ixgbe_start(struct ifnet *);
 static void ixgbe_start_locked(struct tx_ring *, struct ifnet *);
-#else
+#else /* ! IXGBE_LEGACY_TX */
 static int	ixgbe_mq_start(struct ifnet *, struct mbuf *);
 static int	ixgbe_mq_start_locked(struct ifnet *, struct tx_ring *);
 static void	ixgbe_qflush(struct ifnet *);
-static void	ixgbe_deferred_mq_start(void *);
-#endif
+static void	ixgbe_deferred_mq_start(void *, int);
+#endif /* IXGBE_LEGACY_TX */
 static int  ixgbe_ioctl(struct ifnet *, u_long, void *);
 static void	ixgbe_ifstop(struct ifnet *, int);
 static int	ixgbe_init(struct ifnet *);
@@ -338,7 +338,7 @@ SYSCTL_INT(hw.ixgbe.rxd, ixgbe_rxd);
 ** of unsupported SFP+ modules, note that
 ** doing so you are on your own :)
 */
-static int allow_unsupported_sfp = true;
+static int allow_unsupported_sfp = false;
 SYSCTL_INT(hw.ix.unsupported_sfp, allow_unsupported_sfp);
 
 /*
@@ -608,8 +608,7 @@ ixgbe_attach(device_t parent, device_t d
 		*/
 		adapter-sfp_probe = TRUE;
 		error = 0;
-	} else if ((error == IXGBE_ERR_SFP_NOT_SUPPORTED)
-	 (hw-allow_unsupported_sfp == false)) {
+	} else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) {
 		aprint_error_dev(dev,Unsupported SFP+ module detected!\n);
 		error = EIO;
 		goto err_late;
@@ -1094,7 +1093,7 @@ ixgbe_mq_start_locked(struct ifnet *ifp,
  * Called from a taskqueue to drain queued transmit packets.
  */
 static void
-ixgbe_deferred_mq_start(void *arg)
+ixgbe_deferred_mq_start(void *arg, int pending)
 {
 	struct tx_ring *txr = arg;
 	struct adapter *adapter = txr-adapter;
@@ -1341,7 +1340,7 @@ ixgbe_init_locked(struct adapter *adapte
 	/* Enable Fan Failure Interrupt */
 	gpie |= IXGBE_SDP1_GPIEN;
 
-	/* Add for Thermal detection */
+	/* Add for Module detection */
 	if (hw-mac.type == ixgbe_mac_82599EB)
 		gpie |= IXGBE_SDP2_GPIEN;
 
@@ -1633,11 +1632,12 @@ ixgbe_legacy_irq(void *arg)
 	struct ix_queue *que = arg;
 	struct adapter	*adapter = que-adapter;
 	struct ixgbe_hw	*hw = adapter-hw;
-	struct ifnet   *ifp = adapter-ifp;
+	struct ifnet*ifp = adapter-ifp;
 	struct 		tx_ring *txr = adapter-tx_rings;
 	bool		more = false;
 	u32   	reg_eicr;
 
+
 	reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
 
 	adapter-stats.legint.ev_count++;
@@ -2669,6 +2669,7 @@ ixgbe_allocate_msix(struct adapter *adap
 		que-msix = vector;
 	adapter-que_mask |= (u64)(1  que-msix);
 #ifdef	RSS
+		/*
 		 * The queue ID is used as the RSS layer bucket ID.
 		 * We look up the queue ID - RSS CPU ID and select
 		 * that.
@@ -2677,7 +2678,7 @@ ixgbe_allocate_msix(struct adapter *adap
 #else
 		/*
 		 * Bind the msix vector, and thus the
-		 * ring to the corresponding cpu.
+		 * rings to the corresponding cpu.
 		 *
 		 * This just happens to match the default RSS round-robin
 		 * bucket - queue - CPU allocation.
@@ -4112,6 +4113,7 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr,
 			mp = rxbuf-buf;
 
 		mp-m_pkthdr.len = mp-m_len = rxr-mbuf_sz;
+
 		/* If we're dealing with an mbuf that was copied rather
 		 * than replaced, there's no need to go through busdma.
 		 */
@@ -4823,6 +4825,7 @@ ixgbe_rx_discard(struct rx_ring *rxr, in
 
 	rbuf = rxr-rx_buffers[i];
 
+
 	/*
 	** With advanced descriptors the writeback
 	** clobbers the buffer addrs, so its easier
@@ -4830,16 +4833,17 @@ ixgbe_rx_discard(struct rx_ring *rxr, in
 	** the normal refresh path to get new buffers
 	** and mapping.
 	*/
+
 	if (rbuf-buf != NULL) {/* Partial chain ? */
 		rbuf-fmp-m_flags |= M_PKTHDR;
 		m_freem(rbuf-fmp);
 		rbuf-fmp = NULL;
 		rbuf-buf = NULL; /* rbuf-buf is part of fmp's chain */
 	

CVS commit: src/sys/dev/pci/ixgbe

2015-08-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug 13 10:03:38 UTC 2015

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_api.c ixgbe_api.h ixgbe_type.h
ixv.c

Log Message:
 Reduce diff against FreeBSD r280181.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_api.h
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2015-08-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug 13 04:56:43 UTC 2015

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_82599.c ixgbe_osdep.h ixgbe_type.h
ixv.c

Log Message:
 - Add MSI/MSI-X support. The multiqueue function is not supported yet.
 - Make ixv.c compilable. _NOT_TESTED_YET_


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_82599.c \
src/sys/dev/pci/ixgbe/ixv.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixgbe_type.h

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.33 src/sys/dev/pci/ixgbe/ixgbe.c:1.34
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.33	Wed Aug  5 04:08:44 2015
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Aug 13 04:56:43 2015
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 279805 2015-03-09 10:29:15Z araujo $*/
-/*$NetBSD: ixgbe.c,v 1.33 2015/08/05 04:08:44 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.34 2015/08/13 04:56:43 msaitoh Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -232,8 +232,8 @@ static int	ixgbe_legacy_irq(void *);
 
 #if defined(NETBSD_MSI_OR_MSIX)
 /* The MSI/X Interrupt handlers */
-static void	ixgbe_msix_que(void *);
-static void	ixgbe_msix_link(void *);
+static int	ixgbe_msix_que(void *);
+static int	ixgbe_msix_link(void *);
 #endif
 
 /* Software interrupts for deferred work */
@@ -317,7 +317,7 @@ SYSCTL_INT(hw.ixgbe.enable_msix, ixgb
  * number of cpus with a max of 8. This
  * can be overriden manually here.
  */
-static int ixgbe_num_queues = 0;
+static int ixgbe_num_queues = 1;
 SYSCTL_INT(hw.ixgbe.num_queues, ixgbe_num_queues);
 #endif
 
@@ -508,7 +508,7 @@ ixgbe_attach(device_t parent, device_t d
 {
 	struct adapter *adapter;
 	struct ixgbe_hw *hw;
-	int error = 0;
+	int error = -1;
 	u16		csum;
 	u32		ctrl_ext;
 	ixgbe_vendor_info_t *ent;
@@ -608,7 +608,8 @@ ixgbe_attach(device_t parent, device_t d
 		*/
 		adapter-sfp_probe = TRUE;
 		error = 0;
-	} else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) {
+	} else if ((error == IXGBE_ERR_SFP_NOT_SUPPORTED)
+	 (hw-allow_unsupported_sfp == false)) {
 		aprint_error_dev(dev,Unsupported SFP+ module detected!\n);
 		error = EIO;
 		goto err_late;
@@ -649,10 +650,11 @@ ixgbe_attach(device_t parent, device_t d
 	/* Detect and set physical type */
 	ixgbe_setup_optics(adapter);
 
+	error = -1;
 	if ((adapter-msix  1)  (ixgbe_enable_msix))
-		error = ixgbe_allocate_msix(adapter, pa); 
-	else
-		error = ixgbe_allocate_legacy(adapter, pa); 
+		error = ixgbe_allocate_msix(adapter, pa);
+	if (error != 0)
+		error = ixgbe_allocate_legacy(adapter, pa);
 	if (error) 
 		goto err_late;
 
@@ -1692,7 +1694,7 @@ ixgbe_legacy_irq(void *arg)
  *  MSIX Queue Interrupt Service routine
  *
  **/
-void
+static int
 ixgbe_msix_que(void *arg)
 {
 	struct ix_queue	*que = arg;
@@ -1705,7 +1707,7 @@ ixgbe_msix_que(void *arg)
 
 	/* Protect against spurious interrupts */
 	if ((ifp-if_flags  IFF_RUNNING) == 0)
-		return;
+		return 0;
 
 	ixgbe_disable_queue(adapter, que-msix);
 	++que-irqs;
@@ -1716,6 +1718,7 @@ ixgbe_msix_que(void *arg)
 	ixgbe_txeof(txr);
 #ifdef IXGBE_LEGACY_TX
 	if (!IFQ_IS_EMPTY(adapter-ifp-if_snd))
+		ixgbe_start_locked(txr, ifp);
 #else
 	if (!drbr_empty(ifp, txr-br))
 		ixgbe_mq_start_locked(ifp, txr);
@@ -1777,11 +1780,11 @@ no_calc:
 		softint_schedule(que-que_si);
 	else
 		ixgbe_enable_queue(adapter, que-msix);
-	return;
+	return 1;
 }
 
 
-static void
+static int
 ixgbe_msix_link(void *arg)
 {
 	struct adapter	*adapter = arg;
@@ -1806,7 +1809,7 @@ ixgbe_msix_link(void *arg)
 		if (reg_eicr  IXGBE_EICR_FLOW_DIR) {
 			/* This is probably overkill :) */
 			if (!atomic_cmpset_int(adapter-fdir_reinit, 0, 1))
-return;
+return 1;
 	/* Disable the interrupt */
 			IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EICR_FLOW_DIR);
 			softint_schedule(adapter-fdir_si);
@@ -1847,7 +1850,7 @@ ixgbe_msix_link(void *arg)
 	}
 
 	IXGBE_WRITE_REG(adapter-hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
-	return;
+	return 1;
 }
 #endif
 
@@ -2477,32 +2480,79 @@ ixgbe_setup_optics(struct adapter *adapt
  *
  **/
 static int
-ixgbe_allocate_legacy(struct adapter *adapter, const struct pci_attach_args *pa)
+ixgbe_allocate_legacy(struct adapter *adapter,
+const struct pci_attach_args *pa)
 {
 	device_t	dev = adapter-dev;
 	struct		ix_queue *que = adapter-queues;
 #ifndef IXGBE_LEGACY_TX
 	struct tx_ring		*txr = adapter-tx_rings;
 #endif
-	char intrbuf[PCI_INTRSTR_LEN];
-#if 0
-	int		rid = 0;
-
-	/* MSI RID at 1 */
-	if (adapter-msix == 1)
-		rid = 1;
+#ifndef 

CVS commit: src/sys/dev/pci/ixgbe

2015-08-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Aug 13 04:56:43 UTC 2015

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_82599.c ixgbe_osdep.h ixgbe_type.h
ixv.c

Log Message:
 - Add MSI/MSI-X support. The multiqueue function is not supported yet.
 - Make ixv.c compilable. _NOT_TESTED_YET_


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_82599.c \
src/sys/dev/pci/ixgbe/ixv.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixgbe_type.h

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



CVS commit: src/sys/dev/pci/ixgbe

2015-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug  5 04:08:44 UTC 2015

Modified Files:
src/sys/dev/pci/ixgbe: README ixgbe.c ixgbe.h ixgbe_82598.c
ixgbe_82599.c ixgbe_api.c ixgbe_api.h ixgbe_common.c ixgbe_common.h
ixgbe_osdep.h ixgbe_phy.c ixgbe_phy.h ixgbe_type.h ixgbe_vf.c
ixgbe_x540.c ixgbe_x540.h ixv.c ixv.h

Log Message:
 Sync ixg(4) up to FreeBSD r279805 (or r280181) which include some bugfixes.
TODO:
 - Merge r280182 and newer. It's required to support X55x.
 - MSI/MSI-X support.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ixgbe/README
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe.h \
src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ixgbe/ixgbe_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_api.h src/sys/dev/pci/ixgbe/ixgbe_common.h \
src/sys/dev/pci/ixgbe/ixgbe_phy.h src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_82599.c \
src/sys/dev/pci/ixgbe/ixv.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_common.c \
src/sys/dev/pci/ixgbe/ixgbe_phy.c src/sys/dev/pci/ixgbe/ixv.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/ixgbe/ixgbe_x540.h

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



CVS commit: src/sys/dev/pci/ixgbe

2015-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug  5 03:42:11 UTC 2015

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

Log Message:
 Fix error path in ixgbe_attach() and ixgbe_detatch() to prevent panic.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_osdep.h

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.31 src/sys/dev/pci/ixgbe/ixgbe.c:1.32
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.31	Mon Aug  3 05:43:01 2015
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Aug  5 03:42:11 2015
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 250108 2013-04-30 16:18:29Z luigi $*/
-/*$NetBSD: ixgbe.c,v 1.31 2015/08/03 05:43:01 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.32 2015/08/05 03:42:11 msaitoh Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -510,6 +510,7 @@ ixgbe_attach(device_t parent, device_t d
 	adapter-osdep.pc = pa-pa_pc;
 	adapter-osdep.tag = pa-pa_tag;
 	adapter-osdep.dmat = pa-pa_dmat;
+	adapter-osdep.attached = false;
 
 	ent = ixgbe_lookup(pa);
 
@@ -681,6 +682,7 @@ ixgbe_attach(device_t parent, device_t d
 	ixgbe_netmap_attach(adapter);
 #endif /* DEV_NETMAP */
 	INIT_DEBUGOUT(ixgbe_attach: end);
+	adapter-osdep.attached = true;
 	return;
 err_late:
 	ixgbe_free_transmit_structures(adapter);
@@ -716,6 +718,8 @@ ixgbe_detach(device_t dev, int flags)
 	u32	ctrl_ext;
 
 	INIT_DEBUGOUT(ixgbe_detach: begin);
+	if (adapter-osdep.attached == false)
+		return 0;
 
 #if NVLAN  0
 	/* Make sure VLANs are not using driver */
@@ -2791,7 +2795,8 @@ ixgbe_free_pci_resources(struct adapter 
 	else
 		(adapter-msix != 0) ? (rid = 1):(rid = 0);
 
-	pci_intr_disestablish(adapter-osdep.pc, adapter-osdep.intr);
+	if (adapter-osdep.intr != NULL)
+		pci_intr_disestablish(adapter-osdep.pc, adapter-osdep.intr);
 	adapter-osdep.intr = NULL;
 
 #if defined(NETBSD_MSI_OR_MSIX)

Index: src/sys/dev/pci/ixgbe/ixgbe_osdep.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.7 src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.8
--- src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.7	Fri Apr 24 07:00:51 2015
+++ src/sys/dev/pci/ixgbe/ixgbe_osdep.h	Wed Aug  5 03:42:11 2015
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.h 247822 2013-03-04 23:07:40Z jfv $*/
-/*$NetBSD: ixgbe_osdep.h,v 1.7 2015/04/24 07:00:51 msaitoh Exp $*/
+/*$NetBSD: ixgbe_osdep.h,v 1.8 2015/08/05 03:42:11 msaitoh Exp $*/
 
 #ifndef _IXGBE_OS_H_
 #define _IXGBE_OS_H_
@@ -171,6 +171,7 @@ struct ixgbe_osdep
 	device_t   dev;
 	pci_intr_handle_t  ih;
 	void   *intr;
+	bool		   attached;
 };
 
 /* These routines are needed by the shared code */



CVS commit: src/sys/dev/pci/ixgbe

2015-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug  5 03:42:11 UTC 2015

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

Log Message:
 Fix error path in ixgbe_attach() and ixgbe_detatch() to prevent panic.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_osdep.h

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



CVS commit: src/sys/dev/pci/ixgbe

2015-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug  5 04:11:07 UTC 2015

Added Files:
src/sys/dev/pci/ixgbe: ixgbe_dcb.c ixgbe_dcb.h ixgbe_dcb_82598.c
ixgbe_dcb_82598.h ixgbe_dcb_82599.c ixgbe_dcb_82599.h

Log Message:
 Add some files.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/ixgbe/ixgbe_dcb.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb.h src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.h

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

Added files:

Index: src/sys/dev/pci/ixgbe/ixgbe_dcb.c
diff -u /dev/null src/sys/dev/pci/ixgbe/ixgbe_dcb.c:1.1
--- /dev/null	Wed Aug  5 04:11:07 2015
+++ src/sys/dev/pci/ixgbe/ixgbe_dcb.c	Wed Aug  5 04:11:07 2015
@@ -0,0 +1,718 @@
+/**
+
+  Copyright (c) 2001-2013, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+  this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+  notice, this list of conditions and the following disclaimer in the 
+  documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+  contributors may be used to endorse or promote products derived from 
+  this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+**/
+/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb.c 251964 2013-06-18 21:28:19Z jfv $*/
+
+
+#include ixgbe_type.h
+#include ixgbe_dcb.h
+#include ixgbe_dcb_82598.h
+#include ixgbe_dcb_82599.h
+
+/**
+ * ixgbe_dcb_calculate_tc_credits - This calculates the ieee traffic class
+ * credits from the configured bandwidth percentages. Credits
+ * are the smallest unit programmable into the underlying
+ * hardware. The IEEE 802.1Qaz specification do not use bandwidth
+ * groups so this is much simplified from the CEE case.
+ */
+s32 ixgbe_dcb_calculate_tc_credits(u8 *bw, u16 *refill, u16 *max,
+   int max_frame_size)
+{
+	int min_percent = 100;
+	int min_credit, multiplier;
+	int i;
+
+	min_credit = ((max_frame_size / 2) + IXGBE_DCB_CREDIT_QUANTUM - 1) /
+			IXGBE_DCB_CREDIT_QUANTUM;
+
+	for (i = 0; i  IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) {
+		if (bw[i]  min_percent  bw[i])
+			min_percent = bw[i];
+	}
+
+	multiplier = (min_credit / min_percent) + 1;
+
+	/* Find out the hw credits for each TC */
+	for (i = 0; i  IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) {
+		int val = min(bw[i] * multiplier, IXGBE_DCB_MAX_CREDIT_REFILL);
+
+		if (val  min_credit)
+			val = min_credit;
+		refill[i] = (u16)val;
+
+		max[i] = bw[i] ? (bw[i]*IXGBE_DCB_MAX_CREDIT)/100 : min_credit;
+	}
+
+	return 0;
+}
+
+/**
+ * ixgbe_dcb_calculate_tc_credits_cee - Calculates traffic class credits
+ * @ixgbe_dcb_config: Struct containing DCB settings.
+ * @direction: Configuring either Tx or Rx.
+ *
+ * This function calculates the credits allocated to each traffic class.
+ * It should be called only after the rules are checked by
+ * ixgbe_dcb_check_config_cee().
+ */
+s32 ixgbe_dcb_calculate_tc_credits_cee(struct ixgbe_hw *hw,
+   struct ixgbe_dcb_config *dcb_config,
+   u32 max_frame_size, u8 direction)
+{
+	struct ixgbe_dcb_tc_path *p;
+	u32 min_multiplier	= 0;
+	u16 min_percent		= 100;
+	s32 ret_val =		IXGBE_SUCCESS;
+	/* Initialization values default for Tx settings */
+	u32 min_credit		= 0;
+	u32 credit_refill	= 0;
+	u32 credit_max		= 0;
+	u16 link_percentage	= 0;
+	u8  bw_percent		= 0;
+	u8  i;
+
+	if (dcb_config == NULL) {
+		ret_val = IXGBE_ERR_CONFIG;
+		goto out;
+	}
+
+	min_credit = ((max_frame_size / 2) + IXGBE_DCB_CREDIT_QUANTUM - 1) /
+		 IXGBE_DCB_CREDIT_QUANTUM;
+
+	/* Find 

CVS commit: src/sys/dev/pci/ixgbe

2015-08-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Aug  5 04:11:07 UTC 2015

Added Files:
src/sys/dev/pci/ixgbe: ixgbe_dcb.c ixgbe_dcb.h ixgbe_dcb_82598.c
ixgbe_dcb_82598.h ixgbe_dcb_82599.c ixgbe_dcb_82599.h

Log Message:
 Add some files.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/ixgbe/ixgbe_dcb.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb.h src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c \
src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.h

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



CVS commit: src/sys/dev/pci/ixgbe

2015-08-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug  3 05:43:01 UTC 2015

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

Log Message:
 Add missing evcnt_detach(rxr-rx_copies) in ixgbe_detach().


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.30 src/sys/dev/pci/ixgbe/ixgbe.c:1.31
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.30	Sat May  9 13:08:26 2015
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Aug  3 05:43:01 2015
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 250108 2013-04-30 16:18:29Z luigi $*/
-/*$NetBSD: ixgbe.c,v 1.30 2015/05/09 13:08:26 christos Exp $*/
+/*$NetBSD: ixgbe.c,v 1.31 2015/08/03 05:43:01 msaitoh Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -807,6 +807,7 @@ ixgbe_detach(device_t dev, int flags)
 
 		evcnt_detach(rxr-rx_packets);
 		evcnt_detach(rxr-rx_bytes);
+		evcnt_detach(rxr-rx_copies);
 		evcnt_detach(rxr-no_jmbuf);
 		evcnt_detach(rxr-rx_discarded);
 		evcnt_detach(rxr-rx_irq);



CVS commit: src/sys/dev/pci/ixgbe

2015-08-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug  3 05:43:01 UTC 2015

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

Log Message:
 Add missing evcnt_detach(rxr-rx_copies) in ixgbe_detach().


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.



CVS commit: src/sys/dev/pci/ixgbe

2015-05-20 Thread Tyler R. Retzlaff
Module Name:src
Committed By:   rtr
Date:   Thu May 21 00:45:27 UTC 2015

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

Log Message:
remove duplicated assignment of mh-m_len


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixv.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/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.8 src/sys/dev/pci/ixgbe/ixv.c:1.9
--- src/sys/dev/pci/ixgbe/ixv.c:1.8	Fri Apr 24 07:00:51 2015
+++ src/sys/dev/pci/ixgbe/ixv.c	Thu May 21 00:45:27 2015
@@ -31,7 +31,7 @@
 
 **/
 /*$FreeBSD: head/sys/dev/ixgbe/ixv.c 247822 2013-03-04 23:07:40Z jfv $*/
-/*$NetBSD: ixv.c,v 1.8 2015/04/24 07:00:51 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.9 2015/05/21 00:45:27 rtr Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -2829,7 +2829,6 @@ ixv_refresh_mbufs(struct rx_ring *rxr, i
 			if (mh == NULL)
 goto update;
 			mh-m_pkthdr.len = mh-m_len = MHLEN;
-			mh-m_len = MHLEN;
 			mh-m_flags |= M_PKTHDR;
 			m_adj(mh, ETHER_ALIGN);
 			/* Get the memory mapping */



CVS commit: src/sys/dev/pci/ixgbe

2015-05-20 Thread Tyler R. Retzlaff
Module Name:src
Committed By:   rtr
Date:   Thu May 21 00:45:27 UTC 2015

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

Log Message:
remove duplicated assignment of mh-m_len


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

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



CVS commit: src/sys/dev/pci/ixgbe

2015-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May  9 13:08:26 UTC 2015

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

Log Message:
remove unreachable code.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 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.29 src/sys/dev/pci/ixgbe/ixgbe.c:1.30
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.29	Wed May  6 05:21:22 2015
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Sat May  9 09:08:26 2015
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 250108 2013-04-30 16:18:29Z luigi $*/
-/*$NetBSD: ixgbe.c,v 1.29 2015/05/06 09:21:22 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.30 2015/05/09 13:08:26 christos Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -1977,8 +1977,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m
 		default:
 			adapter-other_tx_dma_setup.ev_count++;
 			return error;
-		case 0:
-			break;
 		}
 	}
 



CVS commit: src/sys/dev/pci/ixgbe

2015-05-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May  6 09:21:22 UTC 2015

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

Log Message:
 Fixes link error without vlan. PR#49879.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 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.28 src/sys/dev/pci/ixgbe/ixgbe.c:1.29
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.28	Fri Apr 24 07:00:51 2015
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed May  6 09:21:22 2015
@@ -59,12 +59,13 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 250108 2013-04-30 16:18:29Z luigi $*/
-/*$NetBSD: ixgbe.c,v 1.28 2015/04/24 07:00:51 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.29 2015/05/06 09:21:22 msaitoh Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
 
 #include ixgbe.h
+#include vlan.h
 
 /*
  *  Set this to one to display debug statistics
@@ -716,6 +717,7 @@ ixgbe_detach(device_t dev, int flags)
 
 	INIT_DEBUGOUT(ixgbe_detach: begin);
 
+#if NVLAN  0
 	/* Make sure VLANs are not using driver */
 	if (!VLAN_ATTACHED(adapter-osdep.ec))
 		;	/* nothing to do: no VLANs */ 
@@ -725,6 +727,7 @@ ixgbe_detach(device_t dev, int flags)
 		aprint_error_dev(dev, VLANs in use\n);
 		return EBUSY;
 	}
+#endif
 
 	IXGBE_CORE_LOCK(adapter);
 	ixgbe_stop(adapter);



CVS commit: src/sys/dev/pci/ixgbe

2015-04-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Apr 24 07:00:51 UTC 2015

Modified Files:
src/sys/dev/pci/ixgbe: LICENSE ixgbe.c ixgbe.h ixgbe_82598.c
ixgbe_82598.h ixgbe_82599.c ixgbe_82599.h ixgbe_api.c ixgbe_api.h
ixgbe_common.c ixgbe_common.h ixgbe_mbx.h ixgbe_netbsd.h
ixgbe_osdep.h ixgbe_phy.c ixgbe_phy.h ixgbe_type.h ixgbe_vf.c
ixgbe_vf.h ixgbe_x540.c ixgbe_x540.h ixv.c

Log Message:
Sync ixg(4) up to FreeBSD r250108:
 - Cleanup some unused counters and some unused code.
 - Improve performance.
 - Fix flow control - don't override user value on re-init
 - Fix to make 1G optics work correctly
 - Change to interrupt enabling - some bits were incorrect
   for certain hardware.
 - Certain stats fixes, remove a duplicate increment of
   ierror, thanks to Scott Long for pointing these out.
 - Fix the setting of RX which related to multicast.
 - Some netmap related fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ixgbe/LICENSE \
src/sys/dev/pci/ixgbe/ixgbe_82599.h src/sys/dev/pci/ixgbe/ixgbe_x540.h
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe.h \
src/sys/dev/pci/ixgbe/ixgbe_api.c src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/ixgbe/ixgbe_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_api.h src/sys/dev/pci/ixgbe/ixgbe_common.h \
src/sys/dev/pci/ixgbe/ixgbe_mbx.h src/sys/dev/pci/ixgbe/ixgbe_phy.h \
src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/ixgbe/ixgbe_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_netbsd.h src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ixgbe/ixgbe_common.c \
src/sys/dev/pci/ixgbe/ixgbe_phy.c src/sys/dev/pci/ixgbe/ixgbe_vf.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2015-04-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 14 07:17:06 UTC 2015

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h ixgbe_82599.c ixgbe_osdep.h
ixv.c

Log Message:
Sync ixg(4) up to FreeBSD r243716:
 - A lot of bugfixes. Some of them are realted to multi queue and those
   have not affected in NetBSD because we have not used it yet.
 - Show 1000Base-SX correctly.
 - Fix if_baudrate from 1G to 10G.
 - Improve performance.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe.h \
src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixv.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.25 src/sys/dev/pci/ixgbe/ixgbe.c:1.26
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.25	Thu Apr  2 09:26:55 2015
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Apr 14 07:17:06 2015
@@ -58,8 +58,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 238149 2012-07-05 20:51:44Z jfv $*/
-/*$NetBSD: ixgbe.c,v 1.25 2015/04/02 09:26:55 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 243716 2012-11-30 22:33:21Z jfv $*/
+/*$NetBSD: ixgbe.c,v 1.26 2015/04/14 07:17:06 msaitoh Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -74,7 +74,7 @@ int ixgbe_display_debug_stat
 /*
  *  Driver version
  */
-char ixgbe_driver_version[] = 2.4.8;
+char ixgbe_driver_version[] = 2.5.0 - 2;
 
 /*
  *  PCI Device ID Table
@@ -134,13 +134,15 @@ static int  ixgbe_detach(device_t, i
 #if 0
 static int  ixgbe_shutdown(device_t);
 #endif
-static void ixgbe_start(struct ifnet *);
-static void ixgbe_start_locked(struct tx_ring *, struct ifnet *);
 #if __FreeBSD_version = 80
 static int	ixgbe_mq_start(struct ifnet *, struct mbuf *);
 static int	ixgbe_mq_start_locked(struct ifnet *,
 struct tx_ring *, struct mbuf *);
 static void	ixgbe_qflush(struct ifnet *);
+static void	ixgbe_deferred_mq_start(void *, int);
+#else
+static void ixgbe_start(struct ifnet *);
+static void ixgbe_start_locked(struct tx_ring *, struct ifnet *);
 #endif
 static int  ixgbe_ioctl(struct ifnet *, u_long, void *);
 static void	ixgbe_ifstop(struct ifnet *, int);
@@ -216,6 +218,9 @@ static __inline void ixgbe_rx_discard(st
 static __inline void ixgbe_rx_input(struct rx_ring *, struct ifnet *,
 		struct mbuf *, u32);
 
+static void	ixgbe_enable_rx_drop(struct adapter *);
+static void	ixgbe_disable_rx_drop(struct adapter *);
+
 /* Support for pluggable optic modules */
 static bool	ixgbe_sfp_probe(struct adapter *);
 static void	ixgbe_setup_optics(struct adapter *);
@@ -296,15 +301,6 @@ static int ixgbe_smart_speed = ixgbe_sma
 static int ixgbe_enable_msix = 1;
 TUNABLE_INT(hw.ixgbe.enable_msix, ixgbe_enable_msix);
 
-/*
- * Header split: this causes the hardware to DMA
- * the header into a separate mbuf from the payload,
- * it can be a performance win in some workloads, but
- * in others it actually hurts, its off by default. 
- */
-static int ixgbe_header_split = FALSE;
-TUNABLE_INT(hw.ixgbe.hdr_split, ixgbe_header_split);
-
 #if defined(NETBSD_MSI_OR_MSIX)
 /*
  * Number of Queues, can be set to 0,
@@ -328,6 +324,20 @@ TUNABLE_INT(hw.ixgbe.txd, ixgbe_txd);
 static int ixgbe_rxd = PERFORM_RXD;
 TUNABLE_INT(hw.ixgbe.rxd, ixgbe_rxd);
 
+/*
+** HW RSC control: 
+**  this feature only works with
+**  IPv4, and only on 82599 and later.
+**  Also this will cause IP forwarding to
+**  fail and that can't be controlled by
+**  the stack as LRO can. For all these
+**  reasons I've deemed it best to leave
+**  this off and not bother with a tuneable
+**  interface, this would need to be compiled
+**  to enable.
+*/
+static bool ixgbe_rsc_enable = FALSE;
+
 /* Keep running tab on them for sanity check */
 static int ixgbe_total_ports;
 
@@ -697,10 +707,10 @@ static int
 ixgbe_detach(device_t dev, int flags)
 {
 	struct adapter *adapter = device_private(dev);
-	struct tx_ring *txr = adapter-tx_rings;
 	struct rx_ring *rxr = adapter-rx_rings;
 	struct ixgbe_hw_stats *stats = adapter-stats;
 	struct ix_queue *que = adapter-queues;
+	struct tx_ring *txr = adapter-tx_rings;
 	u32	ctrl_ext;
 
 	INIT_DEBUGOUT(ixgbe_detach: begin);
@@ -719,7 +729,10 @@ ixgbe_detach(device_t dev, int flags)
 	ixgbe_stop(adapter);
 	IXGBE_CORE_UNLOCK(adapter);
 
-	for (int i = 0; i  adapter-num_queues; i++, que++) {
+	for (int i = 0; i  adapter-num_queues; i++, que++, 

CVS commit: src/sys/dev/pci/ixgbe

2015-04-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 14 07:17:06 UTC 2015

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h ixgbe_82599.c ixgbe_osdep.h
ixv.c

Log Message:
Sync ixg(4) up to FreeBSD r243716:
 - A lot of bugfixes. Some of them are realted to multi queue and those
   have not affected in NetBSD because we have not used it yet.
 - Show 1000Base-SX correctly.
 - Fix if_baudrate from 1G to 10G.
 - Improve performance.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe.h \
src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: src/sys/dev/pci/ixgbe

2015-04-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 14 07:41:52 UTC 2015

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

Log Message:
 Fix a bug that ifconfig -z (SOICZIFDATA) doesn't work.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 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.26 src/sys/dev/pci/ixgbe/ixgbe.c:1.27
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.26	Tue Apr 14 07:17:06 2015
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Apr 14 07:41:52 2015
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 243716 2012-11-30 22:33:21Z jfv $*/
-/*$NetBSD: ixgbe.c,v 1.26 2015/04/14 07:17:06 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.27 2015/04/14 07:41:52 msaitoh Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -5313,8 +5313,10 @@ ixgbe_update_stats_counters(struct adapt
 	struct ixgbe_hw *hw = adapter-hw;
 	u32  missed_rx = 0, bprc, lxon, lxoff, total;
 	u64  total_missed_rx = 0;
+	uint64_t crcerrs, rlec;
 
-	adapter-stats.crcerrs.ev_count += IXGBE_READ_REG(hw, IXGBE_CRCERRS);
+	crcerrs = IXGBE_READ_REG(hw, IXGBE_CRCERRS);
+	adapter-stats.crcerrs.ev_count += crcerrs;
 	adapter-stats.illerrc.ev_count += IXGBE_READ_REG(hw, IXGBE_ILLERRC);
 	adapter-stats.errbc.ev_count += IXGBE_READ_REG(hw, IXGBE_ERRBC);
 	adapter-stats.mspdc.ev_count += IXGBE_READ_REG(hw, IXGBE_MSPDC);
@@ -5328,7 +5330,7 @@ ixgbe_update_stats_counters(struct adapt
 		/* global total per queue */
 	adapter-stats.mpc[j].ev_count += mp;
 		/* Running comprehensive total for stats display */
-		total_missed_rx += adapter-stats.mpc[j].ev_count;
+		total_missed_rx += mp;
 		if (hw-mac.type == ixgbe_mac_82598EB)
 			adapter-stats.rnbc[j] +=
 			IXGBE_READ_REG(hw, IXGBE_RNBC(i));
@@ -5357,7 +5359,8 @@ ixgbe_update_stats_counters(struct adapt
 	}
 	adapter-stats.mlfc.ev_count += IXGBE_READ_REG(hw, IXGBE_MLFC);
 	adapter-stats.mrfc.ev_count += IXGBE_READ_REG(hw, IXGBE_MRFC);
-	adapter-stats.rlec.ev_count += IXGBE_READ_REG(hw, IXGBE_RLEC);
+	rlec = IXGBE_READ_REG(hw, IXGBE_RLEC);
+	adapter-stats.rlec.ev_count += rlec;
 
 	/* Hardware workaround, gprc counts missed packets */
 	adapter-stats.gprc.ev_count += IXGBE_READ_REG(hw, IXGBE_GPRC) - missed_rx;
@@ -5439,17 +5442,15 @@ ixgbe_update_stats_counters(struct adapt
 	}
 
 	/* Fill out the OS statistics structure */
-	ifp-if_ipackets = adapter-stats.gprc.ev_count;
-	ifp-if_opackets = adapter-stats.gptc.ev_count;
-	ifp-if_ibytes = adapter-stats.gorc.ev_count;
-	ifp-if_obytes = adapter-stats.gotc.ev_count;
-	ifp-if_imcasts = adapter-stats.mprc.ev_count;
-	ifp-if_omcasts = adapter-stats.mptc.ev_count;
+	/*
+	 * NetBSD: Don't override if_{i|o}{packets|bytes|mcasts} with
+	 * adapter-stats counters. It's required to make ifconfig -z
+	 * (SOICZIFDATA) work.
+	 */
 	ifp-if_collisions = 0;
-
+	
 	/* Rx Errors */
-	ifp-if_ierrors = total_missed_rx + adapter-stats.crcerrs.ev_count +
-		adapter-stats.rlec.ev_count;
+	ifp-if_ierrors += total_missed_rx + crcerrs + rlec;
 }
 
 /** ixgbe_sysctl_tdh_handler - Handler function



CVS commit: src/sys/dev/pci/ixgbe

2015-04-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Apr 14 07:41:52 UTC 2015

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

Log Message:
 Fix a bug that ifconfig -z (SOICZIFDATA) doesn't work.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 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.



CVS commit: src/sys/dev/pci/ixgbe

2015-04-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Apr  2 09:26:56 UTC 2015

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h ixgbe_82598.c ixgbe_82598.h
ixgbe_82599.c ixgbe_api.c ixgbe_api.h ixgbe_common.c ixgbe_common.h
ixgbe_mbx.c ixgbe_mbx.h ixgbe_osdep.h ixgbe_phy.c ixgbe_phy.h
ixgbe_type.h ixgbe_vf.c ixgbe_vf.h ixgbe_x540.c ixv.c ixv.h

Log Message:
Update our ixg(4) driver up to FreeBSD r238149:
- Add TSO6 support.
- The max size in dma tag is changed from 65535 to 262140 (IXGBE_TSO_SIZE).
  The value is the same as other *BSDs. The change might cause a address
  space shortage (ixgbe_dmamap_create() might fail) on some machines.
- Fix a lot of bugs.
- Improve performance.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ixgbe/ixgbe.h \
src/sys/dev/pci/ixgbe/ixgbe_osdep.h src/sys/dev/pci/ixgbe/ixv.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/ixgbe/ixgbe_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_api.h src/sys/dev/pci/ixgbe/ixgbe_common.h \
src/sys/dev/pci/ixgbe/ixgbe_mbx.c src/sys/dev/pci/ixgbe/ixgbe_mbx.h \
src/sys/dev/pci/ixgbe/ixgbe_phy.h src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ixgbe/ixgbe_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_api.c \
src/sys/dev/pci/ixgbe/ixv.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/ixgbe/ixgbe_common.c \
src/sys/dev/pci/ixgbe/ixgbe_phy.c src/sys/dev/pci/ixgbe/ixgbe_vf.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_type.h

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.24 src/sys/dev/pci/ixgbe/ixgbe.c:1.25
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.24	Fri Mar 27 05:57:28 2015
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Apr  2 09:26:55 2015
@@ -58,8 +58,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-/*$FreeBSD: src/sys/dev/ixgbe/ixgbe.c,v 1.51 2011/04/25 23:34:21 jfv Exp $*/
-/*$NetBSD: ixgbe.c,v 1.24 2015/03/27 05:57:28 msaitoh Exp $*/
+/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 238149 2012-07-05 20:51:44Z jfv $*/
+/*$NetBSD: ixgbe.c,v 1.25 2015/04/02 09:26:55 msaitoh Exp $*/
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -74,7 +74,7 @@ int ixgbe_display_debug_stat
 /*
  *  Driver version
  */
-char ixgbe_driver_version[] = 2.4.5;
+char ixgbe_driver_version[] = 2.4.8;
 
 /*
  *  PCI Device ID Table
@@ -111,6 +111,7 @@ static ixgbe_vendor_info_t ixgbe_vendor_
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0},
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0},
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF_QP, 0, 0, 0},
+	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0},
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0},
 	/* required last entry */
 	{0, 0, 0, 0, 0}
@@ -198,7 +199,7 @@ static void ixgbe_dma_free(struct ad
 static void	ixgbe_add_rx_process_limit(struct adapter *, const char *,
 		const char *, int *, int);
 static u32	ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *);
-static bool	ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *);
+static bool	ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *);
 static void	ixgbe_set_ivar(struct adapter *, u8, u8, s8);
 static void	ixgbe_configure_ivars(struct adapter *);
 static u8 *	ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *);
@@ -357,7 +358,7 @@ static int fdir_pballoc = 1;
  * be a reference on how to implement netmap support in a driver.
  * Additional comments are in ixgbe_netmap.h .
  *
- * dev/netma/ixgbe_netmap.h contains functions for netmap support
+ * dev/netmap/ixgbe_netmap.h contains functions for netmap support
  * that extend the standard driver.
  */
 #include dev/netmap/ixgbe_netmap.h
@@ -595,28 +596,25 @@ ixgbe_attach(device_t parent, device_t d
 		goto err_late;
 	}
 
-	/* Get Hardware Flow Control setting */
-	hw-fc.requested_mode = ixgbe_fc_full;
-	adapter-fc = hw-fc.requested_mode;
-	hw-fc.pause_time = IXGBE_FC_PAUSE;
-	hw-fc.low_water = IXGBE_FC_LO;
-	hw-fc.high_water[0] = IXGBE_FC_HI;
-	hw-fc.send_xon = TRUE;
-
 	error = ixgbe_init_hw(hw);
-	if (error == IXGBE_ERR_EEPROM_VERSION) {
+	switch (error) {
+	case IXGBE_ERR_EEPROM_VERSION:
 		aprint_error_dev(dev, This device is a pre-production adapter/
 		LOM.  Please be aware there may be issues associated 
 		with your hardware.\n If you are experiencing problems 
 		please contact your Intel or hardware representative 

CVS commit: src/sys/dev/pci/ixgbe

2015-04-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Apr  2 09:26:56 UTC 2015

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h ixgbe_82598.c ixgbe_82598.h
ixgbe_82599.c ixgbe_api.c ixgbe_api.h ixgbe_common.c ixgbe_common.h
ixgbe_mbx.c ixgbe_mbx.h ixgbe_osdep.h ixgbe_phy.c ixgbe_phy.h
ixgbe_type.h ixgbe_vf.c ixgbe_vf.h ixgbe_x540.c ixv.c ixv.h

Log Message:
Update our ixg(4) driver up to FreeBSD r238149:
- Add TSO6 support.
- The max size in dma tag is changed from 65535 to 262140 (IXGBE_TSO_SIZE).
  The value is the same as other *BSDs. The change might cause a address
  space shortage (ixgbe_dmamap_create() might fail) on some machines.
- Fix a lot of bugs.
- Improve performance.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ixgbe/ixgbe.h \
src/sys/dev/pci/ixgbe/ixgbe_osdep.h src/sys/dev/pci/ixgbe/ixv.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/ixgbe/ixgbe_82598.c \
src/sys/dev/pci/ixgbe/ixgbe_api.h src/sys/dev/pci/ixgbe/ixgbe_common.h \
src/sys/dev/pci/ixgbe/ixgbe_mbx.c src/sys/dev/pci/ixgbe/ixgbe_mbx.h \
src/sys/dev/pci/ixgbe/ixgbe_phy.h src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ixgbe/ixgbe_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_x540.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_api.c \
src/sys/dev/pci/ixgbe/ixv.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/ixgbe/ixgbe_common.c \
src/sys/dev/pci/ixgbe/ixgbe_phy.c src/sys/dev/pci/ixgbe/ixgbe_vf.h
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_type.h

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



CVS commit: src/sys/dev/pci/ixgbe

2015-03-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 27 06:04:42 UTC 2015

Added Files:
src/sys/dev/pci/ixgbe: ixgbe_82598.h ixgbe_82599.h ixgbe_x540.c
ixgbe_x540.h

Log Message:
 Add some forgotten files in last commit.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/ixgbe/ixgbe_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_82599.h src/sys/dev/pci/ixgbe/ixgbe_x540.c \
src/sys/dev/pci/ixgbe/ixgbe_x540.h

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

Added files:

Index: src/sys/dev/pci/ixgbe/ixgbe_82598.h
diff -u /dev/null src/sys/dev/pci/ixgbe/ixgbe_82598.h:1.1
--- /dev/null	Fri Mar 27 06:04:42 2015
+++ src/sys/dev/pci/ixgbe/ixgbe_82598.h	Fri Mar 27 06:04:42 2015
@@ -0,0 +1,52 @@
+/**
+
+  Copyright (c) 2001-2012, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+  this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+  notice, this list of conditions and the following disclaimer in the 
+  documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+  contributors may be used to endorse or promote products derived from 
+  this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+**/
+/*$FreeBSD$*/
+
+#ifndef _IXGBE_82598_H_
+#define _IXGBE_82598_H_
+
+u32 ixgbe_get_pcie_msix_count_82598(struct ixgbe_hw *hw);
+s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num);
+s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw);
+void ixgbe_enable_relaxed_ordering_82598(struct ixgbe_hw *hw);
+s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
+s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on);
+s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val);
+s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val);
+s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
+u8 *eeprom_data);
+u32 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw);
+s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw);
+void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw);
+void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw);
+#endif /* _IXGBE_82598_H_ */
Index: src/sys/dev/pci/ixgbe/ixgbe_82599.h
diff -u /dev/null src/sys/dev/pci/ixgbe/ixgbe_82599.h:1.1
--- /dev/null	Fri Mar 27 06:04:42 2015
+++ src/sys/dev/pci/ixgbe/ixgbe_82599.h	Fri Mar 27 06:04:42 2015
@@ -0,0 +1,65 @@
+/**
+
+  Copyright (c) 2001-2012, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+  this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+  notice, this list of conditions and the following disclaimer in the 
+  documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+  contributors may be used to endorse or promote products derived from 
+  this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 

CVS commit: src/sys/dev/pci/ixgbe

2015-03-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 27 06:04:42 UTC 2015

Added Files:
src/sys/dev/pci/ixgbe: ixgbe_82598.h ixgbe_82599.h ixgbe_x540.c
ixgbe_x540.h

Log Message:
 Add some forgotten files in last commit.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/ixgbe/ixgbe_82598.h \
src/sys/dev/pci/ixgbe/ixgbe_82599.h src/sys/dev/pci/ixgbe/ixgbe_x540.c \
src/sys/dev/pci/ixgbe/ixgbe_x540.h

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



CVS commit: src/sys/dev/pci/ixgbe

2015-03-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 25 12:53:55 UTC 2015

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

Log Message:
 Fix a bug that vlan setting may not apply to the parent interface correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 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.



<    5   6   7   8   9   10   11   >