From: Alex Elder <elder@linaro.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>,
Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>,
Sean Tranchetti <stranche@codeaurora.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Daniele Palmas <dnlplm@gmail.com>,
Aleksander Morgado <aleksander@aleksander.es>,
Loic Poulain <loic.poulain@linaro.org>
Subject: Re: [PATCH] net: qualcomm: rmnet: Allow partial updates of IFLA_FLAGS
Date: Thu, 22 Apr 2021 13:29:20 -0500 [thread overview]
Message-ID: <76db0c51-15be-2d27-00a7-c9f8dc234816@linaro.org> (raw)
In-Reply-To: <20210422182045.1040966-1-bjorn.andersson@linaro.org>
On 4/22/21 1:20 PM, Bjorn Andersson wrote:
> 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.
I like this a lot. It should have been implemented this way
to begin with; there's not much point to have the mask if
it's only applied to the passed-in value.
KS, are you aware of *any* existing user space code that
would not work correctly if this were accepted?
I.e., the way it was (is), the value passed in *assigns*
the data format flags. But with Bjorn's changes, the
data format flags would be *updated* (i.e., any bits not
set in the mask field would remain with their previous
value).
Reviewed-by: Alex Elder <elder@linaro.org>
> 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;
>
next prev parent reply other threads:[~2021-04-22 18:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-22 18:20 [PATCH] net: qualcomm: rmnet: Allow partial updates of IFLA_FLAGS Bjorn Andersson
2021-04-22 18:29 ` Alex Elder [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=76db0c51-15be-2d27-00a7-c9f8dc234816@linaro.org \
--to=elder@linaro.org \
--cc=aleksander@aleksander.es \
--cc=bjorn.andersson@linaro.org \
--cc=davem@davemloft.net \
--cc=dnlplm@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=stranche@codeaurora.org \
--cc=subashab@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).