net/cnxk: support flow API
[dpdk.git] / drivers / net / cnxk / cn10k_ethdev.c
index 5ff36bb..0396ff6 100644 (file)
@@ -2,6 +2,7 @@
  * Copyright(C) 2021 Marvell.
  */
 #include "cn10k_ethdev.h"
+#include "cn10k_rte_flow.h"
 #include "cn10k_rx.h"
 #include "cn10k_tx.h"
 
@@ -308,6 +309,20 @@ nix_eth_dev_ops_override(void)
        cnxk_eth_dev_ops.dev_ptypes_set = cn10k_nix_ptypes_set;
 }
 
+static void
+npc_flow_ops_override(void)
+{
+       static int init_once;
+
+       if (init_once)
+               return;
+       init_once = 1;
+
+       /* Update platform specific ops */
+       cnxk_flow_ops.create = cn10k_flow_create;
+       cnxk_flow_ops.destroy = cn10k_flow_destroy;
+}
+
 static int
 cn10k_nix_remove(struct rte_pci_device *pci_dev)
 {
@@ -332,6 +347,7 @@ cn10k_nix_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
        }
 
        nix_eth_dev_ops_override();
+       npc_flow_ops_override();
 
        /* Common probe */
        rc = cnxk_nix_probe(pci_drv, pci_dev);