]> git.baikalelectronics.ru Git - kernel.git/commit
rtnetlink: verify rate parameters for calls to ndo_set_vf_rate
authorBin Chen <bin.chen@corigine.com>
Wed, 11 May 2022 11:39:31 +0000 (13:39 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 12 May 2022 11:03:08 +0000 (13:03 +0200)
commited62f85ec48df9e4df780bc873a63858f77de298
treebb80fe7970e1fece0b6e97f978caebbc3e9a3d15
parent5f627b587abae0b8ab32ad1b2cdfee55344ae0ad
rtnetlink: verify rate parameters for calls to ndo_set_vf_rate

When calling ndo_set_vf_rate() the max_tx_rate parameter may be zero,
in which case the setting is cleared, or it must be greater or equal to
min_tx_rate.

Enforce this requirement on all calls to ndo_set_vf_rate via a wrapper
which also only calls ndo_set_vf_rate() if defined by the driver.

Based on work by Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Bin Chen <bin.chen@corigine.com>
Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/core/rtnetlink.c