nvethernet: Handle error conditions in macsec

1. Track MAC state and return error if MAC is down
2. Protect ref_count read with mutex to avoid race condition
3. free macsec priv memory on rmmod

Bug 3309824

Change-Id: Ia6f1cee0399c294b603b10a3ce8a3407060578d3
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2548464
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Mahesh Patil
2021-05-25 11:27:45 -07:00
committed by Revanth Kumar Uppala
parent 2811efc501
commit c1cd386acd
3 changed files with 129 additions and 59 deletions

View File

@@ -128,7 +128,9 @@ enum nv_macsec_nl_commands {
* @brief MACsec supplicant data structure
*/
struct macsec_supplicant_data {
/** specific port id to identity supplicant instance */
unsigned int snd_portid;
/** flag check supplicant instance is allocated */
unsigned short in_use;
/** MACsec protect frames variable */
unsigned int protect_frames;