Commit Graph

38 Commits

Author SHA1 Message Date
Sushil Kumar Singh
8fc898d1ec nvethernet: assign macsec private data to NULL
Issue:
L4T platforms on boot comes up with MTU as 1500.
However on changing the MTU to jumbo, the final
MTU which gets set accounts the MACSEC ICV tag
len and reduces the MTU by 34 bytes even though
the platform does not support MACSEC.

Fix:
Assign macsec allocated private data to NULL and
use the NULL check in ndo mtu change ioctl call
to reject MTU reduction if macsec is not supported.

Bug 4137597

Change-Id: Ica3003b54762dd5d240c9b0c5c012049b4e503b2
Signed-off-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2928569
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-04 13:57:42 -07:00
Revanth Kumar Uppala
306f33d38e nvethernet: Read instance_id irrespective of macsec.
Issue:
MGBE0 ASID is getting programmed for all the MAC instances
which inturn causing the data transfer failures.Macsec is not enable
and hence instance_id is not getting updated to the corresponding mac
instance number and hence all mac instance_id's are initialized with 0.
Since ASID programming is based on mac instance_id, all MACs are
programmed with MGBE0 MAC instance id.

Fix:
Moved reading of instance_id from DT out of macsec_probe and hence the
instance_id gets updated irrespective of MAC sec enable/disable.

Bug 4124937

Change-Id: I500ed8d3db402995488260af99ad190217ff6dd2
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2925252
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-27 09:23:14 -07:00
Revanth Kumar Uppala
b23abb0c87 nvethernet: Resolve compilation warnings on kernels 5.17+
dev_addr present in struct net_device is made const
from K5.17. So, typecasting it to "nveu8_t * const" while
passing it to the osi_macsec_init().

Bug 4076818

Change-Id: I4b2ac2b1a033bc41af5174da29ff9867fe4df89f
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2900162
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-10 13:53:44 -07:00
Sanath Kumar Gampa
d07b3d604c nvethernet:MACSEC, add byp lut with VF MAC
Issue: If the supplicant is killed for some reason Data would flow
plain on that interface, this needs to be avoided

Fix: Update bypass LUT such that if the frames from the VF(on which
supplicant is launched) is received on MACSEC either authenticate the
same or drop. Along with this handles below items as well. All the VFs MACIDs
are obtained in OSI to update the bypass LUTs to decide on which VF frames
to be authenticated and which VF frames needs to be bypassed.

1. Remove osi_macsec_en API and have single API to init and deinit
2. Remove explicit command from supplicant to set control port and
set protected frames. Handle the same in osi_macsec_init

Bug 3984665

Change-Id: I8bc8aa95d1e21e99e992b471fb70ed58073163f7
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2878515
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-21 11:35:13 -07:00
Sushil Singh
9b97e33558 nvethernet: Fix cert c issues
Issue:
CERT EXP33-C - Using uninitialized value.

Fix:
Initialize variable before use

Bug 3959323

Change-Id: Ia4dc3f58ef13c76305ce8242d38a1863986af193
Signed-off-by: Sushil Singh <sushilkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2853914
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-02-10 23:44:41 -08:00
Revanth Kumar Uppala
e37e03efd9 nvethernet: Enable nvethernet driver support
Enable nvethernet driver support for K5.15

Bug 3793131

Change-Id: I2a6d46c9173ea633931308c34e950b404f54796d
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2801126
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-29 04:06:17 -08:00
Sanath Kumar Gampa
8ff195acb5 nvethernet: Add support for SAK 256 with PKCS11
Bug 3784504

Change-Id: Id2f4af4e3d882f95a76b7281d7b260ca8c32c702
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2776048
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-01 14:27:08 +05:30
Mahesh Patil
ae8ea24a6c Port wpa_supplicant nvmacsec to nvpkcs11
Adding linux driver changes required to support macsec nvpkcs11
framework api's

Bug 3573999
Bug 3345671

Change-Id: I6181b05eea08e9c329e89384fb7f23604918632b
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2692303
Reviewed-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
1cb18af637 nvethernet: Update the sysfs with macsec an status
Bug 3757857

Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Change-Id: I61101fcd1d8229c5e0b8e9f85aae4cea8320ef07
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2765063
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
f502700729 nvethernet: macsec: Do not enable car in virt case
Issue: Clocks and resets would be taken care by server if enabled

Fix: Skip enabling macsec clocks and resets if virtualization is enabled

Bug 3743615

Change-Id: I0ed13d7ba52279652619b5cac406c2b2ffd503a5
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2755780
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
47185d2fc3 nvethernet: macsec API cleanup
Cleanup of OSI macsec APIs, hence made relevant changes to OSD

Bug 3709820

