#include <vnet/ip/ip6.h>
#include <vnet/udp/udp_packet.h>
+#define foreach_gso_error \
+ _ (NO_BUFFERS, "no buffers to segment GSO") \
+ _ (UNHANDLED_TYPE, "unhandled gso type")
+
+static char *gso_error_strings[] = {
+#define _(sym, string) string,
+ foreach_gso_error
+#undef _
+};
+
+typedef enum
+{
+#define _(sym, str) GSO_ERROR_##sym,
+ foreach_gso_error
+#undef _
+ GSO_N_ERROR,
+} gso_error_t;
+
+typedef enum
+{
+ GSO_NEXT_DROP,
+ GSO_N_NEXT,
+} gso_next_t;
+
typedef struct
{
u32 flags;
vlib_error_drop_buffers (vm, node, pbi0,
/* buffer stride */ 1,
- /* n_buffers */ 1,
- VNET_INTERFACE_OUTPUT_NEXT_DROP,
- node->node_index, drop_error_code);
+ /* n_buffers */ 1, GSO_NEXT_DROP, node->node_index,
+ drop_error_code);
}
static_always_inline uword
/* not supported yet */
drop_one_buffer_and_count (vm, vnm, node, from - 1,
hi->sw_if_index,
- VNET_INTERFACE_OUTPUT_ERROR_UNHANDLED_GSO_TYPE);
+ GSO_ERROR_UNHANDLED_TYPE);
b += 1;
continue;
}
{
drop_one_buffer_and_count (vm, vnm, node, from - 1,
hi->sw_if_index,
- VNET_INTERFACE_OUTPUT_ERROR_NO_BUFFERS_FOR_GSO);
+ GSO_ERROR_NO_BUFFERS);
b += 1;
continue;
}
.vector_size = sizeof (u32),
.format_trace = format_gso_trace,
.type = VLIB_NODE_TYPE_INTERNAL,
- .n_errors = 0,
- .n_next_nodes = 0,
+ .n_errors = ARRAY_LEN(gso_error_strings),
+ .error_strings = gso_error_strings,
+ .n_next_nodes = GSO_N_NEXT,
+ .next_nodes = {
+ [GSO_NEXT_DROP] = "error-drop",
+ },
.name = "gso-l2-ip4",
};
.vector_size = sizeof (u32),
.format_trace = format_gso_trace,
.type = VLIB_NODE_TYPE_INTERNAL,
- .n_errors = 0,
- .n_next_nodes = 0,
+ .n_errors = ARRAY_LEN(gso_error_strings),
+ .error_strings = gso_error_strings,
+ .n_next_nodes = GSO_N_NEXT,
+ .next_nodes = {
+ [GSO_NEXT_DROP] = "error-drop",
+ },
.name = "gso-l2-ip6",
};
.vector_size = sizeof (u32),
.format_trace = format_gso_trace,
.type = VLIB_NODE_TYPE_INTERNAL,
- .n_errors = 0,
- .n_next_nodes = 0,
+ .n_errors = ARRAY_LEN(gso_error_strings),
+ .error_strings = gso_error_strings,
+ .n_next_nodes = GSO_N_NEXT,
+ .next_nodes = {
+ [GSO_NEXT_DROP] = "error-drop",
+ },
.name = "gso-ip4",
};
.vector_size = sizeof (u32),
.format_trace = format_gso_trace,
.type = VLIB_NODE_TYPE_INTERNAL,
- .n_errors = 0,
- .n_next_nodes = 0,
+ .n_errors = ARRAY_LEN(gso_error_strings),
+ .error_strings = gso_error_strings,
+ .n_next_nodes = GSO_N_NEXT,
+ .next_nodes = {
+ [GSO_NEXT_DROP] = "error-drop",
+ },
.name = "gso-ip6",
};