Commit Graph

470 Commits

Author SHA1 Message Date
Mohan Thadikamalla
1150fc9b29 osi: core: clean-up MGBE MMC counters
Issue:
MGBE OSI_CMD_READ_MMC command
execution time is more than MAX_PROC_TIME.

Fix:
Clean up unwanted MMC register reads.

Bug 4101129

Change-Id: I01e0d74f263947beab21b21fe3782ef465c898ed
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2913392
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: svc-mobile-misra <svc-mobile-misra@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>
jetson_36.4.7 rel-36_lws2_eng_2025-09-23 l4t-l4t-r36.4.4_eng_2025-09-23 l4t-l4t-r36.4.1_eng_2025-09-19 jetson_36.4.4 l4t-l4t-r36.4.4_eng_2025-06-03 l4t-l4t-r36.4.4_eng_2025-04-02 IGX_OS-1.1.1 jetson_36.4.3 l4t-l4t-r36.4.1_eng_2025-01-08 IGX_OS-1.1 rel-36_eng_2024-10-24 jetson_36.4 l4t-l4t-r36.4_eng_2024-09-12 rel-36_eng_2024-08-29 rel-36_eng_2024-07-23 rel-36_eng_2024-07-08 rel-36_eng_2024-06-26 rel-36_eng_2024-06-13 l4t-l4t-r36.3.1_eng_2024-05-29 jetson_36.3 l4t-l4t-r36.3_eng_2024-04-24 rel-36_eng_2024-04-04 rel-36_eng_2024-03-14 rel-36_eng_2024-03-06 rel-36_eng_2024-02-27 rel-36_eng_2024-02-05 rel-36_eng_2024-01-24 rel-36_eng_2024-01-12 rel-36_eng_2024-01-03 rel-36_eng_2023-12-12 jetson_36.2 rel-36_eng_2023-12-04 rel-36_eng_2023-11-07 rel-36_eng_2023-10-04
2023-06-06 02:05:11 -07:00
Mohan Thadikamalla
163e9cf67c osi: core: Add OSI_CMD_READ_HSI_ERR command
Issue:
Observed HSI diagnostic timer execution is taking
more than MAX_PROC_TIME due to OSI_CMD_READ_MMC
execution time. As this is reading 151 MMC
registers for MGBE and 91 registers for EQOS.

Fix:
As this OSI_CMD_READ_MMC command execution is not
meeting the MAX_PROC_TIME, add new OSI_CMD_READ_HSI_ERR
command only to read 5 MMC error registers.

Bug 4069585

Change-Id: I38a10b7f09ac7614d548b5caa4203f1c94889908
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2895845
Reviewed-by: svcacv <svcacv@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: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-10 06:28:28 -07:00
Bhadram Varka
c6382f708e osi: mgbe: Enable LSI only after UPHY lane bring up
Issue: During boot or interface up/down test local
fault interrupts observed during UPHY lane bring up
and which resuts in scheduling the UPHY lane bring up
again. With this HW is generating the continuous local
faults and link ok interrupts. This causes CPU to stall.

Fix:
Enable Link Status interrupt only after the PCS block
lock is a success.

Bug 4076432

Change-Id: I00049900d5d687cc043b184a7b87cc68a2651aea
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2893961
(cherry picked from commit 438811eb89ab5826df17349c1be9128d28e897f1)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2894369
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: Krishna Thota <kthota@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-28 08:10:57 -07:00
Sanath Kumar Gampa
cf366ff65c osi: MACSEC changes to add byp lut with VF MAC
Issue: If the supplicant is killed for some reason Data would flow
plain on that interface, this is not expected

Fix: All the unicast frames from/to the MACSEC interfaceare
authenticated or dropped. Below are the detailes of the changes:

1. Update Rx bypass LUT such that frames on the MACSEC VF(on which
supplicant is launched) would be authenticated or dropped.
2. A dummy SCI LUT is created with the MACSEC VF MACID such
that all the tx frames from MACSEC VF would be sectagged.
3.As part of delete SCI LUT, added the an_valid map as 0 such
that Invalid_SC_AN errors are seen when frames are transmitted
post session termination.

