From: Satheesh Paul <psatheesh@marvell.com>
This patch adds flow ops get operation to enable rte_flow_ops.
Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
---
drivers/common/cnxk/roc_npc.c | 2 ++
drivers/net/cnxk/cnxk_ethdev.c | 3 +++
drivers/net/cnxk/cnxk_ethdev.h | 5 ++++-
drivers/net/cnxk/cnxk_ethdev_ops.c | 10 ++++++++++
4 files changed, 19 insertions(+), 1 deletion(-)
@@ -785,6 +785,8 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,
struct npc_flow_list *list;
int rc;
+ npc->channel = roc_npc->channel;
+
flow = plt_zmalloc(sizeof(*flow), 0);
if (flow == NULL) {
*errcode = NPC_ERR_NO_MEM;
@@ -790,6 +790,8 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
goto fail_configure;
}
+ dev->npc.channel = roc_nix_get_base_chan(nix);
+
nb_rxq = data->nb_rx_queues;
nb_txq = data->nb_tx_queues;
rc = -ENOMEM;
@@ -1194,6 +1196,7 @@ struct eth_dev_ops cnxk_eth_dev_ops = {
.rxq_info_get = cnxk_nix_rxq_info_get,
.txq_info_get = cnxk_nix_txq_info_get,
.tx_done_cleanup = cnxk_nix_tx_done_cleanup,
+ .flow_ops_get = cnxk_nix_flow_ops_get,
};
static int
@@ -218,6 +218,8 @@ cnxk_eth_pmd_priv(struct rte_eth_dev *eth_dev)
/* Common ethdev ops */
extern struct eth_dev_ops cnxk_eth_dev_ops;
+extern const struct rte_flow_ops cnxk_flow_ops;
+
/* Ops */
int cnxk_nix_probe(struct rte_pci_driver *pci_drv,
struct rte_pci_device *pci_dev);
@@ -255,7 +257,8 @@ int cnxk_nix_rx_queue_intr_disable(struct rte_eth_dev *eth_dev,
uint16_t rx_queue_id);
int cnxk_nix_pool_ops_supported(struct rte_eth_dev *eth_dev, const char *pool);
int cnxk_nix_tx_done_cleanup(void *txq, uint32_t free_cnt);
-
+int cnxk_nix_flow_ops_get(struct rte_eth_dev *eth_dev,
+ const struct rte_flow_ops **ops);
int cnxk_nix_configure(struct rte_eth_dev *eth_dev);
int cnxk_nix_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid,
uint16_t nb_desc, uint16_t fp_tx_q_sz,
@@ -294,6 +294,16 @@ cnxk_nix_flow_ctrl_set(struct rte_eth_dev *eth_dev,
}
int
+cnxk_nix_flow_ops_get(struct rte_eth_dev *eth_dev,
+ const struct rte_flow_ops **ops)
+{
+ RTE_SET_USED(eth_dev);
+
+ *ops = &cnxk_flow_ops;
+ return 0;
+}
+
+int
cnxk_nix_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr)
{
struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);