Commit Graph

123 Commits

Author SHA1 Message Date
Revanth Kumar Uppala
9831027796 nvethernet: Support both DT flags to maintain backward compatibility
In the previous release for T264 platforms,the restart lane bringup
logic was controlled through the device tree flag
'nvidia,pcs-rx-eq-sw-ovrd'.
In incremental releases, the flag has been renamed
'nvidia,force-restart-lane-bringup'.

To maintain backward compatibility with older device trees,
the driver now checks for both flags.If either flag is present,
restart lane bringup is executed.

The legacy flag 'nvidia,pcs-rx-eq-sw-ovrd' is deprecated.

Bug 5017313

Change-Id: I24040f508ef776e29a0bb0c1f07d4a74fa4cc8cc
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3471233
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-10-24 16:27:28 -07:00
Rakibul Hassan
f374450381 coe: Add Camera Over Ethernet cababilities
The following change is a squash change that aims to reintroduce
Camera Over Ethernet (CoE) functionality to kernel.

Bug 5401884
Bug 5419655

Change-Id: Id2fc0263c43ed8566241dbf712aa603a3b3a76f4
Signed-off-by: Rakibul Hassan <rakibulh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3419627
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Igor Mitsyanko <imitsyanko@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
2025-07-30 07:15:10 -07:00
Narayan Reddy
29ee31019b nvethernet: remove ETHER_PRV_TS_IOCTL support
remove ETHER_PRV_TS_IOCTL since it is not longer used.

Bug 5265084

Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Change-Id: If3fd6d82b67812e25c9146569d2ff2f0e8dab5f4
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3367197
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
2025-07-24 10:20:35 +00:00
Sanath Kumar Gampa
7fec719a7c nvethernet:Move blocking MACSec in PHY to server
Removed the below functionality from Linux OSD as we moved
the same to ethernet server to avoid implementation in QNX OSD

- Restrict enabling MACSec in PHY

Bug 5221921

Change-Id: I0cbdeccfe91a67060a4609b9b8bc2bf842547b99
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3341020
Reviewed-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:18 +00:00
Sanath Kumar Gampa
5a5cf6254f nvethernet: handling new CERT errors
CERT INT08-C
CERT STR07-C

Jira NET-2907

Change-Id: If331caf9838840073792de5ac722f268920c4a87
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3328902
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:18 +00:00
Bhadram Varka
1960558372 nvethernet: suspend/resume time profiling
Add suspend/resume time to the debugfs so that
tests can be written to monitor the SC7 KPI

Bug 4202840

Change-Id: I92531277ab7149269186f8c61237931de99a3368
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3300390
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
2025-07-24 10:19:16 +00:00
Mohan Thadikamalla
a40f3c81dc nvethernet: icd: Add MACsec netlink events
- Added support for MACsec Netlink
message commands.
- Integrated Doxygen comments for
NvEthernetLinux documentation.

Jira NET-2816

Change-Id: I340be3451a92d8ae4e0164a2caf61da1650a2939
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3312567
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
2025-07-24 10:19:16 +00:00
Sanath Kumar Gampa
5193e86207 kernel-nvidia-oot: Restrict enabling MACSec in PHY
Restrict enabling MACSec support in below PHYs via MDIO

- MV-Q3244
- 88Q2221M

Jira NET-2795

Change-Id: I2cf767ad89762a5daa8ac29e753365af2e5d24fb
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3308513
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Narayana Reddy P <narayanr@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:16 +00:00
Sanath Kumar Gampa
247613d6ce nvethernet: fix top-25 issues
Fixed below issues

-FORWARD_NULL
-CERT STR07-C
-CERT INT32-C
-CERT INT30-C
-CERT INT08-C
-CERT EXP39-C
-CERT EXP34-C

JIRA NET-2044

