"port (port_id) (rxq|txq) (queue_id) setup\n"
" Setup a rx/tx queue of port X.\n\n"
- "port config (port_id|all) l2-tunnel E-tag ether-type"
- " (value)\n"
- " Set the value of E-tag ether-type.\n\n"
-
"port config (port_id|all) l2-tunnel E-tag"
" (enable|disable)\n"
" Enable/disable the E-tag support.\n\n"
* only support E-tag now.
*/
-/* Ether type config */
-struct cmd_config_l2_tunnel_eth_type_result {
- cmdline_fixed_string_t port;
- cmdline_fixed_string_t config;
- cmdline_fixed_string_t all;
- portid_t id;
- cmdline_fixed_string_t l2_tunnel;
- cmdline_fixed_string_t l2_tunnel_type;
- cmdline_fixed_string_t eth_type;
- uint16_t eth_type_val;
-};
-
-cmdline_parse_token_string_t cmd_config_l2_tunnel_eth_type_port =
- TOKEN_STRING_INITIALIZER
- (struct cmd_config_l2_tunnel_eth_type_result,
- port, "port");
-cmdline_parse_token_string_t cmd_config_l2_tunnel_eth_type_config =
- TOKEN_STRING_INITIALIZER
- (struct cmd_config_l2_tunnel_eth_type_result,
- config, "config");
-cmdline_parse_token_string_t cmd_config_l2_tunnel_eth_type_all_str =
- TOKEN_STRING_INITIALIZER
- (struct cmd_config_l2_tunnel_eth_type_result,
- all, "all");
-cmdline_parse_token_num_t cmd_config_l2_tunnel_eth_type_id =
- TOKEN_NUM_INITIALIZER
- (struct cmd_config_l2_tunnel_eth_type_result,
- id, UINT16);
-cmdline_parse_token_string_t cmd_config_l2_tunnel_eth_type_l2_tunnel =
- TOKEN_STRING_INITIALIZER
- (struct cmd_config_l2_tunnel_eth_type_result,
- l2_tunnel, "l2-tunnel");
-cmdline_parse_token_string_t cmd_config_l2_tunnel_eth_type_l2_tunnel_type =
- TOKEN_STRING_INITIALIZER
- (struct cmd_config_l2_tunnel_eth_type_result,
- l2_tunnel_type, "E-tag");
-cmdline_parse_token_string_t cmd_config_l2_tunnel_eth_type_eth_type =
- TOKEN_STRING_INITIALIZER
- (struct cmd_config_l2_tunnel_eth_type_result,
- eth_type, "ether-type");
-cmdline_parse_token_num_t cmd_config_l2_tunnel_eth_type_eth_type_val =
- TOKEN_NUM_INITIALIZER
- (struct cmd_config_l2_tunnel_eth_type_result,
- eth_type_val, UINT16);
-
static enum rte_eth_tunnel_type
str2fdir_l2_tunnel_type(char *string)
{
return RTE_TUNNEL_TYPE_NONE;
}
-/* ether type config for all ports */
-static void
-cmd_config_l2_tunnel_eth_type_all_parsed
- (void *parsed_result,
- __rte_unused struct cmdline *cl,
- __rte_unused void *data)
-{
- struct cmd_config_l2_tunnel_eth_type_result *res = parsed_result;
- struct rte_eth_l2_tunnel_conf entry;
- portid_t pid;
-
- entry.l2_tunnel_type = str2fdir_l2_tunnel_type(res->l2_tunnel_type);
- entry.ether_type = res->eth_type_val;
-
- RTE_ETH_FOREACH_DEV(pid) {
- rte_eth_dev_l2_tunnel_eth_type_conf(pid, &entry);
- }
-}
-
-cmdline_parse_inst_t cmd_config_l2_tunnel_eth_type_all = {
- .f = cmd_config_l2_tunnel_eth_type_all_parsed,
- .data = NULL,
- .help_str = "port config all l2-tunnel E-tag ether-type <value>",
- .tokens = {
- (void *)&cmd_config_l2_tunnel_eth_type_port,
- (void *)&cmd_config_l2_tunnel_eth_type_config,
- (void *)&cmd_config_l2_tunnel_eth_type_all_str,
- (void *)&cmd_config_l2_tunnel_eth_type_l2_tunnel,
- (void *)&cmd_config_l2_tunnel_eth_type_l2_tunnel_type,
- (void *)&cmd_config_l2_tunnel_eth_type_eth_type,
- (void *)&cmd_config_l2_tunnel_eth_type_eth_type_val,
- NULL,
- },
-};
-
-/* ether type config for a specific port */
-static void
-cmd_config_l2_tunnel_eth_type_specific_parsed(
- void *parsed_result,
- __rte_unused struct cmdline *cl,
- __rte_unused void *data)
-{
- struct cmd_config_l2_tunnel_eth_type_result *res =
- parsed_result;
- struct rte_eth_l2_tunnel_conf entry;
-
- if (port_id_is_invalid(res->id, ENABLED_WARN))
- return;
-
- entry.l2_tunnel_type = str2fdir_l2_tunnel_type(res->l2_tunnel_type);
- entry.ether_type = res->eth_type_val;
-
- rte_eth_dev_l2_tunnel_eth_type_conf(res->id, &entry);
-}
-
-cmdline_parse_inst_t cmd_config_l2_tunnel_eth_type_specific = {
- .f = cmd_config_l2_tunnel_eth_type_specific_parsed,
- .data = NULL,
- .help_str = "port config <port_id> l2-tunnel E-tag ether-type <value>",
- .tokens = {
- (void *)&cmd_config_l2_tunnel_eth_type_port,
- (void *)&cmd_config_l2_tunnel_eth_type_config,
- (void *)&cmd_config_l2_tunnel_eth_type_id,
- (void *)&cmd_config_l2_tunnel_eth_type_l2_tunnel,
- (void *)&cmd_config_l2_tunnel_eth_type_l2_tunnel_type,
- (void *)&cmd_config_l2_tunnel_eth_type_eth_type,
- (void *)&cmd_config_l2_tunnel_eth_type_eth_type_val,
- NULL,
- },
-};
-
/* Enable/disable l2 tunnel */
struct cmd_config_l2_tunnel_en_dis_result {
cmdline_fixed_string_t port;
(cmdline_parse_inst_t *)&cmd_set_port_meter_stats_mask,
(cmdline_parse_inst_t *)&cmd_show_port_meter_stats,
(cmdline_parse_inst_t *)&cmd_mcast_addr,
- (cmdline_parse_inst_t *)&cmd_config_l2_tunnel_eth_type_all,
- (cmdline_parse_inst_t *)&cmd_config_l2_tunnel_eth_type_specific,
(cmdline_parse_inst_t *)&cmd_config_l2_tunnel_en_dis_all,
(cmdline_parse_inst_t *)&cmd_config_l2_tunnel_en_dis_specific,
(cmdline_parse_inst_t *)&cmd_config_e_tag_insertion_en,
const struct timespec *timestamp);
static void ixgbevf_dev_interrupt_handler(void *param);
-static int ixgbe_dev_l2_tunnel_eth_type_conf
- (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
static int ixgbe_dev_l2_tunnel_offload_set
(struct rte_eth_dev *dev,
struct rte_eth_l2_tunnel_conf *l2_tunnel,
.timesync_adjust_time = ixgbe_timesync_adjust_time,
.timesync_read_time = ixgbe_timesync_read_time,
.timesync_write_time = ixgbe_timesync_write_time,
- .l2_tunnel_eth_type_conf = ixgbe_dev_l2_tunnel_eth_type_conf,
.l2_tunnel_offload_set = ixgbe_dev_l2_tunnel_offload_set,
.udp_tunnel_port_add = ixgbe_dev_udp_tunnel_port_add,
.udp_tunnel_port_del = ixgbe_dev_udp_tunnel_port_del,
return 0;
}
-/* Config l2 tunnel ether type */
-static int
-ixgbe_dev_l2_tunnel_eth_type_conf(struct rte_eth_dev *dev,
- struct rte_eth_l2_tunnel_conf *l2_tunnel)
-{
- int ret = 0;
- struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- struct ixgbe_l2_tn_info *l2_tn_info =
- IXGBE_DEV_PRIVATE_TO_L2_TN_INFO(dev->data->dev_private);
-
- if (l2_tunnel == NULL)
- return -EINVAL;
-
- switch (l2_tunnel->l2_tunnel_type) {
- case RTE_L2_TUNNEL_TYPE_E_TAG:
- l2_tn_info->e_tag_ether_type = l2_tunnel->ether_type;
- ret = ixgbe_update_e_tag_eth_type(hw, l2_tunnel->ether_type);
- break;
- default:
- PMD_DRV_LOG(ERR, "Invalid tunnel type");
- ret = -EINVAL;
- break;
- }
-
- return ret;
-}
-
/* Enable e-tag tunnel */
static int
ixgbe_e_tag_enable(struct ixgbe_hw *hw)