Commit Graph

443 Commits

Author SHA1 Message Date
Srinivas Ramachandran
c3ed68143b nvethernet: Add IOCTL handler to config loopback mode
MODS tests use private IOCTL to configure MAC loopback mode.
Add a priv ioctl handler to support this in nvethernet driver.
nvethernet driver also has a sysfs knob to configure loopback.

Bug 2665785

Change-Id: I7f488fe81a0772a0881dbba48592bbcd11205dbf
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2166181
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Narayan Reddy
da8bbea503 nvethernet: IOCTL and broadcasting MAC timestamp support
1) Register broadcasting MAC timestamp to clients so that
client can make use of the ptp callback for getting the
timestamp
2) Add private ioctl to read Timestamp information of
both HW PTP time and kernel time

Bug 200512422

Change-Id: I03509cc02f28571108a1061c739840c86f960af4
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2161172
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Bhadram Varka
ffde058071 nvethernet: Add driver suspend/resume support
Add the driver suspend/resume PM ops. These will ensure that
the MAC HW is de-init when tegra is suspended, and re-inited
when resume happens. WOLAN is not supported with this change.

Bug 2666797

Change-Id: Ibe47025fb5e4853885ea3b9ccffb49965e5e3e28
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2165029
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Tested-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
a0ced14509 nvethernet: fix kernel_warning_test errors
Moving informative prints from dev_err to dev_info

Bug 200512422

Change-Id: I3e404f14c2ee0bc24fef3943c3bb402c33d492e2
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2162925
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Bhadram Varka
23da7763f3 nvethernet: fix race in enable/disable Tx/Rx interrupts
Change-Id: I5d2ba00662d965d742fea0c655dd2845b65f59b9
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2161941
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
65a4e04daf nvethernet: check return value form interface function
Issue:
1) OSI interface function return value are not validated
2) MTL Q and DMA channel 1:1 mapping check missing

Fix:
1) check for valid return value for such API before proceed
2) check for 1:1 mapping between MTLQs and DMA channels

Bug 200512422

Change-Id: Ib61e6099d2dcdd64cb40a58718b0552fc08efa8e
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2161185
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
134a4c1057 nvethernet: handle various mtl and dma combination
Issue:
1) MTL Queue can be in any order in input to DT. If not
initialized sw can crash.
2) Don't use return value of skb_get_queue_mapping as
channel number.

Fix:
1) As MTL Queue sequence is already read, use it for
initialization and storing corresponding configuration.
2) Derive the channel number based on the q index
provided by skb_get_queue_mapping.

Bug 200512422

Change-Id: I145f67ee07101ae69821b5ae4a770e512252985b
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2156243
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Narayan Reddy
db777e2ece nvethernet: add MAC core deinit in remove
1. Call MAC de init incase of remove.
2. Fix ether_select_queue iteration count

Bug 200512422

Change-Id: Ic0abc30c97efbab02dab1ae73ac39c96df36ac7c
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2145731
GVS: Gerrit_Virtual_Submit
Reviewed-by: Automatic_Commit_Validation_User
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>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
4fcd7633cd nvethernet: fix eqos ioctls for MAC filter validation app
Issue:
1) EQOS_UDP_FILTERING_CMD: SW check for VLAN Hash Filter hw feature
along with user input.

2) EQOS_UDP_FILTERING_CMD/EQOS_TCP_FILTERING_CMD: SW don't set IPFE bit
in MAC packet filter register.

Fix:
1) No need to check for VLAN hash filter hw feature as Hash
filtering is not supported in SW.

2) Call osi_config_l3_l4_filter_enable if MAC filter register already
not configured for L3/L4 filtering.

Bug 200512422

Change-Id: I2cba199f57b79b7357663d39c8e2281f4b49bda8
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2148361
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>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
7bddaf1e51 nvethernet: fix regression due to early mac_rst
Issue: Interface is not up after boot

Fix: in ether_open(), MAC reset called before phy is
out of reset, adding steps to take care of it.

Also added put clks in case of probe failure and remove.

Bug 200512422

