#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
-#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#ifdef RTE_NET_BNXT
#include <rte_pmd_bnxt.h>
#endif
+#ifdef RTE_LIB_GRO
#include <rte_gro.h>
+#endif
#include <rte_hexdump.h>
#include "testpmd.h"
error->cause), buf) : "",
error->message ? error->message : "(no stated reason)",
rte_strerror(err));
+
+ switch (error->type) {
+ case RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER:
+ fprintf(stderr, "The status suggests the use of \"transfer\" "
+ "as the possible cause of the failure. Make "
+ "sure that the flow in question and its "
+ "indirect components (if any) are managed "
+ "via \"transfer\" proxy port. Use command "
+ "\"show port (port_id) flow transfer proxy\" "
+ "to figure out the proxy port ID\n");
+ break;
+ default:
+ break;
+ }
+
return -err;
}
struct port_indirect_action *pia;
int ret;
struct rte_flow_error error;
- struct rte_port *port;
-
- if (port_id_is_invalid(port_id, ENABLED_WARN) ||
- port_id == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
ret = action_alloc(port_id, id, &pia);
if (ret)
return ret;
-
- port = &ports[port_id];
-
- if (conf->transfer)
- port_id = port->flow_transfer_proxy;
-
- if (port_id_is_invalid(port_id, ENABLED_WARN) ||
- port_id == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
-
if (action->type == RTE_FLOW_ACTION_TYPE_AGE) {
struct rte_flow_action_age *age =
(struct rte_flow_action_age *)(uintptr_t)(action->conf);
return port_flow_complain(&error);
}
pia->type = action->type;
- pia->transfer = conf->transfer;
printf("Indirect action #%u created\n", pia->id);
return 0;
}
for (i = 0; i != n; ++i) {
struct rte_flow_error error;
struct port_indirect_action *pia = *tmp;
- portid_t port_id_eff = port_id;
if (actions[i] != pia->id)
continue;
-
- if (pia->transfer)
- port_id_eff = port->flow_transfer_proxy;
-
- if (port_id_is_invalid(port_id_eff, ENABLED_WARN) ||
- port_id_eff == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
-
/*
* Poisoning to make sure PMDs update it in case
* of error.
memset(&error, 0x33, sizeof(error));
if (pia->handle && rte_flow_action_handle_destroy(
- port_id_eff, pia->handle, &error)) {
+ port_id, pia->handle, &error)) {
ret = port_flow_complain(&error);
continue;
}
struct rte_flow_error error;
struct rte_flow_action_handle *action_handle;
struct port_indirect_action *pia;
- struct rte_port *port;
const void *update;
- if (port_id_is_invalid(port_id, ENABLED_WARN) ||
- port_id == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
-
- port = &ports[port_id];
-
action_handle = port_action_handle_get_by_id(port_id, id);
if (!action_handle)
return -EINVAL;
update = action;
break;
}
-
- if (pia->transfer)
- port_id = port->flow_transfer_proxy;
-
- if (port_id_is_invalid(port_id, ENABLED_WARN) ||
- port_id == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
-
if (rte_flow_action_handle_update(port_id, action_handle, update,
&error)) {
return port_flow_complain(&error);
struct rte_flow_query_age age;
struct rte_flow_action_conntrack ct;
} query;
- portid_t port_id_eff = port_id;
- struct rte_port *port;
-
- if (port_id_is_invalid(port_id, ENABLED_WARN) ||
- port_id == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
-
- port = &ports[port_id];
pia = action_get_by_id(port_id, id);
if (!pia)
id, pia->type, port_id);
return -ENOTSUP;
}
-
- if (pia->transfer)
- port_id_eff = port->flow_transfer_proxy;
-
- if (port_id_is_invalid(port_id_eff, ENABLED_WARN) ||
- port_id_eff == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
-
/* Poisoning to make sure PMDs update it in case of error. */
memset(&error, 0x55, sizeof(error));
memset(&query, 0, sizeof(query));
- if (rte_flow_action_handle_query(port_id_eff, pia->handle, &query,
- &error))
+ if (rte_flow_action_handle_query(port_id, pia->handle, &query, &error))
return port_flow_complain(&error);
switch (pia->type) {
case RTE_FLOW_ACTION_TYPE_AGE:
{
struct rte_flow_error error;
struct port_flow_tunnel *pft = NULL;
- struct rte_port *port;
-
- if (port_id_is_invalid(port_id, ENABLED_WARN) ||
- port_id == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
-
- port = &ports[port_id];
-
- if (attr->transfer)
- port_id = port->flow_transfer_proxy;
-
- if (port_id_is_invalid(port_id, ENABLED_WARN) ||
- port_id == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
+ int ret;
/* Poisoning to make sure PMDs update it in case of error. */
memset(&error, 0x11, sizeof(error));
if (pft->actions)
actions = pft->actions;
}
- if (rte_flow_validate(port_id, attr, pattern, actions, &error))
- return port_flow_complain(&error);
+ ret = rte_flow_validate(port_id, attr, pattern, actions, &error);
if (tunnel_ops->enabled)
port_flow_tunnel_offload_cmd_release(port_id, tunnel_ops, pft);
+ if (ret)
+ return port_flow_complain(&error);
printf("Flow rule validated\n");
return 0;
}
struct port_flow_tunnel *pft = NULL;
struct rte_flow_action_age *age = age_action_get(actions);
- if (port_id_is_invalid(port_id, ENABLED_WARN) ||
- port_id == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
-
port = &ports[port_id];
-
- if (attr->transfer)
- port_id = port->flow_transfer_proxy;
-
- if (port_id_is_invalid(port_id, ENABLED_WARN) ||
- port_id == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
-
if (port->flow_list) {
if (port->flow_list->id == UINT32_MAX) {
fprintf(stderr,
uint32_t i;
for (i = 0; i != n; ++i) {
- portid_t port_id_eff = port_id;
struct rte_flow_error error;
struct port_flow *pf = *tmp;
* of error.
*/
memset(&error, 0x33, sizeof(error));
-
- if (pf->rule.attr->transfer)
- port_id_eff = port->flow_transfer_proxy;
-
- if (port_id_is_invalid(port_id_eff, ENABLED_WARN) ||
- port_id_eff == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
-
- if (rte_flow_destroy(port_id_eff, pf->flow, &error)) {
+ if (rte_flow_destroy(port_id, pf->flow, &error)) {
ret = port_flow_complain(&error);
continue;
}
fprintf(stderr, "Flow rule #%u not found\n", rule);
return -ENOENT;
}
-
- if (pf->rule.attr->transfer)
- port_id = port->flow_transfer_proxy;
-
- if (port_id_is_invalid(port_id, ENABLED_WARN) ||
- port_id == (portid_t)RTE_PORT_ALL)
- return -EINVAL;
-
ret = rte_flow_conv(RTE_FLOW_CONV_OP_ACTION_NAME_PTR,
&name, sizeof(name),
(void *)(uintptr_t)action->type, &error);
}
/*
- * Displays the RSS hash functions of a port, and, optionaly, the RSS hash
+ * Displays the RSS hash functions of a port, and, optionally, the RSS hash
* key of the port.
*/
void
tx_pkt_times_intra = tx_times[1];
}
+#ifdef RTE_LIB_GRO
void
setup_gro(const char *onoff, portid_t port_id)
{
} else
printf("Port %u doesn't enable GRO.\n", port_id);
}
+#endif /* RTE_LIB_GRO */
+#ifdef RTE_LIB_GSO
void
setup_gso(const char *mode, portid_t port_id)
{
gso_ports[port_id].enable = 0;
}
}
+#endif /* RTE_LIB_GSO */
char*
list_pkt_forwarding_modes(void)
{"ipv6-sctp", RTE_ETH_FLOW_NONFRAG_IPV6_SCTP},
{"ipv6-other", RTE_ETH_FLOW_NONFRAG_IPV6_OTHER},
{"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
+ {"ipv6-ex", RTE_ETH_FLOW_IPV6_EX},
+ {"ipv6-tcp-ex", RTE_ETH_FLOW_IPV6_TCP_EX},
+ {"ipv6-udp-ex", RTE_ETH_FLOW_IPV6_UDP_EX},
{"port", RTE_ETH_FLOW_PORT},
{"vxlan", RTE_ETH_FLOW_VXLAN},
{"geneve", RTE_ETH_FLOW_GENEVE},
{"nvgre", RTE_ETH_FLOW_NVGRE},
{"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE},
+ {"gtpu", RTE_ETH_FLOW_GTPU},
};
for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
{
port->mc_addr_nb--;
if (addr_idx == port->mc_addr_nb) {
- /* No need to recompact the set of multicast addressses. */
+ /* No need to recompact the set of multicast addresses. */
if (port->mc_addr_nb == 0) {
/* free the pool of multicast addresses. */
free(port->mc_addr_pool);