From fe750c248be58b76479836639fbd0c4617210aa5 Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Mon, 25 Mar 2019 11:41:34 +0100 Subject: Add RDMA ibverb driver plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/vnet/ethernet/mac_address.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/vnet/ethernet/mac_address.h') 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) { -- cgit 1.2.3-korg