uint16_t crc; /**< CRC of key. */
uint16_t priority; /**< Priority of matcher. */
uint8_t egress; /**< Egress matcher. */
+ uint8_t transfer; /**< 1 if the flow is E-Switch flow. */
uint32_t group; /**< The matcher group. */
struct mlx5_flow_dv_match_params mask; /**< Matcher mask. */
};
struct mlx5_fdir *fdir; /**< Pointer to associated FDIR if any. */
uint8_t ingress; /**< 1 if the flow is ingress. */
uint32_t group; /**< The group index. */
+ uint8_t transfer; /**< 1 if the flow is E-Switch flow. */
};
typedef int (*mlx5_flow_validate_t)(struct rte_eth_dev *dev,
* Table id to use.
* @param[in] egress
* Direction of the table.
+ * @param[in] transfer
+ * E-Switch or NIC flow.
* @param[out] error
* pointer to error structure.
*
static struct mlx5_flow_tbl_resource *
flow_dv_tbl_resource_get(struct rte_eth_dev *dev,
uint32_t table_id, uint8_t egress,
+ uint8_t transfer,
struct rte_flow_error *error)
{
struct mlx5_priv *priv = dev->data->dev_private;
struct mlx5_flow_tbl_resource *tbl;
#ifdef HAVE_MLX5DV_DR
- if (egress) {
+ if (transfer) {
+ tbl = &sh->fdb_tbl[table_id];
+ if (!tbl->obj)
+ tbl->obj = mlx5_glue->dr_create_flow_tbl
+ (sh->fdb_ns, table_id);
+ } else if (egress) {
tbl = &sh->tx_tbl[table_id];
if (!tbl->obj)
tbl->obj = mlx5_glue->dr_create_flow_tbl
#else
(void)error;
(void)tbl;
- if (egress)
+ if (transfer)
+ return &sh->fdb_tbl[table_id];
+ else if (egress)
return &sh->tx_tbl[table_id];
else
return &sh->rx_tbl[table_id];
matcher->priority == cache_matcher->priority &&
matcher->egress == cache_matcher->egress &&
matcher->group == cache_matcher->group &&
+ matcher->transfer == cache_matcher->transfer &&
!memcmp((const void *)matcher->mask.buf,
(const void *)cache_matcher->mask.buf,
cache_matcher->mask.size)) {
RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
"cannot allocate matcher memory");
tbl = flow_dv_tbl_resource_get(dev, matcher->group * MLX5_GROUP_FACTOR,
- matcher->egress, error);
+ matcher->egress, matcher->transfer,
+ error);
if (!tbl) {
rte_free(cache_matcher);
return rte_flow_error_set(error, ENOMEM,
jump_data = action->conf;
tbl = flow_dv_tbl_resource_get(dev, jump_data->group *
MLX5_GROUP_FACTOR,
- attr->egress, error);
+ attr->egress,
+ attr->transfer, error);
if (!tbl)
return rte_flow_error_set
(error, errno,
matcher.priority);
matcher.egress = attr->egress;
matcher.group = attr->group;
+ matcher.transfer = attr->transfer;
if (flow_dv_matcher_register(dev, &matcher, dev_flow, error))
return -rte_errno;
return 0;