[RFC,2/3] ethdev: advertise default MAC as retained on device restart

Message ID 1539157900-6208-3-git-send-email-arybchenko@solarflare.com
State New
Delegated to: Ferruh Yigit
Headers show
Series
  • ethdev: document more retained across restart
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Oct. 10, 2018, 7:51 a.m.
The documentation says MAC addresses array is retained and
it is logical to assume that default MAC address is retained
as well.

Also some PMDs do not allow to change the default MAC in
running state (see RTE_ETH_DEV_NOLIVE_MAC_ADDR).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_ethdev/rte_ethdev.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Thomas Monjalon Oct. 10, 2018, 8:53 a.m. | #1
10/10/2018 09:51, Andrew Rybchenko:
> The documentation says MAC addresses array is retained and
> it is logical to assume that default MAC address is retained
> as well.

I'm confused. Default MAC address isn't implied by MAC addresses array?
Andrew Rybchenko Oct. 10, 2018, 9:05 a.m. | #2
On 10/10/18 11:53 AM, Thomas Monjalon wrote:
> 10/10/2018 09:51, Andrew Rybchenko:
>> The documentation says MAC addresses array is retained and
>> it is logical to assume that default MAC address is retained
>> as well.
> I'm confused. Default MAC address isn't implied by MAC addresses array?

 From API point of view it looks as different features (at least for me):
  - default MAC address is rte_eth_dev_default_mac_addr_set()
  - MAC addresses array is 
rte_eth_dev_mac_addr_add()/rte_eth_dev_mac_addr_remove()
but it is under one umbrella in NIC features (Unicast MAC filter).

May be it is my misunderstanding.
Thomas Monjalon Oct. 10, 2018, 9:35 a.m. | #3
10/10/2018 11:05, Andrew Rybchenko:
> On 10/10/18 11:53 AM, Thomas Monjalon wrote:
> > 10/10/2018 09:51, Andrew Rybchenko:
> >> The documentation says MAC addresses array is retained and
> >> it is logical to assume that default MAC address is retained
> >> as well.
> > I'm confused. Default MAC address isn't implied by MAC addresses array?
> 
>  From API point of view it looks as different features (at least for me):
>   - default MAC address is rte_eth_dev_default_mac_addr_set()
>   - MAC addresses array is 
> rte_eth_dev_mac_addr_add()/rte_eth_dev_mac_addr_remove()
> but it is under one umbrella in NIC features (Unicast MAC filter).

Because default MAC address is mac_addrs[0].

> May be it is my misunderstanding.

More doc is better :)
If it can be thought as different features, let's document it as you do.

Patch

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index efe223b61..94f7cd141 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -85,6 +85,7 @@ 
  *     - receive mode configuration (promiscuous mode, hardware checksum mode,
  *       RSS/VMDQ settings etc.)
  *     - VLAN filtering configuration
+ *     - default MAC address
  *     - MAC addresses supplied to MAC address array
  *     - flow director filtering mode (but not filtering rules)
  *     - NIC queue statistics mappings