From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CBBFC433B4 for ; Thu, 22 Apr 2021 18:29:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E1000613B7 for ; Thu, 22 Apr 2021 18:29:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238463AbhDVS37 (ORCPT ); Thu, 22 Apr 2021 14:29:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238699AbhDVS35 (ORCPT ); Thu, 22 Apr 2021 14:29:57 -0400 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FA64C06174A for ; Thu, 22 Apr 2021 11:29:22 -0700 (PDT) Received: by mail-il1-x12d.google.com with SMTP id l19so34805637ilk.13 for ; Thu, 22 Apr 2021 11:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IbyceF9eui++TAtaSZCeZk5izUprZMiF7QKSv4IUobA=; b=wFbJIb87LPilAH04qOvCl1m//akK+exnwlHVZTVvemwMBA6BxEytxRdZvZuT1Vut8Y /hlyWUZEQwaZ8dv6gZ6Nm3zJUeuqxhs6csXnOwf1mp7ZrLo3ZVvmPWEQ/aVX1NIbafj7 lrTqpo83oxozY6x1fEVyGMdK32GgDkBCEx1yFzxxrmC8TIXAf5PqlHfhs9TP9vSXWZPB CvvW+rBpDSZN/T4YYy8zg2+RzffPIu/2hz0FvVHV8Onqti5uLSDPKoyDiZX/mJUv9S+L LiZNoFpulV9KdU+8Bv0hQ0r+4FiYgwtHhuez87M+pLnZHO99w5BwQiU/Tdsm6lx8ih71 e18w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IbyceF9eui++TAtaSZCeZk5izUprZMiF7QKSv4IUobA=; b=N62cfmqIP0+usVGdMucIHU90lsKyjQdtuph4yERnBQiMqTs+zN1TW5PBmpNK6Xb4Bx Iz1IfAbpEpDnZNbhGQ+YhGZ4eNOcggSUCKWiNaaQP4J9fjbRNHHAGPwCntTbrJIM7OcN ouoEJyciVFmBr1Ho/XYM22+QM7P3Bby94qMMDhRYFtISsYI/FRKh9cbnVf/+qVIb9//P JrDkSDtKx/g4OM6rpYkjJ9HZ7gM2TB4Ol3FA6LPczcQi3gUbaJolyeGDXIN4S6+0XAzx 0ZMnII/9YugvxQrfHWDI5NIlrkssuiORuxZz9bUfZX+WIwv0Aco62XIttP/xgzfvM/X/ ll8A== X-Gm-Message-State: AOAM531L8CA/iGxLLLp05YVOrxwAhbx+/JQlaNJ5fzjL/w/4MVoT40bT Xzdl8dLKlu6tMr1zWMCIMPSkxbIzRHTvfA== X-Google-Smtp-Source: ABdhPJyY9eJZp9VAetK5Q0+RdfAXkpq38nHagsnhZeEz9s729SPJ5vt8aH5CMSfLEBwViFdbG+qADA== X-Received: by 2002:a05:6e02:168f:: with SMTP id f15mr4222568ila.264.1619116161690; Thu, 22 Apr 2021 11:29:21 -0700 (PDT) Received: from [172.22.22.4] (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.googlemail.com with ESMTPSA id u9sm1422138ilg.69.2021.04.22.11.29.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Apr 2021 11:29:21 -0700 (PDT) Subject: Re: [PATCH] net: qualcomm: rmnet: Allow partial updates of IFLA_FLAGS To: Bjorn Andersson , Subash Abhinov Kasiviswanathan , Sean Tranchetti , "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Daniele Palmas , Aleksander Morgado , Loic Poulain References: <20210422182045.1040966-1-bjorn.andersson@linaro.org> From: Alex Elder Message-ID: <76db0c51-15be-2d27-00a7-c9f8dc234816@linaro.org> Date: Thu, 22 Apr 2021 13:29:20 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210422182045.1040966-1-bjorn.andersson@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > Signed-off-by: Bjorn Andersson > --- > 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; >