Commit Graph

422 Commits

Author SHA1 Message Date
Mohan Thadikamalla
2b21d4a86e nvethernet: Remove MAC START ioctl
Issue:
MAC START and STOP IOCTL are deprecated,
so these IOCTL calls has internally
generated failure for Linux OSD.

Fix:
Remove MAC START IOCTL from Linux OSD.

Bug 3889287

Change-Id: I19684936d22dac35df5af2393e163f51118fc8ce
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2824816
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-13 06:23:15 -08:00
Jon Hunter
1e04890051 nvethernet: Fix build for Linux v5.14 and v5.17+
The nvethernet driver fails to build for Linux v5.14 and Linux v5.17+
kernels. In Linux v5.15 the return type of the get/set_coalesce
callbacks were updated. In Linux v5.17 the parameters for the
get/set_ringparam callbacks were updated. In Linux v6.1 the
weight parameter for the netif_napi_add() function was removed and the
function netif_napi_add_weight() was added for passing the weight
parameter. Add the necessary kernel version checks to ensure that the
drivers build with the different versions of the Linux kernel.

Bug 3793131

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I56738eddd27eb4ebf7db5a2d0d031a64379482e8
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2820712
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-05 20:45:48 -08:00
Hareesh Kesireddy
32b805cab1 nvethernet: remove unnecessary ioctls
- Removed IPV4/IPV6/TCP/UDP ioctls.
- Added support for single L3L4 ioctl which supports all of the above.

Bug 3825731

Change-Id: Iae3cee595258abf8c908dae5a214d9da9bc8ae80
Signed-off-by: Hareesh Kesireddy <hkesireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2819351
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-05 20:41:29 -08:00
Prasun Kumar
46bc09119b nvethernet: Fix HSI Err Rpt Inj
Update nvethernet for HSI Err Rpt Inj

Bug 3877863

Signed-off-by: Prasun Kumar <prasunk@nvidia.com>
Change-Id: I6171742d2ba1c55be971069643ead713e7f5c439
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2819005
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-05 20:36:52 -08:00
Hareesh Kesireddy
db62bc86bb nvethernet: update l3l4 filter handling
Modified l3l4 filter ioctls based on corresponding osi changes.

Bug 3576506
Bug 3825731

Change-Id: Id9a4ce263f3526e4c5a357d74f9d55ebb59fef29
Signed-off-by: Hareesh Kesireddy <hkesireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2803367
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-30 06:17:02 -08:00
Revanth Kumar Uppala
59a116a6f8 rtl8822ce: Integrate driver with nvidia tree
Bug 3750163

Change-Id: I4378d6c2e105fa2d7f2d969866e9c3557ae1ff29
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2814817
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-29 04:12:33 -08:00
Shobek Attupurath
37d1d67c60 rtl8822ce: Update to _v5.9.0.3e_nv for k-5.15
Update driver to _v5.9.0.3e_nv for k-5.15
Version: v5.9.0.3e_nv-16-g319d9877b.20221101_COEX20200103-0000

Bug 3750163

Change-Id: Ic6b689c100b7e14215793be26943fa46964fc89b
Signed-off-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2814784
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2022-11-29 04:12:28 -08:00
Revanth Kumar Uppala
599d993c3d rtl8822ce: Porting Base driver from K5.10
Porting Base K5.10 driver to K5.15
Version: v5.9.0.3e_nv-1-gdafe03f15.20220505_COEX20200103-1717

Bug 3750163

Change-Id: I5c46db2976addff08a73bd31dafd84c093702545
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2814761
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2022-11-29 04:12:23 -08:00
Revanth Kumar Uppala
729793fc3b nvethernet: Change registers naming convention.
Follow registers naming conventions similar to
upstream DT

Bug 3793131

Change-Id: I6c64294d7c55e3f78e5dddb007db31bdbbef63a4
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2809191
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-29 04:06:27 -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
Mohan Thadikamalla
d0ac6d4396 nvethernet: Update status counters using ioctls
Issue:
TSN, extra, packet error stats counters
are not getting updated during virtualization,
as NVEQOS reads them from the VF OSI core structure.

