ethtool: Fail number of channels change when it conflicts with rxnfc
authorGal Pressman <gal@nvidia.com>
Sun, 6 Nov 2022 12:31:27 +0000 (14:31 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 8 Nov 2022 11:08:44 +0000 (12:08 +0100)
commit47f3ecf4763d3fea37d3453c9ee1f9f2169d71b3
tree90403e03187c2518d8543ab37fe045d74109aee4
parent9a0f830f80265bd1ef816e1541ac24bee80e9a3c
ethtool: Fail number of channels change when it conflicts with rxnfc

Similar to what we do with the hash indirection table [1], when network
flow classification rules are forwarding traffic to channels greater
than the requested number of channels, fail the operation.
Without this, traffic could be directed to channels which no longer
exist (dropped) after changing number of channels.

[1] commit d4ab4286276f ("ethtool: correctly ensure {GS}CHANNELS doesn't conflict with GS{RXFH}")

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Link: https://lore.kernel.org/r/20221106123127.522985-1-gal@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ethtool/channels.c
net/ethtool/common.c
net/ethtool/common.h
net/ethtool/ioctl.c