]> git.droids-corp.org - dpdk.git/commitdiff
net/iavf: fix device stop
authorRadu Nicolau <radu.nicolau@intel.com>
Mon, 23 May 2022 12:04:36 +0000 (13:04 +0100)
committerQi Zhang <qi.z.zhang@intel.com>
Wed, 25 May 2022 08:50:55 +0000 (10:50 +0200)
Move security context destroy from device stop to device close function.
Deleting the context on device stop can prevent the application from
properly cleaning and releasing resources.

Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_ethdev.c
drivers/net/iavf/iavf_ipsec_crypto.c

index 7a3b37d5e306f403d91da4747b646cfb92c9e430..e85ae0ed0e5290ac78eb2630a78fdc89a613c080 100644 (file)
@@ -1088,9 +1088,6 @@ iavf_dev_stop(struct rte_eth_dev *dev)
        iavf_add_del_mc_addr_list(adapter, vf->mc_addrs, vf->mc_addrs_num,
                                  false);
 
-       /* free iAVF security device context all related resources */
-       iavf_security_ctx_destroy(adapter);
-
        adapter->stopped = 1;
        dev->data->dev_started = 0;
 
@@ -2713,6 +2710,9 @@ iavf_dev_close(struct rte_eth_dev *dev)
        ret = iavf_dev_stop(dev);
        adapter->closed = true;
 
+       /* free iAVF security device context all related resources */
+       iavf_security_ctx_destroy(adapter);
+
        iavf_flow_flush(dev, NULL);
        iavf_flow_uninit(adapter);
 
index 72ce39a0526976993fd12105867016776f2272b3..fa1cecc1e1be1e40c1fd307ec963283037e103e1 100644 (file)
@@ -1551,8 +1551,6 @@ iavf_security_ctx_destroy(struct iavf_adapter *adapter)
        if (iavf_sctx == NULL)
                return -ENODEV;
 
-       /* TODO: Add resources cleanup */
-
        /* free and reset security data structures */
        rte_free(iavf_sctx);
        rte_free(sctx);