Current ethdev always stores MAC address even it fails to be added. Other function may regard the failed MAC address valid and lead to some errors. So There is a need to check if the addr is added successfully or not and discard it if it fails.
In 3rd patch, add a command "add_more_mac_addr port_id base_mac_addr count" to add more than one MAC address one time. This command can simplify the test for the first patch. Normally a MAC address may fails to be added only after many MAC addresses have been added. Without this command, a tester may only trigger failed MAC address by running many times of testpmd command 'mac_addr add' . --- Changes v3: 1. Change return value for some specific NIC according to feedbacks from the community; 2. Add ABI change in release note; 3. Add more detailed commit message. v2: fix warnings and erros from check-git-log.sh and checkpatch.pl Wei Dai (3): ethdev: fix adding invalid MAC addr doc: change type of return value of adding MAC addr app/testpmd: add a command to add many MAC addrs app/test-pmd/cmdline.c | 55 ++++++++++++++++++++++++++++++++++ doc/guides/rel_notes/release_17_05.rst | 6 ++++ drivers/net/bnx2x/bnx2x_ethdev.c | 7 +++-- drivers/net/bnxt/bnxt_ethdev.c | 12 ++++---- drivers/net/e1000/base/e1000_api.c | 2 +- drivers/net/e1000/em_ethdev.c | 6 ++-- drivers/net/e1000/igb_ethdev.c | 5 ++-- drivers/net/enic/enic.h | 2 +- drivers/net/enic/enic_ethdev.c | 4 +-- drivers/net/enic/enic_main.c | 6 ++-- drivers/net/fm10k/fm10k_ethdev.c | 3 +- drivers/net/i40e/i40e_ethdev.c | 11 +++---- drivers/net/i40e/i40e_ethdev_vf.c | 8 ++--- drivers/net/ixgbe/ixgbe_ethdev.c | 27 +++++++++++------ drivers/net/mlx4/mlx4.c | 14 +++++---- drivers/net/mlx5/mlx5.h | 4 +-- drivers/net/mlx5/mlx5_mac.c | 12 +++++--- drivers/net/qede/qede_ethdev.c | 6 ++-- drivers/net/ring/rte_eth_ring.c | 3 +- drivers/net/virtio/virtio_ethdev.c | 13 ++++---- lib/librte_ether/rte_ethdev.c | 15 ++++++---- lib/librte_ether/rte_ethdev.h | 2 +- 22 files changed, 157 insertions(+), 66 deletions(-) -- 2.7.4