Commit Graph

388 Commits

Author SHA1 Message Date
Bhadram Varka
b60b44dc67 osi: add support for handling multiple IP's
Issue: Since core_ops/dma_chan_ops are static global
variables and these are stored in data segment of
a process. In linux when insmod happens eqos and mgbe
will get probe which inturn initialize osi core ops.
Since data segment is shared here eqos core ops pointer
overwritten by mgbe core operations.

Fix: Use separe core ops and local global variable
for each instance.

Bug 200671160

Change-Id: I7f093608d812e2ced1bf73339dbd70f0091fe5b4
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
2024-02-21 16:31:59 +05:30
Mahesh Patil
8273721434 nvethernetrm: Reduce 2 byte ethertype from mtu
Add 2 byte to SECTAG+ICV length to reduce 2 byte mtu size
Bug 200690445

Change-Id: I4ccab6958e73fdfe90e386714a5ea4a8454ed8d9
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
2024-02-21 16:31:59 +05:30
Srinivas Ramachandran
bc73f82428 nvethernetrm: Add support for MACsec controller
This commit adds support for MACsec controller HW
operations. The MACsec HW ops can be accessed via
osi_core layer.

Currently, MACsec HW is enabled when MAC interface
is brough up, with no LUT entry so that packets
will still be bypassed. MTU check is enabled and
default interrupts are enabled for statistics.

Bug 2913560

Change-Id: I62e8567fac6603db47f4069a40458038f9b4178a
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
57847505ed nvethernetrm: mgbe: Add XDCS support
Enable multiple DMA Channels routing support
for MC/BC MAC Address with XDCS.

Bug 200565911

Change-Id: I7c9f9347361dd72e68696846a0a59e2e241e20c9
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
2024-02-21 16:31:59 +05:30
narayanr
b5a12c85e6 osi: mgbe: program recommended values
program the recommended values by HW team for
better performance

Bug 200565630
Bug 200570017

Change-Id: I96a870114623ce76804c49706d2961010448ca86
Signed-off-by: narayanr <narayanr@nvidia.com>
2024-02-21 16:31:59 +05:30
mohant
c5df9eacea nvethernetrm: Add PTP offload support
Bug 200562286

Change-Id: I7adf08da12458c7291391ef726fe1fa65cb1bda1
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2319556
Tested-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
984a87dfff nvethernetrm: Add Flexible Receive Parser support
- Define new data structure for the FRP table entry,
declare new frp_table and NVE variables in the OSI
core private structure.
- Define a new data structure for the OSI FRP command.
Add new OSI API to initiate FRP commands from OSD.

Bug 200565623

Change-Id: I84660a6e8270a681b82236d0c39423660b3821ff
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2330182
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
2024-02-21 16:31:59 +05:30
rakesh goyal
75a529b2f0 nvethernetrm: eqos: TSN support for EQOS IP
1. Adds basic OSI API's for EST/FPE
2. EST/FPE support for EQOS
3. MMC counters for FPE
4. EST errors and state counter

Bug 200561100

Change-Id: Iee3e6caac5d16e1620c25420d72700f9cdd00465
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2319820
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
2024-02-21 16:31:59 +05:30
Bhadram Varka
ed13225788 nvethernetrm: update SSINC & ptp_ref_clk
Configure SSINC and ptp_ref_clk based on ethernet IP

Bug 200565914

Change-Id: I0a29d4506f56c7e4bdb36cc2cee9276f849b4a26
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2320590
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
f6cbb32a42 nvethernetrm: mgbe: add PTP support
Change takes care of -
o Enable PTP for MGBE
o Added flags for One step/two step and also
for PTP master/slave
o Getting timestamp from MAC registers for MGBE.

Bug 200565914

