[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <331e15f7-a27f-4229-8aac-16ebea952969@lunn.ch>
Date: Tue, 20 Jun 2023 21:21:37 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Mengyuan Lou <mengyuanlou@...-swift.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net: ngbe: add Wake on Lan support
> +static void ngbe_get_wol(struct net_device *netdev,
> + struct ethtool_wolinfo *wol)
> +{
> + struct wx *wx = netdev_priv(netdev);
> +
> + if (!wx->wol_enabled)
> + return;
> + wol->supported = WAKE_MAGIC;
What exactly does wol_enabled mean?
You should always return what is supported. Which makes me think
wol_enabled is more like,
wol_is_supported_by_this_version_of_firmware?
If it is this, please give it a better name than wol_enabled.
> +static int ngbe_resume(struct pci_dev *pdev)
> +{
> + struct net_device *netdev;
> + struct wx *wx;
> + u32 err;
> +
> + wx = pci_get_drvdata(pdev);
> + netdev = wx->netdev;
> +
> + err = pci_enable_device_mem(pdev);
> + if (err) {
> + wx_err(wx, "Cannot enable PCI device from suspend\n");
> + return err;
> + }
> + /* make sure to complete pre-operations */
> + smp_mb__before_atomic();
I've no idea what this actually does, but it seems to be used a lot in
pairs with smp_mb__after_atomic(). Is it actually valid to use it on
its own, not in a pair?
Andrew
Powered by blists - more mailing lists