diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2018-05-17 15:42:27 +0200 |
---|---|---|
committer | Mohsin Kazmi <sykazmi@cisco.com> | 2018-05-28 11:20:35 +0200 |
commit | acba9f794be8aa97e51fef6fd2dc0fe339349d22 (patch) | |
tree | f7d818e0f01fc8665978658b8b10ca4ca1350479 /src/vnet/devices/af_packet/device.c | |
parent | a50a14c5577e82866b05f325e359c86ba7145730 (diff) |
af-packet: Add support for logging
Change-Id: I4cc6a20b69cce2aa52768a27c5d455eb098224c8
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/af_packet/device.c')
-rw-r--r-- | src/vnet/devices/af_packet/device.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/vnet/devices/af_packet/device.c b/src/vnet/devices/af_packet/device.c index 0991378f640..0b0697b705f 100644 --- a/src/vnet/devices/af_packet/device.c +++ b/src/vnet/devices/af_packet/device.c @@ -213,8 +213,8 @@ af_packet_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, if (0 > fd) { - clib_unix_warning ("af_packet_%s could not open socket", - apif->host_if_name); + vlib_log_warn (apm->log_class, "af_packet_%s could not open socket", + apif->host_if_name); return 0; } @@ -226,8 +226,9 @@ af_packet_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, ifr.ifr_ifindex = apif->host_if_index; if ((rv = ioctl (fd, SIOCGIFNAME, &ifr)) < 0) { - clib_unix_warning ("af_packet_%s ioctl could not retrieve eth name", - apif->host_if_name); + vlib_log_warn (apm->log_class, + "af_packet_%s ioctl could not retrieve eth name", + apif->host_if_name); goto error; } @@ -235,8 +236,8 @@ af_packet_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, if ((rv = ioctl (fd, SIOCGIFFLAGS, &ifr)) < 0) { - clib_unix_warning ("af_packet_%s error: %d", - apif->is_admin_up ? "up" : "down", rv); + vlib_log_warn (apm->log_class, "af_packet_%s error: %d", + apif->is_admin_up ? "up" : "down", rv); goto error; } @@ -253,8 +254,8 @@ af_packet_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, if ((rv = ioctl (fd, SIOCSIFFLAGS, &ifr)) < 0) { - clib_unix_warning ("af_packet_%s error: %d", - apif->is_admin_up ? "up" : "down", rv); + vlib_log_warn (apm->log_class, "af_packet_%s error: %d", + apif->is_admin_up ? "up" : "down", rv); goto error; } @@ -287,8 +288,8 @@ static clib_error_t *af_packet_set_mac_address_function if (0 > fd) { - clib_unix_warning ("af_packet_%s could not open socket", - apif->host_if_name); + vlib_log_warn (apm->log_class, "af_packet_%s could not open socket", + apif->host_if_name); return 0; } @@ -300,8 +301,9 @@ static clib_error_t *af_packet_set_mac_address_function ifr.ifr_ifindex = apif->host_if_index; if ((rv = ioctl (fd, SIOCGIFNAME, &ifr)) < 0) { - clib_unix_warning - ("af_packet_%s ioctl could not retrieve eth name, error: %d", + vlib_log_warn + (apm->log_class, + "af_packet_%s ioctl could not retrieve eth name, error: %d", apif->host_if_name, rv); goto error; } @@ -311,8 +313,9 @@ static clib_error_t *af_packet_set_mac_address_function if ((rv = ioctl (fd, SIOCSIFHWADDR, &ifr)) < 0) { - clib_unix_warning ("af_packet_%s ioctl could not set mac, error: %d", - apif->host_if_name, rv); + vlib_log_warn (apm->log_class, + "af_packet_%s ioctl could not set mac, error: %d", + apif->host_if_name, rv); goto error; } |