Change-Id: I839bd5aedff30c7e9679f513a2cf7a1fbe3b2b8a
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3258684
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:16 +00:00
Mohan Thadikamalla
524e20def3 nvethernet: Add NvEthernetLinux ICD support
Add NvEthernetLinux Doxygen comments support
by documenting platform_driver,
net_device_ops, and ioctl command data.

Jira NET-2168

Change-Id: Ia8140290e4f01c00b6a5d310d8d64a8e0eb3b29c
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3291517
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:16 +00:00
Nagaraj Annaiah
731489e015 Ethernet: Add Sysfs Support to test Tx and Rx bandwidth
Transmit: Add test_tx_bandwidth_dump_enable support to
transmit packets from the driver which helps measure
line rate for 25G and 10G.
pkt1500, pkt8192, pkt64 packet sizes can be configured.
Receive- Drop Packets at the driver level.

Bug 4742868

Change-Id: I52fe1b73b169dfedc06afea5fb62d7bc21fd9ba1
Signed-off-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3197198
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:10 +00:00
Narayan Reddy
0bca2438be nvethernet:set clocks based on serdes speed
1) set eqos rx clock based on serdes speed
2) set mgbe app parent based on serdes speed

Bug 4713751

Change-Id: If776c84807f7aa0373e1106c218b60da51921e79
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3166928
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
2024-07-08 15:55:49 -07:00
Mahesh Patil
6bc9570126 nvethernet: T26x CAR changes
Ported from -
https://git-master.nvidia.com/r/c/nvethernet-docs/+/3126090

Bug 4228185

Change-Id: I74b0607de28b9a635afeae80dbc31cb79bd45f30
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>

fix compilation error

Change-Id: I088609c66a180aeacf8baeb9dad0d29a38550726
2024-06-07 13:10:54 +00:00
Rakesh Goyal
eb29db2879 nvethernet: ptp support for upcoming chip
Bug 4221043

Change-Id: I4689259e48705aa975ec33dddaba8fd7e941d304
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/nvethernet-docs/+/2968051
Tested-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2024-06-07 13:10:54 +00:00
Rakesh Goyal
4cd40b0b3b nvethernet: T26X MAC_Address0_High reg AE bit
In T26X, MAC_Address0_High reg AE bit R/W, so changing
UC and BC address indexing to 0 and 1.

Ported from -
https://git-master.nvidia.com/r/c/nvethernet-docs/+/2987634

Bug 4325242

Change-Id: Id2e6d757ceee750a31bf1fdf3821bc5dd892f08b
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
2024-06-07 13:10:54 +00:00
Mahesh Patil
2b4c6bc2fb nvethernet: match stats count to num of vdma
In T164 MTL Q numbers are not same as VDMA, so change
ether_xtra_stat_counters to match VDMA number

Ported from -
https://git-master.nvidia.com/r/c/nvethernet-docs/+/2992110

Bug 4316080

Change-Id: Id8e4f1b37f4aa6d84e4faa0c2b03c42d1cfd4cc2
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
2024-06-07 13:10:54 +00:00
Mahesh Patil
90a31dac49 nvethernet: Add T264 changes to include 48 filters
Add support to include 48 filters for T264 from feature register

Ported from -
https://git-master.nvidia.com/r/c/linux-nv-oot/+/3148383

Bug 4291865

Change-Id: Ic3df0db74dc86bebcacff2f77238f1a6bcf38657
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
2024-06-07 13:10:54 +00:00
Mahesh Patil
5edac49a28 nvethernet: T264 Enable 20 VDMA channel support
Ported from -
https://git-master.nvidia.com/r/c/nvethernet-docs/+/2940794

Bug 4043836

Change-Id: I763bfdaa78082de035219e10ef1c131bdbba5e35
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
2024-06-07 13:10:54 +00:00
Rakesh Goyal
2a104ca84d nvethernet: T264 VDMA feature and initial bring up
Bug 4043836

Ported from the change -
https://git-master.nvidia.com/r/c/nvethernet-docs/+/2896006

