summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
AgeCommit message (Collapse)Author
2020-02-22mlxsw: spectrum_router: Expose router struct to internal usersIdo Schimmel
The dpipe code accesses internal router data structures and acquires RTNL to protect against their changes. Subsequent patches will remove reliance on RTNL and introduce a dedicated lock to protect router data structures. Publish the router struct to internal users such as the dpipe, so that they could acquire it instead of RTNL. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-22mlxsw: spectrum_mr: Protect multicast route list with a lockIdo Schimmel
Protect the per-table multicast route list with a lock and remove RTNL from the delayed work that periodically updates the kernel about packets and bytes statistics from each multicast route. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-22mlxsw: spectrum_mr: Protect multicast table list with a lockIdo Schimmel
The multicast table list is traversed from a delayed work that periodically updates the kernel about packets and bytes statistics from each multicast route. The list is currently protected by RTNL, but subsequent patches will remove the driver's dependence on this contended lock. In order to be able to remove dependence on RTNL in the next patch, guard this list with a dedicated mutex. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-22mlxsw: spectrum_mr: Publish multicast route after writing it to the deviceIdo Schimmel
The driver periodically traverses the linked list of multicast routes and updates the kernel about packets and bytes statistics from each multicast route. These statistics are read from a counter associated with the route when it is written to the device. Currently, multicast routes are published via this linked list before they are associated with a counter. Despite that, it is not possible for the driver to access an invalid counter because the delayed work that reads the statistics and multicast route addition / deletion are mutually exclusive using RTNL. In order to be able to remove RTNL, the list needs to be protected by a dedicated lock, but any route published via the list must have an associated counter, otherwise the driver will access an invalid counter. Solve this by re-ordering the operations during multicast route addition so that the route is only added to the linked list after it was written to the device. Similarly, during deletion the route is first removed from the linked list before its deletion from the device. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-21net/mlx5: Add fsm_reactivate callback supportEran Ben Elisha
Add support for fsm reactivate via MIRC (Management Image Re-activation Control) set and query commands. For re-activation flow, driver shall first run MIRC set, and then wait until FW is done (via querying MIRC status). Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-21net/mlxfw: Add reactivate flow support to FSM burn flowEran Ben Elisha
Expose fsm_reactivate callback to the mlxfw_dev_ops struct. FSM reactivate is needed before flashing the new image in order to flush the old flashed but not running firmware image. In case mlxfw_dev do not support the reactivation, this step will be skipped. But if later image flash will fail, a hint will be provided by the extack to advise the user that the failure might be related to it. Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-21net/mlxfw: Use MLXFW_ERR_MSG macro for error reportingSaeed Mahameed
Instead of always calling both mlxfw_err and NL_SET_ERR_MSG_MOD with the same message, use the dedicated macro instead. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-21net/mlxfw: Convert pr_* to dev_* in mlxfw_fsm.cSaeed Mahameed
Introduce mlxfw_{info, err, dbg} macros and make them call corresponding dev_* macros, then convert all instances of pr_* to mlxfw_*. This will allow printing the device name mlxfw is operating on. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-21net/mlxfw: More error messages coverageSaeed Mahameed
Make sure mlxfw_firmware_flash reports a detailed user readable error message in every possible error path, basically every time mlxfw_dev->ops->*() is called and an error is returned, or when image initialization is failed. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-21net/mlxfw: Improve FSM err message reporting and return codesSaeed Mahameed
Report unique and standard error codes corresponding to the specific FW flash error. In addition, add a more detailed error messages to netlink. Before: $ devlink dev flash pci/0000:05:00.0 file ... Error: mlxfw: Firmware flash failed. devlink answers: Invalid argument After: $ devlink dev flash pci/0000:05:00.0 file ... Error: mlxfw: Firmware flash failed: pending reset. devlink answers: Device busy Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-21net/mlxfw: Generic mlx FW flash status notifySaeed Mahameed
FW flash status notify is currently implemented via a callback to the caller mlx module, and all it is doing is to call devlink_flash_update_status_notify with the specific module devlink instance. Instead of repeating the whole process for all mlx modules and re-implement the status_notify callback again and again. Just provide the devlink instance as part of mlxfw_dev when calling mlxfw_firmware_flash and let mlxfw do the devlink status updates directly. This will be very useful for adding status notify support to mlx5, as already done in this patch, with a simple one line of just providing the devlink instance to mlxfw_firmware_flash. mlxfw now depends on NET_DEVLINK as all other mlx modules. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-21Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller
Conflict resolution of ice_virtchnl_pf.c based upon work by Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-21enetc: remove "depends on (ARCH_LAYERSCAPE || COMPILE_TEST)"Vladimir Oltean
ARCH_LAYERSCAPE isn't needed for this driver, it builds and sends/receives traffic without this config option just fine. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Acked-by: Claudiu Manoil <claudiu.manoil@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20bnxt_en: Issue PCIe FLR in kdump kernel to cleanup pending DMAs.Vasundhara Volam
If crashed kernel does not shutdown the NIC properly, PCIe FLR is required in the kdump kernel in order to initialize all the functions properly. Fixes: d629522e1d66 ("bnxt_en: Reduce memory usage when running in kdump kernel.") Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20bnxt_en: Improve device shutdown method.Vasundhara Volam
Especially when bnxt_shutdown() is called during kexec, we need to disable MSIX and disable Bus Master to completely quiesce the device. Make these 2 calls unconditionally in the shutdown method. Fixes: c20dc142dd7b ("bnxt_en: Disable bus master during PCI shutdown and driver unload.") Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20Merge branch '1GbE' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 1GbE Intel Wired LAN Driver Updates 2020-02-19 This series contains updates to e1000e and igc drivers. Ben Dooks adds a missing cpu_to_le64() in the e1000e transmit ring flush function. Jia-Ju Bai replaces a couple of udelay() with usleep_range() where we could sleep while holding a spinlock in e1000e. Chen Zhou make 2 functions static in igc, Sasha finishes the legacy power management support in igc by adding resume and schedule suspend requests. Also added register dump functionality in the igc driver. Added device id support for the next generation of i219 devices in e1000e. Fixed a typo in the igc driver that referenced a device that is not support in the driver. Added the missing PTP support when suspending now that igc has legacy power management support. Added PCIe error detection, slot reset and resume capability in igc. Added WoL support for igc as well. Lastly, added a code comment to distinguish between interrupt and flag definitions. Vitaly adds device id support for Tiger Lake platforms, which has another next generation of i219 device in e1000e. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20net: thunderx: workaround BGX TX Underflow issueTim Harvey
While it is not yet understood why a TX underflow can easily occur for SGMII interfaces resulting in a TX wedge. It has been found that disabling/re-enabling the LMAC resolves the issue. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Robert Jones <rjones@gateworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20ionic: fix fw_status readShannon Nelson
The fw_status field is only 8 bits, so fix the read. Also, we only want to look at the one status bit, to allow for future use of the other bits, and watch for a bad PCI read. Fixes: 97ca486592c0 ("ionic: add heartbeat check") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20Merge branch '100GbE' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 100GbE Intel Wired LAN Driver Updates 2020-02-19 This series contains updates to the ice driver only. Avinash adds input validation for software DCB configurations received via lldptool or pcap to ensure bad bandwidth inputs are not inputted which could cause the loss of link. Paul update the malicious driver detection event messages to rate limit once per second and to include the total number of receive|transmit MDD event count. Dan updates how TCAM entries are managed to ensure when overriding pre-existing TCAM entries, properly delete the existing entry and remove it from the change/update list. Brett ensures we clear the relevant values in the QRXFLXP_CNTXT register for VF queues to ensure the receive queue data is not stale. Avinash adds required DCBNL operations for configuring ETS in software DCB CEE mode. Also added code to detect if DCB is in IEEE or CEE mode to properly report what mode we are in. Dave fixes the driver to properly report the current maximum TC, not the maximum allowed number of TCs. Krzysztof adds support for AF_XDP feature in the ice driver. Jake increases the maximum time that the driver will wait for a PR reset to account for possibility of a slightly longer than expected PD reset. Jesse fixes a number of strings which did not have line feeds, so add line feeds so that messages do not rum together, creating a jumbled mess. Bruce adds support for additional E810 and E823 device ids. Also updated the product name change for E822 devices. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20net: macb: Properly handle phylink on at91rm9200Alexandre Belloni
at91ether_init was handling the phy mode and speed but since the switch to phylink, the NCFGR register got overwritten by macb_mac_config(). The issue is that the RM9200_RMII bit and the MACB_CLK_DIV32 field are cleared but never restored as they conflict with the PAE, GBE and PCSSEL bits. Add new capability to differentiate between EMAC and the other versions of the IP and use it to set and avoid clearing the relevant bits. Also, this fixes a NULL pointer dereference in macb_mac_link_up as the EMAC doesn't use any rings/bufffers/queues. Fixes: 7897b071ac3b ("net: macb: convert to phylink") Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20net: use netif_is_bridge_port() to check for IFF_BRIDGE_PORTJulian Wiedmann
Trivial cleanup, so that all bridge port-specific code can be found in one go. CC: Johannes Berg <johannes@sipsolutions.net> CC: Roopa Prabhu <roopa@cumulusnetworks.com> CC: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20net: page_pool: API cleanup and commentsIlias Apalodimas
Functions starting with __ usually indicate those which are exported, but should not be called directly. Update some of those declared in the API and make it more readable. page_pool_unmap_page() and page_pool_release_page() were doing exactly the same thing calling __page_pool_clean_page(). Let's rename __page_pool_clean_page() to page_pool_release_page() and export it in order to show up on perf logs and get rid of page_pool_unmap_page(). Finally rename __page_pool_put_page() to page_pool_put_page() since we can now directly call it from drivers and rename the existing page_pool_put_page() to page_pool_put_full_page() since they do the same thing but the latter is trying to sync the full DMA area. This patch also updates netsec, mvneta and stmmac drivers which use those functions. Suggested-by: Jonathan Lemon <jonathan.lemon@gmail.com> Acked-by: Toke Høiland-Jørgensen <toke@redhat.com> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum_nve: Make tunnel initialization symmetricIdo Schimmel
The device supports a single VTEP whose configuration is shared between all VXLAN tunnels. While the shared configuration is cleared upon the destruction of the last tunnel - in mlxsw_sp_nve_tunnel_fini() - it is set in mlxsw_sp_nve_fid_enable(), after calling mlxsw_sp_nve_tunnel_init(). Make tunnel initialization and destruction symmetric and set the configuration in mlxsw_sp_nve_tunnel_init(). This will later allow us to protect the shared configuration with a lock. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum: Export function to check if RIF existsIdo Schimmel
After the previous patch, all the callers of mlxsw_sp_rif_find_by_dev() outside of the routing code use it to understand if a RIF exists for the passed netdev. Therefore, export a function to check if a RIF exists and make mlxsw_sp_rif_find_by_dev() internal to the routing code. This will later allow us to more easily introduce the router lock which will also protect the RIFs. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum: Prevent RIF access outside of routing codeIdo Schimmel
There are currently 5 users of mlxsw_sp_rif_find_by_dev() outside of the routing code. Only one call site actually needs to dereference the router interface (RIF). The rest merely need to know if a RIF exists for the provided netdev. Convert this call site to query the needed information directly from the routing code instead of dereferencing the RIF. This will later allow us to replace mlxsw_sp_rif_find_by_dev() with a function that checks if a RIF exist. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum_router: Prepare function for router lock introductionIdo Schimmel
The function de-associates the port-vlan from its router interface (RIF). It is called both from the netdev notifier block and the inetaddr notifier block that will soon hold the router lock. Make sure that router code calls the internal version, as it will already have the router lock held when the function is called. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum_router: Prepare function for router lock introductionIdo Schimmel
The function removes the FDB entry that directs the macvlan's MAC to the router port. It is called from both the netdev notifier block and the inetaddr notifier block that will soon hold the router lock. Make sure that only the netdev notifier calls the exported version, so that is will take the router lock, which will already be held by the inetaddr notifier. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum_router: Do not assume RTNL is taken when resolving underlay ↵Ido Schimmel
device The function that resolves the underlay device of the IPIP tunnel assumes that RTNL is taken, but this will not be correct when RTNL is removed from the route insertion path. Convert the function to use dev_get_by_index_rcu() instead of __dev_get_by_index() and make sure it is always called from an RCU read-side critical section. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum_router: Do not assume RTNL is taken during RIF teardownIdo Schimmel
IPv6 addresses are deleted in an atomic context, so the driver defers the potential teardown of the associated router interface (RIF) to a work item that takes RTNL. The RIF is only destroyed if the associated netdev does not have any IP addresses (both IPv4 and IPv6). The IPv4 device ('struct in_device') is currently fetched via __in_dev_get_rtnl() which assumes RTNL is taken. Since RTNL is going to be removed, convert it to use __in_dev_get_rcu() from an RCU read-side critical section. Note that the IPv6 device ('struct inet6_dev') is fetched via __in6_dev_get(), which does not require RTNL. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum_router: Do not assume RTNL is taken during nexthop initIdo Schimmel
RTNL is going to be removed from route insertion path, so use __in_dev_get_rcu() from an RCU read-side critical section instead of __in_dev_get_rtnl() which assumes RTNL is taken. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum_span: Only update mirroring agents if presentIdo Schimmel
In order not to needlessly schedule the work item that updates the mirroring agents, only schedule it if there are any mirroring agents present. This is done by adding an atomic counter that counts the active mirroring agents. It is incremented / decremented whenever a mirroring agent is created / destroyed. It is read before scheduling the work item and in the devlink-resource occupancy callback. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum: Convert callers to use new mirroring APIIdo Schimmel
Previous patch added a work item in the mirroring code that will take care of updating the active mirroring agents in response to different events. Change the mirroring agents update function - mlxsw_sp_span_respin() - to invoke this work item when called. Therefore there is no need for callers to schedule a work item themselves. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum_span: Prepare work item to update mirroring agentsIdo Schimmel
The driver updates its mirroring agents whenever it receives a notification about an event that can affect these. For example, the addition of a route might require the driver to change the egress port of an ERSPAN session. Currently, RTNL needs to be held when these agents are updates, so the driver either: 1. Calls directly into the mirroring code, in case RTNL is held 2. Schedules a work item that will take RTNL and call into the mirroring code Simplify this by having the mirroring code schedule the work item for the update instead of requiring callers to schedule a work item themselves. The conversion of the callers will be done in the next patch to make review easier. This will later allow us to remove RTNL from different parts of the driver. It will also allow us to only schedule the work item in case there are active mirroring agents, which is information private to the mirroring code. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum_span: Use struct_size() to simplify allocationIdo Schimmel
Allocate the main mirroring struct and the individual structs for the different mirroring agents in a single allocation. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum_span: Do no expose mirroring agents to entire driverIdo Schimmel
The struct holding the different mirroring agents is currently allocated as part of the main driver struct. This is unlike other driver modules. Allocate the memory required to store the different mirroring agents as part of the initialization of the mirroring module. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum: Protect counter pool with a lockIdo Schimmel
The counter pool is a shared resource. It is used by both the ACL code to allocate counters for actions and by the routing code to allocate counters for adjacency entries (for example). Currently, all allocations are protected by RTNL, but this is going to change with the removal of RTNL from the routing code. Therefore, protect counter allocations with a spin lock. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-20mlxsw: spectrum_kvdl: Protect allocations with a lockIdo Schimmel
The KVDL is used to store objects allocated throughout various places in the driver. For example, both nexthops (adjacency entries) and ACL actions are stored in the KVDL. Currently, all allocations are protected by RTNL, but this is going to change with the removal of RTNL from the routing code. Therefore, protect KVDL allocations with a lock. A mutex is used since the free operation can block in Spectrum-2. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-19igc: Add commentSasha Neftin
Separate interrupt and flag definitions. Made the code clear. Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2020-02-19igc: Add WOL supportSasha Neftin
This patch adds a define and WOL support for an i225 parts. Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2020-02-19igc: Add pcie error handler supportSasha Neftin
Add pcie error detection, slot reset and resume capability Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2020-02-19igc: Complete to commit Add basic skeleton for PTPSasha Neftin
commit 5f2958052c58 ("igc: Add basic skeleton for PTP") added basic support for PTP, what's missing is support for suspending. Legacy power management has been added. Now we can add the suspend method to the igc_shutdown. By cleaning the runtime storage for timestamp this avoids a possible invalid memory access when the system comes back from suspend state. Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2020-02-19e1000e: Add support for Tiger Lake deviceVitaly Lifshits
Added support for a device id that is a part of the Intel Tiger Lake platform. Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2020-02-19igc: Fix the typo in commentSasha Neftin
Fix the typo and comment to correspond to the i225 device Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2020-02-19e1000e: Add support for Alder LakeSasha Neftin
Add devices ID's for the next LOM generations that will be available on the next Intel Client platform (Alder Lake) This patch provides the initial support for these devices Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2020-02-19sfc: remove unused variable 'efx_default_channel_type'YueHaibing
drivers/net/ethernet/sfc/efx.c:116:38: warning: efx_default_channel_type defined but not used [-Wunused-const-variable=] commit 83975485077d ("sfc: move channel alloc/removal code") left behind this, remove it. Reported-by: Hulk Robot <hulkci@huawei.com> Fixes: 83975485077d ("sfc: move channel alloc/removal code") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Martin Habets <mhabets@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-19net: hns3: add missing help info for QS shaper in debugfsYonglong Liu
HNS3 driver can dump QS shaper configs via debugfs, but missing help info in debugfs for this operation. Signed-off-by: Yonglong Liu <liuyonglong@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-19net: hns3: add support for dump MAC ID and loopback status in debugfsYufeng Mo
The MAC ID and loopback status information are obtained from the hardware, which will be helpful for debugging. This patch adds support for these two items in debugfs. Signed-off-by: Yufeng Mo <moyufeng@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-19net: hns3: add enabled TC numbers and DWRR weight info in debugfsYonglong Liu
The actual enabled TC numbers and the DWRR weight of each TC may be helpful for debugging, so adds them into debugfs. Signed-off-by: Yonglong Liu <liuyonglong@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-19net: hns3: modify an unsuitable print when setting unknown duplex to fibreGuangbin Huang
Currently, if device is in link down status and user uses 'ethtool -s' command to set speed but not specify duplex mode, the duplex mode passed from ethtool to driver is unknown value(255), and the fibre port will identify this value as half duplex mode and print "only copper port supports half duplex!". This message is confusing. So for fibre port, only the setting duplex is half, prints error and returns. Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-19mlxsw: Replace zero-length array with flexible-array memberGustavo A. R. Silva
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Tested-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>