Added below cleanup changes as well to this CL

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: I9e0cdd9862d175b034478b7c5d59c1397c39c933
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2875774
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: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-21 11:34:42 -07:00
Rakesh Goyal
f3a4320760 osi: core: add m2m sync error detection and reporting
Issue: New safety requirement to detect
and report M2M eqos sync error.

Fix: add support for error detection and
reporting.

Bug 4033627

Change-Id: I377b8f11a6518841e21fe9e1ab3682447b31138b
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2875581
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Krishna Thota <kthota@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-01 10:51:54 -07:00
Mohan Thadikamalla
b49b61a253 osi: core: Fix EQOS DCS restore after SC7
Issue:
DCS bits are not resored properly after SC7
with dynamic

Fix:
Use dma_chansel to restore the EQOS DCS.

Bug 4013176

Change-Id: I3257286f46413d9583e1e96663b8d2bd2f7fdd49
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2869605
Reviewed-by: svcacv <svcacv@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: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-16 13:14:41 -07:00
Rakesh Goyal
1762865077 osi: dma: Fix PTP Tx timestamp for VLAN
Issue:
Tx timestamp is not propagate to QNX OSD driver.
OSI tx completion routine check for txdone_pkt_cx
flags OSI_TXDONE_CX_TS_DELAYED which is missing.

In case of QNX OSD, PTP untagged TX packet
 has LD and FD bit set for single descriptor
which is having valid mbuf.

In case of QNX OSD, ptp tagged packet have 2
separate descriptors. Valid mbuf is with descriptor
which has LD bit set.

Due to this OSD discard first descriptor data and
for last descriptor txdone_pkt_cxflags are not set.

Fix:
For TX timestamp, tx_swcx of last descriptor
should also set as
     last_swcx->flags |= OSI_PKT_CX_PTP;
     last_swcx->pktid = pkt_id;
so txdone_pkt_cx flags set for last descriptor
corresponds to tagged PTP tx packet.

Bug 4001072

Change-Id: Ie7e52b197ebfbc77c79d02a6e821b641f15707a4
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2868500
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-15 01:56:07 -07:00
Mahesh Patil
047a42bef8 osi: core: Update eqos pad calibration
Updated eqos pad calibration for qnx

Bug 2831220
Bug 3500401

Change-Id: I2301e66ae8bc905b8a61deb37694b0875a20173d
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2846450
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-02-25 11:07:02 -08:00
Mohan Thadikamalla
43efa1f979 nvethernetrm: Fix Linux safety builds issues
Issue:
Observed compilation issues
on the nvethernet driver
for DRIVE Linux safety builds.

Fix:
Move out required defines from OSI_STRIPPED_LIB

Bug 3939603

Change-Id: I2418b2b3bd21b5ed4e7e75a3b585f2f542a451c1
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2843094
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-02-23 15:22:24 -08:00
Narayan Reddy
a65d45e6c9 osi: core: add PHY write verify err inject support
Add PHY write verify HSI error injection support

Bug 3510868

Change-Id: I371f24b9eb9a9e422d3e61e76820d32f51611aec
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2858194
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-02-18 02:36:54 -08:00
Hareesh Kesireddy
086e4f09fc osi: l3l4: disable IPFE when wildcard enabled
- Having IPFE set causes MAC to drop all packets which
  do not match with configured l3l4 filters. Hence
  disable IPFE related code using a compile switch.

Bug 3576506

Change-Id: Ibf6c0e724141c9f7dc16a41de476057fc8eb7835
Signed-off-by: Hareesh Kesireddy <hkesireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2834367
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-02-17 07:20:42 -08:00
Mohan Thadikamalla
cdc06a45d3 osi: core: Restore FRP rules on resume
Issue:
FRP rules got lost during SC7
suspend and resume transition.

Fix:
Restore FRP rules after resume

Bug 3928364

Change-Id: If38ed1c54c19f6cfb9bb00f56c524712e24c1f59
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2848286
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-02-10 06:08:14 -08:00
Hareesh Kesireddy
84f5a14973 osi: l3l4: fix wildcard filter setup
Issue description:
- If a filter index is configured for L3+L4(UDP) with 4 tuple to
  route packets to a dma channel, then all incoming TCP packets are
  also getting routed to the same dma channel as Hw is finding match
  for L3 filter and ignoring L4 filter since it is configured for UDP.

