Commit Graph

297 Commits

Author SHA1 Message Date
Ajay Gupta
d7ecf48908 nvethernetrm: fix AXI clock to 125MHz
Fixes incorrect number of rx interrupt triggered with
rx coalescing (rx-usecs in ethtool) parameter.

Bug 200529168

Change-Id: I49ea2c469667e05f7e12f2741984f609127f395c
Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2229564
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
a7d1fada19 nvethernetrm: change required clock freq to 250MHz
increase required clock frequency from 62.5MHz to 250MHz
for better PTP time stamping accuracy.Switching to 250 MHz
will increase the accuracy of the PTP timestamp by ~22ns

Bug 200565215

Change-Id: I1dab385ade30df4864c1477685f39d4374700932
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2234039
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
e2c9e7e3cb nvethernetrm: Add slot function support
Issue:
Data packets sent via EQOS hardware are not
following any packet gaping. The AVB use-cases
have different timing requirements for class A
data packets. For example, the time difference
between two class A data packets are supposed
to be 125 microseconds for audio data of
frequency 48 kHz.

Fix:
Add slot function support to schedule
the data fetching from the system memory
by the DMA. This will help the AVB SW stack
timing requirements for class A data.

Bug 200545374

Change-Id: Id7c606f7491a423051667811bd6d459ee58f6700
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2222282
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: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Krishna Thota <kthota@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Srinivas Ramachandran
5faa6bc5bd nvethernetrm: Remove APIs that micro-manage the controller
Issue: APIs like osi_clear_tx/rx_intr, osi_update_rx_tailptr
       are redundant. The operations that are done in these
       functions can be included as part of other existing
       OSD-OSI interface API. OSD need not micro-manage the
       hardware controller by using such fine grain APIs.
Fix:   Remove the redundant APIs and implement their functionality
       as part of existing APIs.

Bug 2715391

Change-Id: I47851c204988475cac1cadf6fe678d7d446a3cc3
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2211093
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
3decafa55a nvethernetrm: eqos: Use single API to enable/configure filter
Configuring L3/L4 filter: osi_l3l4_filter() shall be called

Configuring L2 filter: osi_l2_filter() shall be called

Bug 2715384

Change-Id: Id5598b43a3723de4535b5595e019f6fced6c56ab
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2216068
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
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
521f9ddd19 nvethernet: Remove variable args API's for MISRA
Issue:
Variable arguments not allowed in misra/certc.

Fix:
Remove variable arguments API's and add
fixed arguments API

Bug 200553611

Change-Id: I5566683a01e1e65654c25f779ea96f68d9de8555
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2214093
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Bhadram Varka
6ef38dbc9d nvethernetrm: fix map/unmap of Rx timestamp descriptor
Receive timestamp for a received packet will be in context descriptor
which is immediate of normal descriptor (has valid packet data)
In current case nvethernet driver only unmap normal descriptor buffer
address and provide the buffer to the network stack for data processing.
Context descriptor buffer is not unmapped which leads to running out of
IOVA space for the new buffers.

Context descriptor buffer can be used as is since that is not provided
to the network stack. So this change to a flag for context descriptor.
Based on this flag OSD can skip new buffer allocation and mapping for
the context descriptor and use already allocated buffer.

Bug 2700522

Change-Id: I18c8ebe39bf2eaaaeb13a9de3c9595cbe2ada45d
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2214726
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
296166d895 nvethernetrm: Fix MISRA violation with ULONG_MAX
Issues:
Observed MISRA Rule 14.3 violations due to
ULONG_MAX comparison.

Fix:
Redesign this code by removing the ULONG_MAX
comparison logic and handle CERT-C
wrap violations.

Bug 200544430

Change-Id: I05e0dc03356ae19a0dcb895d35ef679f96575ac0
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2206001
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Krishna Thota <kthota@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
b711582e73 nvethernetrm: Fix CERT-C casting string issue
Issue:
Observed casting string literal pointer casting
to non-const issue in nvethernetmcal repo.

Fix:
Declare mac input parameter as constant in
osi_update_mac_addr_low_high_reg function definition.

Bug 200551115

Change-Id: Ie5c182a33056d99ba58227226d3c4c6908165d5b
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2200347
Tested-by: Praveen Mallaiah <pmallaiah@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Krishna Thota <kthota@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
ff5b7d28bc nvethernetrm: add vlan tag stripping control
Provide a control to enable or disable
VLAN tag stripping

