From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: brking@linux.vnet.ibm.com, netdev@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, davem@davemloft.net
Subject: Re: [PATCHi v2] ibmveth: Add function to enable live MAC address changes
Date: Mon, 02 Mar 2015 11:52:38 -0600 [thread overview]
Message-ID: <54F4A366.90005@linux.vnet.ibm.com> (raw)
In-Reply-To: <20150228085932.GA2012@nanopsycho.orion>
On 02/28/2015 02:59 AM, Jiri Pirko wrote:
> Sat, Feb 28, 2015 at 06:56:04AM CET, tlfalcon@linux.vnet.ibm.com wrote:
>> Add a function that will enable changing the MAC address
>> of an ibmveth interface while it is still running.
>>
>> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
>> ---
>> v2:
>> If h_change_logical_lan_mac fails, dev->dev_addr will not be changed.
>>
>> drivers/net/ethernet/ibm/ibmveth.c | 25 ++++++++++++++++++++++++-
>> 1 file changed, 24 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
>> index 21978cc..b6ac676 100644
>> --- a/drivers/net/ethernet/ibm/ibmveth.c
>> +++ b/drivers/net/ethernet/ibm/ibmveth.c
>> @@ -1327,6 +1327,29 @@ static unsigned long ibmveth_get_desired_dma(struct vio_dev *vdev)
>> return ret;
>> }
>>
>> +static int ibmveth_set_mac_addr(struct net_device *dev, void *p)
>> +{
>> + struct ibmveth_adapter *adapter = netdev_priv(dev);
>> + struct sockaddr *addr = p;
>> + u64 mac_address;
>> + int rc;
>> +
>> + if (!is_valid_ether_addr(addr->sa_data))
>> + return -EADDRNOTAVAIL;
>> +
>> + mac_address = ibmveth_encode_mac_addr(addr->sa_data);
>> + rc = h_change_logical_lan_mac(adapter->vdev->unit_address, mac_address);
>> + if (rc) {
>> + netdev_err(adapter->netdev, "h_change_logical_lan_mac failed "
>> + "with rc=%d\n", rc);
> Please do not wrap text in message. For that, 80-char limit does not apply.
I will send a new patch fixing this shortly. Thanks to you, Brian, and Dave for reviewing this patch.
>
>
>> + return rc;
>> + }
>> +
>> + ether_addr_copy(dev->dev_addr, addr->sa_data);
>> +
>> + return 0;
>> +}
>> +
>> static const struct net_device_ops ibmveth_netdev_ops = {
>> .ndo_open = ibmveth_open,
>> .ndo_stop = ibmveth_close,
>> @@ -1337,7 +1360,7 @@ static const struct net_device_ops ibmveth_netdev_ops = {
>> .ndo_fix_features = ibmveth_fix_features,
>> .ndo_set_features = ibmveth_set_features,
>> .ndo_validate_addr = eth_validate_addr,
>> - .ndo_set_mac_address = eth_mac_addr,
>> + .ndo_set_mac_address = ibmveth_set_mac_addr,
>> #ifdef CONFIG_NET_POLL_CONTROLLER
>> .ndo_poll_controller = ibmveth_poll_controller,
>> #endif
>> --
>> 1.8.3.1
>>
prev parent reply other threads:[~2015-03-02 17:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-28 5:56 [PATCHi v2] ibmveth: Add function to enable live MAC address changes Thomas Falcon
2015-02-28 8:59 ` Jiri Pirko
2015-03-02 17:52 ` Thomas Falcon [this message]
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=54F4A366.90005@linux.vnet.ibm.com \
--to=tlfalcon@linux.vnet.ibm.com \
--cc=brking@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=jiri@resnulli.us \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
/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).