From: Ben Hutchings <bhutchings@solarflare.com>
To: Danny Kukawka <danny.kukawka@bisect.de>
Cc: "David S. Miller" <davem@davemloft.net>,
Danny Kukawka <dkukawka@suse.de>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
Jesse Brandeburg <jesse.brandeburg@intel.com>,
Bruce Allan <bruce.w.allan@intel.com>,
Carolyn Wyborny <carolyn.wyborny@intel.com>,
Don Skidmore <donald.c.skidmore@intel.com>,
Greg Rose <gregory.v.rose@intel.com>,
Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>,
Alex Duyck <alexander.h.duyck@intel.com>,
John Ronciak <john.ronciak@intel.com>,
Mitch Williams <mitch.a.williams@intel.com>,
Jiri Pirko <jpirko@redhat.com>,
Eric Dumazet <eric.dumazet@gmail.com>,
<e1000-devel@lists.sourceforge.net>,
Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: [PATCH 2/2] rename dev_hw_addr_random and remove redundant second
Date: Thu, 9 Feb 2012 20:11:30 +0000 [thread overview]
Message-ID: <1328818290.2562.19.camel@bwh-desktop> (raw)
In-Reply-To: <1328816934-11508-3-git-send-email-danny.kukawka@bisect.de>
On Thu, 2012-02-09 at 20:48 +0100, Danny Kukawka wrote:
> Renamed dev_hw_addr_random to eth_hw_addr_random() to reflect that
> this function only assign a random ethernet address (MAC). Removed
> the second parameter (u8 *hwaddr), it's redundant since the also
> given net_device already contains net_device->dev_addr.
> Set it directly.
>
> Adapt igbvf and ixgbevf to the changed function.
[...]
> --- a/drivers/net/ethernet/intel/igbvf/netdev.c
> +++ b/drivers/net/ethernet/intel/igbvf/netdev.c
> @@ -2695,18 +2695,19 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
> dev_info(&pdev->dev,
> "PF still in reset state, assigning new address."
> " Is the PF interface up?\n");
> - dev_hw_addr_random(adapter->netdev, hw->mac.addr);
> + eth_hw_addr_random(netdev);
> + memcpy(adapter->hw.mac.addr, netdev->dev_addr,
> + netdev->addr_len);
> } else {
> err = hw->mac.ops.read_mac_addr(hw);
> if (err) {
> dev_err(&pdev->dev, "Error reading MAC address\n");
> goto err_hw_init;
> }
> + memcpy(netdev->dev_addr, adapter->hw.mac.addr,
> + netdev->addr_len);
> }
>
> - memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
> - memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
> -
> if (!is_valid_ether_addr(netdev->perm_addr)) {
> dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
> netdev->dev_addr);
> @@ -2714,6 +2715,8 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
> goto err_hw_init;
> }
>
> + memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
[...]
I wonder whether VF drivers should claim to have a permanent address at
all, let alone setting the 'permanent' address to a randomly generated
address.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2012-02-09 20:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-09 19:48 [PATCH v2 0/2] Part 1: handle addr_assign_type for random addresses Danny Kukawka
2012-02-09 19:48 ` [PATCH v2 1/2] eth: reset addr_assign_type if eth_mac_addr() called Danny Kukawka
2012-02-13 5:50 ` David Miller
2012-02-09 19:48 ` [PATCH 2/2] rename dev_hw_addr_random and remove redundant second Danny Kukawka
2012-02-09 20:11 ` Ben Hutchings [this message]
2012-02-13 5:50 ` David Miller
2012-02-09 20:09 ` [PATCH v2 0/2] Part 1: handle addr_assign_type for random addresses Jeff Kirsher
2012-07-02 18:55 ` Shuah Khan
2012-07-02 19:23 ` Jeff Kirsher
2012-07-02 19:41 ` Shuah Khan
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=1328818290.2562.19.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=alexander.h.duyck@intel.com \
--cc=bruce.w.allan@intel.com \
--cc=carolyn.wyborny@intel.com \
--cc=danny.kukawka@bisect.de \
--cc=davem@davemloft.net \
--cc=dkukawka@suse.de \
--cc=donald.c.skidmore@intel.com \
--cc=e1000-devel@lists.sourceforge.net \
--cc=eric.dumazet@gmail.com \
--cc=gregory.v.rose@intel.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=john.ronciak@intel.com \
--cc=jpirko@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mitch.a.williams@intel.com \
--cc=netdev@vger.kernel.org \
--cc=peter.p.waskiewicz.jr@intel.com \
--cc=shemminger@vyatta.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).