linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: <Steen.Hegelund@microchip.com>
To: <kuba@kernel.org>
Cc: <andrew@lunn.ch>, <masahiroy@kernel.org>,
	<Bjarni.Jonasson@microchip.com>,  <davem@davemloft.net>,
	<linux-kernel@vger.kernel.org>, <UNGLinuxDriver@microchip.com>,
	<alexandre.belloni@bootlin.com>, <linux@armlinux.org.uk>,
	<Lars.Povlsen@microchip.com>, <arnd@arndb.de>,
	<p.zabel@pengutronix.de>, <simon.horman@netronome.com>,
	<linux-arm-kernel@lists.infradead.org>, <netdev@vger.kernel.org>,
	<mark.einon@gmail.com>, <madalin.bucur@oss.nxp.com>
Subject: Re: [PATCH net-next 03/10] net: sparx5: add hostmode with phylink support
Date: Tue, 20 Apr 2021 12:54:14 +0000	[thread overview]
Message-ID: <e443bf58c73cb382ea5f84eda9da1ea00ebf44c0.camel@microchip.com> (raw)
In-Reply-To: <20210416142244.244656a8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

Hi Jacub,


On Fri, 2021-04-16 at 14:22 -0700, Jakub Kicinski wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Fri, 16 Apr 2021 15:16:50 +0200 Steen Hegelund wrote:
> > +static int sparx5_set_mac_address(struct net_device *dev, void *p)
> > +{
> > +     const struct sockaddr *addr = p;
> > +
> > +     /* Record the address */
> > +     ether_addr_copy(dev->dev_addr, addr->sa_data);
> 
> I think you need to validate that add is a valid ethernet address.
> is_valid_ether_addr()

I will add validation.

> 
> > +struct net_device *sparx5_create_netdev(struct sparx5 *sparx5, u32 portno)
> > +{
> > +     struct sparx5_port *spx5_port;
> > +     struct net_device *ndev;
> > +     u64 val;
> > +
> > +     ndev = devm_alloc_etherdev(sparx5->dev, sizeof(struct sparx5_port));
> > +     if (!ndev)
> > +             return ERR_PTR(-ENOMEM);
> > +
> > +     SET_NETDEV_DEV(ndev, sparx5->dev);
> > +     spx5_port = netdev_priv(ndev);
> > +     spx5_port->ndev = ndev;
> > +     spx5_port->sparx5 = sparx5;
> > +     spx5_port->portno = portno;
> > +     sparx5_set_port_ifh(spx5_port->ifh, portno);
> > +     snprintf(ndev->name, IFNAMSIZ, "eth%d", portno);
> 
> Please don't try to name interfaces in the kernel.

OK.  I will remove that.

Thanks for your comments.

BR
Steen

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-04-20 12:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 13:16 [PATCH net-next 00/10] Adding the Sparx5 Switch Driver Steen Hegelund
2021-04-16 13:16 ` [PATCH net-next 01/10] dt-bindings: net: sparx5: Add sparx5-switch bindings Steen Hegelund
2021-04-21 22:44   ` Rob Herring
2021-04-16 13:16 ` [PATCH net-next 03/10] net: sparx5: add hostmode with phylink support Steen Hegelund
2021-04-16 21:22   ` Jakub Kicinski
2021-04-20 12:54     ` Steen.Hegelund [this message]
2021-04-16 13:16 ` [PATCH net-next 04/10] net: sparx5: add port module support Steen Hegelund
2021-04-16 13:16 ` [PATCH net-next 05/10] net: sparx5: add mactable support Steen Hegelund
2021-04-16 13:16 ` [PATCH net-next 06/10] net: sparx5: add vlan support Steen Hegelund
2021-04-16 13:16 ` [PATCH net-next 07/10] net: sparx5: add switching support Steen Hegelund
2021-04-16 13:16 ` [PATCH net-next 08/10] net: sparx5: add calendar bandwidth allocation support Steen Hegelund
2021-04-16 13:16 ` [PATCH net-next 09/10] net: sparx5: add ethtool configuration and statistics support Steen Hegelund
2021-04-16 21:26   ` Jakub Kicinski
2021-04-20 12:54     ` Steen.Hegelund
2021-04-16 13:16 ` [PATCH net-next 10/10] arm64: dts: sparx5: Add the Sparx5 switch node Steen Hegelund

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=e443bf58c73cb382ea5f84eda9da1ea00ebf44c0.camel@microchip.com \
    --to=steen.hegelund@microchip.com \
    --cc=Bjarni.Jonasson@microchip.com \
    --cc=Lars.Povlsen@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=madalin.bucur@oss.nxp.com \
    --cc=mark.einon@gmail.com \
    --cc=masahiroy@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=simon.horman@netronome.com \
    /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).