From ef65cb0696b3ee42834a72a35c1eb08da75eed99 Mon Sep 17 00:00:00 2001 From: Pierre Pfister Date: Fri, 19 Feb 2016 13:52:44 +0000 Subject: Add custom mac address option to vhost interfaces. Generating a new MAC address everytime vpp reboots can quickly become cumbersome (e.g. in test scenarios). This commit allows vhost mac addresses to be configured manually. Change-Id: Ic6d16a2d14cdf8e49dc29041bbafde39d9fc8370 Signed-off-by: Pierre Pfister --- vpp/api/api.c | 3 ++- vpp/api/vpe.api | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'vpp') diff --git a/vpp/api/api.c b/vpp/api/api.c index e14eef63..e30240c4 100644 --- a/vpp/api/api.c +++ b/vpp/api/api.c @@ -3551,7 +3551,8 @@ vl_api_create_vhost_user_if_t_handler (vl_api_create_vhost_user_if_t *mp) rv = dpdk_vhost_user_create_if(vnm, vm, (char *)mp->sock_filename, mp->is_server, &sw_if_index, (u64)~0, - mp->renumber, ntohl(mp->custom_dev_instance)); + mp->renumber, ntohl(mp->custom_dev_instance), + (mp->use_custom_mac)?mp->mac_address:NULL); REPLY_MACRO2(VL_API_CREATE_VHOST_USER_IF_REPLY, ({ diff --git a/vpp/api/vpe.api b/vpp/api/vpe.api index d76a5c8e..05ba5567 100644 --- a/vpp/api/vpe.api +++ b/vpp/api/vpe.api @@ -1903,6 +1903,8 @@ define l2_interface_vlan_tag_rewrite_reply { @param client_index - opaque cookie to identify the sender @param is_server - our side is socket server @param sock_filename - unix socket filename, used to speak with frontend + @param use_custom_mac - enable or disable the use of the provided hardware address + @param mac_address - hardware address to use if 'use_custom_mac' is set */ define create_vhost_user_if { u32 client_index; @@ -1911,6 +1913,8 @@ define create_vhost_user_if { u8 sock_filename[256]; u8 renumber; u32 custom_dev_instance; + u8 use_custom_mac; + u8 mac_address[6]; }; /** \brief vhost-user interface create response -- cgit