Fix description:
- To avoid above issue, configured TCP wildcard filter at index 0 with
  below configuration.
  L3 (IP4): Inverse SA (0x0) + Inverse DA (0x0).
  L4 (UDP): Perfect SP (0x0) + Perfect DP (x0).
- If IPFE is not enabled, HW is not dropping any udp/tcp
  packets irrespective of l3l4 match status. Hence
  generic l3l4 wildcard filter at highest filter index is not
  needed. Removed generic l3l4 wildcard filter.

Bug 3576506
Bug 3825731

Change-Id: I49d0072c269294822f0984f33756aed04207f6ed
Signed-off-by: Hareesh Kesireddy <hkesireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2821504
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-02-07 02:52:37 -08:00
Narayan Reddy
3fff0cd9ba osi: core: fix Doxygen warnings
1) Fix Doxygen warnings
2) include debug.h code only when OSI_DEBUG
is defined

JIRA NET-570

Change-Id: I5d002b959925bec3898cc2faafe3f506b3c9bd22
Signed-off-by: Narayan Reddy<narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2847327
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-02-04 16:49:50 -08:00
Narayan Reddy
2a82c10c8f osi: core: mgbe: Fix 9K Jumbo issue
Issue: Not able to transfer 9K Jumbo frame.
Currently each TxQ is divided into 12KB of size
which leads to not making use of 8KB in total which
is affecting 9K Jumbo

Fix: Instead of using 12KB per TxQ, 128KB is equally
divided among 10 Tx Ques.

Bug 3934258

Change-Id: I86623e2726789d42a683aa755f47d77e04391dc1
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2848255
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-01-27 20:03:06 -08:00
Bibhay Ranjan
91511ff641 nvethernetrm: Log compilation using LOG_OSI flag
Based on the cflag LOG_OSI logging code will be
compiled

Bug 3759976
Bug 3954687

Change-Id: Ief57c926bc4d3b1d0d251e5da77d0eb73d928d62
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2811077
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-01-27 20:00:22 -08:00
Narayan Reddy
e5e4f81518 osi: core: move vlan_filter.c and debug.c out of safety
vlan_filter.c and debug.c files not used
for safety builds. Move this out of safety build
compilation

Bug 3949980

Change-Id: I1bc177dc62be55b409d9a2dd5db551fc20828ac1
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2847416
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-25 14:52:44 -08:00
Bhadram Varka
59afaa132c osi: dma: move *_dma.c and debug.c out of safety
eqos_dma.c, mgbe_dma.c and debug.c files not used
for safety builds. Move this out of safety build
compilation

Bug 3949980

Change-Id: I5922446e0098717061ae1c181ccd462b4566f299
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2846847
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Krishna Thota <kthota@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-23 22:37:25 -08:00
Bhadram Varka
32fa453326 nvethernetrm: move pause-frame macros
Pause frames not programmed in safety builds
so move those macros under non safety builds.

Bug 3932946

Change-Id: Iff89373c4ffd20b35589f3f3852ef191f5f54acf
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2844105
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Krishna Thota <kthota@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-19 07:52:33 -08:00
Diptanshu Jamgade
8089f79df8 osi: core: Update OSI_PAUSE_FRAMES_DISABLE
Issue:
Wrong value of OSI_PAUSE_FRAMES_DISABLE
enabling flow control at probe.

Fix:
Update OSI_PAUSE_FRAMES_DISABLE as per
dt-bindings to disable pause frame support
as a default

Bug 3932946

Change-Id: I0d5227c06b4b5627dc47f5542bbf5d2a0e7ed3bf
Signed-off-by: Diptanshu Jamgade <djamgade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2839839
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-14 18:12:09 -08:00
Rakesh Goyal
562c4879f4 osi: core: improve MAC-2-MAC accuracy
Use PTP-TSC timestamp capture feature
instead of PTP HW register read to
improve MAC-2-MAC sync accuracy.

Bug 3893803

Change-Id: I5b5876cedf9b2fd200749623d9b047dc27eeb0a8
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2835302
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-12 16:37:58 -08:00
Rakesh Goyal
d2bb5de0f5 osi: core: update boundary for lo and hi credit
As per HW specification update boundary check
for locredit and hicredit.