Change-Id: Id9da0cf77356cc03aaa69f2420028764ba462d47
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2142245
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
3cb8c90059 nvethernet: read max mtu size from platform DT
Issue: Configure Max MTU size support for specific platform

Fix:
 if "nvidia,max_platform_mtu" present in platform DT and less than
    MAX_HW_MTU supported
 	set platform max value from DT
 else
	default MTU(1500 bytes) will be used as platform max mtu

Bug 2594873

Change-Id: Id9b912a0c797c8cefb4233209b4d38004bcdf840
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2137919
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bhadram Varka <vbhadram@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>
2022-11-01 14:27:07 +05:30
Narayan Reddy
481b69b58a nvethernet: 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: I01bf170faa3c0f337d433eb19ebec49270483e18
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2139369
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
f71600879c nvethernet: Reset MAC registers on interface down and up.
Issue: MAC registers are not getting reset on ether_close(),
which lead to old values in MAC registers at the time of
osi_hw_core_init().

Fix: Assert MAC-RST gpio and disable clocks in ether_close().
Enable clock, reset MAC_RST gpio and poll for swr, which will
reset all MAC registers.

Note: To read MAC registers, you must have clocks enable and MAC
out of reset

Bug 200512422

Change-Id: If253eff0ae456702d3cdcbe1f177dd91a5aae20d
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2138031
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Narayan Reddy
d3161de4da nvethernet: issue PHY reset in probe fail/remove
handle the phy reset in case of probe failure
and driver removal

Bug 200512422

Change-Id: I69fd8697b36ab8f69f482762bf3fcc8ee6cd36a3
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2139628
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Srinivas Ramachandran
d1bf60985d nvethernet: Move thermal cooling device registration
Issue: Tegra-eqos thermal cooling device is registered
during driver probe(). Once this registration is done,
callbacks via cooling_device_ops can be invoked at any time.
This implies even if driver is just probed, callbacks can try
to trigger a pad calibration due to temperature change and
result in failure trying to access MAC registers when the
MAC netdev interface is not up.

Fix: Move cooling device register/unregister to ether_open/
ether_close() routines respectively, so that callbacks can
be invoked only when interface is actually up.

Bug 1679250

Change-Id: Iaf181ceb3af4b9def188171606d9a9c141d06ccc
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2138382
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>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
8c7d9510f2 nvethernet: support filter based dma routing API
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>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
2f9ecd7d54 nvethernet: ethtool: add support for stats
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>
2022-11-01 14:27:07 +05:30
Narayan Reddy
21dcef7b83 nvethernet: 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: Id647db1f60582717a09f24699841e00d7a582a1d
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2123439
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>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
6a3fdf61b3 nvethernet: enable MAC filter
Functions added to support filter setting from Network
stack as well as from customized app using ioctl.

Bug 200512993

Change-Id: Id9a7712242ef229969d7c476c85171509ab53d73
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2111084
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
GVS: Gerrit_Virtual_Submit
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>
2022-11-01 14:27:07 +05:30
Srinivas Ramachandran
3565e0eb75 nvethernet: Add temperature based pad calibration.
Ethernet pad calibration needs to be triggered for temperature
changes in steps of 35C from -40C to 110C. In order to get
indication of current operating temperature, register a ethernet
cooling device with thermal zones defined as per above requirement.
When the temperature trips these zones, callback function is invoked
from kernel thermal framework, and ethernet driver can trigger pad
calibration.

Bug 1679250

Change-Id: Iaeccca650e371843fa571f7b368bb5464e106314
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2120431
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ajay Gupta <ajayg@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>
2022-11-01 14:27:07 +05:30
Srinivas Ramachandran
e05030a4e2 nvethernet: Add support for ioctls and HW offloads
1. ARP offload can be configured via private ioctl.
   Application requesting the arp offload configuration
   should provide the IP address to be configured for
   ARP offload via ioctl data struct. Refer to
   struct ether_ifr_data and
   struct arp_offload_param for details.

2. Tx/Rx Checksum offload can be configured via ethtool

3. TCP Segmentation offload can be configured via ethtool

