]> git.baikalelectronics.ru Git - kernel.git/commitdiff
bnxt_en: Reset rings if ring reservation fails during open()
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Sun, 22 Mar 2020 20:40:05 +0000 (16:40 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2020 04:42:48 +0000 (21:42 -0700)
If ring counts are not reset when ring reservation fails,
bnxt_init_dflt_ring_mode() will not be called again to reinitialise
IRQs when open() is called and results in system crash as napi will
also be not initialised. This patch fixes it by resetting the ring
counts.

Fixes: 370b587f979a ("bnxt_en: Reserve rings at driver open if none was reserved at probe time.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 95f4c02aa7e183510a820b7573bd68b6e3b6a32f..d28b406a26b183cb160c4ec677bc2cca640d3cfa 100644 (file)
@@ -11677,6 +11677,10 @@ static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh)
                bp->rx_nr_rings++;
                bp->cp_nr_rings++;
        }
+       if (rc) {
+               bp->tx_nr_rings = 0;
+               bp->rx_nr_rings = 0;
+       }
        return rc;
 }