]> git.droids-corp.org - dpdk.git/commitdiff
net/bnxt: register TruFlow flow API ops
authorVenkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Wed, 15 Apr 2020 08:19:08 +0000 (13:49 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:08 +0000 (13:57 +0200)
Register bnxt_ulp_rte_flow_ops when host based TRUFLOW is
enabled.

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt.h
drivers/net/bnxt/bnxt_ethdev.c

index f22f4a749bb20d88025d25fe86bf111e2ff8f060..0a6b350d77cb401f7f5ae13c08b4b1ceb124d7a4 100644 (file)
@@ -731,6 +731,7 @@ extern int bnxt_logtype_driver;
 #define PMD_DRV_LOG(level, fmt, args...) \
          PMD_DRV_LOG_RAW(level, fmt, ## args)
 
+extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;
 int32_t bnxt_ulp_init(struct bnxt *bp);
 void bnxt_ulp_deinit(struct bnxt *bp);
 
index 2f08921336ae8ee34c380e3fb40f058b0797cccd..783e6a4f45edc1aa8ec22e08a51e3f6a1543d338 100644 (file)
@@ -3288,6 +3288,7 @@ bnxt_filter_ctrl_op(struct rte_eth_dev *dev,
                    enum rte_filter_type filter_type,
                    enum rte_filter_op filter_op, void *arg)
 {
+       struct bnxt *bp = dev->data->dev_private;
        int ret = 0;
 
        ret = is_bnxt_in_error(dev->data->dev_private);
@@ -3311,7 +3312,10 @@ bnxt_filter_ctrl_op(struct rte_eth_dev *dev,
        case RTE_ETH_FILTER_GENERIC:
                if (filter_op != RTE_ETH_FILTER_GET)
                        return -EINVAL;
-               *(const void **)arg = &bnxt_flow_ops;
+               if (bp->truflow)
+                       *(const void **)arg = &bnxt_ulp_rte_flow_ops;
+               else
+                       *(const void **)arg = &bnxt_flow_ops;
                break;
        default:
                PMD_DRV_LOG(ERR,