Module Name:    src
Committed By:   martin
Date:           Thu Aug 29 16:31:53 UTC 2019

Modified Files:
        src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1347):

        sys/dev/pci/ixgbe/ixgbe.c: revision 1.205
        sys/dev/pci/ixgbe/ixgbe.c: revision 1.206

fix typo in error handling of ixgbe_allocate_legacy().
ok by msaitoh@n.o
pullup-8, pullup-9

 -

Fix panic when ncpu == 1 && sysctl -w hw.ixg0.txrx_workqueue=1. Reported by 
nonaka@n.o.

ok by msaitoh@n.o and nonaka@n.o
pullup-8, pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.31 -r1.88.2.32 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.88.2.31 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.32
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.31	Thu Aug  1 14:14:30 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Aug 29 16:31:53 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.31 2019/08/01 14:14:30 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.32 2019/08/29 16:31:53 martin Exp $ */
 
 /******************************************************************************
 
@@ -6410,7 +6410,9 @@ ixgbe_allocate_legacy(struct adapter *ad
 	int		counts[PCI_INTR_TYPE_SIZE];
 	pci_intr_type_t intr_type, max_type;
 	char		intrbuf[PCI_INTRSTR_LEN];
+	char		wqname[MAXCOMLEN];
 	const char	*intrstr = NULL;
+	int defertx_error = 0, error;
 
 	/* We allocate a single interrupt resource */
 	max_type = PCI_INTR_TYPE_MSI;
@@ -6472,15 +6474,27 @@ alloc_retry:
 	 * Try allocating a fast interrupt and the associated deferred
 	 * processing contexts.
 	 */
-	if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX))
+	if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)) {
 		txr->txr_si =
 		    softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
 			ixgbe_deferred_mq_start, txr);
+
+		snprintf(wqname, sizeof(wqname), "%sdeferTx", device_xname(dev));
+		defertx_error = workqueue_create(&adapter->txr_wq, wqname,
+		    ixgbe_deferred_mq_start_work, adapter, IXGBE_WORKQUEUE_PRI,
+		    IPL_NET, IXGBE_WORKQUEUE_FLAGS);
+		adapter->txr_wq_enqueued = percpu_alloc(sizeof(u_int));
+	}
 	que->que_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
 	    ixgbe_handle_que, que);
+	snprintf(wqname, sizeof(wqname), "%sTxRx", device_xname(dev));
+	error = workqueue_create(&adapter->que_wq, wqname,
+	    ixgbe_handle_que_work, adapter, IXGBE_WORKQUEUE_PRI, IPL_NET,
+	    IXGBE_WORKQUEUE_FLAGS);
 
 	if ((!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)
-		& (txr->txr_si == NULL)) || (que->que_si == NULL)) {
+		&& ((txr->txr_si == NULL) || defertx_error != 0))
+	    || (que->que_si == NULL) || error != 0) {
 		aprint_error_dev(dev,
 		    "could not establish software interrupts\n");
 

Reply via email to