OSDN Git Service

ethtool: fix the check logic of at least one channel for RX/TX
authorYinjun Zhang <yinjun.zhang@corigine.com>
Thu, 25 Feb 2021 12:51:02 +0000 (13:51 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sun, 28 Feb 2021 19:49:07 +0000 (11:49 -0800)
commita4fc088ad4ff4a99d01978aa41065132b574b4b2
treed81ea405c161b3812696a62e69f6bce5a93781ff
parenteee7ede695cfbb19fefdeb14992535b605448f35
ethtool: fix the check logic of at least one channel for RX/TX

The command "ethtool -L <intf> combined 0" may clean the RX/TX channel
count and skip the error path, since the attrs
tb[ETHTOOL_A_CHANNELS_RX_COUNT] and tb[ETHTOOL_A_CHANNELS_TX_COUNT]
are NULL in this case when recent ethtool is used.

Tested using ethtool v5.10.

Fixes: 7be92514b99c ("ethtool: check if there is at least one channel for TX/RX in the core")
Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Louis Peens <louis.peens@netronome.com>
Link: https://lore.kernel.org/r/20210225125102.23989-1-simon.horman@netronome.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/channels.c