Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp184092pxj; Tue, 15 Jun 2021 23:28:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxo+XTtWnVPOWilzSjCuGtKWP5LfOJjI5MelL5cWfJEVx+hcTiGDz86QzzBSWaRNRa6nuve X-Received: by 2002:a17:906:fa04:: with SMTP id lo4mr3728196ejb.162.1623824929884; Tue, 15 Jun 2021 23:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623824929; cv=none; d=google.com; s=arc-20160816; b=KSP+PxXH6mHsHgFOYlElc03OR3l/eaS1IOBrZ0fomz4Kj5lRZQoszskgP6vAgSMACp nd2qTffiD7G8GN7qty1fwdS5va+KT8CTMmBOWLdDJ7xwDHVrTEWH+d3WxL+w3jblKj18 eX7goillcPhmKMbdSu6eUhbMVHTCc2+SvVYHREC+EeKyFyte6dNfa+n9cmV1N8T6scGS kpVRlEHqSmEZh3L73AeP/INxDBqc3Yc3wbidNbvVKo3UsMs5kwzG5bANDOYBIhgf2OVR lpbIulcd3YejBpQa1AhCAnCE8AV16T/pEyuFV/nUSq4PCTJoKQzY63XoGlMuyCDodZel H5eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=tfQcGeVIJlbVK4n5GuCdAaFYDeWtfPMofUGELoT/fCA=; b=H5m5cIRflIBtdxMC5N3ISpTHWQOLiLMyfyaZ1UgiyeCe8ZDhU5/a7ag4PJvXEqlBk1 CjVq91XQn/zxFGNP7sPkHjYg7vJAatuuQwqkhzzUNzvEASdRWL2/r34fjwpDBNaZxKbe nTVQyTSMrfEAzHCmnVFZ3XbGsOetkUkL23qA2Kix7T/rV/kXm2Wg0ePjE24S7WgC+Zgk 5RXIGysgVzJqDCf++t2p2Jmo/1BQsDJ8mXUsyqPhChgRThe+1LesKzz6l4OKRSrf35vN HA5QPFY8p6issTIJzOoKzj+fAxT90gAZkbXeaRSQ9nb5NiQ2KeQ1SG7MZponeINPCdhJ Yl6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=GIZMPifI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lg21si1525955ejb.482.2021.06.15.23.28.27; Tue, 15 Jun 2021 23:28:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=GIZMPifI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231530AbhFPG3b (ORCPT + 99 others); Wed, 16 Jun 2021 02:29:31 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:15993 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231466AbhFPG3a (ORCPT ); Wed, 16 Jun 2021 02:29:30 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1623824844; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=tfQcGeVIJlbVK4n5GuCdAaFYDeWtfPMofUGELoT/fCA=; b=GIZMPifIRbDrq9WaJxRgrRlxVGWKATjFxrasyrSaud00mLidwKzU7H1+Aw6R6JTGApFezbsB QyRuw1fL4Yl6FzGP5aX3ZP8ixmQSpZN84tTHS6iXciZ9FPG2T2uz0FDhA7UDD+HI3qHhyNGx g5i6g/FYq/LunnIZsycxYL20hb4= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-west-2.postgun.com with SMTP id 60c999b9ed59bf69ccbeff7c (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 16 Jun 2021 06:27:05 GMT Sender: subashab=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2B986C43460; Wed, 16 Jun 2021 06:27:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: subashab) by smtp.codeaurora.org (Postfix) with ESMTPSA id 635DFC433D3; Wed, 16 Jun 2021 06:27:04 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 16 Jun 2021 00:27:04 -0600 From: subashab@codeaurora.org To: Bjorn Andersson Cc: Sean Tranchetti , "David S. Miller" , Jakub Kicinski , Alex Elder , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2] net: qualcomm: rmnet: Allow partial updates of IFLA_FLAGS In-Reply-To: <20210615232707.835258-1-bjorn.andersson@linaro.org> References: <20210615232707.835258-1-bjorn.andersson@linaro.org> Message-ID: X-Sender: subashab@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-06-15 17:27, 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. > > Signed-off-by: Bjorn Andersson > --- > > Changes since v1: > - Also do the masking dance on newlink, per Subash request > - Add "net-next" to subject prefix > > drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > index 8d51b0cb545c..27b1663c476e 100644 > --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > @@ -163,7 +163,8 @@ static int rmnet_newlink(struct net *src_net, > struct net_device *dev, > struct ifla_rmnet_flags *flags; > > flags = nla_data(data[IFLA_RMNET_FLAGS]); > - data_format = flags->flags & flags->mask; > + data_format &= ~flags->mask; > + data_format |= flags->flags & flags->mask; > } > > netdev_dbg(dev, "data format [0x%08X]\n", data_format); > @@ -336,7 +337,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; Reviewed-by: Subash Abhinov Kasiviswanathan