netdevsim: don't overwrite read only ethtool parms
authorFilip Pokryvka <fpokryvk@redhat.com>
Fri, 10 Dec 2021 17:50:32 +0000 (18:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:32:40 +0000 (09:32 +0100)
commit4cd2d21bbe580fb7539a87c574671e4196d82353
treec47b18d5e150d08d627d1fd47f004568372f99ad
parente5d28205bf1de7082d904ed277ceb2db2879e302
netdevsim: don't overwrite read only ethtool parms

[ Upstream commit ee60e626d536da4c710b3634afe68fe7c6d69b59 ]

Ethtool ring feature has _max_pending attributes read-only.
Set only read-write attributes in nsim_set_ringparam.

This patch is useful, if netdevsim device is set-up using NetworkManager,
because NetworkManager sends 0 as MAX values, as it is pointless to
retrieve them in extra call, because they should be read-only. Then,
the device is left in incosistent state (value > MAX).

Fixes: a7fc6db099b5 ("netdevsim: support ethtool ring and coalesce settings")
Signed-off-by: Filip Pokryvka <fpokryvk@redhat.com>
Link: https://lore.kernel.org/r/20211210175032.411872-1-fpokryvk@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/netdevsim/ethtool.c