Received: by 2002:a05:6520:2586:b029:fa:41f3:c225 with SMTP id u6csp4277093lky; Tue, 15 Jun 2021 18:37:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1Mvx3d6jbqXUeg9XhNLyExvRrL/xsVBeozOA5gUm8oZ1bgHXrummZRGamhjLpTA0MEtSX X-Received: by 2002:a17:906:b03:: with SMTP id u3mr2409583ejg.95.1623807432254; Tue, 15 Jun 2021 18:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623807432; cv=none; d=google.com; s=arc-20160816; b=PSPYzmZK0EB5xL3hayJG3+nJcLKhsH5bUwN8+nTHceXkN8Cz70xH9R452fsCrWwg1/ U7C35MtHKB+kcyxQAbAIGTnO7yokyM3UeivyJUiPQ97ttRktHKEW/DBCRqp782TJeohv taBvC5wIx0++uloZs9HQpcqk+eEX1jrIpMayLprRNTMRMCB7doqAaG3/yILuEnDAoKuT HRj5vXYsknsfR3aeD5PxMYR/a1po2euLngWu969T7PXeBPKo2fLee1q6xwSUnVQLutd6 9861PFFsXtxirL4UV+EWU2Ho2tBQ9hRIgyEB/H0DxxJw/LYzuDO4IMhUjRvnGR+gU7Jc JSlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=7bNjmIPFclZ2FCgec9xd3eJMIjtOz4tBaEzOZZ1tjmI=; b=tuunbvBj/1CFHbLfDbg6lI43Sa26ackB8Rsoa2L47wjivL7qvOP6dC8/RCWbO26bwh t2FQLe8hLICs8+BC+uEggyAnsL3u4Q1pERbULX0/Dzj/+hV0YzAzyZmcyUh840ml6PcI QY4VdMFPNwv8tuwyuSt1gUSC7MqAvEYS2P2qbNxRtBZOkevaKThQq23yLBZB6JArBnqt dOaJoQPQ+mvMLFmuYB/hCtiXVHBL2DvLPa3YcWcwkXqJuF/u+u2AbvmOpS0OUFXdzejY XNHgr/1EtzJ02O24CqDqAcck8jszhPHVhHgAKsGuRW2BtJ7h96dRw1atozUtoOlb9PY4 pp4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CQQ7Zg8W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si817442eje.551.2021.06.15.18.36.49; Tue, 15 Jun 2021 18:37:12 -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=@linaro.org header.s=google header.b=CQQ7Zg8W; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231254AbhFPBiB (ORCPT + 99 others); Tue, 15 Jun 2021 21:38:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230371AbhFPBiA (ORCPT ); Tue, 15 Jun 2021 21:38:00 -0400 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C5AFC061574 for ; Tue, 15 Jun 2021 18:35:55 -0700 (PDT) Received: by mail-io1-xd36.google.com with SMTP id f10so1277061iok.6 for ; Tue, 15 Jun 2021 18:35:55 -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=7bNjmIPFclZ2FCgec9xd3eJMIjtOz4tBaEzOZZ1tjmI=; b=CQQ7Zg8WS61afNkLnw/NYffYdJhxZ5WM39Sr6PmBhIQH/e67aVU718IDjV5WtVGxiH tHa2UYN386lxPOKDL9x5dVlWi4EEhXCBHC4rOH5vQA7SwaF/YEsr3S9ia+j8o7LlHH1m GVRcUFBtyomUaEDYRm4jWSdxYMkPWo8T3/o4seWwg0BgXjLEmMYdJQB7whHuXPNbtX0U cTRCgr72Hm0vyIu8aiiEJsJ4KJb8yBKU4B+ai3FHX1zdUPNUEEu5mgkSX+M5L1qIdScg M8RrEYPjBHtf/e0cJ8L4jIMmRiqFkwnzN7/lc+F3ADJbS8pMcrBPVolQXJhZt5XRVpCe boFg== 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=7bNjmIPFclZ2FCgec9xd3eJMIjtOz4tBaEzOZZ1tjmI=; b=Eyq3gCjjJ6OG3DIqQKYgjiVesweH++tln56IqIeOVBbJSjF3pqAzLTOw0A2MrPfkkK 3RXZIe32MN5eBteNdcl2sW9IaAhOPjCxQCcyTg9nnby1fwBPYJ0MgXHk+VYgrd4HevAi sn6t1aHEnLQnwiEmLkh2lGY+PrCWeQMIfPMfNXy9ww3Sb++X6ftBa7Hr7UW0xlffks0H sebW8iTvKMkT7/+uJx6YJDuWV0jG4A1FeldLxZuCpRMk8r5rdkP+eTLlUzGHgNWAW1qh UVh3uewZwKThhG9sGzobnwrZPWVYqBdRHwcwb6l3JnMRLuzvhWPBBv/sa417RotSZzVC g2PA== X-Gm-Message-State: AOAM533DKDlzi5tDUXtnJO9qhxVMvGtVaQQ+eoYCCsFRU7pkmgpvG6k+ dWCWl4U9ZvAgiRWpRLjowrO8lsck+ECENyct X-Received: by 2002:a5d:904c:: with SMTP id v12mr1565434ioq.95.1623807354648; Tue, 15 Jun 2021 18:35:54 -0700 (PDT) Received: from [172.22.22.26] (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.googlemail.com with ESMTPSA id d12sm402073ilr.38.2021.06.15.18.35.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Jun 2021 18:35:54 -0700 (PDT) Subject: Re: [PATCH net-next v2] 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 References: <20210615232707.835258-1-bjorn.andersson@linaro.org> From: Alex Elder Message-ID: <37f0f6f3-3a11-304f-4030-445e2bc578e6@linaro.org> Date: Tue, 15 Jun 2021 20:35:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210615232707.835258-1-bjorn.andersson@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/15/21 6:27 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. > > Signed-off-by: Bjorn Andersson KS was right, we want the same behavior in both newlink and changelink, but aside from that, I like this a lot. It looks good to me. Reviewed-by: Alex Elder > --- > > 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; >