Bug 3927833

Change-Id: I3b6efeba52a7c40d3f4d276dea50e95310011d5f
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2837043
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-06 22:36:42 -08:00
Bhadram Varka
47e6662a46 nvethernetrm: Convert OSD core as a static library
Issue:
OSD core needs to be converted as
a static library for the data path support in servers.

Fix:
Convert OSD core as a static library.

Bug 3691486

Change-Id: If904be9f886b2149dd247d0672eb933891a437ba
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2827987
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Tested-by: Nagaraj Annaiah <nannaiah@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-06 16:48:20 -08:00
Rakesh Goyal
6fe20b098e osi: core: adjust_time boundary check
1) Add check for adjust_time boundary
2) Fix functional issue introduced
   while fixing Cert-C issue.
3) Update MAX frequency

Bug 3909337

Change-Id: Ib2402827219d512cd5fd9f6bb6638b21510d86ff
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2830043
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-29 13:30:19 -08:00
Narayan Reddy
ddd0ab4e61 osi: xpcs: add delays as per HW team suggestion
Issue: Random delays were added in xpcs_start and xpcs_init
which can lead to increase in the boot time

Fix: Instead of adding random delays and retries add  the
exact delays suggested by HW team

Bug 3806700

Change-Id: If6f781d86c7de4019883e4b02dc89b2d04ecc768
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2826256
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Zuyu Liao <zuyul@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Tested-by: Zuyu Liao <zuyul@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-23 15:13:05 -08:00
Mohan Thadikamalla
a114ece241 osi: core: mgbe: Enable HSI for TXESIE interrupt
Issue:
Need HSI support for TXESIE interrupt

Fix:
Handle TXESIE interrupt for safety builds
and update HSI CE counters

Bug 3846917

Change-Id: Ie431f4b166d8adb524fba74e0da80570aa162bf1
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2827634
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-16 03:34:06 -08:00
Rakesh Goyal
6a8f317407 osi: core: validate input argument
Validate input argument for exported
data structures

Bug 3789594

Change-Id: Ib16ace8cc933fcfce635f82ad0c89dc5791c999b
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2827045
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-16 03:33:19 -08:00
Mohan Thadikamalla
fb21f5d8f4 osi: core: Add a BYPASS FRP entry for XDCS
Issue:
MAC Filters DCH/XDCS is not routing
to the proper DMA channel
after FRP enable.

Fix:
As per HW's suggestion add a BYPASS entry after user entries.

Bug 3899802

Change-Id: I330490ff94ed719ba3fc27f38b6dfaf1bc37369b
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2826024
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Krishna Thota <kthota@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-15 15:14:49 -08:00
Mohan Thadikamalla
0ee7e64669 osi: core: Cleanup MAC start and stop ioctls
Issue:
Observed STOP MAC ioctl
failure on standard builds.

Fix:
-Update ivc_core_deinit to call
core_deinit command
- As MAC start and stop is part
of init/deinit clean up these IOCTLs

Bug 3889287

Change-Id: I07ba4dd5dc2e9630a4e4001199c6aae24ade6c70
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2819152
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-13 06:22:38 -08:00
Mohan Thadikamalla
3db08e6480 osi: hsi: Add return code for HSI Error injection
Issue:
HSI error injection IOCTL does
not return failure on invalid
error codes.

Fix:
Handle invalid HSI error codes
for HSI error injection IOCTL.

Bug 3806923

Change-Id: I317b15e9a3ac98ab3d8d5c3ab37dd6782760bec3
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2823800
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-12 15:09:49 -08:00
Narayan Reddy
4d974956c0 osi: core: fix MISRA rule 15.5
JIRA NET-520
Bug 3899804

Change-Id: Ibec55a06c960aec5550cdea77dbaf89210f49b9e
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2820748
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-12 15:08:52 -08:00
Mahesh Patil
3348487d2a osi: core: Macsec hw access when disabled
- Do not allow macsec reg read/write when macsec is not supported or
macsec is disabled in DT
- Fix macsec ops null access crash during mtu when macsec disabled

Bug 3889865

