summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* mlxsw: core: Change BUG to WARN in hwmon codeJiri Pirko2015-12-031-1/+1
| | | | | | | | | Better to just warn the user that something really odd is going on and continue to run. Suggested-by: Or Gerlitz <gerlitz.or@gmail.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* stmmac: ipq806x: Return error values instead of pointersStephen Boyd2015-12-031-13/+11
| | | | | | | | | | | Typically we return error pointers when we want to use those pointers in the non-error case, but this function is just returning error pointers or NULL for success. Change the style to plain int to follow normal kernel coding styles. Cc: Joachim Eastwood <manabian@gmail.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* tipc: fix node reference count bugJon Paul Maloy2015-12-031-8/+7
| | | | | | | | | | | | | | Commit 5405ff6e15f40f2f ("tipc: convert node lock to rwlock") introduced a bug to the node reference counter handling. When a message is successfully sent in the function tipc_node_xmit(), we return directly after releasing the node lock, instead of continuing and decrementing the node reference counter as we should do. This commit fixes this bug. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'mvneta-ethtool-autoneg'David S. Miller2015-12-031-25/+74
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stas Sergeev says: ==================== mvneta: implement ethtool autonegotiation control These 2 patches add an ability to control the autonegotiation via ethtool. For example: ethtool -s eth0 autoneg off ethtool -s eth0 autoneg on This is needed if you want to connect the mvneta's MII to different switches or PHYs: the ones the do support the in-band status, and the ones that do not. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * mvneta: implement ethtool autonegotiation controlStas Sergeev2015-12-031-35/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows to do ethtool -s eth0 autoneg off ethtool -s eth0 autoneg on to disable or enable autonegotiation at run-time. Without that functionality, the only way to control the autonegotiation is to modify the device tree. This is needed if you plan to use the same kernel with different ethernet switches, the ones that support the in-band status and the ones that not. CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> CC: netdev@vger.kernel.org CC: linux-kernel@vger.kernel.org Signed-off-by: Stas Sergeev <stsp@users.sourceforge.net> Signed-off-by: David S. Miller <davem@davemloft.net>
| * mvneta: consolidate autoneg enablingStas Sergeev2015-12-031-3/+13
|/ | | | | | | | | | | This moves autoneg-related bit manipulations to the single place. CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> CC: netdev@vger.kernel.org CC: linux-kernel@vger.kernel.org Signed-off-by: Stas Sergeev <stsp@users.sourceforge.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: mv643xx: Use platform_register/unregister_drivers()Thierry Reding2015-12-031-12/+7
| | | | | | | | | These new helpers simplify implementing multi-driver modules and properly handle failure to register one driver by unregistering all previously registered drivers. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: mpc52xx: Use platform_register/unregister_drivers()Thierry Reding2015-12-031-13/+9
| | | | | | | | | These new helpers simplify implementing multi-driver modules and properly handle failure to register one driver by unregistering all previously registered drivers. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: bcm63xx: Use platform_register/unregister_drivers()Thierry Reding2015-12-031-20/+8
| | | | | | | | | These new helpers simplify implementing multi-driver modules and properly handle failure to register one driver by unregistering all previously registered drivers. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: bfin_mac: Use platform_register/unregister_drivers()Thierry Reding2015-12-031-7/+7
| | | | | | | | | These new helpers simplify implementing multi-driver modules and properly handle failure to register one driver by unregistering all previously registered drivers. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pppox: use standard module auto-loading featureGuillaume Nault2015-12-034-3/+5
| | | | | | | | | | | | | * Register PF_PPPOX with pppox module rather than with pppoe, so that pppoe doesn't get loaded for any PF_PPPOX socket. * Register PX_PROTO_* with standard MODULE_ALIAS_NET_PF_PROTO() instead of using pppox's own naming scheme. * While there, add auto-loading feature for pptp. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'vsock-virtio'David S. Miller2015-12-0314-0/+2779
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stefan Hajnoczi says: ==================== Add virtio transport for AF_VSOCK v2: * Rebased onto Linux v4.4-rc2 * vhost: Refuse to assign reserved CIDs * vhost: Refuse guest CID if already in use * vhost: Only accept correctly addressed packets (no spoofing!) * vhost: Support flexible rx/tx descriptor layout * vhost: Add missing total_tx_buf decrement * virtio_transport: Fix total_tx_buf accounting * virtio_transport: Add virtio_transport global mutex to prevent races * common: Notify other side of SOCK_STREAM disconnect (fixes shutdown semantics) * common: Avoid recursive mutex_lock(tx_lock) for write_space (fixes deadlock) * common: Define VIRTIO_VSOCK_TYPE_STREAM/DGRAM hardware interface constants * common: Define VIRTIO_VSOCK_SHUTDOWN_RCV/SEND hardware interface constants * common: Fix peer_buf_alloc inheritance on child socket This patch series adds a virtio transport for AF_VSOCK (net/vmw_vsock/). AF_VSOCK is designed for communication between virtual machines and hypervisors. It is currently only implemented for VMware's VMCI transport. This series implements the proposed virtio-vsock device specification from here: http://comments.gmane.org/gmane.comp.emulators.virtio.devel/855 Most of the work was done by Asias He and Gerd Hoffmann a while back. I have picked up the series again. The QEMU userspace changes are here: https://github.com/stefanha/qemu/commits/vsock Why virtio-vsock? ----------------- Guest<->host communication is currently done over the virtio-serial device. This makes it hard to port sockets API-based applications and is limited to static ports. virtio-vsock uses the sockets API so that applications can rely on familiar SOCK_STREAM and SOCK_DGRAM semantics. Applications on the host can easily connect to guest agents because the sockets API allows multiple connections to a listen socket (unlike virtio-serial). This simplifies the guest<->host communication and eliminates the need for extra processes on the host to arbitrate virtio-serial ports. Overview -------- This series adds 3 pieces: 1. virtio_transport_common.ko - core virtio vsock code that uses vsock.ko 2. virtio_transport.ko - guest driver 3. drivers/vhost/vsock.ko - host driver Howto ----- The following kernel options are needed: CONFIG_VSOCKETS=y CONFIG_VIRTIO_VSOCKETS=y CONFIG_VIRTIO_VSOCKETS_COMMON=y CONFIG_VHOST_VSOCK=m Launch QEMU as follows: # qemu ... -device vhost-vsock-pci,id=vhost-vsock-pci0,guest-cid=3 Guest and host can communicate via AF_VSOCK sockets. The host's CID (address) is 2 and the guest is automatically assigned a CID (use VMADDR_CID_ANY (-1) to bind to it). Status ------ There are a few design changes I'd like to make to the virtio-vsock device: 1. The 3-way handshake isn't necessary over a reliable transport (virtqueue). Spoofing packets is also impossible so the security aspects of the 3-way handshake (including syn cookie) add nothing. The next version will have a single operation to establish a connection. 2. Credit-based flow control doesn't work for SOCK_DGRAM since multiple clients can transmit to the same listen socket. There is no way for the clients to coordinate buffer space with each other fairly. The next version will drop credit-based flow control for SOCK_DGRAM and only rely on best-effort delivery. SOCK_STREAM still has guaranteed delivery. 3. In the next version only the host will be able to establish connections (i.e. to connect to a guest agent). This is for security reasons since there is currently no ability to provide host services only to certain guests. This also matches how AF_VSOCK works on modern VMware hypervisors. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * VSOCK: Add Makefile and KconfigAsias He2015-12-035-0/+35
| | | | | | | | | | | | | | | | Enable virtio-vsock and vhost-vsock. Signed-off-by: Asias He <asias@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * VSOCK: Introduce vhost-vsock.koAsias He2015-12-032-0/+635
| | | | | | | | | | | | | | | | | | VM sockets vhost transport implementation. This module runs in host kernel. Signed-off-by: Asias He <asias@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * VSOCK: Introduce virtio-vsock.koAsias He2015-12-031-0/+466
| | | | | | | | | | | | | | | | | | VM sockets virtio transport implementation. This module runs in guest kernel. Signed-off-by: Asias He <asias@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * VSOCK: Introduce virtio-vsock-common.koAsias He2015-12-034-0/+1571
| | | | | | | | | | | | | | | | | | This module contains the common code and header files for the following virtio-vsock and virtio-vhost kernel modules. Signed-off-by: Asias He <asias@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * VSOCK: Introduce vsock_find_unbound_socket and vsock_bind_dgram_genericAsias He2015-12-032-0/+72
|/ | | | | | Signed-off-by: Asias He <asias@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mpls: support for dead routesRoopa Prabhu2015-12-032-28/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for RTNH_F_DEAD and RTNH_F_LINKDOWN flags on mpls routes due to link events. Also adds code to ignore dead routes during route selection. Unlike ip routes, mpls routes are not deleted when the route goes dead. This is current mpls behaviour and this patch does not change that. With this patch however, routes will be marked dead. dead routes are not notified to userspace (this is consistent with ipv4 routes). dead routes: ----------- $ip -f mpls route show 100 nexthop as to 200 via inet 10.1.1.2 dev swp1 nexthop as to 700 via inet 10.1.1.6 dev swp2 $ip link set dev swp1 down $ip link show dev swp1 4: swp1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether 00:02:00:00:00:01 brd ff:ff:ff:ff:ff:ff $ip -f mpls route show 100 nexthop as to 200 via inet 10.1.1.2 dev swp1 dead linkdown nexthop as to 700 via inet 10.1.1.6 dev swp2 linkdown routes: ---------------- $ip -f mpls route show 100 nexthop as to 200 via inet 10.1.1.2 dev swp1 nexthop as to 700 via inet 10.1.1.6 dev swp2 $ip link show dev swp1 4: swp1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 00:02:00:00:00:01 brd ff:ff:ff:ff:ff:ff /* carrier goes down */ $ip link show dev swp1 4: swp1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether 00:02:00:00:00:01 brd ff:ff:ff:ff:ff:ff $ip -f mpls route show 100 nexthop as to 200 via inet 10.1.1.2 dev swp1 linkdown nexthop as to 700 via inet 10.1.1.6 dev swp2 Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Acked-by: Robert Shearman <rshearma@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'rsvb-compat-strings'David S. Miller2015-12-032-1/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simon Horman says: ==================== ravb: More compatibility strings this short series adds generic gen2 and gen3, and soc-specific compatibility strings for the missing gen2 SoCs. Key Changes in v2: * Include "rcar-" in generic bindings ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * ravb: add device tree support for r8a779[123]Simon Horman2015-12-031-0/+3
| | | | | | | | | | | | | | | | | | | | Simply document new compatibility strings. As a previous patch adds a generic R-Car Gen2 compatibility string there appears to be no need for a driver updates. Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
| * ravb: add fallback compatibility stringsSimon Horman2015-12-032-1/+10
|/ | | | | | | | | | Add fallback compatibility strings for R-Car Gen 2 & 3 SoC Families. This is in keeping with the fallback scheme being adopted wherever appropriate for drivers for Renesas SoCs. Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ipv6: restrict hop_limit sysctl setting to range [1; 255]Phil Sutter2015-12-031-1/+15
| | | | | | | | | | | | | | | | | | | Setting a value bigger than 255 resulted in using only the lower eight bits of that value as it is assigned to the u8 header field. To avoid this unexpected result, reject such values. Setting a value of zero is technically possible, but hosts receiving such a packet have to treat it like hop_limit was set to one, according to RFC2460. Therefore I don't see a use-case for that. Setting a route's hop_limit to zero in iproute2 means to use the sysctl default, which is not the case here: Setting e.g. net.conf.eth0.hop_limit=0 will not make the kernel use net.conf.all.hop_limit for outgoing packets on eth0. To avoid these kinds of confusion, reject zero. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
* ravb: ptp: Add CONFIG mode supportKazuya Mizuguchi2015-12-032-5/+29
| | | | | | | | This patch makes PTP support active in CONFIG mode on R-Car Gen3. Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'netronome-NFP4000-NFP6000'David S. Miller2015-12-0313-0/+4823
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jakub Kicinski says: ==================== Netronome NFP4000/NFP6000 NIC VF driver This patchset adds support for VFs of Netronome's NFP-4000 and NFP-6000 based NICs. We are currently also preparing the submission for the PF driver, but it is not quite ready yet. The PF driver can be found on GitHub: https://github.com/Netronome/nfp-drv-kmods ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: add driver for Netronome NFP4000/NFP6000 NIC VFsJakub Kicinski2015-12-0312-0/+4821
| | | | | | | | | | | | | | | | | | Add driver for Virtual Functions for the Netronome's NFP-4000 and NFP-6000 based NICs. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * pci_ids: add Netronome Systems vendorJakub Kicinski2015-12-031-0/+2
|/ | | | | | | | Add PCI vendor id for Netronome Systems. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch '40GbE' of ↵David S. Miller2015-12-0311-203/+226
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== 40GbE Intel Wired LAN Driver Updates 2015-12-03 This series contains updates to i40e and i40evf only. Mitch updates the i40evf driver by increasing the maximum number of queues, since future devices will allow for more queue pairs. Cleans up a duplicate printing of the driver info string done in init, since it is already done in probe. Cleaned up the several allocations which did not need to be at atomic level, where GFP_KERNEL would work just fine. Then makes i40e_sync_vsi_filters() a more mature function, make having a common exit point so it will properly release the busy lock on the VSI and propagate errors to the callers. Then does some whitespace housekeeping in i40evf. Kiran moves and updates the detection/recovery of transmit queue hang code to service_task from tx_timeout function. Also fixed memory leak when users program flow-director filter using ethtool (sideband filter programming), the cause being the check of 'tx_buffer->skb' was preventing 'raw_buf' from being freed as part of the cleanup. Jesse enabled the ability to turn off/on packet split using ethtool priv flags. Then does some housekeeping for both the i40e and i40evf drivers which includes: remove unused/useless code, correct whitespace, remove duplicate #include, fix incorrect comment, etc... Neerav cleans up functions to gather Flow Control Rx XOFF stats, since the recent change in the driver logic for checking transmit hang has been moved, so these functions do not do anything meaningful any longer. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * i40e: trivial fixesJesse Brandeburg2015-12-033-20/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) remove duplicate include of tcp.h 2) put an ampersand at the end of a line instead of the beginning 3) remove a useless dev_info 4) match declaration of function to the implementation 5) repair incorrect comment 6) correct whitespace 7) remove unused define Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e/i40evf: Bump version to 1.4.7 for i40e and 1.4.3 for i40evfCatherine Sullivan2015-12-032-2/+2
| | | | | | | | | | | | | | | | | | Bump. Change-ID: Id8c83c64c973349a722bab40d285ad8ded8c28f7 Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e/i40evf: use logical operatorMitch Williams2015-12-032-2/+2
| | | | | | | | | | | | | | | | | | | | | | We shouldn't be using a bitwise operator here; it's not a bitwise operation. Use a logical operator instead. Why doesn't c have a logical-or-and-assign operator? Change-ID: Id84f3ca884910bed7073c84b1e16a102e958d0de Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: fix whitespaceMitch Williams2015-12-031-2/+2
| | | | | | | | | | | | | | | | | | Operators should have spaces around them. Change-ID: I64735e9aa8618b9a5059a87ace1c999d6d3bfcfb Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: Remove separate functions gathering XOFF Rx statsNeerav Parikh2015-12-031-70/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The separate functions to gather Flow control Rx XOFF stats was to determine if the Tx for a queue was paused due to Link Flow Control(LFC) or Priority Flow Control(PFC). But, with recent change in the i40e driver the logic for checking th Tx hang has been removed and these functions don't do anything meaningful. Hence, there is no need to keep these separate functions to gather Rx XOFF stats for LFC or PFC. This patch removes these functions and moves the stat collection for XOFF Rx to the i40e_update_pf_stats() that collects all the PF stats. Change-ID: Iec1452dac3a6766f0d968e754cb407530d7c60cd Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: remove CONFIG_I40E_VXLANJesse Brandeburg2015-12-033-20/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having our own custom symbol, we can just rely on whether or not the kernel has the feature enabled. In this case use IS_ENABLED(CONFIG_VXLAN) in order to handle built-in or module in the current BKM way. Change-ID: I5890fbb518ff8ed6bb07c3362fb0a8a829f9b241 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: use priv flags to control packet splitJesse Brandeburg2015-12-032-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ethtool priv flags implementation to enable or disable packet split, which is a hardware feature that inspects headers and will put headers in a separate DMA buffer from the payload data. The driver was automatically choosing to enable packet split in some cases and this gives the user the ability to turn it off/on explicitly. to query state: ethtool --show-priv-flags ethx to enable: ethtool --set-priv-flags ethx packet-split on to disable: ethtool --set-priv-flags ethx packet-split off Why would anyone want this? Because some environments benefit from header/data split in the receive buffer, and the driver defaults to one or the other depending on environment/kernel parameters. Why didn't you implement a generic ethtool control for this feature? Because Intel hardware is the only hardware that supports header/data split. Change-ID: I803121e1eecc9ccb2884031fd85dd1110b3af66d Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40evf: use correct typesMitch Williams2015-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | Don't use uint32_t type the kernel. Use u32 instead. No functional change. Change-ID: I77bbf3b6464edaef747c7104b43534032a4dba63 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: propagate properlyMitch Williams2015-12-032-51/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i40e_sync_vsi_filters() is the surly teenager of this driver. It says it's going to report errors, but it doesn't actually do that most of the time. And when it does, it leaves a mess. Change this function to have a common exit point so it will properly release the busy lock on the VSI. Propagate errors to the callers. Finally, adjust a few callers to check for and deal with errors from this function. Change-ID: Ic6af4956491e72402ebb3c538a3c31a0ad7f8667 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40evf: don't use atomic allocationMitch Williams2015-12-031-6/+6
| | | | | | | | | | | | | | | | | | | | | | These allocations don't need to be at atomic level. GFP_KERNEL is fine and they'll reduce stress on the allocator when the system is starved for memory. Change-ID: I3561d0399a681de0ad25291b6c848b224c1fde12 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: Fix memory leaks, sideband filter programmingKiran Patil2015-12-032-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the memory leak which would be seen otherwise when user programs flow-director filter using ethtool (sideband filter programming). When ethtool is used to program flow directory filter, 'raw_buf' gets allocated and it is supposed to be freed as part of queue cleanup. But check of 'tx_buffer->skb' was preventing it from being freed. Change-ID: Ief4f0a1a32a653180498bf6e987c1b4342ab8923 Signed-off-by: Kiran Patil <kiran.patil@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: Detection and recovery of TX queue hung logic moved to service_task ↵Kiran Patil2015-12-035-13/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from tx_timeout This patch contains following changes: - detection and recovery logic (issue SW interrupt) has been moved to service_task from timeout function. - added some more debug info from tx_timeout. Logic to detect and recover TX queue hung is now two step process: - service_task detects TX queue hung and sets a bit(hung_detected) if it was not set. - if bit was set (means this is back-back hung condition detected), issue SW interrupt and clear the bit. - napi_poll clears the bit unconditionally since it cleans TX/RX queues. Change-ID: Ieed03a48927c845a988b3ff375090bf37caeb903 Signed-off-by: Kiran Patil <kiran.patil@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40evf: remove duplicate stringMitch Williams2015-12-031-1/+0
| | | | | | | | | | | | | | | | | | | | We already print the driver info string in probe, so don't print it again in init. No need to repeat. No need to repeat. Change-ID: Ief597997f580a8c54d5950e3a84c29f2075be66b Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40evf: set real num queuesMitch Williams2015-12-031-1/+2
| | | | | | | | | | | | | | | | | | | | Use the helper function to set the real number of RX queues, and also set the real number of TX queues. Change-ID: I67982799de3f248fb4158ccdc9b1a74385f42ddd Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40evf: increase max number of queuesMitch Williams2015-12-032-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | Future devices will allow for more queue pairs, so allocate a netdev that can handle them. While we're at it, get rid of the separate MAX_TX/MAX_RX defines. Since we always get matched queue pairs, having these makes no sense. Change-ID: I0e3556cd9a962506e509eb7c0afa36b329e8cb51 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* | Merge branch 'mlx5-connectx-4-sriov'David S. Miller2015-12-0318-71/+2742
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Or Gerlitz says: ==================== Introducing ConnectX-4 Ethernet SRIOV This patchset introduces the support of Ethernet SRIOV in ConnectX-4 family of 100G Ethernet NICs. Some features are still missing, but all the basic SRIOV functionalities are there already. Basic Introduction: ConnectX-4 HW architecture provides two kinds of underlying HW switches. MPFS (Multi Physical Function Switch) or L2 Table in Software terms: The HCA has one MPFS switch per physical port, this switch is responsible of forwarding Unicast traffic to the various overlying Physical Functions (PFs). Multicast traffic is flooded amongst all the PFs, Each PF can request to forward a unicast MAC to its E-Switch Uplink vport (which we will cover later) through SET_L2_TABLE_ENTRY HW command. MPFS has five ports, four are connected to PFs (one for each) and one is connected directly to the Physical Port (Physical Link). E-Switch (Ethernet Switch): The HCA has one per physical function. The main responsibility of this component is to forward Unicast/Multicast and vlan tagged/untagged traffic to the various Virtual Functions (VFs) allocated by the PF. Unlike MPFS, the PF needs to explicitly create the E-Switch FDB table, Which is a HW flow table managed by the PF driver whenever vport_group_manager capability bit is set for this PF. E-Switch has Virtual Ports (vports) entities as its ports, vport0 and uplink vport are special kind of vports that represents PF vport (vport0) and uplink vport which is connected to the MPFS switch (if exists) as the PF external link. vport1..vportN represent VF0..VF(N-1) egress/ingress ports. E-Switch FDB contains forwarding rules such as: UC MAC0 -> vport0(PF). UC MAC1 -> vport1. UC MAC2 -> vport2. MC MACX -> vport0, vport2, Uplink. MC MACY -> vport1, Uplink. For unmatched traffic FDB has the following default rules: Unmatched Traffic (src vport != Uplink) -> Uplink. Unmatched Traffic (src vport == Uplink) -> vport0(PF). NIC VPort context: Each NIC (VF/PF) has its own vport context which will be used to store the current NIC vport context (UC/MC and vlan lists) and other NIC properties such as MTU, promisc mode, etc.. NIC (VF/PF) driver is responsible of constantly updating this context. FDB rules population: Each NIC vport (VF/PF) will notify E-Switch manager of its UC/MC vport context changes via modify vport context command, which will be translated to an event that will be handled by E-Switch manager (PF) which will update FDB table accordingly. Both PF and VF use the same driver and submit commands directly to the firmware. The PF sees the vport_group_manager capability bit and as such runs the code to populate the embedded switches as explained above. The patch goes as follows: Patches 1-2 introduces the basic PCI SRIOV functionalities and the support of Connectx4 to enable specific VFs via enable/disable HCA commands. These two patches will be also in use later for the IB SRIOV flow. Patches 3-8 Introduces the basic E-Switch capabilities and commands to be used later by VF to modify and update its NIC vport context, and by PF (E-Switch Manager) driver to Query the VF NIC context and acts accordingly. Patches 9-10 Provide the needed functionality of a NIC driver VF/PF to support SRIOV, mainly vport context update support. Patch 11 ("net/mlx5: Introducing E-Switch and l2 table"), Introduces the basic E-Switch support and infrastructure to read vport context events and to update MPFS L2 Table of the UC mac addresses request by the PF. Patches 12-18 Introduces SRIOV enablemenet and E-Switch FDB table management It adds the Basic E-Swtich public API to set and get sriov properties to be used in PF netdev sriov ndos. Patchset was applied ontop of commit 3f8c0f7 "gianfar: use of_property_read_bool()" Saeed, Eli and Or. changes from V0, addressed feedback from Alex Duyck: - patch 09, remove the loop to seek the device address - patch 09, avoid using array as returned value from helper function - patch 10, fix possible buffer over-run changes from V1, addressed feedback from and Julia Lawall and kbuild test robot - patch 11 check the right variable for allocation failure - patch 18 eliminated unneeded semicolon ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * | net/mlx5e: Add support for SR-IOV ndosSaeed Mahameed2015-12-031-1/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implement and enable SR-IOV ndos to manage SR-IOV configuration via netdev netlink API. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | net/mlx5: E-Switch, Introduce get vf statisticsSaeed Mahameed2015-12-032-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add support to get VF statistics using query vport counter command. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | net/mlx5: E-Switch, Introduce set vport vlan (VST mode)Saeed Mahameed2015-12-032-2/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add query and modify functions to control client vlan and qos striping or insertion, in E-Switch vports contexts. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | net/mlx5: E-Switch, Introduce HCA cap and E-Switch vport contextSaeed Mahameed2015-12-033-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | E-Switch vport context is unlike NIC vport context, managed by the E-Switch manager or vport_group_manager and not by the NIC(VF) driver. The E-Switch manager can access (read/modify) any of its vports E-Switch context. Currently E-Switch vport context includes only clietnt and server vlan insertion and striping data (for later support of VST mode). Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | net/mlx5: E-Switch, Introduce Vport administration functionsSaeed Mahameed2015-12-032-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implement set VF mac/link state and query VF config to be used later in nedev VF ndos or any other management API. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | net/mlx5: E-Switch, Add SR-IOV (FDB) supportSaeed Mahameed2015-12-037-83/+661
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enabling E-Switch SRIOV for nvfs+1 vports. Create E-Switch FDB for L2 UC/MC mac steering between VFs/PF and external vport (Uplink). FDB contains forwarding rules such as: UC MAC0 -> vport0(PF). UC MAC1 -> vport1. UC MAC2 -> vport2. MC MACX -> vport0, vport2, Uplink. MC MACY -> vport1, Uplink. For unmatched traffic FDB has the following default rules: Unmached Traffic (src vport != Uplink) -> Uplink. Unmached Traffic (src vport == Uplink) -> vport0(PF). FDB rules population: Each NIC vport (VF) will notify E-Switch manager of its UC/MC vport context changes via modify vport context command, which will be translated to an event that will be handled by E-Switch manager (PF) which will update FDB table accordingly. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | net/mlx5: E-Switch, Introduce FDB hardware capabilitiesSaeed Mahameed2015-12-033-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | Define needed hardware structures and capabilities needed for E-Switch FDB flow tables and read them on driver load. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>