summary refs log tree commit diff
path: root/drivers
AgeCommit message (Collapse)Author
2020-07-07net: phy: Properly define genphy_c45_driverAndrew Lunn
Avoid the W=1 warning that symbol 'genphy_c45_driver' was not declared. Should it be static? Declare it on the phy header file. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-07net: phy: Fixup parameters in kerneldocAndrew Lunn
Correct the kerneldoc for a few structure and function calls, as reported by C=1 W=1. Cc: Alexandru Ardelean <alexaundru.ardelean@analog.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-07net: phy: at803x: Avoid comparison is always false warningAndrew Lunn
By placing the GENMASK value into an unsigned int and then passing it to PREF_FIELD, the type is reduces down from ULL. Given the reduced size of the type, the range checks in PREP_FAIL() are always true, and -Wtype-limits then gives a warning. By skipping the intermediate variable, the warning can be avoided. Reviewed-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-07net: sfp: Unique GPIO interrupt namesChris Healy
Dynamically generate a unique GPIO interrupt name, based on the device name and the GPIO name. For example: 103: 0 sx1503q 12 Edge sff2-los 104: 0 sx1503q 13 Edge sff2-tx-fault The sffX indicates the SFP the los and tx-fault are associated with. v3: - reverse Christmas tree new variable - fix spaces vs tabs v2: - added net-next to PATCH part of subject line - switched to devm_kasprintf() Signed-off-by: Chris Healy <cphealy@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-07net: systemport: Add support for VLAN transmit accelerationFlorian Fainelli
SYSTEMPORT is capable of performing VLAN transmit acceleration, support that by configuring it appropriately, providing the VLAN ID and PCP/DEI where necessary. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06net: qede: fix BE vs CPU comparisonAlexander Lobakin
Flow Dissector's keys are mostly Network / Big Endian. U{16,32}_MAX are the same in either of byteorders, but let's make sparse happy with wrapping them into noops. Signed-off-by: Alexander Lobakin <alobakin@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06net: qede: fix kernel-doc for qede_ptp_adjfreq()Alexander Lobakin
One of the function arguments was renamed some time ago, but this wasn't reflected in its kernel-doc comment. Also add the description for return values. Signed-off-by: Alexander Lobakin <alobakin@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06net: qed: sanitize BE/LE data processingAlexander Lobakin
Current code assumes that both host and device operates in Little Endian in lots of places. While this is true for x86 platform, this doesn't mean we should not care about this. This commit addresses all parts of the code that were pointed out by sparse checker. All operations with restricted (__be*/__le*) types are now protected with explicit from/to CPU conversions, even if they're noops on common setups. I'm sure there are more such places, but this implies a deeper code investigation, and is a subject for future works. Signed-off-by: Alexander Lobakin <alobakin@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06net: qed: use ptr shortcuts to dedup field accessing in some partsAlexander Lobakin
Use intermediate pointers instead of multiple dereferencing to simplify and beautify parts of code that will be addressed in the next commit. Signed-off-by: Alexander Lobakin <alobakin@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06net: qed: improve indentation of some parts of codeAlexander Lobakin
To not mix functional and stylistic changes, correct indentation of code that will be modified in the subsequent commits. Signed-off-by: Alexander Lobakin <alobakin@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06net: qed: address kernel-doc warningsAlexander Lobakin
Get rid of the kernel-doc warnings when building with W=1+ by rewriting the problematic doc comments according to the recommended format and style. Note that this only fixes problems found in C source files, headers aren't in scope for now. Signed-off-by: Alexander Lobakin <alobakin@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06net: qed: correct qed_hw_err_notify() prototypeAlexander Lobakin
Change the prototype of qed_hw_err_notify() with the following: * constify "fmt" argument according to printk() declarations; * anontate it with __cold attribute to move the function out of the line; * annotate it with __printf() attribute; This eliminates W=1+ warning: drivers/net/ethernet/qlogic/qed/qed_hw.c: In function ‘qed_hw_err_notify’: drivers/net/ethernet/qlogic/qed/qed_hw.c:851:3: warning: function ‘qed_hw_err_notify’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] len = vsnprintf(buf, QED_HW_ERR_MAX_STR_SIZE, fmt, vl); ^~~ as well as saves some code size: add/remove: 0/0 grow/shrink: 2/4 up/down: 40/-125 (-85) Function old new delta qed_dmae_execute_command 1680 1711 +31 qed_spq_post 1104 1113 +9 qed_int_sp_dpc 3554 3545 -9 qed_mcp_cmd_and_union 1896 1876 -20 qed_hw_err_notify 395 352 -43 qed_mcp_handle_events 2630 2577 -53 Total: Before=368645, After=368560, chg -0.02% __printf() will also be helpful with catching bad format strings and arguments. Signed-off-by: Alexander Lobakin <alobakin@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06net: qed: cleanup global structs declarationsAlexander Lobakin
Fix several sparse warnings by moving structs declarations into the corresponding header files: drivers/net/ethernet/qlogic/qed/qed_dcbx.c:2402:32: warning: symbol 'qed_dcbnl_ops_pass' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_ll2.c:2754:26: warning: symbol 'qed_ll2_ops_pass' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_ptp.c:449:30: warning: symbol 'qed_ptp_ops_pass' was not declared. Should it be static? drivers/net/ethernet/qlogic/qed/qed_sriov.c:5265:29: warning: symbol 'qed_iov_ops_pass' was not declared. Should it be static? (some of them were declared twice in different header files) Also make qed_hw_err_type_descr[] const while at it. Signed-off-by: Alexander Lobakin <alobakin@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06net: qed: move static iro_arr[] out of header fileAlexander Lobakin
Static variables (and functions, unless they're inline) should not be declared in header files. Move the static array iro_arr[] from "qed_hsi.h" to the sole place where it's used, "qed_init_ops.c". This eliminates lots of warnings (42 of them actually) against W=1+: In file included from drivers/net/ethernet/qlogic/qed/qed.h:51:0, from drivers/net/ethernet/qlogic/qed/qed_ooo.c:40: drivers/net/ethernet/qlogic/qed/qed_hsi.h:4421:18: warning: 'iro_arr' defined but not used [-Wunused-const-variable=] static const u32 iro_arr[] = { ^~~~~~~ Signed-off-by: Alexander Lobakin <alobakin@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06geneve: move all configuration under struct geneve_configSabrina Dubroca
This patch adds a new structure geneve_config and moves the per-device configuration attributes to it, like we already have in VXLAN with struct vxlan_config. This ends up being pretty invasive since those attributes are used everywhere. This allows us to clean up the argument lists for geneve_configure (4 arguments instead of 8) and geneve_nl2info (5 instead of 9). This also reduces the copy-paste of code setting those attributes between geneve_configure and geneve_changelink to a single memcpy, which would have avoided the bug fixed in commit 56c09de347e4 ("geneve: allow changing DF behavior after creation"). Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06dpaa2-eth: fix draining of S/G cacheIoana Ciornei
On link down, the draining of the S/G cache should be done on all _possible_ CPUs not just the ones that are online in that moment. Fix this by changing the iterator. Fixes: d70446ee1f40 ("dpaa2-eth: send a scatter-gather FD instead of realloc-ing") Reported-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06net/amd: Remove needless assignment and the extra brank linesTang Bin
The variable 'err = -ENODEV;' in au1000_probe() is duplicate, so remove redundant one. And remove the extra blank lines in the file au1000_eth.c Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06sun/cassini: use generic power managementVaibhav Gupta
With legacy PM, drivers themselves were responsible for managing the device's power states and takes care of register states. After upgrading to the generic structure, PCI core will take care of required tasks and drivers should do only device-specific operations. Compile-tested only. Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06sun/niu: use generic power managementVaibhav Gupta
With legacy PM, drivers themselves were responsible for managing the device's power states and takes care of register states. After upgrading to the generic structure, PCI core will take care of required tasks and drivers should do only device-specific operations. The driver was calling pci_save/restore_state() which is no more needed. Compile-tested only. Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-06sun/sungem: use generic power managementVaibhav Gupta
With legacy PM, drivers themselves were responsible for managing the device's power states and takes care of register states. And they use PCI helper functions to do it. After upgrading to the generic structure, PCI core will take care of required tasks and drivers should do only device-specific operations. In this driver: gem_suspend() calls gem_do_stop() which in turn invokes pci_disable_device(). As the PCI helper function is not called at the end/start of the function body, breaking the function in two parts may change its behavior. The only other function invoking gem_do_stop() is gem_close(). Hence, gem_close() and gem_suspend() can do the required end steps on their own. The same case is with gem_resume(). Both gem_resume() and gem_open() invoke gem_do_start(). Again, make the caller functions do the required steps on their own. Compile-tested only. Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: vitesse-vsc73xx: Convert to plain comments to avoid kerneldoc warningsAndrew Lunn
The comments before struct vsc73xx_platform and struct vsc73xx_spi use kerneldoc format, but then fail to document the members of these structures. All the structure members are self evident, and the driver has not other kerneldoc comments, so change these to plain comments to avoid warnings. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: lan9303: fix variable 'res' set but not usedAndrew Lunn
Since lan9303_adjust_link() is a void function, there is no option to return an error. So just remove the variable and lets any errors be discarded. Cc: Egil Hjelmeland <privat@egil-hjelmeland.no> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: rtl8366: Pass GENMASK() signed bitsAndrew Lunn
Oddly, GENMASK() requires signed bit numbers, so that it can compare them for < 0. If passed an unsigned type, we get warnings about the test never being true. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: bcm_sf2: Pass GENMASK() signed bitsAndrew Lunn
Oddly, GENMASK() requires signed bit numbers, so that it can compare them for < 0. If passed an unsigned type, we get warnings about the test never being true. There is no danger of overflow here, udf is always a u8, so there is plenty of space when expanding to an int. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: bcm_sf2: Initialize __be16 with a __be16 valueAndrew Lunn
A __be16 variable should be initialised with a __be16 value. So add a htons(). In this case it is pointless, given the value being assigned is 0xffff, but it stops sparse from warnings. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: b53: Fixup endianness warningsAndrew Lunn
leX_to_cpu() expects to be passed an __leX type. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: mv88e6xxx: scratch: Fixup kerneldocAndrew Lunn
Correct parameters and add the missing ones. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: mv88e6xxx: Remove set but unused variableAndrew Lunn
We don't act on any errors reading registers while handling watchdog interrupt. Since this is an interrupt handler, we cannot return such errors. So just remove the variable. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: mv88e6xxx: vlan_tci is __be16Andrew Lunn
The flow spec member vlan_tci is in network order. Hence comparisons should be made again network order values. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: mv88e6xxx: Fix sparse warnings from GENMASKAndrew Lunn
Oddly, GENMASK() requires signed bit numbers, so that it can compare them for < 0. If passed an unsigned type, we get warnings about the test never being true. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: felix: use resolved link config in mac_link_up()Vladimir Oltean
Phylink now requires that parameters established through auto-negotiation be written into the MAC at the time of the mac_link_up() callback. In the case of felix, that means taking the port out of reset, setting the correct timers for PAUSE frames, and enabling/disabling TX flow control. This patch also splits the inband and noinband configuration of the vsc9959 PCS (currently found in a function called "init") into 2 different functions, which have a nomenclature closer to phylink: "config", for inband setup, and "link_up", for noinband (forced) setup. This is necessary as a preparation step for giving up control of the PCS to phylink, which will be done in further patch series. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: felix: delete .phylink_mac_an_restart codeVladimir Oltean
Phylink uses the .mac_an_restart method to offer the user an implementation of the "ethtool -r" behavior, when the media-side auto negotiation can be restarted by the local MAC PCS. This is the case for fiber modes 1000Base-X and 2500Base-X (IEEE clause 37) that don't have an Ethernet PHY connected locally, and the media is connected to the MAC PCS directly. On the other hand, the Cisco SGMII and USXGMII standards also have an auto negotiation mechanism based on IEEE 802.3 clause 37 (their respective specs require a MAC PCS and a PHY PCS to implement the same state machine, which is described in IEEE 802.3 "Auto-Negotiation Figure 37-6"), so the ability to restart auto-negotiation is intrinsically symmetrical (the MAC PCS can do it too). However, it appears that not all SGMII/USXGMII PHYs have logic to restart the MDI-side auto-negotiation process when they detect a transition of the SGMII link from data mode to configuration mode. Some do (VSC8234) and some don't (AR8033, MV88E1111). IEEE and/or Cisco specification wordings to not help to prove whether propagating the "AN restart" event from MII side ("mr_restart_an") to MDI side ("mr_restart_negotiation") is required behavior - neither of them specifies any mandatory interaction between the clause 37 AN state machine from Figure 37-6 and the clause 28 AN state machine from Figure 28-18. Therefore, even if a certain behavior could be proven as being required, real-life SGMII/USXGMII PHYs are inconsistent enough that a clause 37 AN restart cannot be used by phylink to reliably trigger a media-side renegotiation, when the user requests it via ethtool. The only remaining use that the .mac_an_restart callback might possibly have, given what we know now, is to implement some silicon quirks, but so far that has proven to not be necessary. So remove this code for now, since it never gets called and we don't foresee any circumstance in which it might be, either. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: felix: set proper pause frame timers based on link speedVladimir Oltean
state->speed holds a value of 10, 100, 1000 or 2500, but SYS_MAC_FC_CFG_FC_LINK_SPEED expects a value in the range 0, 1, 2 or 3. So set the correct speed encoding into this register. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: felix: unconditionally configure MAC speed to 1000MbpsVladimir Oltean
In VSC9959, the PCS is the one who performs rate adaptation (symbol duplication) to the speed negotiated by the PHY. The MAC is unaware of that and must remain configured for gigabit. If it is configured at OCELOT_SPEED_10 or OCELOT_SPEED_100, it'll start transmitting PAUSE frames out of control and never recover, _even if_ we then reconfigure it at OCELOT_SPEED_1000 afterwards. This patch fixes a bug that luckily did not have any functional impact. We were writing 10, 100, 1000 etc into this 2-bit field in DEV_CLOCK_CFG, but the hardware expects values in the range 0, 1, 2, 3. So all speed values were getting truncated to 0, which is OCELOT_SPEED_2500, and which also appears to be fine. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: felix: support half-duplex link modesVladimir Oltean
Ping tested: [ 11.808455] mscc_felix 0000:00:00.5 swp0: Link is Up - 1Gbps/Full - flow control rx/tx [ 11.816497] IPv6: ADDRCONF(NETDEV_CHANGE): swp0: link becomes ready [root@LS1028ARDB ~] # ethtool -s swp0 advertise 0x4 [ 18.844591] mscc_felix 0000:00:00.5 swp0: Link is Down [ 22.048337] mscc_felix 0000:00:00.5 swp0: Link is Up - 100Mbps/Half - flow control off [root@LS1028ARDB ~] # ip addr add 192.168.1.1/24 dev swp0 [root@LS1028ARDB ~] # ping 192.168.1.2 PING 192.168.1.2 (192.168.1.2): 56 data bytes (...) ^C--- 192.168.1.2 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 0.383/0.611/1.051 ms [root@LS1028ARDB ~] # ethtool -s swp0 advertise 0x10 [ 355.637747] mscc_felix 0000:00:00.5 swp0: Link is Down [ 358.788034] mscc_felix 0000:00:00.5 swp0: Link is Up - 1Gbps/Half - flow control off [root@LS1028ARDB ~] # ping 192.168.1.2 PING 192.168.1.2 (192.168.1.2): 56 data bytes (...) ^C --- 192.168.1.2 ping statistics --- 16 packets transmitted, 16 packets received, 0% packet loss round-trip min/avg/max = 0.301/0.384/1.138 ms Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-05net: dsa: felix: clarify the intention of writes to MII_BMCRVladimir Oltean
The driver appears to write to BMCR_SPEED and BMCR_DUPLEX, fields which are read-only, since they are actually configured through the vendor-specific IF_MODE (0x14) register. But the reason we're writing back the read-only values of MII_BMCR is to alter these writable fields: BMCR_RESET BMCR_LOOPBACK BMCR_ANENABLE BMCR_PDOWN BMCR_ISOLATE BMCR_ANRESTART In particular, the only field which is really relevant to this driver is BMCR_ANENABLE. Clarify that intention by spelling it out, using phy_set_bits and phy_clear_bits. The driver also made a few writes to BMCR_RESET and BMCR_ANRESTART which are unnecessary and may temporarily disrupt the link to the PHY. Remove them. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-04qlcninc: use generic power managementVaibhav Gupta
With legacy PM, drivers themselves were responsible for managing the device's power states and taking care of register states. And they use PCI helper functions to do it. After upgrading to the generic structure, PCI core will take care of required tasks and drivers should do only device-specific operations. .suspend() calls __qlcnic_shutdown, which then calls qlcnic_82xx_shutdown; .resume() calls __qlcnic_resume, which then calls qlcnic_82xx_resume; Both ...82xx..() are define in drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c and are used only in drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c. Hence upgrade them and remove PCI function calls, like pci_save_state() and pci_enable_wake(), inside them Compile-tested only. Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-04netxen_nic: use generic power managementVaibhav Gupta
With legacy PM, drivers themselves were responsible for managing the device's power states and takes care of register states. And they use PCI helper functions to do it. After upgrading to the generic structure, PCI core will take care of required tasks and drivers should do only device-specific operations. In this driver: netxen_nic_resume() calls netxen_nic_attach_func() which then invokes PCI helper functions like pci_enable_device(), pci_set_power_state() and pci_restore_state(). Other function: - netxen_io_slot_reset() also calls netxen_nic_attach_func(). Also, netxen_io_slot_reset() returns specific value based on the return value of netxen_nic_attach_func() as whole. Thus, cannot simply move some piece of code from netxen_nic_attach_func() to it. Hence, define a new function netxen_nic_attach_late_func() to do the tasks which has to be done after PCI helper functions have done their job. Now, netxen_nic_attach_func() invokes netxen_nic_attach_late_func(), thus netxen_io_slot_reset() behaves normally. And, netxen_nic_resume() calls netxen_nic_attach_late_func() to avoid PCI helper functions calls. Compile-tested only. Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-04net: dsa: microchip: remove unused private membersCodrin Ciubotariu
Private structure members live_ports, on_ports, rx_ports, tx_ports are initialized but not used anywhere. Let's remove them. Suggested-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-04net: dsa: microchip: split adjust_link() in phylink_mac_link_{up|down}()Codrin Ciubotariu
The DSA subsystem moved to phylink and adjust_link() became deprecated in the process. This patch removes adjust_link from the KSZ DSA switches and adds phylink_mac_link_up() and phylink_mac_link_down(). Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-04bnx2x: Perform Idlechk dump during the debug collection.Sudarsana Reddy Kalluru
The patch adds driver changes to perform Idlechk dump during the debug data collection. Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-04bnx2x: Add support for idlechk tests.Sudarsana Reddy Kalluru
This patch populates a database of idlechk tests (registers and predicates) and performs the idlechk using this data. Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-04bnx2x: Add Idlechk related register definitions.Sudarsana Reddy Kalluru
The patch adds register definitions required for Idlechk implementation. Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-03mvpp2: xdp ethtool statsSven Auhagen
Add ethtool statistics for XDP. Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-03mvpp2: XDP TX supportMatteo Croce
Add the transmit part of XDP support, which includes: - support for XDP_TX in mvpp2_xdp() - .ndo_xdp_xmit hook for AF_XDP and XDP_REDIRECT with mvpp2 as destination mvpp2_xdp_submit_frame() is a generic function which is called by mvpp2_xdp_xmit_back() when doing XDP_TX, and by mvpp2_xdp_xmit when doing AF_XDP or XDP_REDIRECT target. The buffer allocation has been reworked to be able to map the buffers as DMA_FROM_DEVICE or DMA_BIDIRECTIONAL depending if native XDP is in use or not. Co-developed-by: Sven Auhagen <sven.auhagen@voleatech.de> Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de> Signed-off-by: Matteo Croce <mcroce@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-03mvpp2: add basic XDP supportMatteo Croce
Add XDP native support. By now only XDP_DROP, XDP_PASS and XDP_REDIRECT verdicts are supported. Co-developed-by: Sven Auhagen <sven.auhagen@voleatech.de> Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de> Signed-off-by: Matteo Croce <mcroce@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-03mvpp2: use page_pool allocatorMatteo Croce
Use the page_pool API for memory management. This is a prerequisite for native XDP support. Tested-by: Sven Auhagen <sven.auhagen@voleatech.de> Signed-off-by: Matteo Croce <mcroce@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-03mvpp2: refactor BM pool init percpu codeMatteo Croce
In mvpp2_swf_bm_pool_init_percpu(), a reference to a struct mvpp2_bm_pool is obtained traversing multiple structs, when a local variable already points to the same object. Fix it and, while at it, give the variable a meaningful name. Signed-off-by: Matteo Croce <mcroce@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-03net: ipa: fix HOLB timer calculationAlex Elder
For IPA v4.2, the exact interpretation of the register that defines the timeout for avoiding head-of-line blocking was a little unclear. We're only assigning a 0 timeout to it right now, so that wasn't very important. But now that I know how it's supposed to work, I'm fixing it. The register represents a tick counter, where each tick is equal to 128 IPA core clock cycles. For IPA v3.5.1, the register contains a simple counter value. But for IPA v4.2, the register contains two fields, base and scale, which approximate the tick counter as: ticks = base << scale The base and scale values to use for a given tick count are computed using clever bit operations, and measures are taken to make the resulting time period as close as possible to that requested. There's no need for ipa_endpoint_init_hol_block_timer() to return an error, so change its return type to void. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-03net: ipa: introduce ipa_clock_rate()Alex Elder
Create a new function that returns the current rate of the IPA core clock. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>