1. 07 Dec, 2015 13 commits
    • Rainer Weikusat's avatar
      af_unix: fix unix_dgram_recvmsg entry locking · 64874280
      Rainer Weikusat authored
      The current unix_dgram_recvsmg code acquires the u->readlock mutex in
      order to protect access to the peek offset prior to calling
      __skb_recv_datagram for actually receiving data. This implies that a
      blocking reader will go to sleep with this mutex held if there's
      presently no data to return to userspace. Two non-desirable side effects
      of this are that a later non-blocking read call on the same socket will
      block on the ->readlock mutex until the earlier blocking call releases it
      (or the readers is interrupted) and that later blocking read calls
      will wait longer than the effective socket read timeout says they
      should: The timeout will only start 'ticking' once such a reader hits
      the schedule_timeout in wait_for_more_packets (core.c) while the time it
      already had to wait until it could acquire the mutex is unaccounted for.
      
      The patch avoids both by using the __skb_try_recv_datagram and
      __skb_wait_for_more packets functions created by the first patch to
      implement a unix_dgram_recvmsg read loop which releases the readlock
      mutex prior to going to sleep and reacquires it as needed
      afterwards. Non-blocking readers will thus immediately return with
      -EAGAIN if there's no data available regardless of any concurrent
      blocking readers and all blocking readers will end up sleeping via
      schedule_timeout, thus honouring the configured socket receive timeout.
      Signed-off-by: default avatarRainer Weikusat <rweikusat@mobileactivedefense.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64874280
    • Rainer Weikusat's avatar
      core: enable more fine-grained datagram reception control · ea3793ee
      Rainer Weikusat authored
      The __skb_recv_datagram routine in core/ datagram.c provides a general
      skb reception factility supposed to be utilized by protocol modules
      providing datagram sockets. It encompasses both the actual recvmsg code
      and a surrounding 'sleep until data is available' loop. This is
      inconvenient if a protocol module has to use additional locking in order
      to maintain some per-socket state the generic datagram socket code is
      unaware of (as the af_unix code does). The patch below moves the recvmsg
      proper code into a new __skb_try_recv_datagram routine which doesn't
      sleep and renames wait_for_more_packets to
      __skb_wait_for_more_packets, both routines being exported interfaces. The
      original __skb_recv_datagram routine is reimplemented on top of these
      two functions such that its user-visible behaviour remains unchanged.
      Signed-off-by: default avatarRainer Weikusat <rweikusat@mobileactivedefense.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ea3793ee
    • Andrew Lunn's avatar
      PHY: DP83867: Remove looking in parent device for OF properties · 7bf9ae01
      Andrew Lunn authored
      Device tree properties for a phy device are expected to be in the phy
      node. The current code for the DP83867 also tries to look in the
      parent node. The devices binding documentation does not mention this,
      no current device tree file makes use of this, and it is not behaviour
      we want. So remove looking in the parent device.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7bf9ae01
    • Bjørn Mork's avatar
      net: cdc_ncm: add "ndp_to_end" sysfs attribute · 404814af
      Bjørn Mork authored
      Adding a writable sysfs attribute for the "NDP to end"
      quirk flag.
      
      This makes it easier for end users to test new devices for
      this firmware bug.  We've been lucky so far, but we should
      not depend on reporters capable of rebuilding the driver.
      
      Cc: Enrico Mioso <mrkiko.rs@gmail.com>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      404814af
    • David S. Miller's avatar
      Merge branch 'mlx4-HA-LAG-SRIOV-VF' · 0fe3e204
      David S. Miller authored
      Or Gerlitz says:
      
      ====================
      Add HA and LAG support for mlx4 SRIOV VFs
      
      This series is built upon the code added in commit ce388fff "Merge branch
      'mlx4-next'" which added HA and LAG support to mlx4 RoCE and SRIOV services.
      
      We add HA and Link Aggregation support to single ported mlx4 Ethernet VFs.
      
      In this case, the PF Ethernet interfaces are bonded, the VFs see single
      port HW devices (already supported) -- however, now this port is highly
      available. This means that all VF HW QPs (both VF Ethernet driver and VF
      RoCE / RAW QPs) are subject to the V2P (Virtual-To-Physical) mapping which
      is managed by the PF driver, and hence resilient across link failures and
      such events.
      
      When bonding operates in Dynamic link aggregation (802.3ad) mode, traffic
      from each VF will go over the VF "base port" (the port this VF is assigned
      to by the admin) as long as this port is up. When the port fails, traffic
      from all VFs that are defined on this port will move to the other port, and
      be back to their base-port when it recovers.
      
      Moni and Or.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0fe3e204
    • Moni Shoua's avatar
      net/mlx4_core: Support the HA mode for SRIOV VFs too · e57968a1
      Moni Shoua authored
      When the mlx4 driver runs in HA mode, and all VFs are single ported
      ones, we make their single port Highly-Available.
      
      This is done by taking advantage of the HA mode properties (following
      bonding changes with programming the port V2P map, etc) and adding
      the missing parts which are unique to SRIOV such as mirroring VF
      steering rules on both ports.
      
      Due to limits on the MAC and VLAN table this mode is enabled only when
      number of total VFs is under 64.
      Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
      Reviewed-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e57968a1
    • Or Gerlitz's avatar
      IB/mlx4: Use the VF base-port when demuxing mad from wire · f1b4e12a
      Or Gerlitz authored
      Under HA mode, it's possible that the VF registered its GID
      (and expects to get mads through the PV scheme) on a port which is
      different from the one this mad arrived on, due to HA fail over.
      
      Therefore, if the gid is not matched on the port that the packet arrived
      on, check for a match on the other port if HA mode is active -- and if a
      match is found on the other port, continue processing the mad using that
      other port.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Reviewed-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f1b4e12a
    • Moni Shoua's avatar
      net/mlx4_core: Keep VLAN/MAC tables mirrored in multifunc HA mode · 5f61385d
      Moni Shoua authored
      Due to HW limitations, indexes to MAC and VLAN tables are always taken
      from the table of the actual port. So, if a resource holds an index to
      a table, it may refer to different values during the lifetime of the
      resource,  unless the tables are mirrored. Also, even when
      driver is not in HA mode the policy of allocating an index to these
      tables is such to make sure, as much as possible, that when the time
      comes the mirroring will be successful. This means that in multifunction
      mode the allocation of a free index in a port's table tries to make sure
      that the same index in the other's port table is also free.
      Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
      Reviewed-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5f61385d
    • Moni Shoua's avatar
      net/mlx4_core: Support mirroring VF DMFS rules on both ports · 78efed27
      Moni Shoua authored
      Under HA mode, steering rules set by VFs should be mirrored on both
      ports of the device so packets will be accepted no matter on which
      port they arrived.
      
      Since getting into HA mode is done dynamically when the user bonds mlx4
      Ethernet netdevs, we keep hold of the VF DMFS rule mbox with the port
      value flipped (1->2,2->1) and execute the mirroring when getting into
      HA mode. Later, when going out of HA mode, we unset the mirrored rules.
      In that context note that mirrored rules cannot be removed explicitly.
      Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
      Reviewed-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      78efed27
    • Moni Shoua's avatar
      net/mlx4_core: Use both physical ports to dispatch link state events to VF · 8d80d04a
      Moni Shoua authored
      Under HA mode, the link down event should be sent to VFs only if both
      ports are down.
      Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
      Reviewed-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d80d04a
    • Or Gerlitz's avatar
      net/mlx4_core: Use both physical ports to set the VF link state · e34305c8
      Or Gerlitz authored
      In HA mode, the link state for VFs for which the policy is "auto"
      (i.e. follow the physical link state) should be ORed from both ports.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Reviewed-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e34305c8
    • Julia Lawall's avatar
      VSOCK: fix returnvar.cocci warnings · 0d76d6e8
      Julia Lawall authored
      Remove unneeded variable used to store return value.
      
      Generated by: scripts/coccinelle/misc/returnvar.cocci
      
      CC: Asias He <asias@redhat.com>
      Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0d76d6e8
    • Bjørn Mork's avatar
      net: qmi_wwan: should hold RTNL while changing netdev type · 6c730080
      Bjørn Mork authored
      The notifier calls were thrown in as a last-minute fix for an
      imagined "this device could be part of a bridge" problem. That
      revealed a certain lack of locking.  Not to mention testing...
      
      Avoid this splat:
      
      RTNL: assertion failed at net/core/dev.c (1639)
      CPU: 0 PID: 4293 Comm: bash Not tainted 4.4.0-rc3+ #358
      Hardware name: LENOVO 2776LEG/2776LEG, BIOS 6EET55WW (3.15 ) 12/19/2011
       0000000000000000 ffff8800ad253d60 ffffffff8122f7cf ffff8800ad253d98
       ffff8800ad253d88 ffffffff813833ab 0000000000000002 ffff880230f48560
       ffff880230a12900 ffff8800ad253da0 ffffffff813833da 0000000000000002
      Call Trace:
       [<ffffffff8122f7cf>] dump_stack+0x4b/0x63
       [<ffffffff813833ab>] call_netdevice_notifiers_info+0x3d/0x59
       [<ffffffff813833da>] call_netdevice_notifiers+0x13/0x15
       [<ffffffffa09be227>] raw_ip_store+0x81/0x193 [qmi_wwan]
       [<ffffffff8131e149>] dev_attr_store+0x20/0x22
       [<ffffffff811d858b>] sysfs_kf_write+0x49/0x50
       [<ffffffff811d8027>] kernfs_fop_write+0x10a/0x151
       [<ffffffff8117249a>] __vfs_write+0x26/0xa5
       [<ffffffff81085ed4>] ? percpu_down_read+0x53/0x7f
       [<ffffffff81174c9e>] ? __sb_start_write+0x5f/0xb0
       [<ffffffff81174c9e>] ? __sb_start_write+0x5f/0xb0
       [<ffffffff81172c37>] vfs_write+0xa3/0xe7
       [<ffffffff811734ad>] SyS_write+0x50/0x7e
       [<ffffffff8145c517>] entry_SYSCALL_64_fastpath+0x12/0x6f
      
      Fixes: 32f7adf6 ("net: qmi_wwan: support "raw IP" mode")
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c730080
  2. 06 Dec, 2015 24 commits
  3. 05 Dec, 2015 3 commits