Module Name:    src
Committed By:   martin
Date:           Mon Jan 23 14:04:42 UTC 2023

Modified Files:
        src/sys/dev/pci [netbsd-9]: files.pci
        src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe_82598.c
            ixgbe_api.c ixgbe_common.c ixgbe_netbsd.h ixv.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1579:

        sys/dev/pci/files.pci                           1.442
        sys/dev/pci/ixgbe/ix_txrx.c                     1.99-1.100
        sys/dev/pci/ixgbe/ixgbe.c                       1.320-1.324 via patch
        sys/dev/pci/ixgbe/ixgbe_82598.c                 1.19
        sys/dev/pci/ixgbe/ixgbe_api.c                   1.28
        sys/dev/pci/ixgbe/ixgbe_common.c                1.43
        sys/dev/pci/ixgbe/ixgbe_netbsd.h                1.17
        sys/dev/pci/ixgbe/ixv.c                         1.183

- Add an option for Tx to use deferred softint regardless of whether
  can get txq lock or not. It's off by default.
- Call txeof first, then rxeof for the consistency.
- Make three "Unsupported SFP+ module..." messages the same.
- KNF. Modify comment. Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.413.2.5 -r1.413.2.6 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.54.2.10 -r1.54.2.11 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.24 -r1.199.2.25 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.12.8.5 -r1.12.8.6 src/sys/dev/pci/ixgbe/ixgbe_82598.c
cvs rdiff -u -r1.23.2.3 -r1.23.2.4 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.25.2.5 -r1.25.2.6 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.11.4.3 -r1.11.4.4 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.125.2.20 -r1.125.2.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.

Modified files:

Index: src/sys/dev/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.413.2.5 src/sys/dev/pci/files.pci:1.413.2.6
--- src/sys/dev/pci/files.pci:1.413.2.5	Thu Oct 21 14:30:10 2021
+++ src/sys/dev/pci/files.pci	Mon Jan 23 14:04:41 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.413.2.5 2021/10/21 14:30:10 martin Exp $
+#	$NetBSD: files.pci,v 1.413.2.6 2023/01/23 14:04:41 martin Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -691,6 +691,7 @@ file	dev/pci/ixgbe/ixgbe_phy.c	ixg | ixv
 file	dev/pci/ixgbe/ixgbe_vf.c	ixg | ixv
 file	dev/pci/ixgbe/if_bypass.c	ixg | ixv
 file	dev/pci/ixgbe/if_fdir.c		ixg | ixv
+defflag	opt_if_ixg.h	IXGBE_ALWAYS_TXDEFER
 
 # This appears to be the driver for virtual instances of i82599.
 device	ixv: ether, ifnet, arp, mii, mii_phy

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.10 src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.11
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.10	Mon May 30 17:01:06 2022
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Mon Jan 23 14:04:42 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.54.2.10 2022/05/30 17:01:06 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.54.2.11 2023/01/23 14:04:42 martin Exp $ */
 
 /******************************************************************************
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.10 2022/05/30 17:01:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.11 2023/01/23 14:04:42 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -250,6 +250,11 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 		IXGBE_EVC_ADD(&txr->pcq_drops, 1);
 		return ENOBUFS;
 	}
+#ifdef IXGBE_ALWAYS_TXDEFER
+	kpreempt_disable();
+	softint_schedule(txr->txr_si);
+	kpreempt_enable();
+#else
 	if (IXGBE_TX_TRYLOCK(txr)) {
 		ixgbe_mq_start_locked(ifp, txr);
 		IXGBE_TX_UNLOCK(txr);
@@ -279,6 +284,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 			kpreempt_enable();
 		}
 	}
+#endif
 
 	return (0);
 } /* ixgbe_mq_start */