Change-Id: Ia111027c7f880a9697470b4118a9c98483575871
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2820321
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-09 15:18:46 -08:00
Mahesh Patil
8b8527d5f0 macsec: Rename LOG to MACSEC_LOG
Rename LOG to MACSEC_LOG to avoid conflicts with
other modules LOG macro

Bug 3338608

Change-Id: Ib746dc4cddd835308cf6a6da8e79135c566a8135
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2798519
Reviewed-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-09 15:12:45 -08:00
Narayan Reddy
d1e320cc82 osi: core: fix CERT INT31-C
Bug 3745813

Change-Id: I7d686c45ae5e74f3bfc3c4e6642fc38ee312d6a1
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2821888
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-08 00:13:26 -08:00
Rakesh Goyal
379f8ae9a5 osi: core: enable m2m by default
Mac2Mac sync code enable by default.

Bug 3883951

Change-Id: Iaf09dba80be0d180bf23dff70c65a8e6f34ab9d2
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2814598
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@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-08 00:05:39 -08:00
Mahesh Patil
de2d2e2fcc osi: core: eqos pad calibration reg offsets
Make eqos pad calibration reg ETHER_QOS_AUTO_CAL_CONFIG_0 offsets
AUTO_CAL_PD_OFFSET and 	AUTO_CAL_PU_OFFSET configurable as per
customer boards tuning

Bug 3846183

Change-Id: Ic305ced0d8324d7b9f5a03ffa7d6c21f7a12d9e5
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2805651
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-08 00:01:22 -08:00
Hareesh Kesireddy
6f0c3604d0 osi: l3l4: split perfect inv bit for each field
- HW has separate Inverse Match bits in l3l4 control register for each
  source address, destination address, source port and destination port.
- Hence, added separate Inverse match bits for all the 4 fields in
  osi l3l4 structure to provide flexibility for l3l4 users.
- Fixed validation parameter sequence to validate l3l4 parameters
  before processing filter data.

Bug 3576506
Bug 3825731

Change-Id: Id7f8939acd92ad5799f2ad0d7cef5d4fcb7e00c5
Signed-off-by: Hareesh Kesireddy <hkesireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2820517
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-05 20:44:28 -08:00
Bibhay Ranjan
aa21c9e4bf nvethernet: Fix the incorrect code in CFLAGS
Issue:
Few places incorrect CFLAGS are used.
OSD based flags cannot be used in OSI

Fix:
Move the code under correct CFLAGS
remove the OSD based codes

Note:
The OSD based logging need to be reimplemnedted
by  the macsec module.

Bug 3759976

Change-Id: I407b945a24028792f146bc08adf67428612978c3
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2811917
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@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-12-05 20:33:14 -08:00
Bibhay Ranjan
a315ac8155 nvethernetrm: Universal config.tmk for all OS
Issue:
Currently each OS defines OSI CFLAGS locally which
creates issues in structure memory, if mismatched

Fix:
Move all the shared CFLAGS to OSI controlled config.tmk

Bug 3759976

Change-Id: I9d957ebbc2fc8a176ef70d42b5ae6a9ccb7f342f
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2808840
Reviewed-by: Bhadram Varka <vbhadram@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-12-05 20:33:09 -08:00
Rakesh Goyal
2065aa48d1 osi: core: remove condition to compiled code for QNX
If there is no request from PTP application to read
Tx timestamp to OSD driver, OSD driver don't
read time to local OSI structure and it may lead to wrong
TX time on request from OSD.
Any PTP time stamp after 2 sync time is not useful.
As POR 2 sync time can be max equal to 1sec.
Remove old timestamp from driver structure if it older
than 1 sec.

Bug 3810821
Bug 3759976

Change-Id: I3173104b60bb50de05285ba1993291c489c34079
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2814646
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-12-01 00:52:09 -08:00
Narayan Reddy
8d6b5654aa osi: remove Makefile.sdk
remove Makefile.sdk since no longer valid as
AUTOSAR support is deprecated

Bug 3871403

Change-Id: Ie4d984fd3d6a447a3da7fd0ec62441ac21a45a03
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2818388
Reviewed-by: Nagarjuna Kristam <nkristam@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-30 06:28:07 -08:00
Hareesh Kesireddy
3be2a1e7f3 osi: l3l4: support four tuple for l3l4 fitlers
Following implemented for non safety.
- Moved l3l4 filter index assignment to OSI for better management.
  OSDs need not worry about managing l3l4 filter indexes.
