bnxt_en: Centralize logic to reserve rings.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 6 Feb 2017 21:55:38 +0000 (16:55 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Feb 2017 18:30:59 +0000 (13:30 -0500)
commitd1e7925e6d80ce5f9ef6deb8f3cec7526f5c443c
tree364ded8b82fe7ac857effce22d862f237948ffe5
parent4e5dbbda4c40a239e2ed4bbc98f2aa320e4dcca2
bnxt_en: Centralize logic to reserve rings.

Currently, bnxt_setup_tc() and bnxt_set_channels() have similar and
duplicated code to check and reserve rx and tx rings.  Add a new
function bnxt_reserve_rings() to centralize the logic.  This will
make it easier to add XDP_TX support which requires allocating a
new set of TX rings.

Also, the tx ring checking logic in bnxt_setup_msix() can be removed.
The rings have been reserved before hand.

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
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c