Change-Id: I33a77f31553d213e565a7f4ad346fe3c026fafde
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2738231
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: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
6104d5e348 nvethernet:macsec:Related change to OSI misra fix
Fixed MISRA 15.5 and 2.5 errors in OSI hence these are the dependednt
changes in Linux OSD

Bug 3691236

Change-Id: Ie590082025235c48abb1588550121e80b92db487
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2735586
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: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
c7376b2390 nvethernet: macsec suspend-resume with wol enabled
Issue: If WOL is enabled after running "./ethtool -s eth0 wol g"
command there will not be any eapol frames transaction, hence macsec
will be disabled. As macsec is disabled before suspend we are not
enabling it back once resumed. Because of this eapol frames are also
sent with sec-tag as byp_lut is not programmed.

Fix: Instead of depending on the macsec state, check if there is any
supplicant running, if there is any supplicant then enable the macsec
post resume.

Bug 3577131

Change-Id: I6018b94411034eebba34f5f0a9520907305c573e
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2694446
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
cafe9a309c nvethernet:macsec: Added support to use AES_256
Bug 3673435

Change-Id: Ifeedf740f23595e887de0cb8b67dc07f901b089e
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2730247
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
0913e1b2ed nvethernet: Support macsec enablement via DT
Issue: Name of the nl_family is nv_macsec for all the interfaces
hence even if the macsec is enabled for one interface and disabled for
other interfaces, supplicant can be launched for all the interfaces.

Fix: Use the interface name for the nl_family name hence supplicant can
check if macsec is enabled in DT before initializing supplicant for that
particular interface

Bug 3673434

Change-Id: I33d62a0ab2b74f7f53abcd8e6629c1b013eede86
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2726483
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
4c8ec560fa nvethernet:macsec:Replay protection enable config
Issue: Replay protection is enabled by default though disabled from
supplicant configuration

Fix: If replay protection is enabled from supplcant use maximum
PN window

Bug 3673458

Change-Id: I5a2c3f0b6bca56831afb0e5f635dbdd8e8bc4db8
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2728326
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
1b36ff2b67 nvethernet: fix macsec osi Misra/coverity issues
Issue: To fix the MISRA/COVERITY defects in OSI
Some of the API names got changed

Fix: Update the OSD by using the new API name.
Addressed another issue where some of the unwanted
code is removed as MACSEC is always enabled for both
tx and Rx but not anyone of them

Bug 3460422

Change-Id: I21e64f7004fe1f7b09f863c7a68c36408198cbe2
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2618710
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:08 +05:30
Om Prakash Singh
4ae758b99b nvethernet: add HSI support
1) Add threaded interrupt handler function to call EPL API
   to report error.

2) add hsi_enable sysfs interface to enable HSI feature at runtime
   to enable:
   echo enable > /sys/devices/platform/./nvethernet/hsi_enable
   to disable:
   echo disable > /sys/devices/platform/./nvethernet/hsi_enable

3) For mac RX CRC and checksum error, error reporting frequency is
   every one second for HSI_ERROR_THRESHOLD error count

4) Added DT property “nvidia,hsi_err_time_threshold” to specify time
   threshold for error reporting

5) Added DT property "nvidia,hsi_err_count_threshold" to specify
    error count threshold for error reporting

Bug 3543410
Change-Id: I73ef1a674a846295e02deff7e07954e8dada9792
Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2675040
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
d84a598002 nvethernet: MACSEC MTU update
Issue: If MTU is increased after Supplicant is initialized
we are not updating the MACSEC MTU so the frames will get
dropped as the MACSEC MTU is lesser than the frames received

Fix: Changes to update the MACSEC MTU along with MAC MTU

Bug 3577143

Change-Id: I8cdd8ce331cbf40139e6f486439113d5b29a0687
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2686289
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
36d76518df nvethernet:Fix crash issue when driver is reloaded
Issue: Kernel crash is seen when nvethernet driver is reloaded

Fix: Remove the "readonly after init" attribute for MACSEC ops
structure.

Bug 3560071

Change-Id: I973135c5090d55d40087b30dc59ae77b1bae5e5a
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2677537
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
a7db87668c nvethernet: Move Hkey generation logic to OSD
Bug 3522740

Change-Id: I5a5dd5d51f8492f65d1f9c928c0c30770beaa7fa
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2664024
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Sanath Kumar Gampa
818847a4e8 nvethernet:MACSEC suspend/resume changes
Added functionality to support MACSEC
suspend and resume by disabling/enabling
MACSEC CAR as part of ether suspend and resume
and using macsec_open and macsec_close

Bug 3399462

Change-Id: I296675ea62e99922bd20cd805a40afa805b08214
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2610649
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: 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
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