In Linux v6.4, commit
3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAGS")
added a kernel config option for MAX_SKB_FRAGS and change the type of
the definition to integer. This causes the nvethernet driver build to
fail and the following errors are seen ...
drivers/net/ethernet/nvidia/nvethernet/ether_linux.c:5949:33: error:
format ‘%ld’ expects argument of type ‘long int’, but argument 4
has type ‘nveu32_t’ {aka ‘unsigned int’} [-Werror=format=]
"invalid tx-frames, must be inrange %d to %ld",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/nvidia/nvethernet/ethtool.c:950:28: error: format
‘%ld’ expects argument of type ‘long int’, but argument 4 has
type ‘nveu32_t’ {aka ‘unsigned int’} [-Werror=format=]
"invalid tx-frames, must be in the range of"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix this by changing the type in the respective prints to integer. Note
that his is also to make this change for kernel prior to Linux v6.4.
Bug 4183168
Bug 4221847
Change-Id: Ibd9160ad08e65e0b85cae1cf4903075c31a1cd77
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989002
Reviewed-by: Shanker Donthineni <sdonthineni@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Instead of relying on kernel version to determine if functions or
specific versions of functions are present in the kernel, add compile
time tests to the conftest.sh script to determine this at compile time
for the kernel being used. This is beneficial for working with 3rd party
Linux kernels that may have back-ported upstream changes into their
kernel and so the kernel version checks do not work.
Bug 4119327
Change-Id: I79e701940ca70ca4d66500c75b5992f9d92b54b0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985744
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
The nvethernet driver fails to build for Linux v5.14 and Linux v5.17+
kernels. In Linux v5.15 the return type of the get/set_coalesce
callbacks were updated. In Linux v5.17 the parameters for the
get/set_ringparam callbacks were updated. In Linux v6.1 the
weight parameter for the netif_napi_add() function was removed and the
function netif_napi_add_weight() was added for passing the weight
parameter. Add the necessary kernel version checks to ensure that the
drivers build with the different versions of the Linux kernel.
Bug 3793131
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I56738eddd27eb4ebf7db5a2d0d031a64379482e8
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2820712
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Issue: In the current scenrio, when the remote
interface is brought down and up. There is no way
of getting the link up again with the remote device
which in turn fails the data transfers even though
interface from other end is brought up.
Fix: When interface is gone down on the other side,
MAC receives local faults and in this scenario
no data should be sent to MAC, so disable network
queues and initiate the lane bring up process for
monitoring the link status. Once the link is up,
re enable the network queues for data transfers.
Also added support for enabling driver logs using
msglvl of ethtool
Bug 3744088
Bug 3654543
Bug 3665378
Change-Id: I16cdee74e4e3ff6cd176924575f5005f385d4c5d
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2730876
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Issue: below ptk error stats are showing wrong value:
mgbe_ip_header_err
mgbe_jabber_timeout_err
mgbe_payload_cs_err
mgbe_tx_underflow_err
Fix: pkt error stats are part of osi_core structure. Move
these state in ether_gstrings_stats array that are
referenced from osi_core, instead of ether_cstrings_stats
which is referenced from osi_dma.
Bug 3484504
Change-Id: I38eae17526be654b93b1adb4bd1a70de359b9608
Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2647928
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Issue:
1) usuage of SUPPORTED_* in PHY driver for setting
the link mode parameters leading data corruption. So
replaced SUPPORTED_* with linkmode_*_bit in PHY driver.
2) Redundant code of setting Pause of PHY
Fix:
1) Change SUPPORTED_* to ETHTOOL_LINK_MODE_*_BIT for
consistent check between PHY and Ethernet driver for K5.10.
2) removed pause setting of PHY, since this is already
taken care in corresponding PHY drivers.
Bug 200781153
Change-Id: Ic6a212dd4560fb3a06a4f60be3bdd33620a38197
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2607712
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
To reduce number of external OSI interface APIs,
consolidated all IOCTL API to one interface API.
OSD should use same for all interaction to OSI.
Bug 200671160
Change-Id: I2ada2746f29be6cf396709c2ec12dd96d4a5ca15
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
Fix build linux-5.7-rc5 errors including following:
- change timespec to timespec64. replace getnstimeofday
with ktime_get_ts64
- replace usage of macro FIELD_SIZEOF with sizeof_field in ethtool.c
nvethernet and eqos files.
- support 2 arguments for of_get_phy_mode call
bug 200617764
Change-Id: I46067d7d36d08ee9556b2722e9ccec707b8853d4
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2347244
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tx frame count and software timer based interrupt coalescing
is enabled. Tx frame count based interrupt coalescing can be
enabled only when tx software timer based interrupt coalescing
is also enabled.
Bug 200529168
Change-Id: I8ac701c86238e8d34d7dbe9924df1162083c023e
Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2234610
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Rx frame based coalescing can be enabled only when
Rx timer based coalescing is also enabled. This is to avoid
no rx interrupt issues for applications which send only limited
frames and expects reply.
Bug 200529168
Change-Id: I7b00414bd56935ad8df57c9fa28764feb878213d
Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2233503
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Issue: Ethtool ops are registered during probe function and can
be invoked by external modules at any time as long as driver
is loaded. Certain ops functions read HW registers from the
MAC controller during function execution. Reading HW stats
is one such ops. However, when interface is down - HW is
placed in reset. Trying to read HW registers results in CBB
errors in this case. Also, the stats maintained in SW structs
are not cleared upon interface down.
Fix: Do not allow reading HW stats when interface is down in the
ethtool ops callback functions. Clear the SW stats structs
when interface is down. There is no need to explicitly
clear the stats in probe as stats memory is already zero
inititalized in probe.
Bug 2732055
Change-Id: I425b473819f170039ff63e6973ff29a0fe4a4e9c
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2221221
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Updated IOCTL path to not get impacted with new API
change. OSI call should be done with correct parameters
1) dma_routing_enable
2) dma_chan and
3) addr_mask (for L2 filtering) to support new IOCTL
4) src_dest (for L2 filtering) to support new IOCTL
Included logic for User priority based RxQ selection. We can have DT
entry "nvidia,rx_queue_prio" to configure this setting
i.e. for valid following Queue mapping
Priorities 6,3 to Queue 3
Priorities 4,5 to Queue 2
Priority 0 to Queue 1 and
Priority 1 to Queue 0.
setting will be nvidia,rx-queue-prio = <0x2 0x1 0x30 0x48>;
If static channel selection, i.e. RXQtoDMA set with value 0x03020100,
Priorities 6,3 to Queue 3 to chan 3
Priorities 4,5 to Queue 2 to chan 2
Priority 0 to Queue 1 to chan 1 and
Priority 1 to Queue 0 to chan 0
else if DCS(dma channel selection) enabled
channel will be selected based on filter rules.
Included logic to take input from User On DCS enable or disable. User can
update dt entry "nvidia,dcs-enable", for dcs enable disable for all queue.
i.e nvidia,dcs-enable = <0x1> will enable DCS for all queue.
Bug 200525721
Change-Id: I4ba820f178b03424d01bb4ddd1f1d6eadde572f7
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2133196
GVS: Gerrit_Virtual_Submit
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>
These stats are read from MAC HW RMON counters as well as SW controlled
control from Core and DMA path.
ethtool -S <interface> is used to get statistics.
There are 3 stats
1) ether_mmc_counters: EQOS HW 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: I5b1b6592541c650f01e845667eca2f5c59bcfd08
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2113962
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>