Fix:
Add new ioctls to update these counters from
the ethernet server OSI core to
the VF OSI core structure.

Bug 3763499

Change-Id: I6e82f9756afe0c2f1adefb5a2449fad479864ea6
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2809358
(cherry picked from commit ab043869fb9b1feb197496d4695b333845689e5e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2815774
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-29 04:06:13 -08:00
Bhadram Varka
61f908bce9 nvethernet: use updated init API
osi_hw_core_init updated by removing not needed arguments

Bug 3787316

Change-Id: I71230fcbac11e911fe24cfcdef20a131bb1c2ade
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
(cherry picked from commit 6027a30d9780678bdbd7f3f947f8e31adf8d0f1f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2808751
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2022-11-29 04:06:08 -08:00
Sanath Kumar Gampa
6c7d05d9bb nvethernet: Address review comments on HSI changes
Bug 3590939
Change-Id: Id7bf154880a8f566a9807a3c3c7c210766d48c03
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2801131
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2806411
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
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>
2022-11-29 04:06:03 -08:00
Manish Bhardwaj
c126c2ee93 mttcan: fix kernel compilation warnings
Using this patch we are fixing below kernel compilation
warnings.
nvidia-oot/drivers/net/can/mttcan/native/m_ttcan_linux.c:
In function 'mttcan_tx_complete':
nvidia-oot/drivers/net/can/mttcan/native/m_ttcan_linux.c
:619:3: warning: ignoring return value of 'can_get_echo_skb',
declared with attribute warn_unused_result [-Wunused-result]
   can_get_echo_skb(dev, msg_no, 0);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bug 3832874

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: I38426d44a479eb7f87f911985bcaabc96b6b1aa1
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2811270
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Shubhi Garg <shgarg@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-22 11:57:40 -08:00
Manish Bhardwaj
9408892331 mttcan: fix kernel compilation warnings
Using this patch we are fixing below kernel compilation
warnings.
out/linux/arm64-defconfig-jetson-modules/nvidia-oot/drivers
/net/can/mttcan/native/m_ttcan_linux.c: In function 'mttcan_start_xmit':
/mlt/kernel/include/linux/stddef.h:8:14: warning: passing argument 4 of
'can_put_echo_skb' makes integer from pointer without a cast
[-Wint-conversion]
 #define NULL ((void *)0)

Bug 3832874

Change-Id: I2aa565f37494f6af39a43b389ea3e1ad7775ed44
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2809373
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-15 11:29:11 -08:00
Bhadram Varka
0772521bf1 nvethernet: remove save/restore register IOCTL code
Bug 3701869

Change-Id: I8b4e67aa6420a46fda7185261c8ecbac0db90f40
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2787485
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@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
Rakesh Goyal
e7ff48aaad nvethernet: update code to use new structure
Remove not required members of ifr_data structure.
Add structure in exported header file.
Add support in code to understand new data structure.

Bug 3704251

Change-Id: I495b34edaa6ac324933508c12a3612de4a52175b
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2782590
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@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
Rakesh Goyal
36df82d64b nvethernet: support for adding L2 filter
Support to add L2 filter uing ioctl
when  Ethernet virtulization is enabled

Bug 3659048

Change-Id: Ib990bf5fa5762f01563b1017b8d3e0c8b02320a6
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2777262
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-01 14:27:08 +05:30
Mahesh Patil
c896399b53 nvethernet: Fix CERT INT31-C issues in sysfs.c
Cert error reported in
https://sccovlink:8443/reports.htm#v17826/p10248/g17826g
CID 565796

Bug 3745813

Change-Id: I1edb8bb1de6f4d28f5b1a5eaf14bc33bcb5a829c
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2765590
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-01 14:27:08 +05:30
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
Bhadram Varka
d3509d8c5d nvethernet: fix buffer re-use usage
Issue: If OSI_RX_SWCX_REUSE flag is set in OSI then
OSD will not reallocate the buffer for that descriptor
index. It will re-use the same buffer virt/physical
addresses. If that buffer is a reserved buffer then OSI
will not process that so it will result in packet drops.

Fix: Reuse the buffer is OSI_RX_SWCX_REUSE flag is set
and the buffer is not a reserved buffer.

Bug 3727058

Change-Id: I3331604a90b2cbe902d91f2082e1fe36f830decc
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2745194
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:08 +05:30
Rakesh Goyal
62f3c4ff12 nvethernet: take exported ioctl related header out
Issue: SW needs to support IOCTL on safety builds and
these header should be exposed to user

Fix: create new header file which is exposed externally

Bug 3704251

Change-Id: Ieee52b5e9ff28cefeb2435be389e3e8df0abe6d1
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2759473
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-01 14:27:08 +05:30
Bhadram Varka
f667be2c63 nvethernet: fix spin lock recursion
Issue:
1) dev_queue_xmit acquired the per queue tx lock and called driver
transmit routine.
2) During the transmit - common interrupt asserted which tries to
acquire the same tx lock which resulted in lock recursion.

