aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/udp/udp_cli.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-10-18 18:37:56 -0700
committerDave Wallace <dwallacelf@gmail.com>2022-10-20 18:14:32 +0000
commitf8ee39ff715ec713045af69da465ba4da8248212 (patch)
treeb9625b2f2b3effaabaded647b06d6ba871d71d6a /src/vnet/udp/udp_cli.c
parent20de85b6da7e0b6dd0d73bc8358e7c67564d0c36 (diff)
udp: support for disabling tx csum
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I84843eb3a0a66c64cd46536624633e0dae1c4681
Diffstat (limited to 'src/vnet/udp/udp_cli.c')
-rw-r--r--src/vnet/udp/udp_cli.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/vnet/udp/udp_cli.c b/src/vnet/udp/udp_cli.c
index 9787eedf933..72dd9d8447d 100644
--- a/src/vnet/udp/udp_cli.c
+++ b/src/vnet/udp/udp_cli.c
@@ -38,6 +38,33 @@ format_udp_connection_id (u8 * s, va_list * args)
return s;
}
+static const char *udp_cfg_flags_str[] = {
+#define _(sym, str) str,
+ foreach_udp_cfg_flag
+#undef _
+};
+
+static u8 *
+format_udp_cfg_flags (u8 *s, va_list *args)
+{
+ udp_connection_t *tc = va_arg (*args, udp_connection_t *);
+ int i, last = -1;
+
+ for (i = 0; i < UDP_CFG_N_FLAG_BITS; i++)
+ if (tc->cfg_flags & (1 << i))
+ last = i;
+ if (last >= 0)
+ s = format (s, " cfg: ");
+ for (i = 0; i < last; i++)
+ {
+ if (tc->cfg_flags & (1 << i))
+ s = format (s, "%s, ", udp_cfg_flags_str[i]);
+ }
+ if (last >= 0)
+ s = format (s, "%s", udp_cfg_flags_str[last]);
+ return s;
+}
+
static const char *udp_connection_flags_str[] = {
#define _(sym, str) str,
foreach_udp_connection_flag
@@ -68,8 +95,8 @@ format_udp_vars (u8 * s, va_list * args)
{
udp_connection_t *uc = va_arg (*args, udp_connection_t *);
- s = format (s, " index %u flags: %U", uc->c_c_index,
- format_udp_connection_flags, uc);
+ s = format (s, " index %u%U flags: %U", uc->c_c_index, format_udp_cfg_flags,
+ uc, format_udp_connection_flags, uc);
if (!(uc->flags & UDP_CONN_F_LISTEN))
s = format (s, " \n sw_if_index: %d, mss: %u\n", uc->sw_if_index, uc->mss);
@@ -106,6 +133,8 @@ udp_config_fn (vlib_main_t * vm, unformat_input_t * input)
um->default_mtu = tmp;
else if (unformat (input, "icmp-unreachable-disabled"))
um->icmp_send_unreachable_disabled = 1;
+ else if (unformat (input, "no-csum-offload"))
+ um->csum_offload = 0;
else
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);