From: "Wang, Liang-min" <liang-min.wang@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"bruce.richardson@intle.com" <bruce.richardson@intle.com>
Subject: Re: [dpdk-dev] [PATCH 1/2] ethdev: add api to set default mac address
Date: Fri, 29 May 2015 18:21:41 +0000 [thread overview]
Message-ID: <B6CB929FEBC10D4FAC4BCA7EF2298E2571764885@FMSMSX110.amr.corp.intel.com> (raw)
In-Reply-To: <20150529082021.16147bb5@urahara>
>On Fri, 29 May 2015 09:15:08 -0400
>Liang-Min Larry Wang <liang-min.wang@intel.com> wrote:
>
>> }
> >
>> int
>> +rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr
>> +*addr) {
>> + struct rte_eth_dev *dev;
>> + const int index = 0;
>> + const uint32_t pool = 0;
>> +
>> + if (!rte_eth_dev_is_valid_port(port_id)) {
>> + PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
>> + return -ENODEV;
>> + }
>> +
>> + dev = &rte_eth_devices[port_id];
>> + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_remove, -ENOTSUP);
>> + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mac_addr_add, -ENOTSUP);
>> +
>> + /* Update NIC default MAC address*/
>> + (*dev->dev_ops->mac_addr_remove)(dev, index);
>> + (*dev->dev_ops->mac_addr_add)(dev, addr, index, pool);
>> +
>> + /* Update default address in NIC data structure */
>> + ether_addr_copy(addr, &dev->data->mac_addrs[index]);
>> +
>> + return 0;
>> +}
>> +
>
>No. this won't work. for some devices.
>
>Please use mac_addr_set hook added in recent DPDK
I tested over ixgbe and igb, and both work. As for your concern, it's legit. I will take your suggestion and make modification.
next prev parent reply other threads:[~2015-05-29 18:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 13:15 [dpdk-dev] [PATCH 0/2] User-space Ethtool Liang-Min Larry Wang
2015-05-29 13:15 ` [dpdk-dev] [PATCH 1/2] ethdev: add api to set default mac address Liang-Min Larry Wang
2015-05-29 15:20 ` Stephen Hemminger
2015-05-29 18:21 ` Wang, Liang-min [this message]
2015-05-29 13:15 ` [dpdk-dev] [PATCH 2/2] ethtool: add new library to provide ethtool-alike APIs Liang-Min Larry Wang
2015-05-29 15:22 ` Stephen Hemminger
2015-05-29 18:17 ` Wang, Liang-min
2015-05-29 19:26 [dpdk-dev] [PATCH 0/2] User-space Ethtool Liang-Min Larry Wang
2015-05-29 19:26 ` [dpdk-dev] [PATCH 1/2] ethdev: add api to set default mac address Liang-Min Larry Wang
2015-06-02 10:52 ` Ananyev, Konstantin
2015-06-02 12:23 ` Thomas Monjalon
2015-06-02 14:51 ` Stephen Hemminger
2015-06-02 15:07 ` Wang, Liang-min
2015-06-02 12:23 ` Wang, Liang-min
2015-06-02 13:10 ` Ananyev, Konstantin
2015-05-30 0:37 [dpdk-dev] [PATCH 0/2] User-space Ethtool Liang-Min Larry Wang
2015-05-30 0:37 ` [dpdk-dev] [PATCH 1/2] ethdev: add api to set default mac address Liang-Min Larry Wang
2015-05-30 1:57 ` Andrew Harvey (agh)
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=B6CB929FEBC10D4FAC4BCA7EF2298E2571764885@FMSMSX110.amr.corp.intel.com \
--to=liang-min.wang@intel.com \
--cc=bruce.richardson@intle.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.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).