#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
-#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_mempool.h>
#include <rte_string_fns.h>
#include <rte_devargs.h>
#include <rte_flow.h>
+#ifdef RTE_LIB_GRO
#include <rte_gro.h>
+#endif
#include <rte_mbuf_dyn.h>
#include <cmdline_rdline.h>
"show port (port_id) macs|mcast_macs"
" Display list of mac addresses added to port.\n\n"
+ "show port (port_id) flow transfer proxy\n"
+ " Display proxy port to manage transfer flows\n\n"
+
"show port (port_id) fec capabilities"
" Show fec capabilities of a port.\n\n"
"tso show (portid)"
" Display the status of TCP Segmentation Offload.\n\n"
+#ifdef RTE_LIB_GRO
"set port (port_id) gro on|off\n"
" Enable or disable Generic Receive Offload in"
" csum forwarding engine.\n\n"
"set gro flush (cycles)\n"
" Set the cycle to flush GROed packets from"
" reassembly tables.\n\n"
+#endif
+#ifdef RTE_LIB_GSO
"set port (port_id) gso (on|off)"
" Enable or disable Generic Segmentation Offload in"
" csum forwarding engine.\n\n"
"show port (port_id) gso\n"
" Show GSO configuration.\n\n"
+#endif
"set fwd (%s)\n"
" Set packet forwarding mode.\n\n"
},
};
+#ifdef RTE_LIB_GRO
/* *** SET GRO FOR A PORT *** */
struct cmd_gro_enable_result {
cmdline_fixed_string_t cmd_set;
NULL,
},
};
+#endif /* RTE_LIB_GRO */
+#ifdef RTE_LIB_GSO
/* *** ENABLE/DISABLE GSO *** */
struct cmd_gso_enable_result {
cmdline_fixed_string_t cmd_set;
NULL,
},
};
+#endif /* RTE_LIB_GSO */
/* *** ENABLE/DISABLE FLUSH ON RX STREAMS *** */
struct cmd_set_flush_rx {
},
};
+/* *** show flow transfer proxy port ID for the given port *** */
+struct cmd_show_port_flow_transfer_proxy_result {
+ cmdline_fixed_string_t show;
+ cmdline_fixed_string_t port;
+ portid_t port_id;
+ cmdline_fixed_string_t flow;
+ cmdline_fixed_string_t transfer;
+ cmdline_fixed_string_t proxy;
+};
+
+cmdline_parse_token_string_t cmd_show_port_flow_transfer_proxy_show =
+ TOKEN_STRING_INITIALIZER
+ (struct cmd_show_port_flow_transfer_proxy_result,
+ show, "show");
+cmdline_parse_token_string_t cmd_show_port_flow_transfer_proxy_port =
+ TOKEN_STRING_INITIALIZER
+ (struct cmd_show_port_flow_transfer_proxy_result,
+ port, "port");
+cmdline_parse_token_num_t cmd_show_port_flow_transfer_proxy_port_id =
+ TOKEN_NUM_INITIALIZER
+ (struct cmd_show_port_flow_transfer_proxy_result,
+ port_id, RTE_UINT16);
+cmdline_parse_token_string_t cmd_show_port_flow_transfer_proxy_flow =
+ TOKEN_STRING_INITIALIZER
+ (struct cmd_show_port_flow_transfer_proxy_result,
+ flow, "flow");
+cmdline_parse_token_string_t cmd_show_port_flow_transfer_proxy_transfer =
+ TOKEN_STRING_INITIALIZER
+ (struct cmd_show_port_flow_transfer_proxy_result,
+ transfer, "transfer");
+cmdline_parse_token_string_t cmd_show_port_flow_transfer_proxy_proxy =
+ TOKEN_STRING_INITIALIZER
+ (struct cmd_show_port_flow_transfer_proxy_result,
+ proxy, "proxy");
+
+static void
+cmd_show_port_flow_transfer_proxy_parsed(void *parsed_result,
+ __rte_unused struct cmdline *cl,
+ __rte_unused void *data)
+{
+ struct cmd_show_port_flow_transfer_proxy_result *res = parsed_result;
+ portid_t proxy_port_id;
+ int ret;
+
+ printf("\n");
+
+ ret = rte_flow_pick_transfer_proxy(res->port_id, &proxy_port_id, NULL);
+ if (ret != 0) {
+ fprintf(stderr, "Failed to pick transfer proxy: %s\n",
+ rte_strerror(-ret));
+ return;
+ }
+
+ printf("Transfer proxy port ID: %u\n\n", proxy_port_id);
+}
+
+cmdline_parse_inst_t cmd_show_port_flow_transfer_proxy = {
+ .f = cmd_show_port_flow_transfer_proxy_parsed,
+ .data = NULL,
+ .help_str = "show port <port_id> flow transfer proxy",
+ .tokens = {
+ (void *)&cmd_show_port_flow_transfer_proxy_show,
+ (void *)&cmd_show_port_flow_transfer_proxy_port,
+ (void *)&cmd_show_port_flow_transfer_proxy_port_id,
+ (void *)&cmd_show_port_flow_transfer_proxy_flow,
+ (void *)&cmd_show_port_flow_transfer_proxy_transfer,
+ (void *)&cmd_show_port_flow_transfer_proxy_proxy,
+ NULL,
+ }
+};
+
/* ******************************************************************************** */
/* list of instructions */
(cmdline_parse_inst_t *)&cmd_tso_show,
(cmdline_parse_inst_t *)&cmd_tunnel_tso_set,
(cmdline_parse_inst_t *)&cmd_tunnel_tso_show,
+#ifdef RTE_LIB_GRO
(cmdline_parse_inst_t *)&cmd_gro_enable,
(cmdline_parse_inst_t *)&cmd_gro_flush,
(cmdline_parse_inst_t *)&cmd_gro_show,
+#endif
+#ifdef RTE_LIB_GSO
(cmdline_parse_inst_t *)&cmd_gso_enable,
(cmdline_parse_inst_t *)&cmd_gso_size,
(cmdline_parse_inst_t *)&cmd_gso_show,
+#endif
(cmdline_parse_inst_t *)&cmd_link_flow_control_set,
(cmdline_parse_inst_t *)&cmd_link_flow_control_set_rx,
(cmdline_parse_inst_t *)&cmd_link_flow_control_set_tx,
(cmdline_parse_inst_t *)&cmd_config_rss_reta,
(cmdline_parse_inst_t *)&cmd_showport_reta,
(cmdline_parse_inst_t *)&cmd_showport_macs,
+ (cmdline_parse_inst_t *)&cmd_show_port_flow_transfer_proxy,
(cmdline_parse_inst_t *)&cmd_config_burst,
(cmdline_parse_inst_t *)&cmd_config_thresh,
(cmdline_parse_inst_t *)&cmd_config_threshold,