提交 702c221c 编写于 作者: M Michael Chan 提交者: David S. Miller

bnxt_en: Pass in sh parameter to bnxt_set_dflt_rings().

In the existing code, the local variable sh is hardcoded to true to
calculate default rings for shared ring configuration.  It is better
to have the caller determine the value of sh.
Reported-by: NGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4d172f21
...@@ -7567,10 +7567,9 @@ static int bnxt_get_dflt_rings(struct bnxt *bp, int *max_rx, int *max_tx, ...@@ -7567,10 +7567,9 @@ static int bnxt_get_dflt_rings(struct bnxt *bp, int *max_rx, int *max_tx,
return rc; return rc;
} }
static int bnxt_set_dflt_rings(struct bnxt *bp) static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh)
{ {
int dflt_rings, max_rx_rings, max_tx_rings, rc; int dflt_rings, max_rx_rings, max_tx_rings, rc;
bool sh = true;
if (sh) if (sh)
bp->flags |= BNXT_FLAG_SHARED_RINGS; bp->flags |= BNXT_FLAG_SHARED_RINGS;
...@@ -7749,7 +7748,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -7749,7 +7748,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
bnxt_set_tpa_flags(bp); bnxt_set_tpa_flags(bp);
bnxt_set_ring_params(bp); bnxt_set_ring_params(bp);
bnxt_set_max_func_irqs(bp, max_irqs); bnxt_set_max_func_irqs(bp, max_irqs);
rc = bnxt_set_dflt_rings(bp); rc = bnxt_set_dflt_rings(bp, true);
if (rc) { if (rc) {
netdev_err(bp->dev, "Not enough rings available.\n"); netdev_err(bp->dev, "Not enough rings available.\n");
rc = -ENOMEM; rc = -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册