@@ -316,7 +322,7 @@ ixgbe_mq_start_locked(struct ifnet *ifp,
 #if __FreeBSD_version >= 1100036
 		/*
 		 * Since we're looking at the tx ring, we can check
-		 * to see if we're a VF by examing our tail register
+		 * to see if we're a VF by examining our tail register
 		 * address.
 		 */
 		if ((txr->adapter->feat_en & IXGBE_FEATURE_VF) &&
@@ -1977,7 +1983,7 @@ ixgbe_rxeof(struct ix_queue *que)
 		 * not be fragmented across sequential
 		 * descriptors, rather the next descriptor
 		 * is indicated in bits of the descriptor.
-		 * This also means that we might proceses
+		 * This also means that we might process
 		 * more than one packet at a time, something
 		 * that has never been true before, it
 		 * required eliminating global chain pointers

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.24 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.25
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.24	Fri Jun  3 04:00:49 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Jan 23 14:04:42 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.24 2022/06/03 04:00:49 snj Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.25 2023/01/23 14:04:42 martin Exp $ */
 
 /******************************************************************************
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.24 2022/06/03 04:00:49 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.199.2.25 2023/01/23 14:04:42 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -968,7 +968,8 @@ ixgbe_attach(device_t parent, device_t d
 		adapter->sfp_probe = TRUE;
 		error = IXGBE_SUCCESS;
 	} else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) {
-		aprint_error_dev(dev, "Unsupported SFP+ module detected!\n");
+		aprint_error_dev(dev,
+		    "Unsupported SFP+ module detected!\n");
 		unsupported_sfp = true;
 		error = IXGBE_SUCCESS;
 	} else if (error) {
@@ -1562,7 +1563,6 @@ ixgbe_config_link(struct adapter *adapte
 			err = hw->mac.ops.setup_link(hw, autoneg,
 			    adapter->link_up);
 	}
-
 } /* ixgbe_config_link */
 
 /************************************************************************
@@ -2631,7 +2631,7 @@ display:
 } /* ixgbe_get_slot_info */
 
 /************************************************************************
- * ixgbe_enable_queue - MSI-X Interrupt Handlers and Tasklets
+ * ixgbe_enable_queue - Queue Interrupt Enabler
  ************************************************************************/
 static inline void
 ixgbe_enable_queue(struct adapter *adapter, u32 vector)
@@ -3079,7 +3079,7 @@ invalid:
 } /* ixgbe_media_change */
 
 /************************************************************************
- * ixgbe_msix_admin - Link status change ISR (MSI/MSI-X)
+ * ixgbe_msix_admin - Link status change ISR (MSI-X)
  ************************************************************************/
 static int
 ixgbe_msix_admin(void *arg)
@@ -5232,7 +5232,6 @@ ixgbe_free_pci_resources(struct adapter 
 		    adapter->osdep.mem_bus_space_handle,
 		    adapter->osdep.mem_size);
 	}
-
 } /* ixgbe_free_pci_resources */
 
 /************************************************************************
@@ -6226,7 +6225,8 @@ ixgbe_init_device_features(struct adapte
 		if (adapter->feat_cap & IXGBE_FEATURE_FDIR)
 			adapter->feat_en |= IXGBE_FEATURE_FDIR;
 		else
-			device_printf(adapter->dev, "Device does not support Flow Director. Leaving disabled.");
+			device_printf(adapter->dev, "Device does not support "
+			    "Flow Director. Leaving disabled.");
 	}
 	/* Legacy (single queue) transmit */
 	if ((adapter->feat_cap & IXGBE_FEATURE_LEGACY_TX) &&
@@ -6520,9 +6520,8 @@ ixgbe_handle_que(void *context)
 	IXGBE_EVC_ADD(&que->handleq, 1);
 
 	if (ifp->if_flags & IFF_RUNNING) {
-		more = ixgbe_rxeof(que);
 		IXGBE_TX_LOCK(txr);
-		more |= ixgbe_txeof(txr);
+		more = ixgbe_txeof(txr);
 		if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX))
 			if (!ixgbe_mq_ring_empty(ifp, txr->txr_interq))
 				ixgbe_mq_start_locked(ifp, txr);
@@ -6532,6 +6531,7 @@ ixgbe_handle_que(void *context)
 		    && (!ixgbe_legacy_ring_empty(ifp, NULL)))
 			ixgbe_legacy_start_locked(ifp, txr);
 		IXGBE_TX_UNLOCK(txr);
