Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp398390pxb; Wed, 3 Nov 2021 06:09:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1e1nQuLJhVD1YKE4Z9/RzE9y2HeAPu2q8pSXFRj2jzTLNco5u2B8Woqe4Ja1dS8xsiSZD X-Received: by 2002:a05:6638:358e:: with SMTP id v14mr14196240jal.95.1635944953297; Wed, 03 Nov 2021 06:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635944953; cv=none; d=google.com; s=arc-20160816; b=loHUHaA4TVzImzYJAR+FJkW1RjJPhqw4AShnKxgFLVWIVQ/36skE9D2EPNqISovSjS 6Sd3swC/GRIOm99PTUXAjQFWm7mZu71nqCJRskMBSnQoGhygg/5UKMyg0WTefuj279bD DZ60VM9AP/HHhRBiRl3Is+HeIg6iJHt6SHODD4bb9ILVTyC7ny9Epuv/8JjomBFO8Pjj zZne3m2VzStcIxfl/8Yu8/mylZDN47RSb9naEf6pznsUTdJNrzEr6kwbjW1V0XmNliLg n6vgZ2VZ6v2p68qDPY2U1GCVBypHJDrDNgl5nqoPmpAdVKzyScYUnus0T2x3GLZfXmyM TqUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=D3D97geFAuxa9yUR1rbljM0XL+aDENp5AtCe5zwnFCY=; b=uxCYl1ZeeUwm6+r0sR9MGh7bZjIQcwZ6dG7dfKlqKwvJD+KBMBa4WmLEHu8K5Jak9X gRWHkQrlYAcbnbDZ7xsUXZzn+CERXJQNwdBnkMXv4yMpBFOU9Bs57c1Q7Q/GUAEPCjvS TtckjBHv80pNsbUc+JUXR4eMTvYwaRuhuW6AFZVIaLSs/WYioUHl+6BU/QsEbEu7O8wb pD8r0arITqbp75tynjDhlNd70t6kY0uj9C68buHuhZ6Jp3ZVVvEJw8c/nnbYcyM/2rLb eJ/qGn7P0Rx1xH3oQIIMzq9DMDGpWdtUqybBmo1R2yJpip9IrfIId8nj/RF/qwKisS6a Xu6Q== ARC-Authentication-Results: i=1; mx.google.com; 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 k6si3774176ilu.124.2021.11.03.06.09.00; Wed, 03 Nov 2021 06:09:13 -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; 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 S231178AbhKCNKF convert rfc822-to-8bit (ORCPT + 99 others); Wed, 3 Nov 2021 09:10:05 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:34629 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230282AbhKCNKE (ORCPT ); Wed, 3 Nov 2021 09:10:04 -0400 Received: (Authenticated sender: clement.leger@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 809B01BF203; Wed, 3 Nov 2021 13:07:23 +0000 (UTC) Date: Wed, 3 Nov 2021 14:07:22 +0100 From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= To: Vladimir Oltean Cc: "David S. Miller" , Jakub Kicinski , Rob Herring , Claudiu Manoil , Alexandre Belloni , "UNGLinuxDriver@microchip.com" , Andrew Lunn , "netdev@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Thomas Petazzoni Subject: Re: [PATCH v2 4/6] net: ocelot: add support for ndo_change_mtu Message-ID: <20211103140722.75a729e1@fixe.home> In-Reply-To: <20211103124054.pcgruuipw5cpup6v@skbuf> References: <20211103091943.3878621-1-clement.leger@bootlin.com> <20211103091943.3878621-5-clement.leger@bootlin.com> <20211103124054.pcgruuipw5cpup6v@skbuf> Organization: Bootlin X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le Wed, 3 Nov 2021 12:40:55 +0000, Vladimir Oltean a écrit : > > +static int ocelot_change_mtu(struct net_device *dev, int new_mtu) > > +{ > > + struct ocelot_port_private *priv = netdev_priv(dev); > > + struct ocelot_port *ocelot_port = &priv->port; > > + struct ocelot *ocelot = ocelot_port->ocelot; > > + > > + ocelot_port_set_maxlen(ocelot, priv->chip_port, new_mtu); > > + WRITE_ONCE(dev->mtu, new_mtu); > > The WRITE_ONCE seems absolutely gratuitous to me. I applied what is recommended in netdevice.h for the mtu field of the netdev. (https://elixir.bootlin.com/linux/v5.15/source/include/linux/netdevice.h#L1989) And used in __dev_set_mtu (https://elixir.bootlin.com/linux/v5.15/source/net/core/dev.c#L8849) > > > + > > + return 0; > > +} > > + > > enum ocelot_action_type { > > OCELOT_MACT_LEARN, > > OCELOT_MACT_FORGET, -- Clément Léger, Embedded Linux and Kernel engineer at Bootlin https://bootlin.com