Commit Graph

304 Commits

Author SHA1 Message Date
Srinivas Ramachandran
2df2d68dce nvethernetrm: Add API to backup/restore registers
Issue: During SOC suspend, the MAC is placed in reset.
       This causes all dynamic configurations done by
       SW on the MAC core registers is lost. When SOC
       resumes, MAC is initialized to power-on-default
       configuration, while other SW components still
       have previously set configuration. This results
       in mismatch between HW/SW configuration.
Fix:   Add APIs osi_save_registers(), osi_restore_registers()
       to backup and restore the MAC core configuration
       registers before suspend and after resume respectively.

Bug 200561046

Change-Id: I6d7b39d39a6f3fa882cfd905bc49a5850163ea4c
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2267390
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Tested-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: 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
Srinivas Ramachandran
bba8383678 nvethernetrm: Honor budget for processing tx completions
Issue: osi_process_tx_completions is run in the BH for
       processing Tx done irq. This function always loops
       till the Tx status for all packets that are Tx'd so
       far is processed.
       1) The NAPI budget for this Tx completions handler is
       not honored.
       2) The variable 'processed' is expected to keep track
       of Tx'd packets. Currently it is counting Tx'd descriptors.
       There can be multiple Tx descriptors consumed for one packet.

Fix: 1) Add budget parameter to osi_process_tx_completions() API.
     2) Break out of loop in this API if packets to process
        exceeds budget
     3) Increment the processed count variable only after checking
        last descriptor for a packet.

Bug 2756439

Change-Id: Id538343f6853881ea41109b8b46c8d0e82dce98a
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2237822
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: Praveen Mallaiah <pmallaiah@nvidia.com>
Tested-by: Praveen Mallaiah <pmallaiah@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
Mahesh Patil
525bc02acf nvethernetrm: Rename functions to match close functionality
Issue: rename functions to match close functionality

Fix:
 1) Renamed osi_poll_for_swr() to osi_poll_for_mac_reset_complete()
 2) Renamed adjust_systime() to adjust_mactime()
 3) Renamed eqos_adjust_systime() to eqos_adjust_mactime()
 3) Updated ether_adjust_time() description

Bug 2715276

Change-Id: I6c86b6f8e0b50607acbaaf9689757dcfc683a75d
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2209751
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
062fadbdcf nvethernetrm: add rx error stats
add rx frame error stats

Bug 200561724

Change-Id: I284fde9c26559627832f6df5c059a9e201e967ec
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2229248
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
d68e158596 nvethernetrm: Add support for EEE LPI
Add an API to configure the EEE LPI mode.
Tx LPI is enabled with a default entry time of 1sec.
The MAC controller has capability to automatically
enter LPI mode when all transmissions are complete.

Bug 2594864

Change-Id: I765ddfda908b1922abd46c11fa217a35fe6190f1
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2160787
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Ajay Gupta
62753951de nvethernetrm: enable tx interrupt coalescing
Tx frame count and software timer based interrupt coalescing
is enabled. Tx frame based coalescing can be enabled only
when tx software timer based interrupt coalescing is also
enabled.

Bug 200529168

Change-Id: Icd5e2ff3a6b9ad1d1793842b607a93ad779955d7
Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2234609
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: Bhadram Varka <vbhadram@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
Ajay Gupta
d722948b93 nvethernetrm: enable rx frame based interrupt coalescing
Rx frame based coalescing can be enabled only when
Rx timer based coalescing is also enabled. This is to avoid
no rx interrupt issue for applications which send only limited
frames and expects reply.

Bug 200529168

Change-Id: If20ec8322d6597f0a018c5668a9d632e456f60cd
Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2233501
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: Bhadram Varka <vbhadram@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
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