summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2017-06-01mlxsw: spectrum: Add bridge dependency for spectrumIdo Schimmel1-0/+1
When BRIDGE is a loadable module, MLXSW_SPECTRUM mustn't be built-in: drivers/built-in.o: In function `mlxsw_sp_bridge_device_create': drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c:145: undefined reference to `br_vlan_enabled' drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c:158: undefined reference to `br_multicast_enabled' drivers/built-in.o: In function `mlxsw_sp_dev_rif_type': drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:2972: undefined reference to `br_vlan_enabled' drivers/built-in.o: In function `mlxsw_sp_inetaddr_vlan_event': drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3310: undefined reference to `br_vlan_enabled' Add Kconfig dependency to enforce usable configurations. Fixes: c57529e1d5d8 ("mlxsw: spectrum: Replace vPorts with Port-VLAN") Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reported-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Tested-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01net-next: stmmac: Add dwmac-sun8iLABBE Corentin5-2/+1024
The dwmac-sun8i is a heavy hacked version of stmmac hardware by allwinner. In fact the only common part is the descriptor management and the first register function. Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01net-next: stmmac: add optional setup functionLABBE Corentin1-1/+3
Instead of adding more ifthen logic for adding a new mac_device_info setup function, it is easier to add a function pointer to the function needed. Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01net-next: stmmac: export stmmac_set_mac_addr/stmmac_get_mac_addrLABBE Corentin1-1/+2
Thoses symbol will be needed for the dwmac-sun8i ethernet driver. For letting it to be build as module, they need to be exported. Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01mlxsw: spectrum: Implement the ethtool flash_device callbackYotam Gigi1-9/+42
Add callback to the ethtool flash_device op. This callback uses the mlxfw module to flash the new firmware file to the device. As the firmware flash process takes about 20 seconds and ethtool takes the rtnl lock during the flash_device callback, release the rtnl lock at the beginning of the flash process and take it again before leaving the callback. This way, the rtnl is not held during the process. To make sure the device does not get deleted during the flash process, take a reference to it before releasing the rtnl lock. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01qed: No need to reset SBs on IOV initMintz, Yuval3-33/+4
Since we're resetting the IGU CAM each time we initialize the PF device, there's no need to reset the VF SBs again when initializing IOV. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01qed: Reset IGU CAM to default on initMintz, Yuval3-20/+162
The IGU CAM contains an assocaition between hardware SBs and interrupt lines, and it can be dynamically configured to allow more interrupts in one entity over another, specifically for Re-distibution of SBs between a PF and its child VFs. While we don't yet use this functionality, there are other clients that do and as such its possible the information passed from management firmware during initialization in regard to the possible number of SBs doesn't accurately reflect the current HW configuration. The following changes are going to apply to the driver init sequence: a. PF is going to re-configure all entries belonging to itself and its child VFs in IGU CAM based on the management firmware info regarding the number of SBs that are supposed to exist there. b. PF is going to stop using the SB resource [management firmware provided information] for anything but the initialization. Instead, it would use the live-time counters it maintains for the numbers. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01qed: Hold a single array for SBsMintz, Yuval8-27/+103
A PF today holds 2 different arrays - one holding information about the HW configuration and one holding information about the SBs that are used by the protocol drivers. These arrays aren't really connected - e.g., protocol driver initializing a given SB would not mark the same SB as occupied in the HW shadow array. Move into a single array [at least for PFs] - hold the mapping of the driver-protocol SBs on the HW entry which they configure. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01qed: Provide auxiliary for getting free VF SBMintz, Yuval3-29/+51
IOV code is very intrusive in its manipulation of the status block database. Add a new auxiliary function to allow the PF to find an available unused status block to configure for a specific VF's MSI-x vector. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01qed: Remove assumption on SB order in IGUMintz, Yuval2-61/+33
Current code assumes there's a known layout for SBs in the IGU, where all the SBs of a single entity would be laid in consecutive order of vectors. While the assumption is still kept by management firmware, we already have the necessary information to eliminate it, so no reason to keep it in code. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01qed: Encapsulate interrupt counters in structMintz, Yuval5-24/+21
We already have an API struct that contains interrupt-related numbers. Use it to encapsulate all information relating to the status of SBs as (used|free). Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01qed: Add aux. function translating sb_id -> igu_sb_idMintz, Yuval1-10/+21
An additional step for relaxing the IGU order assumption, we now add an auxiliary function that can be used for finding the HW status block that's associated with a given MSI-x vector. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01qed: Distinguish between sb_id and igu_sb_idMintz, Yuval3-25/+30
In qed code, sb_id means 2 different things: - An interrupt vector [usually when received as a parameter from a protocol driver, but not only] that's associated with a status block. - An index to a status block entity existing in HW. This patch renames the references to the HW entity, adding an 'igu_' prefix to allow an easier distinction. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01qed: IGU read revisedMintz, Yuval4-140/+83
As a first step for relaxing various assumptions done by driver about the IGU mapping, the driver is now going to read the entire IGU into a shadow copy, and mark in its database each status block that's relevant for it. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01qed: Minor refactoring in interrupt codeMintz, Yuval1-3/+12
Separate the portions controlling interrupt enablement form those controlling the ability of HW to generate attentions. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01qed: Make qed_int_cau_conf_pi() staticMintz, Yuval2-52/+34
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01ppp: remove unnecessary bh disable in xmit pathGao Feng1-11/+11
Since the commit 55454a565836 ("ppp: avoid dealock on recursive xmit"), the PPP xmit path is protected by wrapper functions which disable the bh already. So it is unnecessary to disable the bh again in the real xmit path. Signed-off-by: Gao Feng <gfree.wind@vip.163.com> Acked-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01dsa: add DSA switch driver for Microchip KSZ9477Woojung Huh8-0/+3398
The KSZ9477 is a fully integrated layer 2, managed, 7 ports GigE switch with numerous advanced features. 5 ports incorporate 10/100/1000 Mbps PHYs. The other 2 ports have interfaces that can be configured as SGMII, RGMII, MII or RMII. Either of these may connect directly to a host processor or to an external PHY. The SGMII port may interface to a fiber optic transceiver. This driver currently supports vlan, fdb, mdb & mirror dsa switch operations. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Woojung Huh <Woojung.Huh@microchip.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01phy: micrel: add Microchip KSZ 9477 Switch PHY supportWoojung Huh1-0/+11
Adding Microchip 9477 Phy included in KSZ9477 Switch. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Woojung Huh <Woojung.Huh@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01nfp: fix memory leak on FW load errorJakub Kicinski1-0/+1
Free management FW info when app FW load failed. Fixes: eefbde7e1002 ("nfp: add hwmon support") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01nfp: move basic eBPF stats to app-specific codeJakub Kicinski5-34/+67
Allow apps to associate private data with vNICs and move BPF-specific fields of nfp_net to such structure. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01nfp: move bpf offload code to the BPF appJakub Kicinski6-59/+159
Move bulk of the eBPF offload code out of common vNIC code into app-specific callbacks. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01nfp: move eBPF offload files to BPF app directoryJakub Kicinski6-10/+10
Pure move of eBPF offload files to BPF app directory, only change the names and relative header location. nfp_asm.h stays in the main dir and it doesn't really have to include nfp_bpf.h. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01nfp: report app name in ethtool -iJakub Kicinski5-3/+15
Let the app print its name in ethtool -i output. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01nfp: move port init to appsJakub Kicinski8-35/+309
Start fleshing out the apps by turning the vNIC init code to a per-app callback. The two initial apps we have are NIC and eBPF. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01nfp: turn reading PCIe RTsym parameters into a helperJakub Kicinski1-7/+17
Turn the function to read number of ports into a generic helper. While at it make sure we propagate all errors other than -ENOENT. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01nfp: add missing fall through statementsJakub Kicinski1-0/+2
GCC 7 checks for fall through comments, add the two missing ones. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01sched: add helper for updating statistics on all actionsJakub Kicinski3-27/+4
Forgetting to disable preemption around tcf_action_stats_update() seems to be a common mistake. Add a helper function for updating stats on all actions of a filter. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01Merge branch '10GbE' of ↵David S. Miller9-80/+180
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 10GbE Intel Wired LAN Driver Updates 2017-05-31 This series contains updates to ixgbe and ixgbevf only. Scott enables support for TSO & GSO for MPLS encapsulated packets for both ixgbe and ixgbevf. Liwei Song fixes an issue where seqcount/seqlock in ixgbe_get_stats64() are not initialized in time, so move the initialization into probe routine after the transmit and receive rings are initialized. Paul cleans up led_[on|off] for X550EM_X, since the firmware configures the PHY & MAC and we have no PHY access so LED on/off is not supported with this device. Emil provides several fixes, starting with enabling RSS on VF to VF traffic on the same PF. Fixed PHY identification, where the previous method was unreliable, so use a different register to ensure proper identification. Cleaned up the logic which could cause us to skip the link configuration, this skipping over the link configuration was leaving SFP+ PHY's in an unstable state, so always call setup_mac_link(). Added RS1 (rate select 1) support for ixgbe. Lastly, fixed incorrect logic in the setting up of SFP+ link speed. Mark fixes the thermal sensor event logic, where it was being executed when there really was no thermal event. So simplify the logic to only execute when there is a thermal event. Tony adds additional error checks and reporting when setting a VF MAC address to ensure that the MAC filter was successfully added. Also fixed possible truncation warnings, as well as implicit fallthrough warnings. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-01Merge branch '40GbE' of ↵David S. Miller9-19/+77
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 40GbE Intel Wired LAN Driver Updates 2017-05-31 This series contains updates to i40e and i40evf only. Jesse provides a couple of fixes, starting with cleaning up duplicate lines of code. Fixed a missing line which enables RSS as a negotiated feature. Since the VF does not have any way of reporting FCoE enabled, so just force the code to always report FCoE as disabled. Jake provides several fixes and changes, starting with fixing a race condition in i40e. The hardware has a limitation on transmit PTP packets, which requires us to limit the driver to timestamping a single packet at once. This is done using a state bitlock which enforces that only one timestamp request is honored at a time, unfortunately this suffers from a race condition. Fixed a corner case where we failed to cleanup the bit lock after a failed transmit, and resulted in a state bit being locked forever. Added a new statistic which tracks when a transmit timestamp request is skipped/ignored, since the driver can only handle one transmit timestamp request at a time. Christophe Jaillet fixes a NULL pointer dereference if kzalloc fails. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-31netvsc: Add #include's for csum_* function declarationsMichael Kelley1-0/+2
Add direct #include statements for declarations of csum_tcpudp_magic() and csum_ipv6_magic(). While the needed #include's are picked up indirectly for the x86 architecture, they aren't on other architectures, resulting in compile errors. Signed-off-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-31net/mlxfw: select CONFIG_XZ_DECArnd Bergmann1-0/+1
The new mlxfw code fails to build without the xz library: drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.o: In function `mlxfw_mfa2_xz_dec_run': :(.text.mlxfw_mfa2_xz_dec_run+0x8): undefined reference to `xz_dec_run' drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.o: In function `mlxfw_mfa2_file_component_get': :(.text.mlxfw_mfa2_file_component_get+0x218): undefined reference to `xz_dec_init' :(.text.mlxfw_mfa2_file_component_get+0x2c0): undefined reference to `xz_dec_end' This adds a Kconfig 'select' statement for it, which is also what the other user of that library has. Fixes: 410ed13cae39 ("Add the mlxfw module for Mellanox firmware flash process") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-31net: dsa: remove dev arg of dsa_register_switchVivien Didelot6-6/+6
The current dsa_register_switch function takes a useless struct device pointer argument, which always equals ds->dev. Drivers either call it with ds->dev, or with the same device pointer passed to dsa_switch_alloc, which ends up being assigned to ds->dev. This patch removes the second argument of the dsa_register_switch and _dsa_register_switch functions. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-31net: dsa: mv88e6xxx: rename PHY PPU functionsVivien Didelot1-19/+19
Respect the implicit naming convention used in all register sets specific files, by renaming the mv88e6xxx_ppu_* functions with the mv88e6xxx_phy_* prefix. This is simply a s/xxx_ppu/xxx_phy_ppu/ substitution. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-31net: dsa: mv88e6xxx: rename PHY PPU accessorsVivien Didelot3-14/+17
Make it clear that mv88e6xxx_phy_ppu_{read,write} are an implementation of the .phy_{read,write} operations, by renaming them with the mv88e6185 prefix, since 88E6185 it is the reference switch model supported in an upstream board (ZII Dev Rev B), which makes use of them. Distinguish the signatures of implementation specific and generic PHY functions in the phy.h header. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-31net: dsa: mv88e6xxx: provide a PHY setup helperVivien Didelot3-9/+11
Similarly to the VTU, PVT and ATU setup, provide a mv88e6xxx_phy_setup helper which wraps mv88e6xxx_ppu_enable, so that no more PPU-related functions are exposed outside of phy.c. Thus make mv88e6xxx_ppu_enable static. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-31ixgbe: fix incorrect status checkEmil Tantilov1-4/+4
Check for ret_val instead of !ret_val to allow the rest of the code to execute and configure the speed properly. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbe: add missing configuration for rate select 1Emil Tantilov1-0/+19
Add RS1 configuration to ixgbe_set_soft_rate_select_speed() Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbe: always call setup_mac_link for multispeed fiberEmil Tantilov1-18/+0
Remove the logic which would previously skip the link configuration in the case where we are already at the requested speed in ixgbe_setup_mac_link_multispeed_fiber(). By exiting early we are skipping the link configuration and as such the driver may not always configure the PHY correctly for SFP+. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbe: add write flush when configuring CS4223/7Emil Tantilov1-2/+18
Make sure the writes are processed immediately. Without the flush it is possible for operations on one port to spill over the other as the resource is shared. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbe: correct CS4223/7 PHY identificationEmil Tantilov2-6/+7
Previous method was unreliable. Use a different register to differentiate between the SKUs. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbevf: Resolve warnings for -Wimplicit-fallthroughTony Nguyen1-0/+2
Additions to gcc 7 now warn whenever a switch statement falls through implicitly. This patch adds explicit fall through comments to address the following warnings: drivers/net/ethernet/intel/ixgbevf/vf.c: In function ‘ixgbevf_get_reta_locked’: drivers/net/ethernet/intel/ixgbevf/vf.c:336:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if (hw->mac.type < ixgbe_mac_X550_vf) ^ drivers/net/ethernet/intel/ixgbevf/vf.c:338:2: note: here default: ^~~~~~~ drivers/net/ethernet/intel/ixgbevf/vf.c: In function ‘ixgbevf_get_rss_key_locked’: drivers/net/ethernet/intel/ixgbevf/vf.c:402:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if (hw->mac.type < ixgbe_mac_X550_vf) ^ drivers/net/ethernet/intel/ixgbevf/vf.c:404:2: note: here default: ^~~~~~~ Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbevf: Resolve truncation warning for q_vector->nameTony Nguyen1-7/+7
The following warning is now shown as a result of new checks added for gcc 7: drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function ‘ixgbevf_open’: drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1363:13: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size between 3 and 18 [-Wformat-truncation=] "%s-%s-%d", netdev->name, "TxRx", ri++); ^~ drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1363:6: note: directive argument in the range [0, 2147483647] "%s-%s-%d", netdev->name, "TxRx", ri++); ^~~~~~~~~~ drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1362:4: note: ‘snprintf’ output between 8 and 32 bytes into a destination of size 24 snprintf(q_vector->name, sizeof(q_vector->name) - 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "%s-%s-%d", netdev->name, "TxRx", ri++); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Resolve this warning by making a couple of changes. - Don't reserve space for the null terminator. Since snprintf adds the null terminator automatically, there is no need for us to reserve a byte for it. - Change a couple variables that can never be negative from int to unsigned int. While we're making changes to the format string, move the constant strings into the format string instead of providing them as specifiers. Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbe: Resolve warnings for -Wimplicit-fallthroughTony Nguyen5-11/+18
This patch adds/changes fall through comments to address new warnings produced by gcc 7. Fixed formatting on a couple of comments in the function. Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbe: Resolve truncation warning for q_vector->nameTony Nguyen1-7/+7
The following warning is now shown as a result of new checks added for gcc 7: drivers/net/ethernet/intel/ixgbe/ixgbe_main.c: In function ‘ixgbe_open’: drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:3118:13: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size between 3 and 18 [-Wformat-truncation=] "%s-%s-%d", netdev->name, "TxRx", ri++); ^~ drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:3118:6: note: directive argument in the range [0, 2147483647] "%s-%s-%d", netdev->name, "TxRx", ri++); ^~~~~~~~~~ drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:3117:4: note: ‘snprintf’ output between 8 and 32 bytes into a destination of size 24 snprintf(q_vector->name, sizeof(q_vector->name) - 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "%s-%s-%d", netdev->name, "TxRx", ri++); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Resolve this warning by making a couple of changes. - Don't reserve space for the null terminator. Since snprintf adds the null terminator automatically, there is no need for us to reserve a byte for it. - Change a couple variables that can never be negative from int to unsigned int. While we're making changes to the format string, move the constant strings into the format string instead of providing them as specifiers. Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbe: Add error checking to setting VF MACTony Nguyen1-13/+41
Currently, when setting a VF MAC address there are no error checks to ensure that the MAC filter was successfully added. This patch adds additional error checks, reporting, and propagation of errors. It also will not set the MAC address unless adding the MAC filter was successful. With these changes, setting the mac address to zeros can no longer call ixgbe_set_vf_mac() as adding a zero MAC address filter is not valid. Instead directly delete the filter and, if successful, clear the MAC address. Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbe: Correct thermal sensor event checkMark Rustad1-2/+1
The thermal sensor event logic is messed up, because it can execute the code when there is no thermal event. The current logic is that it will exit when !capable && !event whereas it really should exit when !capable || !event. For one thing, it means that the service task is doing too much work. It probably has some other symptoms as well. So, correct the logic, simplifying to only execute when there is a thermal event. The capable check is redundant. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbe: enable L3/L4 filtering for Tx switched packetsEmil Tantilov1-0/+3
This will ensure that VF-to-VF traffic on the same PF is filtered to allow RSS operation. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbe: Remove MAC X550EM_X 1Gbase-t led_[on|off] supportPaul Greenwalt3-2/+29
Since FW configures the PHY and MAC X550EM_X has no PHY access, led_[on|off] is not supported with the 1Gbase-t design. Removed MAC X550EM_X 1Gbase-t led_[on|off] support by setting function pointers to NULL and added NULL pointer checks. Also set init_led_link_act to NULL and added NULL pointer check. Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-05-31ixgbe: initialize u64_stats_sync structures early at ixgbe_probeLiwei Song1-4/+4
Fix the following CallTrace: INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 71 PID: 1 Comm: swapper/0 Not tainted 4.8.8-WR9.0.0.1_standard #11 Hardware name: Intel Corporation S2600WTT/S2600WTT, BIOS GRNDSDP1.86B.0036.R05.1407140519 07/14/2014 00200086 00200086 eb5e1ab8 c144dd70 00000000 00000000 eb5e1af8 c10af89a c1d23de4 eb5e1af8 00000009 eb5d8600 eb5d8638 eb5e1af8 c10b14d8 00000009 0000000a c1d32911 00000000 00000000 e44c826c eb5d8000 eb5e1b74 c10b214e Call Trace: [<c144dd70>] dump_stack+0x5f/0x8f [<c10af89a>] register_lock_class+0x25a/0x4c0 [<c10b14d8>] ? check_irq_usage+0x88/0xc0 [<c10b214e>] __lock_acquire+0x5e/0x17a0 [<c1abdb9b>] ? _raw_spin_unlock_irqrestore+0x3b/0x70 [<c10cf14a>] ? rcu_read_lock_sched_held+0x8a/0x90 [<c10b3c5f>] lock_acquire+0x9f/0x1f0 [<c1922dcf>] ? dev_get_stats+0x5f/0x110 [<c176e6b3>] ixgbe_get_stats64+0x113/0x320 [<c1922dcf>] ? dev_get_stats+0x5f/0x110 [<c1922dcf>] dev_get_stats+0x5f/0x110 [<c1ab5415>] rtnl_fill_stats+0x40/0x105 [<c193dd45>] rtnl_fill_ifinfo+0x4c5/0xd20 [<c11c5115>] ? __kmalloc_node_track_caller+0x1a5/0x410 [<c1917487>] ? __kmalloc_reserve.isra.42+0x27/0x80 [<c191754f>] ? __alloc_skb+0x6f/0x270 [<c1942291>] rtmsg_ifinfo_build_skb+0x71/0xd0 [<c194230a>] rtmsg_ifinfo.part.23+0x1a/0x50 [<c1923dad>] ? call_netdevice_notifiers_info+0x2d/0x60 [<c194236b>] rtmsg_ifinfo+0x2b/0x40 [<c192f997>] register_netdevice+0x3d7/0x4d0 [<c192faa7>] register_netdev+0x17/0x30 [<c177b83d>] ixgbe_probe+0x118d/0x1610 [<c1498202>] local_pci_probe+0x32/0x80 [<c1498172>] ? pci_match_device+0xd2/0x100 [<c14991e0>] pci_device_probe+0xc0/0x110 [<c1652cc5>] driver_probe_device+0x1c5/0x280 [<c1498172>] ? pci_match_device+0xd2/0x100 [<c1652e09>] __driver_attach+0x89/0x90 [<c1652d80>] ? driver_probe_device+0x280/0x280 [<c165114f>] bus_for_each_dev+0x4f/0x80 [<c165269e>] driver_attach+0x1e/0x20 [<c1652d80>] ? driver_probe_device+0x280/0x280 [<c1652317>] bus_add_driver+0x1a7/0x220 [<c1653a79>] driver_register+0x59/0xe0 [<c1f897b8>] ? igb_init_module+0x49/0x49 [<c1497b2a>] __pci_register_driver+0x4a/0x50 [<c1f8985d>] ixgbe_init_module+0xa5/0xc4 [<c1000485>] do_one_initcall+0x35/0x150 [<c107e818>] ? parameq+0x18/0x70 [<c1f395d8>] ? repair_env_string+0x12/0x51 [<c107ead0>] ? parse_args+0x260/0x3b0 [<c1074f73>] ? __usermodehelper_set_disable_depth+0x43/0x50 [<c1f39e90>] kernel_init_freeable+0x19b/0x267 [<c1f395c6>] ? set_debug_rodata+0xf/0xf [<c10b1e7b>] ? trace_hardirqs_on+0xb/0x10 [<c1abdc02>] ? _raw_spin_unlock_irq+0x32/0x50 [<c1085f0b>] ? finish_task_switch+0xab/0x1f0 [<c1085ec9>] ? finish_task_switch+0x69/0x1f0 [<c1ab6a30>] kernel_init+0x10/0x110 [<c108bd65>] ? schedule_tail+0x25/0x80 [<c1abe422>] ret_from_kernel_thread+0xe/0x24 [<c1ab6a20>] ? rest_init+0x130/0x130 This CallTrace occurred on 32-bit kernel with CONFIG_PROVE_LOCKING enabled. This happens at ixgbe driver probe hardware stage, when comes to ixgbe_get_stats64, the seqcount/seqlock still not initialize, although this was initialize in TX/RX resources setup routin, but it was too late, then lockdep give this Warning. To fix this, move the u64_stats_init function to driver probe stage, which before we get the status of seqcount and after the RX/TX ring was finished init. Signed-off-by: Liwei Song <liwei.song@windriver.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>