Change-Id: I17346451f2619f0526a737a4a6bffdf130af4fc0
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2314201
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
2024-02-21 16:31:59 +05:30
vbhadram
d17a9e4c63 nvethernetrm: mgbe: add support for RSS
This change programs 40byte Hash key and indirection table
(Hash table) (has DMA channel numbers) in MAC
Once packet received by MAC - 4-tuples will be extracted
from the packet and given to RSS hash engine. Hash function
will generate hash value by using 40byte key.
From hash value LSB bits used as index to RSS lookup table to
find out DMA channel number. If there is a match - packet is
routed to corresponding DMA channel. If there is no match -
packet will be dropped and error will be returned in receive desc.

Bug 200565647

Change-Id: Iffbb5a452f03278b3ba0bc061f09b43c7c994289
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2263398
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
e540dd4386 nvethernetrm: Add RX Route support
- Add new ptp_rx_queue variable in
  osi_ptp_config structure.
- Declare an IP callback function
  for PTP RX queue index programming.
- Check and call IP based PTP RX queue
  callback in osi_ptp_configuration.

Bug 200596985

Change-Id: Ief040dc5b607ad729af5e9c0c1870249b456dcc7
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
d7e31f4de7 nvethernetrm: mgbe: add flow control support
Add flow control support for MGBE.

Bug 200565905

Change-Id: I4edb82225cfd60fcff47d0aef11b516d9960961a
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2278454
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
2024-02-21 16:31:59 +05:30
Bhadram Varka
99ad1ad78e nvethernetrm: mgbe/eqos: Add support for VLAN
Adds support for VLAN insertion/deletion and filtering
on receive side.

Perfect filtering enabled for the VLAN filtering.
HW maximum has 32 VLAN perfect filters. If user adds
more than 32 then all VID's will be allowed

Bug 200565888

Change-Id: I75bdc261a77df4f9d9f5fff9a2943731de9dd4ef
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2312144
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
06a55f9c41 nvethernetrm: mgbe: Add AVB CBS support
Add AVB CBS set and get operations
support.

Bug 200565900

Change-Id: I5402a5ac9dcb080c69a11aaa2eec52f68fe833b8
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2309941
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
00e4638fa3 nvethernetrm: mgbe: Add L3 and L4 filtering
Add L3 IP address filtering support and
L4 port filtering support

Bug 200565909

Change-Id: I31748cfacf41bb6358813b80eabb57dd6416da5c
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2274443
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
68a1d27ab0 nvethernetrm: mgbe: Add DA/SA/MC/BC filtering
Add support for DA/SA/MC/BC L2 address filtering.
Enable MCBC queue, and set queue1 for MCBC queue.

Bug 200565909

Change-Id: I79c2608d1f878695eb8f9c8c3c836c1d458095a0
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2274442
2024-02-21 16:31:59 +05:30
Bhadram Varka
41ef64576a nvethernetrm: xpcs: XPCS initialization
Add support for XPCS initialization in USXMII mode
and start of XPCS will happen once speed set for MAC.

Bug 200552796

Change-Id: I4c98bec2e92d9b189c7d2404705e28b969592f33
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2258482
2024-02-21 16:31:59 +05:30
Bhadram Varka
a2b8d81e43 nvethernetrm: mgbe: support for MAC speed set
Adds support for programming MAC speed based
on PHY speed.

Bug 200565886

Change-Id: I486444186b5575f68d6336229e0672e219725444
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2258483
2024-02-21 16:31:59 +05:30
Bhadram Varka
c0091a34ef nvethernetrm: add support for MGBE initialization
Adds MAC CORE and DMA initialization support for
MGBE MAC Controller.

Bug 200548572

Change-Id: I6796229852b47ff0748a848a6dbe9addab6ab74f
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2250401
2024-02-21 16:31:59 +05:30
Bhadram Varka
d2dd7fefbf osi: core: fix coverity/misra issues
Bug 200671160

Change-Id: I98f0bb2a4a0fde05b81551cd2dd0cab4ddac13dc
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
2024-02-21 16:31:59 +05:30
Rakesh Goyal
cd35e725a8 Revert "core: handle ioctl in single API"
This reverts commit 6b8e39f6d3.