Bug 200549370

Change-Id: I0b7f59493cb6504edc1f94239b730c03e4444af6
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2191631
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
174b0002d0 Fix CERT-C errors INT30-C, INT31-C, INT32-C
Issue:
Observed 177 CERT issue:
CERT INT30-C	158
CERT INT31-C	17
CERT INT32-C	1
CERT INT33-C	1

Fix:
Fix existing defects for above cert-C errors as per
recommended practices.

Bug 200546468
Bug 200512422

Change-Id: I54d6ee35566da1985f2aea83d8c4b10f71309fed
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2123080
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
934dd4b840 nvethernetrm: Fix MISRA issues
Issues:
Observed below MISRA defects:
MISRA C-2012 Rule 17.4: 4
MISRA C-2012 Rule  8.5: 1

Fix Info:
- Handled the return values to clear MISRA 17.7 issues
- Properly defined dma_desc_init function declaration to
fix 8.5 MISRA issue

Bug 200512422

Change-Id: I6f5c5f2ad989d9c180d067018bc50ed325012375
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2176714
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Krishna Thota <kthota@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
f551f8ab61 nvethernetrm: Update comments with Doxygen style
replace kernel doc comments with Doxygen style comments

Bug 200512422

Change-Id: I2e8e1f395674ab9e1b66bf40c1f6cc0551608163
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2154252
GVS: Gerrit_Virtual_Submit
Reviewed-by: Srinivas Ramachandran <srinivasra@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>
2024-02-21 16:31:59 +05:30
Srinivas Ramachandran
006059e0a5 nvethernetrm: Implement external safety mechanism
EQoS MAC version < 5.10 is not safety certified. To ensure
some basic error handling situations, implement external
error handling mechanism in the driver to periodically
read and verify the current register content for certain
critical registers, against the last written value.

Bug 2594911

Change-Id: I1d7c01f89ad838ffe3ab1efd15126640ae9df775
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2136607
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
22af0598ce nvethernetrm: fix null pointer check
Issue: osi_core NULL pointer not validated before
dereferencing

Fix: check for valid osi_core pointer.

Bug 200512422

Change-Id: Ie23f6d3c01d2967738ca048475e1046d3d856efd
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2159532
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
033608b48a nvethernetrm: use correct macro
OSI_EQOS_MAX_NUM_QUEUES should be used instead of
OSI_EQOS_MAX_NUM_CHANS

Bug 200512422

Change-Id: Ie20515991a628fa6c4c0a17033a6bac7facbfff3
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2156971
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
f63dcbf197 nvethernetrm: add MAC deinit support
Add support to de-initialize the MAC

Bug 200512422

Change-Id: I7d9f21aed773f3b06043892fb9a68ce042abcf1c
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2145725
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bhadram Varka <vbhadram@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>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
95b2509e17 Nvethernetrm: update OSI interface APIs
Issue: Some OSI interface function return void

Fix: All OSI interface functions should return -1
if argument validation failed

Bug 200512422

Change-Id: I7dead9b69a3853d815549959c9a14723ccfdc131
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2140378
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohit Dhingra
d37c177696 nvethernetrm: fix macro name
ESQC-9844

Change-Id: If0b0311962c2bf0b676aa464aed44183dabc058f
Signed-off-by: Mohit Dhingra <mdhingra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2152300
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Narayan Reddy <narayanr@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>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
5d80eac3e1 nvethernetrm: update dependencies in function header
Update osi_core and osi_dma function header with
dependency information for osd

Bug 200512422

Change-Id: I9ea647c1728ef4d48d38ec7e0d381ec1ef88f3f7
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2130747
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
f184678da6 nvethernetrm: add support for RIWT
This support enables the configuration of Receive Interrupt
Watchdog Timer register which indicates the watchdog timeout for
Receive Interrupt (RI) from the DMA.

Bug 200512422
Bug 2624476

Change-Id: I66830a47c34845af06e318ba6069935d51d15af8
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2138153
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
5769a9a843 nvethernetrm: add L2/L3/L4 filter based dma routing code
With this feature filtered Rx packet will be redirect to
corresponding DMA channel based on register configuration.

Function driver code need to pass 2 extra parameters enable/disable
and dma channel number within the valid range to utilize this
functionality.

For L2 filtering, function driver code can also pass address mask
and src_dest for filter index 1-31.

