Commit Graph

373 Commits

Author SHA1 Message Date
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
Nagarjuna Kristam
0025d5238b osi: replace osd_* API with osd_ops callbacks
Issue:
OSI calls OSD functionality using a direct API callback.
When multiple OSD's are present in single build system, only one
OSD can be linked to OSI for OSD functionality.

Fix:
Replace direct osd_* API calls by registered osd_ops callback.

Bug 200620687

Change-Id: I967565286fd9334fea6b34436267649f1af671c0
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2419132
(cherry picked from commit 0340c55df5741f73717e7a97e937bc4fdd6f02ef)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2438837
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
eeea518cc2 osi: create stripped library for MCAL/QNX
Update common library to export only API
used in QNX/MCAL driver if OSI_STRIPPED_LIB
is defined.

Bug 200671362

Change-Id: Ide3a5d9a60228b5d07355b58e26f509245db4144
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2410877
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2422285
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@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>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
Nagarjuna Kristam
5db715d7a8 osi: update function headers
Update doxygen comments for functions with below info
 - Use Algorithm inside @note
 - All numberical usages(like 1),2)..) with '-'
 - Add API group, Classification and Traceability note sections
   for all external interface functions.

Bug 200671362

Change-Id: I762df388659f4be75952b7050c7ae03489a086b8
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2407423
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2422284
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@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: 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
Nagarjuna Kristam
5cca29711e osi: common: Add API to check if MAC is enabled
Issue: RFE to check MAC enable status.

Fix: Export osi_is_mac_enabled API to check
for MAC status.

Bug 200646286
Bug 200671362

Change-Id: I26575c7c26095de3598197f5b800d3f1610a8bc9
Signed-off-by: Gaurav Asati <gasati@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2397918
(cherry picked from commit a1b24b2524150aa4b3f60cdd00c08f97de875f1c)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2405293
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
ebe8b29bfa dma: fix Rx DMA suspend issue
Issue:  DMA will be in suspend state if there is no buffer allocation
        happen to HW. If DMA is in suspend state, no interrupt will
        occur for channel which leads to not calling of
        osd_receive_packet().

Fix:    Whenever there is rx buffer kernel memory allocation failure, desc
        will be updated with reserve rx buffer. This reserved buffer is
	already allocated at the time of ether_open. Aim of same to
	make sure rx DMA always have buffer and not go in suspend state.

Bug 200650229

Change-Id: If8ff5f2dbfb631e8d1bc2383f958ed389643d7a4
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2399010
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
2fcef2bf75 nvethernet: Add to read PTP registers from DMA base.
Issue: Virtualization introduces read delay due to trap
mechanism.

Fix:
Move time critical PTP timestamp registers to use alternate
HW MMIO window/page that is not trapped to read PTP timestamp
registers.

Bug 2694285

Change-Id: I52340ae1f136a1a921b9c4a669c398e5d23ded73
Signed-off-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2360103
(cherry picked from commit e2ad2ff5b43532c2d5f9165f0311c59f1c6e9a4c)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2347314
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Gaurav Asati <gasati@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Krishna Thota <kthota@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Gaurav Asati <gasati@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Mohan Thadikamalla
f0478be2c9 nvethernetrm: MISRA fixes for QNX PLC
Issue:
Observed three MISRA/CERT-C issue with
QNX PLC configuration.

Fix:
Fix observed MISRA issues.

Bug 200624259

Change-Id: Iafd0f2694b4506bee12b15f899cf2201cad92925
Signed-off-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2368010
(cherry picked from commit 61310ea022e525d88d9d9def8eebee2b96770e27)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2375768
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Gaurav Asati <gasati@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
Nagarjuna Kristam
4dc2836b11 osi: dma: Add support to read PTP time over DMA base
Issue: RFE to support PTP time read from OSI DMA.

Fix: Add OSI DMA API to read PTP time from DMA base.
Move PTP time read code to OSI common.

Bug 200630996

