]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnxt_en: Fix ethtool -l|-L inconsistent channel counts.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 19 Sep 2016 07:58:04 +0000 (03:58 -0400)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 18:07:39 +0000 (13:07 -0500)
commitcfe776c3ecd2e600e3bf093bebd7993300e5b216
treee3525b161b06af77dcab93ed507a2eab94bb6b23
parentd441f9b99c46fa3cb5c0f4f77843642db3f973b6
bnxt_en: Fix ethtool -l|-L inconsistent channel counts.

Orabug: 24567991

The existing code is inconsistent in reporting and accepting the combined
channel count.  bnxt_get_channels() reports maximum combined as the
maximum rx count.  bnxt_set_channels() accepts combined count that
cannot be bigger than max rx or max tx.

For example, if max rx = 2 and max tx = 1, we report max supported
combined to be 2.  But if the user tries to set combined to 2, it will
fail because 2 is bigger than max tx which is 1.

Fix the code to be consistent.  Max allowed combined = max(max_rx, max_tx).
We will accept a combined channel count <= max(max_rx, max_tx).

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 47f8e8b9bbbbe00740786bd1da0d5097d45ba46b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c