Bug 200671160

Change-Id: Icf22d93e83efbff7cb2a3cdfd5d169e3fd454b4a
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
2024-02-21 16:31:59 +05:30
nannaiah
49f168e572 nvethernetrm: Add IVC support to read mmc counters.
Bug 2694285

Change-Id: I4d88b99968a90108fcb218eb607318da14875834
Signed-off-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2499175
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
a16b1a8a03 core: handle ioctl in single API
To reduce number of external interface APIs,
consolidate all IOCTL API to one interface API.

Bug 200671160

Change-Id: I324bf794b66f6267b9cf4c64059bdd07b90579d4
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2493164
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@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>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
Bhadram Varka
64afd564e4 osi: single API to handle DMA interrupts
Issue: Currently there are multiple API's for
handling DMA interrupts.

Fix: Creating single API to handle DMA interrupts.

Bug 200671160

Change-Id: I9385e8fb0ca044c7a01d38483226e2e83f76f5b9
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2497610
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
rakesh goyal
35bb4dee50 osi: eqos: only interface APIs accessible form OSD
Issue:	Many non API functions are accessible from
	OSD code which can be used to update/access
	HW registers.
Fix:	Move non API function to local files and
	remove header files from code shared with OSD
	so these function can be accessible only
	within OSI code

Bug 200671160

Change-Id: Ic396b3b34e20cd8ee6b252e745df12f4532d0e10
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2494297
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Bhadram Varka
d39e02d47e osi: don't expose DMA ops to OSD
Issue: Currently OSD has access to osi_dma_ops
so these operations can be changed by OSD.
Also each entry funnction has checks for validating
these function pointers which would increase the
unit tests as well.

Fix: Move dma_ops to inside OSI and set a flag
indicate that DMA software init done. Each entry
function needs to check only flag.

It also fixes couple of doxygen comments issues.

Bug 200671160

Change-Id: I675e24cbfca8f4023fd31709f246230d2070d716
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2490156
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@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>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
Bhadram Varka
251441ff2c osi: ivc: support for get_hw_features
Issue: Recently get_hw_features function pointer added
to get the HW features. This pointer is missing for
IVC operations which resulted in kernel panic.

Fix: Add support for IVC get_hw_features

Bug 200671160

Change-Id: I95aa82b157790d6fbf4626000c318d52f3d248ee
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2495585
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Nagaraj Annaiah <nannaiah@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>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
Bhadram Varka
37a103c11d osi: don't expose core_ops to OSD
Issue: Currently OSD has access to osi_core_ops
so these operations can be changed by OSD.
Also each entry funnction has checks for validating
these function pointers which would increase the
unit tests and complexity as well.

Fix: Move dma_ops to inside OSI and set a flag
indicate that CORE software init done. Each entry
function needs to check only flag

Bug 200671160

Change-Id: I6def9e5c39f90a08eb4f48a124a1c2c8c65175a4
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2435991
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@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>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
f91a777e64 core: move get_hw_feat to osi_core
No api from osi_common should be direclty accessible
from OSD code. moving osi_get_hw_feat to osi core.

Moving following API to common/common.h
osi_memset()
osi_memcpy()

Bug 200671160

Change-Id: Idd6269b01ee8ec21c7f3c5b7f3376cf9a91bb661
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2488875
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
nannaiah
22b25f8b97 Add fix to misra & cert errors for ethernet server
Bug 2694285

Change-Id: I6b899538ed92f67351cc21ccbb900d842e91ad5d
Signed-off-by: Nagaraj annaiah <nannaiah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2486524
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Bhadram Varka
8b595b8ddd osi: delete osd_ops functions
Bug 200620687

Change-Id: I1b3d46b86e3d9679a5b4db780aa8ea17a0349c8a
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2483072
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Bhadram Varka
ae2bbaf49a osi: remove core API to get MAC time
Issue:
dma_base pointer being checked in osi_get_systime_from_mac()
API which will be not populated OSD which resulted in PTP
time sync issues.

