aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet/mac_address.h
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-03-25 11:41:34 +0100
committerDamjan Marion <dmarion@me.com>2019-03-28 19:31:59 +0000
commitfe750c248be58b76479836639fbd0c4617210aa5 (patch)
tree471a48243fb13e3eb84c95cf0be0b270607ae286 /src/vnet/ethernet/mac_address.h
parent6bc6fd0aebd7feb523604973bcf593bfe14bbd30 (diff)
Add RDMA ibverb driver plugin
RDMA ibverb is a userspace API to efficiently rx/tx packets. This is an initial, unoptimized driver targeting Mellanox cards. Next steps should include batching, multiqueue and additional cards. Change-Id: I0309c7a543f75f2f9317eaf63ca502ac7a093ef9 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/ethernet/mac_address.h')
-rw-r--r--src/vnet/ethernet/mac_address.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vnet/ethernet/mac_address.h b/src/vnet/ethernet/mac_address.h
index 87a66a242be..01fb76e002b 100644
--- a/src/vnet/ethernet/mac_address.h
+++ b/src/vnet/ethernet/mac_address.h
@@ -70,6 +70,17 @@ ethernet_mac_address_is_zero (const u8 * mac)
return ((*((u32 *) mac) == 0) && (*((u16 *) (mac + 4)) == 0));
}
+static inline void
+ethernet_mac_address_generate (u8 * mac)
+{
+ u32 rnd = clib_cpu_time_now ();
+ rnd = random_u32 (&rnd);
+
+ memcpy (mac + 2, &rnd, sizeof (rnd));
+ mac[0] = 2;
+ mac[1] = 0xfe;
+}
+
static inline int
ethernet_mac_address_equal (const u8 * a, const u8 * b)
{