- Restructured code to support four tuple for osi l3 l4 filter.
- Added a wildcard l3l4 filter at highest filter index to allow the
  the packets to receive on default dma channel (from l2 filter) for the
  packets which do not match with any of the configured l3 l4 filters.
- For IPv4, allowed user to configure all SA+DA+SP+DP together at a
  single l3l4 filter index or user can selectively add any
  combination among them (e.g, only SA or SP+DA, etc.).
- For IPV6, only restriction is to add either of the SA or DA only
  but not both at a time at a single l3l4 index.

Bug 3576506
Bug 3825731

Change-Id: I20bd197f5bf793a77f5e723d1875875d442af66e
Signed-off-by: Hareesh Kesireddy <hkesireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2802626
Reviewed-by: Nagarjuna Kristam <nkristam@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-30 06:16:47 -08:00
Mohan Thadikamalla
20f52bb866 osi: core: Disable TXESIE for safety
Issue:
Observed common intrrupt on
safety builds as TXESIE is not
served.

Fix:
Disable TXESIE intrrupt for
safety builds

Bug 3846917

Change-Id: I8f01d382eb2979439f7a82fce346c66f1133061f
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2814604
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-24 18:16:09 -08:00
Mohan Thadikamalla
2ac6b6f645 osi: core: Update ethernet stats to VF osi core
Issue:
When the ethernet server got enabled,
OSI core stats are not getting
updated to VF's.

Fix:
Add IOCTL to copy OSI core stats
into VF's OSI core structure.

Bug 3763499

Change-Id: Ib0a957ff90805b7e716d8f5994e0a65d63660c1e
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2808680
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-24 18:12:30 -08:00
Rakesh Goyal
9597f795e4 nvethernetrm: take arguments field out of union
ioctl_data as well as arguments required to
support PTP IOCTL in ASIL path

Bug 3868362

Change-Id: Id6d3cf7626b7426a8e44a086335501cf86f50d62
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2807393
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-24 00:39:47 -08:00
Narayan Reddy
67ffdc1d3c osi: core: merge ioctl calls to osi_core_init
By default enable below settings during core init,
so that we can avoid the same by calling from Guest OS

1) bring mac out of reset
2) forward error packets
3) set mode to full duplex
4) enable rx csum
5) Configure PTP
6) start mac

Bug 3701869

Change-Id: I26578b7a0b8c91c4880d9ef6a3a171ab1c1945aa
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2809705
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@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-23 08:06:55 -08:00
Sanath Kumar Gampa
70e0744729 osi: Removal of global variables related to HSI
Removed Report ID and error codes from global and moved them to local.

Bug 3857897

Change-Id: Ib1a5d70782e8c8e26ca3f04316f7f2bb2b03735f
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2806355
Reviewed-by: svcacv <svcacv@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: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-by: Krishna Thota <kthota@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-17 07:19:11 -08:00
Bhadram Varka
2fb7d1d324 osi: eqos: configure MTL RXFIFO and PFC threshold
MTL RXFIFO memory available for EQOS - 64KB
Below is the distribution -
1) Q0 - 36KB
2) Q1 to Q6 - 2KB
3) Q8 - 16KB

It also update flow control parameters for
the Rx queues
1) Q0 - FULL_MINUS_16K
2) Q1 to Q7 - FULL_MINUS_1_5K

Bug 3787316

Change-Id: I59031ad03f02d5804fcc65cb24e05559e6358500
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2789263
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: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Krishna Thota <kthota@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-14 20:55:16 -08:00
Mohan Thadikamalla
f5dca20930 nvethernetrm: Convert OSI core as a static library
Issue:
OSI core needs to be converted as
a static library for the HVRTOS server.

Fix:
Convert OSI core as a static library.

Bug 3691486

Change-Id: Ie1f7fc0c3a722cb7ddab24da8488904ead80ecc4
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2794675
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-11-10 16:48:26 -08:00
Sanath Kumar Gampa
a8387466cd osi:core: Address review comments on HSI changes
Bug 3590939
Change-Id: Id54b61871d5152c58376781c421077c62174bc2f
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2801135
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-09 11:19:09 -08:00