Fix: Use DMA API inside OSD to get MAC time and remove
dma_base usage.

Bug 200696375

Change-Id: I807a99b6af82a12eddd830f5b010c4a83e8b7b92
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2487698
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Nagarjuna Kristam <nkristam@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
Nagarjuna Kristam
dcca85ffd3 osi: update input arguments with boundary values
Issue:
Verification checklist requests input params with boundaries for external
interfaces to be documented.

Fix:
Add boundaries for input argument which has boundaries implemented.

Bug 200673381

Change-Id: I4ffac5dcabf836038cf9b2c4e448ec1f881ef271
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2472860
(cherry picked from commit a84e13325795fb63ad567c95c10813875604e26a)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2474894
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Gaurav Asati <gasati@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>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
nannaiah
3f204d6f16 nvthernetrm: Add IVC support for OSI
In case of virtualization the OSI functions will be handled
at Ethernet Server. Add IVC support where OSD can send
IVC packets to ethernet server. Ethernet Server parses the
messages and calls the corresponding OSI API.

OSI and few DMA API's are updated to support osi_core as an
argument.

Bug 2694285

Change-Id: Ic56b8e9f5f9cd70cc70239b61d756bfa2e998588
Signed-off-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2435281
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
rakesh goyal
e7e389f51d osi: core: dma: fix issue identified in unit testing
Issue:
- rx_ring pointer validation missing in interface API
- Misra-C issue introduced while fixing
  Advisory error.
- if addend = diff, osi_adjut_freq return -1
- OSI_MAC_TCR_SNAPTYPSEL_3 unused macro

Fix:
- add check for rx_ring pointer validation
- Fix Misra C error
- proceed further instead of returning -1
- Hide OSI_MAC_TCR_SNAPTYPSEL_3 for QNX

Bug 200686220

Change-Id: I806b4f33b86ee08c96ddb76fbfb91bf394206d70
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2459580
(cherry picked from commit fabc231aa387a74158b6efe926659c33c1abf0c6)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2460837
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: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
cf683b4ee1 osi: fix doxygen comments and advisory error 11.1
Issue:
- incorrect doxygen comment for new file added
- Misra error 11.1 due to mismatch in defination and
  Diclariation

Fix:
- Fix doxygen comments
- Fix MisraC errors

Bug 200682334

Change-Id: Ia9a5fd71cc41906169dd0d83d9e4d2cdb5163745
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2458315
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2459446
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
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: Krishna Thota <kthota@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Michael Hsu
c609cd7a67 osi: increase rx/tx descriptor count
Increase number of rx/tx descriptors for better network performance.

Bug 3175332

Change-Id: I053143b3512518c6c2dbdbe0d6480ddd5bc013cc
Signed-off-by: Michael Hsu <mhsu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2444522
(cherry picked from commit 6810ca53b294bedb27e8cb275134a143a36b2e68)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2458848
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Narayan Reddy
6e7e9df632 osi: common: change eqos MAC version to 0x53
Bug 200681386

Change-Id: I034e8bde53a957916113812adc937ae3f0dc5825
Signed-off-by: narayanr <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2454879
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
rakesh goyal
327640b4cc nvethernetrm: fix Misra-C 20.5
Fix MISRA C-2012 Rule 20.5

Bug 200682334

Change-Id: I53856a1ec497f432fd3358ffdc16f36d8ca75d40
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2456032
(cherry picked from commit 6b2ca2be82458187318ba51d40166b0d9e437514)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2457309
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: Krishna Thota <kthota@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
24f9d3bb7e core: dma: fix doxygen comment as per review comment
Issue: Doxygen comments needs to be fixed for all
       units where pointer passed to a function
       and structure members updated through that
       pointer.
Fix:   corrected doxygen comments

Bug 200681427