Fix: Move the lock acquire to tasklet context under common isr.

Bug 3773016

Change-Id: I7cfd49beb1238286d3bccd9e4b9ccc054c4f6d30
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2770227
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-01 14:27:08 +05:30
Nagaraj Annaiah
1ffcf6d286 nvethernet: Add IVC support atomic
Issue: completion_timeout doesn't support atomic.

Fix: Remove mutex and wait event and change to poll_timeout.

Bug 3733795

Change-Id: Ieb26623ae6191d442bb2f7e2b8c6925660882cfe
Signed-off-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2759245
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@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
Rakesh Goyal
d4e9ecf359 nvethernet: use default selection algorithm
Issue: EQOS supports SP as default algorithm
where MGBE should support ETS as default algorithm.

Fix: We are removing user configuration option from
application. For MGBE there are CBS or ETS(default) as only
options. For EQOS CBS and SP(default) is only options.

Bug 3735907

Change-Id: I83ff3f59129e188335d9cec239d5eb0b2fa76412
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2757410
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-01 14:27:08 +05:30
Narayan Reddy
99acf2912b nvethernet: add lane bringup restart callback
Issue: In the current scenrio, when the remote
interface is brought down and up. There is no way
of getting the link up again with the remote device
which in turn fails the data transfers even though
interface from other end is brought up.

Fix: When interface is gone down on the other side,
MAC receives local faults and in this scenario
no data should be sent to MAC, so disable network
queues and initiate the lane bring up process for
monitoring the link status. Once the link is up,
re enable the network queues for data transfers.

Also added support for enabling driver logs using
msglvl of ethtool

Bug 3744088
Bug 3654543
Bug 3665378

Change-Id: I16cdee74e4e3ff6cd176924575f5005f385d4c5d
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2730876
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: Rakesh Goyal <rgoyal@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
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
Narayan Reddy
617b7327a9 nvethernet: remove pre_si code
remove code for handling pre_si which is unused

Bug 3701869

Change-Id: I3f8fa3e269ea205709e76c4d53d602a13099c5f0
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2747494
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Tested-by: Bhadram Varka <vbhadram@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
Bhadram Varka
76abafe3a3 nvethernet: consume the timestamp if available in tx done
Issue: Observed Tx timestamp timeout from application since
workqueue is not getting scheduled at the driver layer to consume
the Tx timestamp from the OSI layer which resulted in tx_timeout
from APP layer.

Fix: Invoke the timestamp consume function in tx done instead
of scheduling through workqueue. Schedule the work queue only
if the timestamp is not found.

Bug 3658701

Change-Id: If97aebc1980f685e3cc34f135ace91298ee78657
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2732444
Reviewed-by: Troy Kong <troyk@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Troy Kong <troyk@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
Rakesh Goyal
118cdcebdc nvethernet: delete old skb for tx TS
Remove SKB for which HW timestamps are not present

Bug 3647934