Bug 200525721

Change-Id: Ibf3fb93cdd4c3b7c0384a0e36e7bbe467bb41e04
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2133197
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
11b9f541cb nvethernetrm: add HW and SW counters' support
These stats are read from MAC HW RMON counters as well as from Core
and DMA path.

ethtool -S <interface> is used to get statistics.

There are 3 stats captured currently
1) ether_mmc_counters: EQOS HW RMON counters
2) ether_xtra_stat_counters: SW counters from osi/core
3) ether_xtra_dma_stat_counters: SW counters from osi/dma

Bug 200519211

Change-Id: I5bbeb340cf2ffccb6399687b254f79c67f480179
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2114208
GVS: Gerrit_Virtual_Submit
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
a50f8221de nvethernetrm: add PTP support
This takes care of implementing the PTP support
which includes PTP V1/V2 over IPV4,IPV6,Ethernet,gPTP.

Bug 200524751

Change-Id: Ieb680d818be81c1a1a8349ddd9ff02bba1896b08
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2127117
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
d73ccb3299 nvethernetrm: replace numeric values with Macros
As general practice we have replaced numeric value with Macro for
MAC Filter. This will help to make it readable and scalable.

Bug 200512993

Change-Id: I4bbc676eabc85be5f0b8285328a3a91e1a7c61ee
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2131537
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
54475f5365 nvethernetrm: enable mac filter
Code to configure and program register for L2/L3/L4/VLAN Filter

Bug 200512993

Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Change-Id: I469e25aeb2a31878d2fd7384cbe5f63c63d3b924
Reviewed-on: https://git-master.nvidia.com/r/2111083
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohit Dhingra
f08bdc09b3 nvethernetrm: avoid redefining macro ULONG_MAX
For QNX, macro ULONG_MAX is already defined in the toolchain.
Define the macro only when not defined earlier.

ESQC-9836

Change-Id: I3afcb5ec0933ec31816e8b6602a5a99260e00e04
Signed-off-by: Mohit Dhingra <mdhingra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2124114
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Srinivas Ramachandran
a08e20e2ac nvethernetrm: Add support for HW offloads
1. ARP offload can be configured private ioctl.
   The IP address to be configured for ARP offload
   needs to be provided by application as unsigned
   char array. Refer to struct ether_ifr_data and
   struct arp_offload_param for details.

2. Tx/Rx checksum offload. Enabled by default (can
   be toggled using ethtool)

3. TCP Segmentation offload. Enabled by default (can
   be toggled using ethtool)

Bug 2571001

Change-Id: Ifcf2982557e80655e3cd7ebf3c70f49c538133b5
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2109677
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
3efe5a2afa nvethernetrm: add pause frame support
Pause frame  is a flow control mechanism for
temporarily stopping the transmission of data on
Ethernet. The goal of this mechanism is to ensure
zero packet loss in case of network congestion.

Bug 200516459

Change-Id: Ideaaecd346bc7f509fbe2fc8e915b9e1fc45c958
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2111934
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohit Dhingra
d4547fd86c nvethernetrm: add tmake support
- Split files into core and dma directories to add
   separate tmake files for creating separate RM and DMA
   channel libraries.

ESQC-7634

Change-Id: Id9a2431bbee73a29b4a3565d8aa2bc0d8e7f0c78
Signed-off-by: Mohit Dhingra <mdhingra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2109978
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
4841ba2468 nvethernetrm: CRC Checking for Rx Packets
Added support for configuring MAC to check or
skip the CRC field in the received packets.

Added API to clear the Rx error pkt stats

Bug 200515518

Change-Id: Idc6a9f91c48b60434db9f62d90fb825258db67e7
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2108562
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
835dc93a54 nvethernetrm: Enable Tx packet status reporting
Added support for configuring the MTL to drop or
forward the Tx packet status to application.

Added API to clear the tx packet error stats

Bug 200515518

Change-Id: I818b4581b8bcbe84d0ca065010c60dd93726a385
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2108560
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
393c72f460 nvethernetrm: Add support to forward error pkts
Added support to configure Rx MTL Queue to drop or
forward the error packets to DMA or application

Bug 200515518

Change-Id: I699435aaf5dcfaf4cfced799eaac78cdee65f063
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2108561
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
ca8a642b55 nvethernetrm: add support for CBS (802.1Qav)
The MTL Queue Scheduler uses the credit-based shaper algorithm to
arbitrate the AV traffic in all queues and the legacy Ethernet traffic
in Queue 0.

