uint32_t mark:1; /**< Set if the flow is marked. */
uint32_t drop:1; /**< Drop queue. */
uint64_t hash_fields; /**< Fields that participate in the hash. */
- struct rxq *rxqs[]; /**< Pointer to the queues array. */
+ struct mlx5_rxq_data *rxqs[]; /**< Pointer to the queues array. */
};
/** Static initializer for items. */
struct ibv_cq *cq; /**< Verbs completion queue. */
};
+static const struct rte_flow_ops mlx5_flow_ops = {
+ .validate = mlx5_flow_validate,
+ .create = mlx5_flow_create,
+ .destroy = mlx5_flow_destroy,
+ .flush = mlx5_flow_flush,
+ .query = NULL,
+ .isolate = mlx5_flow_isolate,
+};
+
+/**
+ * Manage filter operations.
+ *
+ * @param dev
+ * Pointer to Ethernet device structure.
+ * @param filter_type
+ * Filter type.
+ * @param filter_op
+ * Operation to perform.
+ * @param arg
+ * Pointer to operation-specific structure.
+ *
+ * @return
+ * 0 on success, negative errno value on failure.
+ */
+int
+mlx5_dev_filter_ctrl(struct rte_eth_dev *dev,
+ enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op,
+ void *arg)
+{
+ int ret = EINVAL;
+
+ if (filter_type == RTE_ETH_FILTER_GENERIC) {
+ if (filter_op != RTE_ETH_FILTER_GET)
+ return -EINVAL;
+ *(const void **)arg = &mlx5_flow_ops;
+ return 0;
+ }
+ ERROR("%p: filter type (%d) not supported",
+ (void *)dev, filter_type);
+ return -ret;
+}
+
/**
* Check support for a given item.
*
return NULL;
}
for (i = 0; i < flow->actions.queues_n; ++i) {
- struct rxq_ctrl *rxq;
+ struct mlx5_rxq_ctrl *rxq;
rxq = container_of((*priv->rxqs)[flow->actions.queues[i]],
- struct rxq_ctrl, rxq);
+ struct mlx5_rxq_ctrl, rxq);
wqs[i] = rxq->wq;
rte_flow->rxqs[i] = &rxq->rxq;
++rte_flow->rxqs_n;
claim_zero(ibv_destroy_rwq_ind_table(flow->ind_table));
if (flow->mark) {
struct rte_flow *tmp;
- struct rxq *rxq;
+ struct mlx5_rxq_data *rxq;
uint32_t mark_n = 0;
uint32_t queue_n;
for (tqueue_n = 0;
tqueue_n < tmp->rxqs_n;
++tqueue_n) {
- struct rxq *trxq;
+ struct mlx5_rxq_data *trxq;
trxq = tmp->rxqs[tqueue_n];
if (rxq == trxq)
* Nonzero if the queue is used by a flow.
*/
int
-priv_flow_rxq_in_use(struct priv *priv, struct rxq *rxq)
+priv_flow_rxq_in_use(struct priv *priv, struct mlx5_rxq_data *rxq)
{
struct rte_flow *flow;