+		more |= ixgbe_rxeof(que);
 	}
 
 	if (more) {
@@ -6781,7 +6781,7 @@ ixgbe_allocate_msix(struct adapter *adap
 		if (error == 0) {
 #if 1 /* def IXGBE_DEBUG */
 #ifdef	RSS
-			aprintf_normal(", bound RSS bucket %d to CPU %d", i,
+			aprint_normal(", bound RSS bucket %d to CPU %d", i,
 			    cpu_id % ncpu);
 #else
 			aprint_normal(", bound queue %d to cpu %d", i,

Index: src/sys/dev/pci/ixgbe/ixgbe_82598.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.12.8.5 src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.12.8.6
--- src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.12.8.5	Sun Jan 30 15:58:28 2022
+++ src/sys/dev/pci/ixgbe/ixgbe_82598.c	Mon Jan 23 14:04:42 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_82598.c,v 1.12.8.5 2022/01/30 15:58:28 martin Exp $ */
+/* $NetBSD: ixgbe_82598.c,v 1.12.8.6 2023/01/23 14:04:42 martin Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_82598.c,v 1.12.8.5 2022/01/30 15:58:28 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_82598.c,v 1.12.8.6 2023/01/23 14:04:42 martin Exp $");
 
 #include "ixgbe_type.h"
 #include "ixgbe_82598.h"
@@ -1053,7 +1053,7 @@ s32 ixgbe_set_vfta_82598(struct ixgbe_hw
  * ixgbe_clear_vfta_82598 - Clear VLAN filter table
  * @hw: pointer to hardware structure
  *
- * Clears the VLAN filer table, and the VMDq index associated with the filter
+ * Clears the VLAN filter table, and the VMDq index associated with the filter
  **/
 static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw)
 {

Index: src/sys/dev/pci/ixgbe/ixgbe_api.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_api.c:1.23.2.3 src/sys/dev/pci/ixgbe/ixgbe_api.c:1.23.2.4
--- src/sys/dev/pci/ixgbe/ixgbe_api.c:1.23.2.3	Sun Jan 30 15:58:28 2022
+++ src/sys/dev/pci/ixgbe/ixgbe_api.c	Mon Jan 23 14:04:42 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_api.c,v 1.23.2.3 2022/01/30 15:58:28 martin Exp $ */
+/* $NetBSD: ixgbe_api.c,v 1.23.2.4 2023/01/23 14:04:42 martin Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_api.c,v 1.23.2.3 2022/01/30 15:58:28 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_api.c,v 1.23.2.4 2023/01/23 14:04:42 martin Exp $");
 
 #include "ixgbe_api.h"
 #include "ixgbe_common.h"
@@ -1062,7 +1062,7 @@ s32 ixgbe_disable_mc(struct ixgbe_hw *hw
  * ixgbe_clear_vfta - Clear VLAN filter table
  * @hw: pointer to hardware structure
  *
- * Clears the VLAN filer table, and the VMDq index associated with the filter
+ * Clears the VLAN filter table, and the VMDq index associated with the filter
  **/
 s32 ixgbe_clear_vfta(struct ixgbe_hw *hw)
 {

Index: src/sys/dev/pci/ixgbe/ixgbe_common.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_common.c:1.25.2.5 src/sys/dev/pci/ixgbe/ixgbe_common.c:1.25.2.6
--- src/sys/dev/pci/ixgbe/ixgbe_common.c:1.25.2.5	Sun Jan 30 15:58:28 2022
+++ src/sys/dev/pci/ixgbe/ixgbe_common.c	Mon Jan 23 14:04:42 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_common.c,v 1.25.2.5 2022/01/30 15:58:28 martin Exp $ */
+/* $NetBSD: ixgbe_common.c,v 1.25.2.6 2023/01/23 14:04:42 martin Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_common.c,v 1.25.2.5 2022/01/30 15:58:28 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_common.c,v 1.25.2.6 2023/01/23 14:04:42 martin Exp $");
 
 #include "ixgbe_common.h"
 #include "ixgbe_phy.h"
@@ -4142,7 +4142,7 @@ vlvf_update:
  * ixgbe_clear_vfta_generic - Clear VLAN filter table
  * @hw: pointer to hardware structure
  *
- * Clears the VLAN filer table, and the VMDq index associated with the filter
+ * Clears the VLAN filter table, and the VMDq index associated with the filter
  **/
 s32 ixgbe_clear_vfta_generic(struct ixgbe_hw *hw)
 {

Index: src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_netbsd.h:1.11.4.3 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h:1.11.4.4
--- src/sys/dev/pci/ixgbe/ixgbe_netbsd.h:1.11.4.3	Wed Feb  2 14:25:49 2022
+++ src/sys/dev/pci/ixgbe/ixgbe_netbsd.h	Mon Jan 23 14:04:42 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_netbsd.h,v 1.11.4.3 2022/02/02 14:25:49 martin Exp $ */
+/* $NetBSD: ixgbe_netbsd.h,v 1.11.4.4 2023/01/23 14:04:42 martin Exp $ */
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -31,6 +31,10 @@
 #ifndef _IXGBE_NETBSD_H
 #define _IXGBE_NETBSD_H
 
+#ifdef _KERNEL_OPT
+#include "opt_if_ixg.h"
+#endif
+
 #if 0 /* Enable this if you don't want to use TX multiqueue function */
 #define	IXGBE_LEGACY_TX	1
 #endif

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.125.2.20 src/sys/dev/pci/ixgbe/ixv.c:1.125.2.21
--- src/sys/dev/pci/ixgbe/ixv.c:1.125.2.20	Thu Jun  2 10:45:12 2022
+++ src/sys/dev/pci/ixgbe/ixv.c	Mon Jan 23 14:04:42 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixv.c,v 1.125.2.20 2022/06/02 10:45:12 martin Exp $ */
+/* $NetBSD: ixv.c,v 1.125.2.21 2023/01/23 14:04:42 martin Exp $ */
 
 /******************************************************************************
 
@@ -35,7 +35,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.125.2.20 2022/06/02 10:45:12 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.125.2.21 2023/01/23 14:04:42 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3245,9 +3245,8 @@ ixv_handle_que(void *context)
 	IXGBE_EVC_ADD(&que->handleq, 1);
 
 	if (ifp->if_flags & IFF_RUNNING) {
-		more = ixgbe_rxeof(que);
 		IXGBE_TX_LOCK(txr);
-		more |= ixgbe_txeof(txr);
+		more = ixgbe_txeof(txr);
 		if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX))
 			if (!ixgbe_mq_ring_empty(ifp, txr->txr_interq))
 				ixgbe_mq_start_locked(ifp, txr);
@@ -3257,6 +3256,7 @@ ixv_handle_que(void *context)
 		    && (!ixgbe_legacy_ring_empty(ifp, NULL)))
 			ixgbe_legacy_start_locked(ifp, txr);
 		IXGBE_TX_UNLOCK(txr);
+		more |= ixgbe_rxeof(que);
 		if (more) {
 			IXGBE_EVC_ADD(&que->req, 1);
 			if (adapter->txrx_use_workqueue) {

Reply via email to