aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell/octeontx2/nic
AgeCommit message (Collapse)Author
2021-01-21octeontx2-pf: Backport upstream kernel changesNaveen Mamindlapalli
Backported PF/VF changes from upstream kernel. -> Avoid modifying netdev->features dynamically by the driver. https://www.kernel.org/doc/html/latest/networking/netdev-features.html -> The MCAM entry allocation is done statically during initialization time. The netdev->features is initialized based on the entries allocated at the low level. -> Removed ndo_features_check callback. -> Used eth_broadcast_addr, eth_zero_addr where ever applicable. -> Use -EOPNOTSUPP instead of -ENOTSUPP. Change-Id: I81092cd33048c011f6478047788f072b45a08dba Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/42673 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2021-01-21octeontx2-af: Backport upstream kernel changesNaveen Mamindlapalli
Backported changes from upstream kernel. -> Merged enum header_fields to enum key_fields. -> Added NPC_PARSE_KEX_S nibble definitions. -> Renamed def_rule to def_ucast_rule. -> Used eth_broadcast_addr, eth_zero_addr where ever applicable. -> Use -EOPNOTSUPP instead of -ENOTSUPP. Change-Id: Ic859c55cbfb966b2a295d92785626e39ea4cf316 Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/42672 Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Tested-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-12-22octeontx2-af: Add support for RSS hashing based on Transport protocol fieldGeorge Cherian
commit 328aaa8ea504c8c746079416f26e8311a20c3764 from git@git.assembla.com:cavium/WindRiver.linux.git Add support to choose RSS flow key algorithm with IPv4 transport protocol field included in hashing input data. This will be enabled by default. There-by enabling 3/5 tuple hash Change-Id: I0419da0fcd357bdd6fc6ed3fa9673ee1a8278488 Signed-off-by: George Cherian <george.cherian@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/39557 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-12-22octeontx2-pf: Set NIX1_RX interface for backpressureSubbaraya Sundeep
commit 93d956c82303c4ba05cbe4b58d69828c95868c5f from git@git.assembla.com:cavium/WindRiver.linux.git To enable NPA aura backpressure to NIX block receive interface the NIX RX interface either NIX0_RX or NIX1_RX need to be set in aura context. If NIX1 LF is attached to PF or VF then use NIX1_RX otherwise NIX0_RX. Change-Id: I46c2b39351f972b14a7c1b1de1ce842baef27281 Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/38543 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-10-26octeontx2-pf: Add IPv6 and SCTP6 ntuple filtersSubbaraya Sundeep
commit b3c0b2df60886211c59e293a2cd180587e1b1f57 from git@git.assembla.com:cavium/WindRiver.linux.git Added support for installing below ntuple filters: Raw IPv6 source and destination ips SCTP over IPv6 Ethtool commands: ethtool -U eth0 flow-type ip6 dst-ip <addr> \ src-ip <addr> action <N> ethtool -U eth0 flow-type sctp6 dst-ip <addr> \ src-ip <addr> src-port <N> dst-port <N> action <N> Change-Id: Ic8a2f101cbfcd6ce0b2fe1fc41961f9b25436479 Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/38178 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-10-26octeontx2-pf: Add raw IPv4 and SCTP4 filtersSubbaraya Sundeep
commit 89d75f25166de27313b62dc15633d97fcb23f667 from git@git.assembla.com:cavium/WindRiver.linux.git This patch does the following: Moves the flow related code to otx2_flow.c from otx2_ethtool.c Refactors the existing ipv4 code to separate function otx2_prepare_ipv4_flow Adds the raw IPv4 and SCTP4 ntuple filters. ethtool commands: ethtool -U eth0 flow-type ip4 dst-ip <addr> \ src-ip <addr> action <N> ethtool -U eth0 flow-type sctp4 dst-ip <addr> \ src-ip <addr> src-port <N> dst-port <N> action <N> Change-Id: I5c818d872047eddf8b51efcf643b48096dbea042 Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/38177 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-10-26octeontx2-pf: add Support QSGMII modeHariprasad Kelam
commit bfd6fb45c282b55ffccf54b5926c76f3b9e6e4cd from git@git.assembla.com:cavium/WindRiver.linux.git Update ethtool supported mode mask such that QSGMII port will be visible in supported link modes. Change-Id: If6a3f7da9b927201137dcb9ff26d94e09ba144ea Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/38067 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-10-26octeontx2-pf: support to change link speed/duplex/autonegHariprasad Kelam
commit cea1b117c1b8e8857f6582d3a84c288658aaa0c6 from git@git.assembla.com:cavium/WindRiver.linux.git Enable user to change configurations like speed, duplex and autoneg of network interface via ethtool -s option. ethtool -s eth0 advertise 0x1 --> default values will be passed speed/duplex/an ethtool -s eth0 advertise 0x40000 speed 10/1000 duplex half/full autoneg on phyad 0x1 Use phyad 0x1 to overwrite default values Change-Id: Icdaf8f2bf60801cd81dd293d2ef78a081627b43d Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/38066 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-10-26octeontx2-pf: Fix interface down flag on errorGeetha sowjanya
commit 11b46e80102666f8a57f55571640ab392abc33cc from git@git.assembla.com:cavium/WindRiver.linux.git In the existing code while changing the number of TX/RX queues using ethtool the PF/VF interface resources are freed and reallocated (otx2_stop and otx2_open is called) if the device is in running state. If any resource allocation fails in otx2_open, driver free already allocated resources and return. But again, when the number of queues changes as the device state still running oxt2_stop is called. In which we try to free already freed resources leading to driver crash. This patch fixes the issue by setting the INTF_DOWN flag on error and free the resources in otx2_stop only if the flag is not set. Change-Id: I5dd3d2ae299412a7548a597c21a8417a1fc76910 Signed-off-by: Geetha sowjanya <gakula@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/37604 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-10-26octeontx2-pf: Add tracepoints for PF/VF mailboxSubbaraya Sundeep
commit dca718e5847d048608e722d5c52f2368c7fe9853 from git@git.assembla.com:cavium/WindRiver.linux.git With tracepoints support present in the mailbox code this patch adds tracepoints in PF and VF drivers at places where mailbox messages are allocated, sent and at message interrupts. Change-Id: I95c803fb8fab6c177329e6e009090c8e721927f3 Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/37172 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-10-14octeontx2-pf: Backport logical changes in netdev drivers.Rakesh Babu
commit 1691d8c48dbfd2de5fb887bb717f34736bea8df8 from git@git.assembla.com:cavium/WindRiver.linux.git Backport logical changes such as changes in xmit etc., in netdev drivers from upstream kernel sources. Signed-off-by: Rakesh Babu <rsaladi2@marvell.com> Change-Id: Ide3924f5e95482d2e386f23870735c181a73a4ee Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/35894 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-10-14octeontx2-pf: Backport cosmetic upstream changes.Rakesh Babu
commit 75abb241bca38adbd7c93f35bea2d54d7c3f2c9f from git@git.assembla.com:cavium/WindRiver.linux.git Backported cosmetic changes such as code (re)placements, comments additions/corrections from upstream kernel sources. Signed-off-by: Rakesh Babu <rsaladi2@marvell.com> Change-Id: I31db5dd7fd08c481345470f369a32bda0f125f45 Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/35353 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-10-14octeontx2-pf: Return proper RSS indirection table size alwaysSunil Goutham
commit 6c80ffc976f9722e342db411b250cf57dce7830b from git@git.assembla.com:cavium/WindRiver.linux.git With current logic, if the interface is not initialized even once then size of indirection table returned is zero. And ethtool says "Operation not supported". Fixed this by returning the size of indirection table array. Change-Id: I1b9a394f66c14d65492af20bbc233da44237e087 Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/35640 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-09-15octeontx2-pf: Remove wrapper APIs for mutex lock and unlockRakesh Babu
commit 248395c2a7b3b99d3ad9b13d69d5182198bdc7c4 from git@git.assembla.com:cavium/WindRiver.linux.git This patch removes wrapper fn()s around mutex_init/lock/unlock. Signed-off-by: Rakesh Babu <rsaladi2@marvell.com> Change-Id: If52051eb0c65bbe34b03d56e1c9af045ca3ca701 Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/35274 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-09-15octeontx2-pf: cleanup transmit link deriving logicSubbaraya Sundeep
commit a149527f26ab2a2ac156522f916b214ec5b39b60 from git@git.assembla.com:cavium/WindRiver.linux.git Unlike OcteonTx2, the channel numbers used by CGX/RPM and LBK on CN10K silicons aren't fixed in HW. They are SW programmable, hence we cannot derive transmit link from static channel numbers anymore. Get the same from admin function via mailbox. Change-Id: I093b68170f3f24f41368dccd586a57759094e19a Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/34812 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-09-15octeontx2-pf: Fix receive buffer size calculationSunil Goutham
commit 1634ec59fefebed6314484b7223a05956edd26e6 from git@git.assembla.com:cavium/WindRiver.linux.git Not considering L2 header while calculating receive buffer size resulting in pkt spilling over to next buffer. Since we no longer support multi-segmented receive pkts while processing CQE_RX these pkts are treated as errors and dropped. This patch fixes the issue to makesure pkt fits in single segment. Change-Id: I6dd49e9bc66aa4a4380b5736afd083d9aab982af Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/34367 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-09-15octeontx2-pf: Support to change VLAN based RSS hash options via ethtoolGeorge Cherian
commit c066890c0646aed46b2a6d11cb6e0cf98770875e from git@git.assembla.com:cavium/WindRiver.linux.git Add support to control rx-flow-hash based on VLAN. By default VLAN plus 4-tuple based hashing is enabled. Changes can be done runtime using ethtool To enable 2-tuple plus VLAN based flow distribution # ethtool -N <intf> rx-flow-hash <prot> sdv To enable 4-tuple plus VLAN based flow distribution # ethtool -N <intf> rx-flow-hash <prot> sdfnv Change-Id: I36b1736b3882a0286e728e9c272e275f78b66bfa Signed-off-by: George Cherian <george.cherian@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/33816 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-08-18octeontx2-pf: Avoid null pointer dereferenceSubbaraya Sundeep
commit 92fd56ae53e27c336da9e15c7c5b6e4852d95a0d from git@git.assembla.com:cavium/WindRiver.linux.git otx2_mbox_up_handler_cgx_ptp_rx_info can be called for a VF too and VF do not have ptp context. Hence check for valid ptp pointer before dereferencing. Change-Id: I30424bc1231ea4384868f22f896933fdab702c1d Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/33392 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-08-18octeontx2-pf: update ethtool supported modes maskHariprasad Kelam
commit 22c602bdcd1de3b215d09228f7ee45881b8a411b from git@git.assembla.com:cavium/WindRiver.linux.git To support Sfp&Qsfp for LIO and LIO3 new link modes are supported. Update ethtool supported modes accordingly. Change-Id: Ic2a7843edded4e4db29ef1556af9fefeb4eae3be Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/32649 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-08-18octeontx2-vf: initialize interface mode as defaultHariprasad Kelam
commit 93dd7c497513541d5be35203789bc0f19e5fcfb6 from git@git.assembla.com:cavium/WindRiver.linux.git To support parsing switch protocols like HIGIG and DSA ,PF sets its interface mode accordingly on user request. But this not applicable for VF.So always initialize interface mode as default for VFs. Change-Id: I321b91d1154fda3d607e7a9ca32b96526b7d39c8 Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/32607 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-08-18octeontx2-pf: Call mbox_reset before incrementing ackHariprasad Kelam
commit fb9f0913a1456407f13c0594000589cf8b19b842 from git@git.assembla.com:cavium/WindRiver.linux.git Mbox has three states alloc, send, reset in mbox response. In few scenarios mbox reset of previous message is triggered while current request is in send state which is resulting mbox errors. To avoid the same call mbox_reset before incrementing msgs_acked flag and check msg has valid size. Change-Id: If78d2635818b766396b6ed549852b24c3baf863b Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/32456 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Ruiqiang Hao <Ruiqiang.Hao@windriver.com>
2020-06-16octeontx2-pf: Stop tx queues in case of subsequent calls failureHariprasad Kelam
commit 4688437d077218b21e8fe695a34afd49f8f036ff from git@git.assembla.com:cavium/WindRiver.linux.git Currently in otx2_open in failure of mcam allocation or nix_lf_start we are not stopping tx queues which are already started in link_event. Hence stop tx queues Change-Id: I8893d46558e7902fa3c1d8961a83172c6ecc48fe Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/28643 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-06-16octeontx2-pf: Calculate LBK link correctlySubbaraya Sundeep
commit a7be3ad280bc6e1dcb52fa060d235a93a4330ce1 from git@git.assembla.com:cavium/WindRiver.linux.git CGX links are followed by LBK links but number of CGX and LBK links varies between platforms. Hence get the number of links present in hardware from AF and use it to calculate LBK link number. Change-Id: Ibbccd3109e723cba5876072de4021e22332b20ce Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/27909 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-06-16octeontx2-pf: Fix TCP/UDP checksum offload for IPv6 pktsGeetha sowjanya
commit 6ff2f961f218e07b0104fbac44b76bcea5979733 from git@git.assembla.com:cavium/WindRiver.linux.git For TCP/UDP checksum offload HW expects L3TYPE to be set irrespective of IP header checksum is being offloaded or not. Currently for IPv6 pkts L3TYPE is not being set resulting in pkts with checksum error. This patch fixes this issue. Change-Id: Ibb090fb6bc14d08e29ce4c6c5731759262c207fe Signed-off-by: Geetha sowjanya <gakula@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/27674 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-06-16octeontx2-pf: Add ntuple filter support for FDSAHariprasad Kelam
commit 0f462c799b44f705662c01a57ee6c6847a86cb67 from git@git.assembla.com:cavium/WindRiver.linux.git Marvell switches support FDSA (Forward DSA). FDSA has 4 bytes length and it contains Src port and vlan field. KPU profile is updated to parse FDSA packet and extract Src port. The extracted Src port is placed in vlan field of KEX key. This patch adds ntuple filter support to FDSA tag. So that user can send traffic to either PF or VF based on Src port or Vlan id. All rules installed for FDSA has default action as RSS. Upon enabling FDSA , vf vlan rules will be disabled. To enable fdsa tag ethtool --set-priv-flags eth0 fdsa on To send traffic with Srcport 30 to PF ethtool -U eth0 flow-type ether user-def 0x1e To send traffic with vlan id 30 to PF ethtool -U eth0 flow-type ether dst xx vlan 30 m 0xf000 To send traffic with Srcport 20 to vf 0 ethtool -U eth0 flow-type ether vf 0 user-def 0x14 Change-Id: I547296bb497e73b5b048297b8459543cd5d3bfb5 Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/27668 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-04-07octeontx2-pf: Fix memory double free in otx2_aura_pool_freeSubbaraya Sundeep
commit 9c7f0b1a2c974ac1fb63f57276982cdb3205a11c from git@git.assembla.com:cavium/WindRiver.linux.git Memory double free problem occurs when otx2_aura_pool_free is called twice because of the dangling pointer. This patch fixes it by setting freed pointer to NULL as well. Also interrupt status is cleared in interrupt handler immediately since upcoming interrupts may be lost in HW until status bit is zeroed by SW. Change-Id: Ic8c1c3ca12da39032db9e0af7dadea83f114b758 Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-on: https://sj1git1.cavium.com/23763 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-04-07octeontx2-pf: Remove unnecessary mbox request in unbindHariprasad Kelam
commit 89e6c3d00d0360f8241bdc820e3e4ba7fbcb3557 from git@git.assembla.com:cavium/WindRiver.linux.git If interface is already in default mode then sending mbox to reset HW config back to default mode is not necessary. This patch fixes the same. minor changes * Remove reinstalling vf vlan config rule upon mac address change as AF takes care of this case Change-Id: I341cbf40433f9e92124efa8ed6c21e80349c772d Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Reviewed-on: https://sj1git1.cavium.com/23594 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-03-10octeontx2-pf: Don't configure RSS context when interface is downSunil Goutham
commit 6248952f194687b88808ae5f2ed75d23a0faa9b6 from git@git.assembla.com:cavium/WindRiver.linux.git When interface is down all NIXLF contexts are disabled, so any attempt to confgiure them will fail. Hence do not try to configure RSS contexts when interface is down. Since the user input is saved when interface comes up RSS is configured as per user input. Change-Id: I692761a125fd6e1fada78291e0124df5adc441d5 Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Reviewed-on: https://sj1git1.cavium.com/23059 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-03-10octeontx2-pf: Set SMQ MAXLEN to max hardware supported valueGeetha sowjanya
commit 5ccebd7152b2aa8ff8f1b387e3e36f62dd539657 from git@git.assembla.com:cavium/WindRiver.linux.git Setting SMQ MAXLEN to max value to avoid MNQ max length errors for the packets whose size > MTU. Fix indefinite loop in otx2_stop in case of SMQ hang due MNQ errors. Fix memory leak while freeing rcv buffers. Change-Id: I10f581d805baa2785780a6a5ee57dc06e9bd7dec Signed-off-by: Geetha sowjanya <gakula@marvell.com> Reviewed-on: https://sj1git1.cavium.com/22846 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Linu Cherian <lcherian@marvell.com> (cherry picked from commit a58b669385cb11260d1042b5f1f9adaa043a13c1) Reviewed-on: https://sj1git1.cavium.com/22963 Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-03-10octeontx2-pf: Fix flow control support for LBK devicesSunil Goutham
commit 97be69d8c134062b0731868d39ce94ccab07aead from git@git.assembla.com:cavium/WindRiver.linux.git Flow control is not supported for LBK devices, so don't send pause frame config messages to AF for LBK devices. Change-Id: I6e3b4b9353230436129fbb24b1fdc45c2227a56d Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Reviewed-on: https://sj1git1.cavium.com/22813 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Restore RSS and pause frame config settingsSunil Goutham
commit 90365b030af9c47cb6bb74716b17a2a5e752b4de from git@git.assembla.com:cavium/WindRiver.linux.git Currently upon ifconfig DOWN/UP the RSS and pause frame config done via ethtool is lost and reverted to default. This patch fixes this to restore these settings. Also made changes in RSS hash option setting to reject configuration to select which select only one of TCP/UDP sport and dport. Few other changes fixing issues related dealing with errors. Change-Id: I72883db2f7ff345a81607c21eb85e72f79bcdac5 Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Reviewed-on: https://sj1git1.cavium.com/22140 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Fix netdev watchdog timeout valueSunil Goutham
commit 9edd121d63757c9fad7c9e3ed5274db772a05a97 from git@git.assembla.com:cavium/WindRiver.linux.git For 96xx A0 due to a silicon which frequently causes transmit side stalls the watchdog timeout was set to a very high value instead of disabling. Since on the subsequent silicon versions the issue is fixed this patch sets a proper meaningful timeout value. Change-Id: Iaffac7a420be957fcdc8378e6ca95d72237ae8ae Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Reviewed-on: https://sj1git1.cavium.com/22045 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-af: Update HW workarounds for 96xx C0, 98xx and F95xx B0 chipsGeetha sowjanya
commit 5bafbd54aca8f7cd9e1e7639b05ce95c828b6b41 from git@git.assembla.com:cavium/WindRiver.linux.git Change-Id: I9ccb20237e27c43f0892a7e4eae2ef4be6c368ac Signed-off-by: Geetha sowjanya <gakula@marvell.com> Reviewed-on: https://sj1git1.cavium.com/21538 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Reset HW config for HIGIG/EDSA in driver unbindhariprasad
commit dfc7abe46c1bf3c2c00fa43003f3e11650e21632 from git@git.assembla.com:cavium/WindRiver.linux.git Once user enabled HIGIG/EDSA to parse these packets specific pkind will be alloted. For HIGIG CGX/LMAC registers are configured to support higig pause frames etc.This patch reset these settings in driver unbind Change-Id: I61cb5255e5f3d97c8caa2c86565e4e7e35f43aba Signed-off-by: hariprasad <hkelam@marvell.com> Reviewed-on: https://sj1git1.cavium.com/21180 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> [Kevin: Just some minor context mods in order to port to linux-yocto] Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Flush pending SQE on teardownGeetha sowjanya
commit 81bca1e5456ace6f7caf79013ef3daf71051b81a from git@git.assembla.com:cavium/WindRiver.linux.git Ensure that all SQEs of SQ are processed before disabling SMQ in PF/VF teardown. Change-Id: Ic7bea55335a332e5dbc891432911f485fbd8c333 Signed-off-by: Geetha sowjanya <gakula@marvell.com> Reviewed-on: https://sj1git1.cavium.com/19038 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> (cherry picked from commit 9335e7e73a98c4191e56d286affcc1d18a244314) Reviewed-on: https://sj1git1.cavium.com/21070 Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Remove multisegment RX_SG processing logicSunil Goutham
commit bd2d6642ce2aef47308ebb8544d744adca12402e from git@git.assembla.com:cavium/WindRiver.linux.git Since now there will always be only one segment in CQE_RX, cleaned up NAPI handlers etc to get rid of unnecessary multisegment handling logic. Also added structs for full CQE_RX and CQE_TX to avoid junk subdescriptor accessing logic. Other changes done - It's been observed that ocassionally HW is doing a partial CQE write (16byte) due to which cqe_hdr->cqe_type is valid but rest of the descriptor is stale. This is resulting in buffer double free issues. Hence along with cqe_type check sg->subdc also to determine if a CQE is valid or not. No changes needed for CQE_TX as full CQE_TX is within 16 bytes. - Adjusted RQ's Aura backpressure level for better performance with higher queue counts (> 12). There still a 10% gap between flowcontrol enable and disable for 24queues. Upto 12queues it is negligible. - Removed lockless transmit capability which at times resulting in wrong accounting of BQL limits. Change-Id: Id8d9be44a58ad808cd5228900649c36d79efd05c Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Reviewed-on: https://sj1git1.cavium.com/21012 Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Tested-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> (cherry picked from commit d0777e85e52cf9d80971e2e7c315cc9a6c62b9c1) Reviewed-on: https://sj1git1.cavium.com/21043 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Allocate receive buffers of MTU sizeSunil Goutham
commit 5e3ec7229b120001681a9d9ea8f7ce7e9cf1320a from git@git.assembla.com:cavium/WindRiver.linux.git Due to SMQ length configuration we are anyway reinitializing the interface upon MTU change. So better allocate receive buffers of size MTU so that pkt always fits into a single buffer. A follow up patch will cleanup the multi segment processing code in Rx napi handler. Change-Id: I0a84ab11650ae507dd03da3076b2fefa8c8cfcbe Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Reviewed-on: https://sj1git1.cavium.com/21018 Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Tested-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Add support for VF VLAN configuration via PFNaveen Mamindlapalli
commit 0f71b19da82820ede6562fa770372a7c36938f0a from git@git.assembla.com:cavium/WindRiver.linux.git This patch adds support for SR-IOV VF VLAN configuration via PF using ip link command. Added VF VLAN flow rules for both Rx/Tx directions. Updating VF VLAN Rx flow rule when PF changes VF mac address. Free tx vtag entries when PF driver is unloaded. The command syntax for vf vlan configuration using ip command is given below. # echo n > /sys/class/net/<pf>/device/sriov_numvfs Create vf's via sysfs where n is the number of vf's. # ip link set <pf> vf <x> vlan <vid> qos <qos> if vid != 0, traffic sent by VF <x> is tagged with vid and receives only traffic tagged with vid. if vid == 0, vf vlan configuration will be removed. qos > 0 is not supported. Change-Id: I8a8fef1f96eedbac4582d161854ee927da6c0a76 Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com> Reviewed-on: https://sj1git1.cavium.com/21014 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Do not set num_msgs in mbox headerSubbaraya Sundeep
commit 8e7f7faf9d90a84283093e02b90a9e9a12b061ae from git@git.assembla.com:cavium/WindRiver.linux.git A single interrupt line from VF to PF is used by VF to send messages to PF and for replying to UP messages sent by PF. Hence num_msgs in mbox header is cleared explicitly in PF interrupt handler to avoid queuing a work twice for an event. The same num_msgs which was cleared in interrupt handler was set again in work queue handler by mistake. This patch fixes it. Also - clearing interrupt in work queue handlers is not necessary hence removed it. - checking status in message response is not needed hence removed it. Change-Id: I1875d37816b61b4874eea1c7175c63dfea71bcb1 Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-on: https://sj1git1.cavium.com/20142 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Use mutex for mbox lockingSubbaraya Sundeep
commit 46a0ce95e2db7ffd083cd2634b7037f32e27501f from git@git.assembla.com:cavium/WindRiver.linux.git Used mutex instead atomic variables for mailbox lock. Also changed WARN_ON to dev_err. Change-Id: I18e1d3cc013bfc058db47a33ed5d123185d3c5ef Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-on: https://sj1git1.cavium.com/20141 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Dereference only a valid pointerSubbaraya Sundeep
commit 7aff3a8035f71bfd3675067ea5b79e5ad9b7bd9d from git@git.assembla.com:cavium/WindRiver.linux.git iommu_domain can be NULL hence check for non NULL pointer before dereferencing it. Change-Id: Iff01276a67f35954f1556b731d43339d152e268d Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-on: https://sj1git1.cavium.com/20065 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: update vlan offload rulehariprasad
commit 4ece484b7a0b62a79ab098f75c2a592839d4d7fb from git@git.assembla.com:cavium/WindRiver.linux.git MAC address field in vlan offload rule and interface mac address needs to be same for VLAN offload functionality. So update mac address field in vlan offload rule whenever user changes it. Change-Id: I272ea3b94b7989fd15efd306c27dbae3dddfb2a6 Signed-off-by: hariprasad <hari1219@gmail.com> Reviewed-on: https://sj1git1.cavium.com/19826 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Set default RR_QUANTUM for transmit scheduling levelsGeetha sowjanya
commit bbcdd24b2067f23ce553f57bd5153a3e3793b651 from git@git.assembla.com:cavium/WindRiver.linux.git Set RR_QUANTUM value high for transmit levels to prevent negative accumulations of the deficit count. Change-Id: I015ed6cfb27f853d653ebd299492a11bf3990abe Signed-off-by: Geetha sowjanya <gakula@marvell.com> Reviewed-on: https://sj1git1.cavium.com/19885 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Skip dma map and unmap when IOMMU is bypassedSunil Goutham
commit 94cef32782641d0e0d89a93db273c583d8fb5dd6 from git@git.assembla.com:cavium/WindRiver.linux.git HW takes care of data coherency at LLC level, to save some CPU cycles skip calling dma_map and dma_unmap apis when IOMMU is bypassed. This improves IP forwarding performance by ~5%. These changes are not for upstream. Change-Id: Ie1be6982d62ffe4bbb4434092c0c5ce3575d9339 Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Reviewed-on: https://sj1git1.cavium.com/19664 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Use likely and unlikelySunil Goutham
commit 66a0f365f4618d9528abcdff121a9e57f7bbb1a2 from git@git.assembla.com:cavium/WindRiver.linux.git Add likely and unliley to conditional statements for generation of optimised code by compiler in terms of branching. Change-Id: I7a80fd14999e187732dd8b8b2037544b97bc8800 Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Reviewed-on: https://sj1git1.cavium.com/19653 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Process CQE_TX first and then CQE_RXSunil Goutham
commit 02237bdd58d65c17d5b502bb027290dd7a281bf2 from git@git.assembla.com:cavium/WindRiver.linux.git Process transmitted pkt's CQEs first so that the freed skbs are recycled for received packets. Change-Id: Ia399659851c4b8181619ee212d1c9ee26711efc6 Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Reviewed-on: https://sj1git1.cavium.com/19652 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Discover NIX block address from RVUMSubbaraya Sundeep
commit f5b4312caee99567741fcb75470673d69a771a18 from git@git.assembla.com:cavium/WindRiver.linux.git For platform with two NIX blocks, LF may be allocated from either of NIX blocks. Hence discover the assigned block address from RVUM register. Change-Id: Id34b7ad968c6b91ea41ef833fad6bdebfef61c51 Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Reviewed-on: https://sj1git1.cavium.com/19496 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Remove warning messages in fast pathGeetha sowjanya
commit 8d48b6712f60b9bf29c482c090f3aee1166ac37b from git@git.assembla.com:cavium/WindRiver.linux.git Change-Id: I0bf0176bf6cd32f3a0b4c7963836b848747d626e Signed-off-by: Geetha sowjanya <gakula@marvell.com> Reviewed-on: https://sj1git1.cavium.com/19129 Tested-by: sa_ip-sw-jenkins <sa_ip-sw-jenkins@marvell.com> Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-af: Add new CGX_CMD to get PHY FEC statisticsFelix Manlunas
commit b1b525868f846e2599dd96ac881d8e483d162c0d from git@git.assembla.com:cavium/WindRiver.linux.git The stats are put in the shared data struct fwdata. A PHY driver indicates that it has FEC stats by setting the flag fwdata.phy.misc.has_fec_stats (for now, only the LIO3 card's 6141 PHY does this; all other PHYs clear that flag). On LIO3, FEC can be enabled at the PHY line-side only, never at the PHY host-side. So for LIO3, the ethtool FEC stats come from the PHY (not from CGX). Besides CGX_CMD_GET_PHY_FEC_STATS, also add CGX_CMD_PRBS and CGX_CMD_DISPLAY_EYE to enum cgx_cmd_id so that Linux's enum list is in sync with ATF's enum list. Change-Id: Ib0cb8e9315b88e3c3f1ddd16cae709f8837d4f1d Signed-off-by: Felix Manlunas <fmanlunas@marvell.com> Reviewed-on: https://sj1git1.cavium.com/18814 Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Tested-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
2020-02-27octeontx2-pf: Remove ARM64 and LSE_ATOMICS dependencyGeetha sowjanya
commit a9d863bf6de65580c54c2424bdc0d09dce663b67 from git@git.assembla.com:cavium/WindRiver.linux.git Generic arm64 atomic APIs for "ldadd" and "ldeor" instructions can't be used if CONFIG_LSE_ATOMIC is disabled. Hence, using asm instructions to remove dependency on kernel config. Change-Id: I40fd44b6246b3fad7479bc3cd3115c93331f80b6 Signed-off-by: Geetha sowjanya <gakula@marvell.com> Reviewed-on: https://sj1git1.cavium.com/18269 Reviewed-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Tested-by: Sunil Kovvuri Goutham <Sunil.Goutham@cavium.com> Signed-off-by: Kevin Hao <kexin.hao@windriver.com>