Change-Id: Ic65a042d23318f93ecf23b481ab7a898cf88d360
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2367295
(cherry picked from commit 7379669ef23507e0f50f1517e819c552ea359300)
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2374403
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Gaurav Asati <gasati@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Srinivas Ramachandran
a89ce48ab2 nvethernetrm: Indicate more Rx frames pending
Issue: The function osi_process_rx_completions does
       not provide indication whether there are more
       Rx frames in the HW ring to be processed by SW.
       This indication is needed in OSD layers like
       AUTOSAR MCAL driver as per the spec.
Fix:   Check the next descriptor in the ring and indicate
       if it has a valid new Rx packet that is pending
       to be processed.

Bug 3019362

Change-Id: I4b4b8ac7b741dedbe979156e44f442cbb0e67590
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2361176
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Mahesh Patil <maheshp@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2024-02-21 16:31:59 +05:30
rakesh goyal
077f63621d nvethernetrm: eqos: handle filter operation flag
Issue:	RM server is not aware of what L2 address
	should be removed from local list and register as
	index passed by OSD/OSI_Core may mis-match in case
	multi FD instance usecase.
Fix:	As RM server finds index/offset on its own corresponding
	to MAC address, Core software should reset AE bit and pass
        other user provided argument as it is. Legacy
	way of removing L2 address is still supported.

Bug 200626200

Change-Id: I43919827422d176334198ee09e822047b606da79
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2359969
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
rakesh goyal
0118473454 nvethernetrm: osi private structure update
update OSI HW feature registers

Bug 200563382

Change-Id: Ia30176bcf9dc1080489caa52bd0c67ac05a17ef1
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2338042
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: 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
9f4bff9f10 osi: dma: Add callback for osd data path
Issue:
When 2 OSD's are part of single compilation process, only one
OSD can be linked at compile time. This causes issues in handling
TX and RX communication from OSI to OSD.

Fix:
Add callbacks for TX and RX communication which can be registered by
OSD to receive callback communication from OSI for TX and RX. Use
existing API's if OSD doesn't register a callback.

Bug 200603660

Change-Id: I0b246a78a3d1bc4bb690e1ad7dac82108500b625
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2343967
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Mahesh Patil
693cefdcc7 nvethernetrm: Check Rx packets processed or not
Issue: If buffer allocation fails in Rx refill, cur_rx_idx overlaps
       and can result in crash in osi_process_rx_completions()
Fix: Track Rx packet processed or not. If pkt is already processed
     skip further rx packet processing in osi_process_rx_completions()

Bug 2945319

Change-Id: Ieaed3aadf3d29aaa0e9d29d074f1f0f54f77e620
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2338920
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
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: svc-mobile-cert <svc-mobile-cert@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
Nagarjuna Kritam
33ccc2f87d nvethernetrm: Use SSINC for SSIR and ADDEND calculations
Use MAC version based SSINC value and use it to configure SSIR
and addend registers.

Bug 200605211

Change-Id: I8ac4e5fbfb9c64db35a3c33417dee5ca34a1c61d
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2341203
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: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30
Bhadram Varka
e8dcbc4286 nvethernetrm: add support for EQOS VM interrupts
Adds VM IRQ handling support at OSI layer and adds
corresponding support for EQOS as well.

Need to pass below parameters from DT -
o Number of VM IRQ's assigned per OS/VM.
o Number of VM channels assigned to a VM IRQ.
o List of DMA channels assigned to a VM IRQ.

Below is the sample DT representation -

vm_irq_config: vm-irq-config {
	nvidia,num-vm-irqs = <4>;
	vm_irq1 {
		nvidia,num-vm-channels = <2>;
		nvidia,vm-channels = <0 1>;
	};
	vm_irq2 {
		nvidia,num-vm-channels = <2>;
		nvidia,vm-channels = <2 3>;
	};
	vm_irq3 {
		nvidia,num-vm-channels = <2>;
		nvidia,vm-channels = <4 5>;
	};
	vm_irq4 {
		nvidia,num-vm-channels = <2>;
		nvidia,vm-channels = <6 7>;
	};
};

ethernet@<base_addr> {
	[...]
	nvidia,vm-irq-config = <&vm_irq_config>;
	[...]
}

Bug 200546379

Change-Id: Id20780d573aa70baf42b003728ba416ed61832d2
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2250403
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2198595
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-02-21 16:31:59 +05:30