Tests are done using kunit framework as well as custom IOCTL app for
linux.

Bug 200512771

Change-Id: Ie05b2adbd2b62208d4f35220daebd635f049e7b0
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2108316
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Bhadram Varka
b8b3d26534 nvethernetrm: support for jumbo frames
Bug 200513783

Change-Id: Ie0fccc6a1cbdf2e6417d78f616fcec71ba6f3ebf
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094021
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@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>
2024-02-21 16:31:59 +05:30
Narayan Reddy
2d363b3616 nvethernetrm: MAC loopback support
When MAC HW loopback is enabled, MAC receives
back all the packets that is being sent by it.
Packets which were sent are looped inside the
MAC and it is not being sent to PHY.

Bug 200512681

Change-Id: Iec42e937824424c46eb15a281fb0c33e92ea2056
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2088985
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
adc88f9c88 nvethernetrm: add adress width read support
Add support for reading the Address Width
from the MAC_HW_Feature1 register

Bug 200458098

Change-Id: I32ae42f536fbac781584425dcccd91155542b579
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2099488
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bhadram Varka <vbhadram@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>
2024-02-21 16:31:59 +05:30
Bhadram Varka
b7931942df nvethernetrm: support for VLAN
This patch introduce Tx/Rx packet context information
so that VLAN info can be passed from OSI to OSD in
Receive path and OSD to OSI in Transmit path.

Bug 200511721

Change-Id: I0ca21300aee2f25f9bc48006421c441abe1586f6
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2077036
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Bhadram Varka
6639ef53c1 nvethernetrm: osi code for EQOS
Bug 200507585

Change-Id: I70ce3d013eeb109ebf323e732820fb51c360e313
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
2024-02-21 16:31:59 +05:30
Bhadram Varka
93c142ba2a delete the directories to move the history
Change-Id: I701c1a8c6c891dc8ee2781d51c2c6ad748ed5bf3
2024-02-21 16:31:52 +05:30
Michael Hsu
02d473389d nvethernetcl: update doxygen header for ICD
JIRA NET-914

Change-Id: Iba2bdc54bcbbd4718af924a77c3b4b356061d57e
Signed-off-by: Michael Hsu <mhsu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2969487
Reviewed-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2981147
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
2023-11-01 21:57:36 -07:00
Mohan Thadikamalla
1ef7aac8cb osi: core: Update NvEthernetRm ICD
Update header files to document
all external interfaces of
the NvEthernetRm Unit for
ICD generation.

Jira NET-1013

Change-Id: I776b7e01a0478dbaf7baaa1fdf363df804429892
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2962418
(cherry picked from commit 09e194e62fe2b2fc85d44aabadf3880cf2a0a993)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2970428
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-01 19:46:37 -07:00
Bhadram Varka
232ce3ef80 osi: core: support pause frames
Enable pause frames for Safety builds as well based
on pause_frames if the osi_core->pause_frames is
set to OSI_PAUSE_FRAMES_ENABLE based on DT parameter
nvidia,pause_frames.

Bug 4186472

Change-Id: I8600ae0ce1a9d9a5dd132a949ec14e8d73735319
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2931298
(cherry picked from commit b553b09358e1b4dbce8529c756f013b528f27862)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2931295
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Hareesh Kesireddy <hkesireddy@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-31 16:23:29 -07:00
Mohan Thadikamalla
62e30dc51e osi: mgbe: Update HSI error for DOS-SHR-6424
Issue:
For DOS-SHR-6424 SHR reported ID handling
is offloaded to HV. And new error IDs and
attributes are defined. So this needs
to be updated.

Fix:
Deprecate reported ID update on OSI.
And updated OSI error codes based
on the DOS-SHR-6424 SHR.

Bug 4158001

Change-Id: I28561325f921f51560aeb58fce38a0e61ba43c83
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2929009
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-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-05 14:46:51 -07:00
Sanath Kumar Gampa
1b6d93d2fd nvmacsec: Addition of MACSEC Over vlan support
Addition of 2 SCI entries for 1 supplicant

Bug 4134079

Change-Id: I6d508f5a5a844d0f9b997f748da74b4a4ac688b3
Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2911837
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-22 10:57:13 -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
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
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