Change-Id: I026ae30dc587234e8491d4764a5a3511042d3b9f
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2455185
(cherry picked from commit f09df9984ab5ff52cfaade8f994e2e63cb0256e0)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2457308
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: Krishna Thota <kthota@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
77aa8112be nvethernetrm: fix review CG and DG comments
- Include header gaurds using INCLUDED_
- Move static inline function to private
  header file.
- Move private macro to private header

Bug 200681427

Change-Id: I810184e077a5642f727e47b9280d3fb9659abd74
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2455014
(cherry picked from commit b3afc7a112460d7f92d8ef0fbe8727c7acd9ec44)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2457307
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: Krishna Thota <kthota@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
c93e5aa268 nvethernetrm: fix Misra-C 2.x, 5.9 and 8.9
Fix MISRA C-2012 Rule 2.3
Fix MISRA C-2012 Rule 2.4
Fix MISRA C-2012 Rule 2.5
Fix MISRA C-2012 Rule 5.9
Fix MISRA C-2012 Rule 8.9

Bug 200682334

Change-Id: Ie95e2f9d346d952fac1cf28f241522f35648be38
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2455622
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2457306
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@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>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
5ae3ed00c4 nvethernetrm: fix for Misra-C 4.6
- Fix Misra-C Rule 4.6

Bug 200682334

Change-Id: I56b1effa4e1a2f0707a26d11358de60d9d12e4f9
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2453789
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2457303
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@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>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
badaedf9f7 osi: update API group
Issue: Need to add "API Group" for all APIs.

Fix: Add "API Group" to all APIs

Bug 200681427

Change-Id: Iea2a77943c61dc166dd885f556454c63e4f6c716
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2453124
(cherry picked from commit b914e618d1ee70b92d60314f7614b20c34772fbc)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2455386
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
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>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
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>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
Nagarjuna Kristam
70f4a64246 osi: dma: Address review feedback
- Use OSI and OSD reference instead of HW and SW for packet
context fields.
- Update doxygen comments.

Bug 200673381

Change-Id: I10fac8476657bdf7048673f24d41271651fd200b
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2440621
(cherry picked from commit 687e36d5a58ffa9d34267994c04da296495be28c)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2455385
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Rakesh Goyal <rgoyal@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
dbb02189b2 osi: address code inspection comments
Issue:
1) Code inspection comments for validation
base address argument, channel out of bound
check and pointer validation missing.
2) Missing debug prints before return.

Fix:
1) Fix bugs/issues as per code inspection.
check for base address, channel and pointers.
2) Add debug prints to identify error.

Bug 200669603

Change-Id: I7e1a235c9aa9249c25a4a02927a9ea13ec3cadf8
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2436154
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2455383
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
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>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
a0bf63c9e9 core: move API form common/ to core/
Issue: As per unit design following APIs are
part of NvEthernetRm but in current implementation
is it getting compile with NvEthernetCl also
- osi_get_mac_version()
- osi_get_hw_features()

Fix: move APIs to NvEthernetRm

Bug 200669603

Change-Id: I27f5f304a586f40693d700e9bdb40b553d591544
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2435473
(cherry picked from commit 2d74a69dd1fd0c2567a506ae0f8e797924650e28)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2448708
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>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
0bfc4d5267 core: Remove unused code for QNX from compilation
Update common library code to remove following 2 APIs
as these are not used anymore by QNX.

osi_config_mac_loopback()
osi_set_mdc_clk_rate()

Bug 200669603

Change-Id: Ice364bfb3fd95f3f846677b80668eb2b0b0b2918
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2434886
(cherry picked from commit 9f69b25b1368b76fd7caa4b55a15e7a5947d3b9c)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2448820
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>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
Nagarjuna Kristam
bd8e8322a0 osi: dma: Update classification for DMA API's
Mark API's that can be called form interrupt/signal handler to Yes.

Bug 200620687

Change-Id: I105c9e6672f823249c1dea36e1891560861a7d07
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2430293
(cherry picked from commit b71a7d4fda87145f33a858bd68392308f09f07b5)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2438838
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Thota <kthota@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30