Commit Graph

16 Commits

Author SHA1 Message Date
Sanath Kumar Gampa
538c60bba4 nvethernet: Changes to enable AN after key program
Issue: In longer stress tests we see unint_key_slot errors
if the key programing is done after AN is enabled.

Fix: Fix is to program the key and then enable AN.

Bug 3422356

Change-Id: I05ec54e5a47f642b5663edffd1b24e1e2ac50777
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2626061
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
a43d0166c5 Nvethernet: changes to receive lpn in enable SA
Enhancement to receive lowest_pn from supplicant
as part of receive AN enable.
Also accept pn_window as 0 from supplicant

Bug 3371004

Change-Id: Ic9b90ea902b9f450fc29a397f93be5cca01e9e87
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2619948
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
db74724d08 nvethernet:MACSEC osd send next PN to supplicant
Changes to get next PN used for a given SCI and AN
Also added change to deinit macsec for failures
after macsec init

Bug 3371004

Change-Id: Ib0f0ee3dbc4da366b0fa1146c974993db2068c60
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2612208
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Mahesh Patil
4b71306a35 nvethernet: Fix err for macro MACSEC_KEY_PROGRAM
- Fix compiler err when macro MACSEC_KEY_PROGRAM enabled
- Add support key programming through sysfs for all macsec instances

Bug 3389496

Change-Id: Ia91fefb72182f62516104dcafa4d75dbf724b8e3
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2601541
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
ee3b01231e nvethernet: MACSEC send InstanceID to supplicant
Issue: If MGBE0 is not up and if we try to run supplicant
on MGBE1/2/3 then we would see a crash as we were accessing
the TZ space allocated to MGBE0 which is not up yet

Fix: Sending the Instance ID to supplicant so that supplicant
will access the TZ space corresponding to the MGBE
interface which is up

Bug 200765688

Change-Id: I42893d6142f7b8495a06e31d88a920353114e141
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2593897
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@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: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
faf4382eb4 nvethernet: macsec secure and n_secure irq freeing
Issue: Observed a Kernel warning if we make enable
MACSEC using sysfs once and disable twice

Fix: Avoid freeing if macsec IRQ is already freed

Bug 200772596

Change-Id: I9e2a018da7b0b6bcef79af895de2dbd04859aa55
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2593896
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:08 +05:30
Bhadram Varka
6c979ebdd5 nvethernet: Get HV window base from DT
Issue: SID needs to be programmed through HV window
to get it reflected in controller register space.
Currently its programmed through RM window.

Fix: Get HV window base address from DT and program
in controller registers in non-hypervisor mode.
Store MAC instance ID to program the same ASID
values which are used in DT.

Bug 200761024

Change-Id: Ie9bcaebcba39f2d07438c9502591c0f51f22378f
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2592481
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:08 +05:30
Mahesh Patil
b02ba38d38 nvethernet: address review comments
- Remove debug code under TEST macro
- Remove macsec CLK/RST hard code WAR's
- Update macsec OSI macro's as per latest OSI_ prefix

Bug 3264523

Change-Id: I8674e953e0faf49125e2326bdeb4b5bdc323a26c
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2548474
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:08 +05:30
Mahesh Patil
c1cd386acd 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
2022-11-01 14:27:08 +05:30
Mahesh Patil
2811efc501 nvethernet: Add DT macsec instance id
Added macsec's intance id which will be used by TZ

Bug 3324237

Change-Id: I6f7daf4e0947cac55ff161c44d628514de0a2e13
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2548469
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:08 +05:30
nannaiah
975e946c85 nvethernet: Add workqueue to set Rx mode.
Issue:
Network RTNL lock disables scheduler which causes IVC hang.

Fix:
- Add workqueue to set Rx mode.
- Change IVC spinlock to workqueue.
- Add virtualization check for macsec clk init.
- Add Read & Write Register.

Bug 2694285

Change-Id: I8354b500c62c0145eeed9a66bfcc8227fc8999e7
Signed-off-by: Nagaraj annaiah <nannaiah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2520309
2022-11-01 14:27:08 +05:30
Mahesh Patil
d814423323 nvethernet: Support multiple SC's
Add support for multiple SC's, so that multiple SC's can be
created using wpa_supplicant

Bug 200672416

Change-Id: Iaaa77972f989a3fafb5ade05c13c50d718bf9da9
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2511176
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Mahesh Patil
ddd655451d nvethernet: Remove osd callback from osi
Remove calling osd callback from osi to program SAK and
program SAK from OSD itself.

Bug 3308383

Change-Id: I38192a6d036fda190a6cd8f3a901a79511972614
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2528694
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Mahesh Patil
b55cba3cf7 nvethernet: Update mac/macsec init
Update mac/macsec init programming
1. macsec clock and reset programming order at init and deinit
2. macsec SOT values as per macsec IAS
3. mac IPG values as per macsec IAS

Bug 3266535

Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Change-Id: I29c829c47d0ae7e3529464da79ba6a9a2bc68919
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2506487
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
2022-11-01 14:27:08 +05:30
Mahesh Patil
023efe53b2 nvethernet: Enable key program through TZ
Enabling macsec key's programming using TZ

Bug 3246511

Change-Id: I07d921018a611e4c8dd57aaa27d20a845c9af658
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2478492
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Tested-by: Bhadram Varka <vbhadram@nvidia.com>
2022-11-01 14:27:08 +05:30
Srinivas Ramachandran
805fe9c4fa nvethernet: Add support for MACsec controller
This commit adds the driver interface for the
MACsec controller. The driver interface is
invoked using generic netlink messages from
userspace MACsec key agreement agent.

Currently sysfs node is added to check the irq
stats for default macsec controller operation.

Bug 2913560

Change-Id: I07b0b778ba1c6674e87b103a3e68e158fea61c2c
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
2022-11-01 14:27:08 +05:30