netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: qualcomm: rmnet: Allow partial updates of IFLA_FLAGS
@ 2021-04-22 18:20 Bjorn Andersson
  2021-04-22 18:29 ` Alex Elder
  0 siblings, 1 reply; 6+ messages in thread
From: Bjorn Andersson @ 2021-04-22 18:20 UTC (permalink / raw)
  To: Subash Abhinov Kasiviswanathan, Sean Tranchetti, David S. Miller,
	Jakub Kicinski
  Cc: netdev, linux-kernel, Daniele Palmas, Alex Elder,
	Aleksander Morgado, Loic Poulain

The idiomatic way to handle the changelink flags/mask pair seems to be
allow partial updates of the driver's link flags. In contrast the rmnet
driver masks the incoming flags and then use that as the new flags.

Change the rmnet driver to follow the common scheme, before the
introduction of IFLA_RMNET_FLAGS handling in iproute2 et al.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
index 8d51b0cb545c..2c8db2fcc53d 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
@@ -336,7 +336,8 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
 
 		old_data_format = port->data_format;
 		flags = nla_data(data[IFLA_RMNET_FLAGS]);
-		port->data_format = flags->flags & flags->mask;
+		port->data_format &= ~flags->mask;
+		port->data_format |= flags->flags & flags->mask;
 
 		if (rmnet_vnd_update_dev_mtu(port, real_dev)) {
 			port->data_format = old_data_format;
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-23  4:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-22 18:20 [PATCH] net: qualcomm: rmnet: Allow partial updates of IFLA_FLAGS Bjorn Andersson
2021-04-22 18:29 ` Alex Elder
2021-04-22 23:28   ` subashab
2021-04-23  1:01     ` Alex Elder
2021-04-23  2:30     ` Bjorn Andersson
2021-04-23  4:04       ` subashab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).