ethdev: function to compare ethernet addresses
To support i40e, function is_same_ether_addr() has been added to compare two ethernet address. Signed-off-by: Helin Zhang <helin.zhang@intel.com> Signed-off-by: Jing Chen <jing.d.chen@intel.com> Acked-by: Cunming Liang <cunming.liang@intel.com> Acked-by: Jijiang Liu <jijiang.liu@intel.com> Acked-by: Jingjing Wu <jingjing.wu@intel.com> Acked-by: Heqing Zhu <heqing.zhu@intel.com> Tested-by: Waterman Cao <waterman.cao@intel.com>
This commit is contained in:
parent
287597000f
commit
0bb4a2b51a
@ -85,6 +85,30 @@ struct ether_addr {
|
||||
#define ETHER_LOCAL_ADMIN_ADDR 0x02 /**< Locally assigned Eth. address. */
|
||||
#define ETHER_GROUP_ADDR 0x01 /**< Multicast or broadcast Eth. address. */
|
||||
|
||||
/**
|
||||
* Check if two Ethernet addresses are the same.
|
||||
*
|
||||
* @param ea1
|
||||
* A pointer to the first ether_addr structure containing
|
||||
* the ethernet address.
|
||||
* @param ea2
|
||||
* A pointer to the second ether_addr structure containing
|
||||
* the ethernet address.
|
||||
*
|
||||
* @return
|
||||
* True (1) if the given two ethernet address are the same;
|
||||
* False (0) otherwise.
|
||||
*/
|
||||
static inline int is_same_ether_addr(const struct ether_addr *ea1,
|
||||
const struct ether_addr *ea2)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < ETHER_ADDR_LEN; i++)
|
||||
if (ea1->addr_bytes[i] != ea2->addr_bytes[i])
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an Ethernet address is filled with zeros.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user