Bug 2571001

Change-Id: If639ab9049db97f200911af456ddb8cb8433fa12
Signed-off-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2109676
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
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>
2022-11-01 14:27:07 +05:30
Narayan Reddy
0426fc74e2 nvethernet: 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: I7b6373bfbb9572c4ac2635f1c4c91011f4244380
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2111933
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Narayan Reddy
731d296d1c nvethernet: Fix OSI core and DMA directories
OSI folder structure has been divided into CORE and DMA
directories, so modifying the makefile accordingly.

Bug 200517622

Change-Id: I629b98b39e0287564a3ac0675a6479c1a1df6f30
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2113713
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mohit Dhingra <mdhingra@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>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
79e4abea9c nvethernet: implement get avb algorithm settings
Implementation of new private IOCTL to get current AVB
settings at user space.

Bug 200512422

Change-Id: I6800778f0ab74ecc58c3813967c79ca11fae5124
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2112643
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>
2022-11-01 14:27:07 +05:30
Narayan Reddy
01bab1179a nvethernet: check for pkt validity
Process only the valid received packets. Don't send packets
to network stack if they are not valid.

Bug 200515518

Change-Id: If5e630c82aeccfeb53da9dd6e7313301fe3cdf4c
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2109601
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@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>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
4e30306bac nvethernet: add support for 802.1Qav (CBS)
Code added for
1) Customized application to configure avb setting
2) ndo_select_queue support to identify queue based on
   user priority.

Bug 200512771

Change-Id: I6468aa838567e50885931f10d49126870f1e25c4
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2108339
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Bhadram Varka
7676530a02 nvethernet: support for jumbo frames
Bug 200513783

Change-Id: I17d3e7e7cf7387814c6a2d60b69ac15e370f93c9
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094022
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: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Narayan Reddy
3fa01bcd71 nvethernet: 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 itself.

Bug 200512681

Change-Id: Ifb29dcdbfbf2c1b3baab438bf5b98c0fb362e6d8
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2088984
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Rakesh Goyal
0975ee4989 nvethernet: fix common irq free path
issue: freeing common irq in ether_free_irqs without check

fix: Use mask for common interrupt as well so it can be used to
check before freeing irq

Bug 200512422

Change-Id: I694ba983658fae3da6948ceda18d24c11f08d458
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2081600
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Narayan Reddy
2893067ed3 nvethernet: add support to parse dma_mask
Add dma-mask parsing in device tree for eqos
driver if IOMMU is enabled. This will allow
memory allocations from the specified address
and downwards, while device can reach every part
of physical memory through the IOMMU.

dma-mask will be remain default 32-bit mask if no
IOMMU is present since now DMA mask represents a
fundamental limit of the device.

Bug 200458098

Change-Id: I6eef70f97dba5807d6483cbd76e474d321debe75
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2096023
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Bhadram Varka
b023f0c0f8 nvethernet: support to change MAC address
Adds support for dynamic MAC address change.
Gets MAC address from userspace and update in
OSI core structure. Automatically MAC address
will be picked up from OSI core structure and
program the same in HW registers.

Bug 200512251

Change-Id: Ie49fd56c3d219637fc4bf33c818c380a8f1c7bf3
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2080718
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Srinivas Ramachandran <srinivasra@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>
2022-11-01 14:27:07 +05:30
Bhadram Varka
f9904e66af nvethernet: support to read/write PHY reg with mdio-tool
Adds IOCTL support to read and write a PHY register

Bug 200512251

Change-Id: I43461e7654ca2aa648c978eeaeca12930871006c
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2080717
GVS: Gerrit_Virtual_Submit
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
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>
2022-11-01 14:27:07 +05:30
Bhadram Varka
6e9c58de03 nvethernet: support for ethtool
Adds support for basic ethtool operations -
o get link propeties
o change speed/duplex

Bug 200512251

Change-Id: I1c754deff7c399db215f3803468c4c1513bf0988
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2080716
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
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>
2022-11-01 14:27:07 +05:30
Bhadram Varka
ec95665467 nvethernet: support for VLAN
Adds support for VLAN tag insertion on Tx path
and parsing of VLAN tag on receive path.