Change-Id: Ib3a5ca6275f74425f4fe43a87ea6696823aedd96
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2716400
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Rakesh Goyal
d38959ba90 nvethernet: add spinlock around skb link list
Issue: In race condition node delete and addition
happen at same time, which leads to corruption of
list

Fix: add spinlock to protect critical section

Bug 3580369

Change-Id: Ief5495f049ed62d4e3832855a92eb066975eb672
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2699119
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Bhadram Varka
b37ab09277 nvethernet: use OSI_SUSPEND/RESUME IOCTL's
Issue: While ethernet going into suspend all registers
of controllers saved through save_registers IOCTL and
same will be restored during resume. Register restoring
without following sequence will lead to multiple issues.

Fix: For every dynamic configuration save the input
parameters and use the same parameters through API's
to restore the controller configuration. API approach
will follow the specific sequence for programming the
controller registers.

Bug 3665476

Change-Id: Ib321937faa07eeb086e00ebfce8d0d0b8aeb1f55
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2663393
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Bhadram Varka
43b6c620b8 nvethernet: fix the typo
Fix the log to print Rx ring size instead of Tx

Bug 3489814

Change-Id: Ibba080d09714f8e8be66265571c987a447f00160
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2711927
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: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Om Prakash Singh
fc25e06026 nvethernet: add interface to configure debug interrupt
Add ioctl ETHER_DEBUG_INTR_CONFIG to enable and disable
debug related interrupt at runtime

Bug 3600647
Change-Id: Ie22a7decc1bd2feb90126841a8d8a0eaafa7dc66
Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2703340
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@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
Prateek Patel
ef1378ba02 drivers: ethernet: fix cert_c defect
Add sanity check on snprintf() call in ether_linux.c.

CID 490856

Bug 3512545

Change-Id: I3a68206a587fa2f56d24c85a786d6dc8f2992c31
Signed-off-by: Prateek Patel <prpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2710373
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
b1309d41ea nvethernet: Support for variable Tx/Rx ring length
o Adds support for variable Tx/Rx ring length
which can be changed with ethtool.
o Using default ring size 1K for both MGBE/EQOS
if ring size values not passed from DT.

Bug 3489814

Change-Id: If90a9b2181f9fe9b4beb2ab44e27cb61026cc150
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2652964
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@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
Hareesh Kesireddy
9717d11402 nvethernet: pass tx swcx to tx complete callback
Dma phy address, virtual address and packet length can be
obtained from tx swcx structure. Hence passing
pointer to tx swcx is sufficient. In future, if more information
from osi is needed, it can be embedded into tx swcx itself rather than
adding more arguments to osd tx complete call back.

Bug 3576506

Change-Id: I3b3aca993c52359668c41f337a79ea4d0d1854fb
Signed-off-by: Hareesh Kesireddy <hkesireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2700392
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
8d2e3a6161 nvethernet: fix MC filter corruption issue
Issue:
OSD Driver maintains a local MC address list to avoid the programming
old addresses again into HW when new MC address list passed from the
network stack.
Its observed MC address index for a specific address is different once a
MC address deleted from the list. Because of this new MC address which
is passed in new list is overwriting the old MC address.

Fix:
Program the entire list every time when network stack passes it instead
of maintaining local list at driver.

Bug 3609583

Change-Id: I97cb3ea4d35641ad156d16c54c89e8593ad64459
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2702851
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: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Bhadram Varka
9d509e2313 nvethernet: Enable RSS
Issue: During bring up RSS disabled due to interrupt
assignment at the hypervisor level. Its fixed now with
ethernet server enable where all channel interrupts
comes to single VM interrupt.

Fix: Enable RSS.

Bug 3420115

Change-Id: Iaa2a25532aaa149474f6cbaaf3ee89b5e85ed105
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2618684
Reviewed-by: svcacv <svcacv@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: Om Prakash Singh <omp@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Bibhay Ranjan
4feb5075e4 nvethernet: fix code defects
Issue: SPARSE issues
Fix: Fix as per the given guidelines in the error

Bug 3568991

Change-Id: I983576d7bea30d87905c06030baed6574e2bdb96
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2688521
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