Module Name:    src
Committed By:   jdolecek
Date:           Tue Jul 14 15:37:40 UTC 2020

Modified Files:
        src/sys/dev/pci: if_bnx.c if_bnxvar.h

Log Message:
make bnx_wk (used to trigger bnx_alloc_pkts()) part of softc instead
of using a static variable, so it's independant for each adapter


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/pci/if_bnx.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/if_bnxvar.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/if_bnx.c
diff -u src/sys/dev/pci/if_bnx.c:1.98 src/sys/dev/pci/if_bnx.c:1.99
--- src/sys/dev/pci/if_bnx.c:1.98	Tue Jul 14 12:15:16 2020
+++ src/sys/dev/pci/if_bnx.c	Tue Jul 14 15:37:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bnx.c,v 1.98 2020/07/14 12:15:16 jdolecek Exp $	*/
+/*	$NetBSD: if_bnx.c,v 1.99 2020/07/14 15:37:40 jdolecek Exp $	*/
 /*	$OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.98 2020/07/14 12:15:16 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.99 2020/07/14 15:37:40 jdolecek Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -5118,7 +5118,6 @@ bnx_tx_encap(struct bnx_softc *sc, struc
 #endif
 	uint32_t		addr, prod_bseq;
 	int			i, error;
-	static struct work	bnx_wk; /* Dummy work. Statically allocated. */
 	bool			remap = true;
 
 	mutex_enter(&sc->tx_pkt_mtx);
@@ -5131,7 +5130,7 @@ bnx_tx_encap(struct bnx_softc *sc, struc
 
 		if (sc->tx_pkt_count <= TOTAL_TX_BD &&
 		    !ISSET(sc->bnx_flags, BNX_ALLOC_PKTS_FLAG)) {
-			workqueue_enqueue(sc->bnx_wq, &bnx_wk, NULL);
+			workqueue_enqueue(sc->bnx_wq, &sc->bnx_wk, NULL);
 			SET(sc->bnx_flags, BNX_ALLOC_PKTS_FLAG);
 		}
 

Index: src/sys/dev/pci/if_bnxvar.h
diff -u src/sys/dev/pci/if_bnxvar.h:1.13 src/sys/dev/pci/if_bnxvar.h:1.14
--- src/sys/dev/pci/if_bnxvar.h:1.13	Sun Jul 12 19:05:32 2020
+++ src/sys/dev/pci/if_bnxvar.h	Tue Jul 14 15:37:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bnxvar.h,v 1.13 2020/07/12 19:05:32 jdolecek Exp $	*/
+/*	$NetBSD: if_bnxvar.h,v 1.14 2020/07/14 15:37:40 jdolecek Exp $	*/
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -129,6 +129,7 @@ struct bnx_softc
 
 	/* packet allocation workqueue */
 	struct workqueue	*bnx_wq;
+	struct work		bnx_wk;
 
 	/* ASIC Chip ID. */
 	uint32_t		bnx_chipid;

Reply via email to