Change-Id: I844112cc71e387f6ae04c2cc7f64b71abb4283fd
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3149289
Tested-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: Michael Hsu <mhsu@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Tested-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-06-05 02:51:08 -07:00
Srinivas Ramachandran
70999e5756 nvethernet: Enable Rx csum offload only for EQOS
Issue: Rx csum offload can be safely enabled
       for EQOS as there is reliable HW sequence to
       ensure data validity when processing descriptors
       which are SW owned.
Fix:   Enable Rxcsum for eqos.

Bug 4486046

Change-Id: Ic3ef7317cfc9d22c0756afc6dfc9f98ce6743977
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3126197
(cherry picked from commit 7e908f2f0bce0650b21c64fddb31401f190c26df)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3146940
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Tested-by: Hareesh Kesireddy <hkesireddy@nvidia.com>
Reviewed-by: Hareesh Kesireddy <hkesireddy@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Amlan Kundu <akundu@nvidia.com>
2024-05-31 02:18:48 -07:00
Aniruddha Paul
615ba15a30 nvethernet: Create pool per Rx DMA channel
Existing implementation uses a single page_pool
for all Rx DMA channels. As by default all irqs
are on CPU 0, this does not cause any issue.
Routing an irq to some other CPU causes race
conditon for page allocation from page_pool which
leads to random memory corruption.

[  158.416637] Call trace:
[  158.416644]  arm_lpae_map_pages+0xb4/0x1e0
[  158.416649]  arm_smmu_map_pages+0x8c/0x160
[  158.416661]  __iommu_map+0xf8/0x2b0
[  158.416677]  iommu_map_atomic+0x58/0xb0
[  158.416683]  __iommu_dma_map+0xac/0x150
[  158.416687]  iommu_dma_map_page+0xf4/0x220
[  158.416690]  dma_map_page_attrs+0x1e8/0x260
[  158.416727]  page_pool_dma_map+0x48/0xd0
[  158.416750]  __page_pool_alloc_pages_slow+0xc4/0x390
[  158.416757]  page_pool_alloc_pages+0x64/0x90
[  158.416762]  ether_padctrl_mii_rx_pins+0x164/0x9d0 [nvethernet]
[  158.416807]  ether_padctrl_mii_rx_pins+0x478/0x9d0 [nvethernet]
[  158.416822]  osi_process_rx_completions+0x284/0x4d0 [nvethernet]
[  158.416832]  0xffffa26218b8f71c
[  158.416855]  __napi_poll+0x48/0x230
[  158.416871]  net_rx_action+0xf4/0x290
[  158.416875]  __do_softirq+0x130/0x3e8
[  158.416889]  __irq_exit_rcu+0xe8/0x110

This change creates a page_pool per Rx DMA channel.
This ensures there is no race conditon for page
alloc/dealloc from each DMA napi context.

Bug 4541158

Change-Id: I12668ee7d824fd30d54a874bbbdf190d02943478
Signed-off-by: Aniruddha Paul <anpaul@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3091494
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
2024-03-17 09:33:32 -07:00
Narayan Reddy
85cf3fb4b3 nvethernet: remove calling of osi_update_stats_counter
remove osi_update_stats_counter and add logic in
nvethernet itself to take care of incrementing the
value

Bug 4284096
Bug 4449611

