]> git.droids-corp.org - dpdk.git/commitdiff
net/iavf: fix VF reset for flow director rule
authorSimei Su <simei.su@intel.com>
Tue, 28 Apr 2020 05:49:19 +0000 (13:49 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 5 May 2020 13:54:25 +0000 (15:54 +0200)
After VF reset, FDIR rule still takes effect. To solve the issue,
this patch adds to flush all flows before flow uninit. VIRTCHNL
sends message to PF by Admin Queue, so flow flush should be implemented
before Admin Queue shut down.

Fixes: ff2d0c345c3b ("net/iavf: support generic flow API")
Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/iavf/iavf_ethdev.c
drivers/net/iavf/iavf_generic_flow.c
drivers/net/iavf/iavf_generic_flow.h

index 117fbc5f73471e3c6d5e6c92076b831c9f1293c4..e09efffd18d9f23636a2b7e1dbc8b523d79f607e 100644 (file)
@@ -1431,6 +1431,7 @@ iavf_dev_close(struct rte_eth_dev *dev)
                IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 
        iavf_dev_stop(dev);
+       iavf_flow_flush(dev, NULL);
        iavf_shutdown_adminq(hw);
        /* disable uio intr before callback unregister */
        rte_intr_disable(intr_handle);
index bca1ffeb34f2a3d4acf9bc69714e6b8c55f77fc5..8c66ac8f2986f505f8aeb070299059889338c61e 100644 (file)
@@ -34,8 +34,6 @@ static struct rte_flow *iavf_flow_create(struct rte_eth_dev *dev,
 static int iavf_flow_destroy(struct rte_eth_dev *dev,
                struct rte_flow *flow,
                struct rte_flow_error *error);
-static int iavf_flow_flush(struct rte_eth_dev *dev,
-               struct rte_flow_error *error);
 static int iavf_flow_query(struct rte_eth_dev *dev,
                struct rte_flow *flow,
                const struct rte_flow_action *actions,
@@ -966,7 +964,7 @@ iavf_flow_destroy(struct rte_eth_dev *dev,
        return ret;
 }
 
-static int
+int
 iavf_flow_flush(struct rte_eth_dev *dev,
                struct rte_flow_error *error)
 {
index c41ca1bd96e05843ad29b70f2d935262bbbbfd87..978d0716b79753a7b567e75c3763357b5337ebe9 100644 (file)
@@ -306,6 +306,8 @@ struct iavf_flow_parser_node {
 void iavf_register_flow_engine(struct iavf_flow_engine *engine);
 int iavf_flow_init(struct iavf_adapter *ad);
 void iavf_flow_uninit(struct iavf_adapter *ad);
+int iavf_flow_flush(struct rte_eth_dev *dev,
+               struct rte_flow_error *error);
 int iavf_register_parser(struct iavf_flow_parser *parser,
                         struct iavf_adapter *ad);
 void iavf_unregister_parser(struct iavf_flow_parser *parser,