ethtool: rss: prevent rss ctx deletion when in use
authorDaniel Zahka <daniel.zahka@gmail.com>
Fri, 11 Oct 2024 18:35:47 +0000 (11:35 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 17 Oct 2024 08:22:01 +0000 (10:22 +0200)
commit42dc431f5d0ea9e9c9caf74dcb5b290ce4dd80b4
tree34a6aaaaae7d7d6369c0987746af26a65d538b1a
parent5cb409b3960e75467cbb0a8e1e5596b4490570e3
ethtool: rss: prevent rss ctx deletion when in use

ntuple filters can specify an rss context to use for packet hashing
and queue selection. When a filter is referencing an rss context, it
should be invalid for that context to be deleted. A list of active
ntuple filters and their associated rss contexts can be compiled by
querying a device's ethtool_ops.get_rxnfc. This patch checks to see if
any ntuple filters are referencing an rss context during context
deletion, and prevents the deletion if the requested context is still
in use.

Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ethtool/common.c
net/ethtool/common.h
net/ethtool/ioctl.c