bnxt_en: Improve preset max value for ethtool -l.
authorMichael Chan <michael.chan@broadcom.com>
Sun, 27 Sep 2020 17:42:20 +0000 (13:42 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Sep 2020 20:35:46 +0000 (13:35 -0700)
commit4301304b04cc79f7b79bc982469fce16397f949f
tree06741e7dbe89e8a080c4831342221d7b962e67b3
parentccd6a9dcab79dc98d8d93d5aa3f68d71494f93fe
bnxt_en: Improve preset max value for ethtool -l.

The current logic that calculates the preset maximum value for combined
channel does not take into account the rings used for XDP and mqprio
TCs.  Each of these features will reduce the number of TX rings.  Add
the logic to divide the TX rings accordingly based on whether the
device is currently in XDP mode and whether TCs are in use.

Reviewed-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_ethtool.c