Change-Id: I0b7e6f03651b0d092d136baf0efd1caffc762205
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053871
(cherry picked from commit bdb1fedec9f3781a3100bd2838271551df31984f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3074753
(cherry picked from commit d31b03a583adf52a7978ef14a9cc0c7d3005ccb0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3081228
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Bhadram Varka <vbhadram@nvidia.com>
2024-02-28 11:20:35 -08:00
Jon Hunter
cd4dce2c20 net: nvethernet: Use conftest for Linux v6.6
In Linux v6.6, the header net/page_pool.h was split into two headers;
net/page_pool/helper.h and net/page_pool/types.h. Use the conftest
script to detect which of these headers are present and generate compile
time definitions for including the appropriate headers.

Bug 4346767

Change-Id: I389ce5b867a1efd867b8392bb21383784c1b4af6
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3026553
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-04 20:00:23 -08:00
Rakesh Goyal
8ca3fa5c51 nvethernet: Skip PHC update if no config change
Issue: Restarting of PTP daemon updates
the current system time in MAC registers.

Fix: Configure PTP registers only if PTP daemon
sends updated configuration. If the configuration
is same continue with earlier registers update.
System time will be set in the MAC registers at
the time of ptp_early_init and the 1st ptp
daemon ioctl to set HW configuration.

Bug 4259584

Change-Id: Ied0eec498cfd4283b71797abf3b272d19998064f
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2994409
(cherry picked from commit e774e69777d92a7136ec6c61571e677bfbde6ebf)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3010369
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-29 05:11:45 -08:00
Laxman Dewangan
f60f770721 net: Split type and declaration of page_pool in Linux 6.6.
Split the type and declaration of page_pool header for Linux6.6
based on below change from kernel 6.6:
---
commit a9ca9f9ceff382b58b488248f0c0da9e157f5d06
Author: Yunsheng Lin <linyunsheng@huawei.com>
Date:   Fri Aug 4 20:05:24 2023 +0200

    page_pool: split types and declarations from page_pool.h

---

Bug 4346767

Change-Id: I0217da34c67d952c97c6812c2760bed2fb3df3e0
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3008090
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-01 20:25:18 -07:00
Jon Hunter
de1bf0e728 net: nvethernet: Remove ivc_ext.h
The ivc_ext.h is not needed by the nvethernet driver and so remove this
header so that we do not need to distribute this header for building
nvethernet.

Bug 3918941

Change-Id: Ic95d6cdc8afebaa3f8e2bdf85ca63e636c05d86c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2913272
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-07 22:06:11 -07:00
Rakesh Goyal
158ea57641 nvethernet: Protect Tx timestamp list
add_skb_node() added to delete the old entries from the list
but this can concurrently create the issue with ether_get_tx_ts()
either from the workqueue or direct call from tx done routine.

Protect the concurrent access of Tx timestamp list from add_skb_node()
and ether_get_tx_ts().

Bug 3927990
Bug 4088361

Change-Id: Ifae84a072d7d16b259178f2a8e79c2065ce837d8
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2842411
(cherry picked from commit 8509d3060cc697cf43c3194521575f859de53e39)
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2895045
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-04 11:35:32 -07:00
Revanth Kumar Uppala
80336d6c96 nvethernet: Fix compilation warnings
1.There is a switch-case where one case is falling to the
next case. This is creating the compilation warning.
Make this fall through as intentional by adding
compiler attribute as "fallthrough".

2.Remove redefinition of macro MII_ADDR_C45

Bug 4055275

Change-Id: I99193b225e97c414588bb306cb48e472ae079f9f
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2882027
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-04 21:57:46 -07:00
Mohan Thadikamalla
01d8319aae nvethernet: Add Linux safety support
Issue:
Observed compilation issues
on the nvethernet driver
for DRIVE Linux safety builds.

Fix:
Add OSI_STRIPPED_LIB support
on nvethernet driver.

Bug 3939603

Change-Id: Id4213c1cf33dc0e925df3e627072b727ae44fa71
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2842470
(cherry picked from commit ece0eb57a89396ea8bdc412beeaa7dfabbda49b1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2879701
Tested-by: Deepak Nibade <dnibade@nvidia.com>
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: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-04 21:49:37 -07:00
Revanth Kumar Uppala
6e2e6973cd nvethernet: Avoid using mdiobus_c45_addr().
Avoid using mdiobus_c45_addr() as it is
obsolete from K6.3.
Instead use its definition directly.

Bug 4014315

Change-Id: Ic407f407b03e465eea97bb530e86360ef81eb1e6
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2873724
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-26 17:35:58 -07: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
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
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
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
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
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
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
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
Bhadram Varka
6479c24ff8 nvethernet: fix monitor clk enable/disable warnings
Issue: Adjust link from the phy subsystem can be called
multiple times either with link down or up. If its called
second time with same link down then code tries to disable
the same clks again which results in clock warinigs.

Fix: Maintain the state of the clk and then disable/enable
the clock based on the state.

Bug 3585098

Change-Id: I7d259e6066c7b67d0a970122eb0841e4b5871b43
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2688290
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
dbf00db6bb Add support for configure CBS through TC
Issue: New feature requirement to have
CBS configuration through TC

Fix: added support for same.

sudo tc qdisc add dev eth4 parent root handle 6666 mqprio \
        num_tc 3 \
        map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
        queues 1@0 1@1 2@2 \
        hw 0
sudo tc qdisc replace dev eth4 parent 6666:3 cbs \
        idleslope 2000000 sendslope -8000000 hicredit 3000 locredit -1200 \
        offload 1

Bug  200776994

Change-Id: Id83b967bcbbb18201f2757987ab1cefe63b4ad8d
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2649428
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Mohan Thadikamalla
5a66fdbf00 nvethernet: Add SET_SPEED ioctl retry on failure
Issue:
When the ethernet server got enabled the boot time KPI
increased due to the XPCS lane up retry.

Fix:
Add work queue on OSD and retry SET_SPEED ioctl.

Bug 3414276

Change-Id: I0a3cc52db0ca4a34c4f5c1d9e7e3361023d0bd35
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2617507
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: Nagaraj Annaiah <nannaiah@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
Rakesh Goyal
594032b82a nvethernet: set affinity for common irq
Issue: when Softirq, vm and common interrupt
are scheduled on CPU0, due to priority inversion
of software IRQ, scheduling ISR corresponding to
HW interrupt got delayed.

Fix: set common IRQ affinity to other CPU core.

Bug 200780703

Change-Id: I56903de12fc753ac0075ace75ed72d34eac95c5d
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2610987
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
5f3e27f093 nvethernet: Use delayed workqueue for tx timestamp
Issue:
- Workqueue for Tx timestamp is running without
  delay, use many CPU cycle at hard isr thread
  priority.
- Incorrect return value from ether_handle_tso()

Fix:
- Update code to use delayed workqueue
- Return correct value

Bug 200780891
Bug 3400623

Change-Id: I2095a0634e079bf870ef87cd2de1d35fe24bafd4
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2610986
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
a91720a4d7 nvethernet: remove MGBE MDIO/MDC pad programming
Remove PAD programming for MGBE MDIO and MDC
PADs and apply pinctrl state if pinctrl present
inside DT.

Bug 200759606

Change-Id: Ib7f41532687dea2935c619e2335a2afd2c3ff8d6
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2593806
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Rakesh Goyal
260d005cc1 nvethernet: schedule TX timestamp workqueue
Issue: With TSN + PTP test cases, PTP packets
shaped based on TSN GCL which may lead to not
having time stamp when asked.

Fix: in case of failure to get timestamp,
schedule workqueue again to try to get timestamp.

Bug 200777069

Change-Id: Ic557f6ba7df5147ce85b21278f053e07a984f410
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2599845
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
78035314d0 nvethernet: define default PTP RxQ
Issue: PTP packets are received on RxQ0, with legacy
       perf data, which cause PTP getting delayed.

Fix:   If DT entry not present, use ETHER_DEFAULT_PTP_QUEUE

Bug 200766950

Change-Id: I25054caf23ffec37fcb422a7aa705b122da96394
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2588641
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30
Bhadram Varka
d93210ee62 nvethernet: Fix IRQ names in multi interface case
Issue: IRQ names not correct when multiple interfaces
probed with nvethernet driver because of static array.

Fix: Move irq names array inside private data structure
so that every interface will have unique name.

Bug 200762612

Change-Id: I9d55b62c345c458fa65e2ad4612ba55473e34752
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2588659
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@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>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-11-01 14:27:08 +05:30