aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/avf/device.c10
-rw-r--r--src/vppinfra/format.h1
-rw-r--r--src/vppinfra/std-formats.c16
3 files changed, 22 insertions, 5 deletions
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index 15af95bbbff..aab81642ac9 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -564,9 +564,9 @@ avf_op_config_rss_lut (vlib_main_t * vm, avf_device_t * ad)
for (i = 0; i < ad->rss_lut_size; i++)
rl->lut[i] = i % ad->n_rx_queues;
- avf_log_debug (ad, "config_rss_lut: vsi_id %u rss_lut_size %u lut %U",
- rl->vsi_id, rl->lut_entries, format_hex_bytes, rl->lut,
- rl->lut_entries);
+ avf_log_debug (ad, "config_rss_lut: vsi_id %u rss_lut_size %u lut 0x%U",
+ rl->vsi_id, rl->lut_entries, format_hex_bytes_no_wrap,
+ rl->lut, rl->lut_entries);
return avf_send_to_pf (vm, ad, VIRTCHNL_OP_CONFIG_RSS_LUT, msg, msg_len, 0,
0);
@@ -588,8 +588,8 @@ avf_op_config_rss_key (vlib_main_t * vm, avf_device_t * ad)
for (i = 0; i < ad->rss_key_size; i++)
rk->key[i] = (u8) random_u32 (&seed);
- avf_log_debug (ad, "config_rss_key: vsi_id %u rss_key_size %u key %U",
- rk->vsi_id, rk->key_len, format_hex_bytes, rk->key,
+ avf_log_debug (ad, "config_rss_key: vsi_id %u rss_key_size %u key 0x%U",
+ rk->vsi_id, rk->key_len, format_hex_bytes_no_wrap, rk->key,
rk->key_len);
return avf_send_to_pf (vm, ad, VIRTCHNL_OP_CONFIG_RSS_KEY, msg, msg_len, 0,
diff --git a/src/vppinfra/format.h b/src/vppinfra/format.h
index 94344474067..c4becff3a67 100644
--- a/src/vppinfra/format.h
+++ b/src/vppinfra/format.h
@@ -94,6 +94,7 @@ _(format_vec32);
_(format_vec_uword);
_(format_ascii_bytes);
_(format_hex_bytes);
+_(format_hex_bytes_no_wrap);
_(format_white_space);
_(format_f64);
_(format_time_interval);
diff --git a/src/vppinfra/std-formats.c b/src/vppinfra/std-formats.c
index da3c54cc07e..b771b947e27 100644
--- a/src/vppinfra/std-formats.c
+++ b/src/vppinfra/std-formats.c
@@ -108,6 +108,22 @@ format_hex_bytes (u8 * s, va_list * va)
return s;
}
+u8 *
+format_hex_bytes_no_wrap (u8 * s, va_list * va)
+{
+ u8 *bytes = va_arg (*va, u8 *);
+ int n_bytes = va_arg (*va, int);
+ uword i;
+
+ if (n_bytes == 0)
+ return s;
+
+ for (i = 0; i < n_bytes; i++)
+ s = format (s, "%02x", bytes[i]);
+
+ return s;
+}
+
/* Add variable number of spaces. */
u8 *
format_white_space (u8 * s, va_list * va)