Bug 200511721

Change-Id: I07d4a576873bae61267244c9eb03a777f515a761
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2077037
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-11-01 14:27:07 +05:30
Bhadram Varka
77ee94796d nvethernet: support for EQOS base MAC
1) support for driver probe based on nveqos
2) support for EQOS hw init
3) data transmission support for Tx and Rx

Bug 200507585

Change-Id: I5c8bc88f97b2e61a2b346a23aadcb19a7b8c53a5
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
2022-11-01 14:27:07 +05:30
Jon Hunter
55f261f5b8 net: can: mtt: Enable building MTTCAN for Linux v6.0+
Building the MTTCAN driver is now fixed for Linux v6.0+ and so
re-enable building this driver for these kernels.

Bug 3831575
Bug 3767126

Change-Id: I43f584c5422090e393d4eb75dd8241f0111a67f5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2797614
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-10-26 16:49:32 -07:00
Jon Hunter
1cb49e59a3 net: can: mttcan: Fix build for Linux v5.19
When compiling the MTTCAN driver for Linux v5.19 the build fails because
the can_led_xxx() functions are not found. The can_led_xxx() functions
were removed for Linux v5.19 and not Linux 6.0 and so update the driver
accordingly to fix this.

Bug 3820317

Change-Id: I340cc9cbb44b5cb892c50cc0b5d06444ef894fe9
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2792549
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-10-20 02:20:03 -07:00
Jon Hunter
5cfa3e3c3f net: Fix build for Linux v6.1
Upstream Linux kernel commit b48b89f9c189 ("net: drop the weight
argument from netif_napi_add") removes the weight argument from the
netif_napi_add() function and this is breaking the build of a few
drivers that use this function. Fix this by updating these drivers to
use the netif_napi_add_weight() function instead for Linux v6.1.

Bug 3831575

Change-Id: I5ab3c2380db75313f9226c68777e6245e9e9dad5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2793511
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-10-18 11:24:42 -07:00
Shanker Donthineni
d12271255e nvidia-oot: disable offending drivers for v6.0
Some of the drivers from nvidia-oot are not compatible with v6.0
kernel API and data structure. Disable those drivers to unblock
the kstable-v6.0 release.

Revert this patch after fixing build issues with v6.0 kernel.

Bug 3767126

Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com>
Change-Id: I6b1499c8e92213a3722c506cfbad66f724b6f14c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2786883
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-10-07 02:51:32 -07:00
Manish Bhardwaj
bb37b5d666 nvidia-oot: fix mttcan driver compilaiton error.
Using this patch we are fixing below compilation
error of mttcan driver with stable kernel.

nvidia-oot/drivers/net/can/mttcan/native/m_ttcan_linux.c:620:3:
error: implicit declaration of function _can_led_event_
[-Werror=implicit-function-declaration]
can_led_event(dev, CAN_LED_EVENT_TX);

Bug 3767126

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: Ic7fa91a34b59f165ce689ad956f1c3779ef13f9a
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2787166
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-10-05 20:15:02 -07:00
Manish Bhardwaj
0e0d2f2c07 nvidia-oot: add support for mttcan driver
Using this patch we are adding support for
mttcan driver in oot kernel.

JIRA ESLC-6885

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: I83a6d43aa99278a546778cf1700e2bd106ec42a9
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2785360
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-10-03 21:31:05 -07:00
Manish Bhardwaj
77001d121e nvidia-oot: add support for hv_net driver
Using this patch we are adding support for
hv_net driver in oot kernel.

JIRA ESLC-6885

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: Ie8f65c014ae1c01a8378f0016ea520a4d114f6d7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2785035
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-10-03 21:30:56 -07:00
Nagarjuna Kristam
750f3ebecd net: ethernet: nvidia: add pcie vnet driver
Add PCIe virtual network driver from Nvidai repo

Bug 3583632

Change-Id: I8449e507978dbbdf0d4a66e53739b532c8df264d
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2736263
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-07-05 14:32:20 -07:00