Date: Tue, 18 Jun 2019 22:32:46 +0000 From: Vaishali Kulkarni <vkulkarni@marvell.com> To: "net@FreeBSD.org" <net@FreeBSD.org> Subject: bxe module patch Message-ID: <BYAPR18MB29525851D26920401F0A9932A3EA0@BYAPR18MB2952.namprd18.prod.outlook.com>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hello,
Can you please submit the bxe patch attached? Patch was created using bxe sources from upstream head branch.
Fix for warning " lock order reversal: (sleepable after non-sleepable) seen with bxe driver module.
Name: Vaishali Kulkarni, email vkulkarni@marvell.com
Thanks,
Vaishali
[-- Attachment #2 --]
Only in latestbxe_head2: .svn
diff -uap latestbxe_head2/bxe.c latest_bxe_head_patch/bxe.c
--- latestbxe_head2/bxe.c 2019-06-12 15:25:49.287760000 -0700
+++ latest_bxe_head_patch/bxe.c 2019-06-18 15:10:14.453304000 -0700
@@ -704,6 +704,8 @@ static void bxe_free_fw_stats_mem(str
static int bxe_interrupt_attach(struct bxe_softc *sc);
static void bxe_interrupt_detach(struct bxe_softc *sc);
static void bxe_set_rx_mode(struct bxe_softc *sc);
+static void bxe_set_rx_mode_sch(struct bxe_softc *sc);
+static void bxe_set_rx_mode_task(void *arg, int pending);
static int bxe_init_locked(struct bxe_softc *sc);
static int bxe_stop_locked(struct bxe_softc *sc);
static void bxe_sp_err_timeout_task(void *arg, int pending);
@@ -4507,6 +4509,22 @@ bxe_handle_chip_tq(void *context,
break;
}
}
+static void
+bxe_set_rx_mode_task(void *context, int pending)
+{
+ struct bxe_softc *sc = (struct bxe_softc *)context;
+ BXE_CORE_LOCK(sc);
+ bxe_set_rx_mode(sc);
+ BXE_CORE_UNLOCK(sc);
+}
+static void
+bxe_set_rx_mode_sch(struct bxe_softc *sc)
+{
+ if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) {
+ taskqueue_enqueue(taskqueue_thread, &sc->set_rx_mode);
+ }
+}
+
/*
* Handles any IOCTL calls from the operating system.
@@ -4561,25 +4579,30 @@ bxe_ioctl(if_t ifp,
/* toggle the interface state up or down */
BLOGD(sc, DBG_IOCTL, "Received SIOCSIFFLAGS ioctl\n");
+ if ((if_getflags(ifp) & IFF_UP) &&
+ (if_getdrvflags(ifp) & IFF_DRV_RUNNING)) {
+ bxe_set_rx_mode_sch(sc);
+ }
+
+
BXE_CORE_LOCK(sc);
/* check if the interface is up */
if (if_getflags(ifp) & IFF_UP) {
- if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
- /* set the receive mode flags */
- bxe_set_rx_mode(sc);
- } else if(sc->state != BXE_STATE_DISABLED) {
- bxe_init_locked(sc);
+ if(((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) &&
+ (sc->state != BXE_STATE_DISABLED)) {
+ bxe_init_locked(sc);
}
} else {
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
- bxe_periodic_stop(sc);
- bxe_stop_locked(sc);
+ bxe_periodic_stop(sc);
+ bxe_stop_locked(sc);
}
}
- BXE_CORE_UNLOCK(sc);
+ BXE_CORE_UNLOCK(sc);
break;
+
case SIOCADDMULTI:
case SIOCDELMULTI:
/* add/delete multicast addresses */
@@ -4588,9 +4611,7 @@ bxe_ioctl(if_t ifp,
/* check if the interface is up */
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
/* set the receive mode flags */
- BXE_CORE_LOCK(sc);
- bxe_set_rx_mode(sc);
- BXE_CORE_UNLOCK(sc);
+ bxe_set_rx_mode_sch(sc);
}
break;
@@ -16357,6 +16378,8 @@ bxe_attach(device_t dev)
TIMEOUT_TASK_INIT(taskqueue_thread,
&sc->sp_err_timeout_task, 0, bxe_sp_err_timeout_task, sc);
+ TASK_INIT(&sc->set_rx_mode, 0, bxe_set_rx_mode_task, sc);
+
/* get device info and set params */
if (bxe_get_device_info(sc) != 0) {
@@ -16535,6 +16558,7 @@ bxe_detach(device_t dev)
sc->chip_tq = NULL;
taskqueue_drain_timeout(taskqueue_thread,
&sc->sp_err_timeout_task);
+ taskqueue_drain(taskqueue_thread,&sc->set_rx_mode);
}
/* stop and reset the controller if it was open */
diff -uap latestbxe_head2/bxe.h latest_bxe_head_patch/bxe.h
--- latestbxe_head2/bxe.h 2019-06-12 15:25:49.288681000 -0700
+++ latest_bxe_head_patch/bxe.h 2019-06-18 14:56:07.133420000 -0700
@@ -654,6 +654,7 @@ struct bxe_fastpath {
struct task tx_task;
struct timeout_task tx_timeout_task;
+ struct task set_rx_mode;
/* ethernet client ID (each fastpath set of RX/TX/CQE is a client) */
uint8_t cl_id;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BYAPR18MB29525851D26920401F0A9932A3EA0>
