aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-02-28 14:21:25 +0100
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-03-04 20:08:24 +0000
commit488e74adf48406441434ba5ea7e03339e9c09751 (patch)
tree6fde7ff40034985f0e91c720d46dcf1739124ccc /src/vpp
parent03bcbd3621867dac4c5dcb32b59f70424a7bc4d9 (diff)
tap: misc fixes
Ticket: VPPSUPP-58 1) Previously, host mtu can't be set if tap interface is in namespace. 2) generate the host mac address, if it is not provided. 3) fix the parameters for tap_create_v2 in vat. 4) fix the pretty print of parameters for tap_create_v2 in custom dump. Type: fix Change-Id: I18898af90dbd37d773a40b6535dd9c03c9984679 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp')
-rw-r--r--src/vpp/api/custom_dump.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vpp/api/custom_dump.c b/src/vpp/api/custom_dump.c
index 16145a9287d..6ad0f9ce9c7 100644
--- a/src/vpp/api/custom_dump.c
+++ b/src/vpp/api/custom_dump.c
@@ -551,10 +551,14 @@ static void *vl_api_tap_create_v2_t_print
s = format (0, "SCRIPT: tap_create_v2 ");
s = format (s, "id %u ", ntohl (mp->id));
- if (memcmp (mp->mac_address, null_mac, 6))
+ if (mp->use_random_mac == 0)
s = format (s, "mac-address %U ",
format_ethernet_address, mp->mac_address);
- if (memcmp (mp->host_mac_addr, null_mac, 6))
+ if (mp->tx_ring_sz)
+ s = format (s, "tx-ring-size %u ", ntohs (mp->tx_ring_sz));
+ if (mp->rx_ring_sz)
+ s = format (s, "rx-ring-size %u ", ntohs (mp->rx_ring_sz));
+ if (mp->host_mac_addr_set)
s = format (s, "host-mac-addr %U ",
format_ethernet_address, mp->host_mac_addr);
if (mp->host_if_name_set)
@@ -573,10 +577,6 @@ static void *vl_api_tap_create_v2_t_print
s = format (s, "host-ip4-gw %U ", format_ip4_address, mp->host_ip4_addr);
if (mp->host_ip6_gw_set)
s = format (s, "host-ip6-gw %U ", format_ip6_address, mp->host_ip6_addr);
- if (mp->tx_ring_sz)
- s = format (s, "tx-ring-size %u ", ntohs (mp->tx_ring_sz));
- if (mp->rx_ring_sz)
- s = format (s, "rx-ring-size %u ", ntohs (mp->rx_ring_sz));
if (mp->host_mtu_set)
s = format (s, "host-mtu-size %u ", ntohl (mp->host_mtu_size));
if (ntohl (mp->tap_flags) & 0x1)