1. 01 Aug, 2014 2 commits
    • Jason Gunthorpe's avatar
      sctp: Fixup v4mapped behaviour to comply with Sock API · 299ee123
      Jason Gunthorpe authored
      The SCTP socket extensions API document describes the v4mapping option as
      follows:
      
      8.1.15.  Set/Clear IPv4 Mapped Addresses (SCTP_I_WANT_MAPPED_V4_ADDR)
      
         This socket option is a Boolean flag which turns on or off the
         mapping of IPv4 addresses.  If this option is turned on, then IPv4
         addresses will be mapped to V6 representation.  If this option is
         turned off, then no mapping will be done of V4 addresses and a user
         will receive both PF_INET6 and PF_INET type addresses on the socket.
         See [RFC3542] for more details on mapped V6 addresses.
      
      This description isn't really in line with what the code does though.
      
      Introduce addr_to_user (renamed addr_v4map), which should be called
      before any sockaddr is passed back to user space. The new function
      places the sockaddr into the correct format depending on the
      SCTP_I_WANT_MAPPED_V4_ADDR option.
      
      Audit all places that touched v4mapped and either sanely construct
      a v4 or v6 address then call addr_to_user, or drop the
      unnecessary v4mapped check entirely.
      
      Audit all places that call addr_to_user and verify they are on a sycall
      return path.
      
      Add a custom getname that formats the address properly.
      
      Several bugs are addressed:
       - SCTP_I_WANT_MAPPED_V4_ADDR=0 often returned garbage for
         addresses to user space
       - The addr_len returned from recvmsg was not correct when
         returning AF_INET on a v6 socket
       - flowlabel and scope_id were not zerod when promoting
         a v4 to v6
       - Some syscalls like bind and connect behaved differently
         depending on v4mapped
      
      Tested bind, getpeername, getsockname, connect, and recvmsg for proper
      behaviour in v4mapped = 1 and 0 cases.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Tested-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      299ee123
    • Karoly Kemeny's avatar
      net: kernel-doc compliant documentation for net_device · 536721b1
      Karoly Kemeny authored
      Net_device is a vast and important structure, but it has no kernel-doc
      compliant documentation. This patch extracts the comments from the structure
      to clean it up, and let the scripts extract documentation from it. I know that
      the patch is big, but it's just reordering of comments into the appropriate
      form, and adding a few more, for the missing members.
      Signed-off-by: default avatarKaroly Kemeny <karoly.kemeny@gmail.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      536721b1
  2. 31 Jul, 2014 33 commits
  3. 30 Jul, 2014 5 commits
    • Vince Bridgers's avatar
      net: stmmac: add platform init/exit for Altera's ARM socfpga · 2d871aa0
      Vince Bridgers authored
      This patch adds platform init/exit functions and modifications to support
      suspend/resume for the Altera Cyclone 5 SOC Ethernet controller. The platform
      exit function puts the controller into reset using the socfpga reset
      controller driver. The platform init function sets up the Synopsys mac by
      first making sure the Ethernet controller is held in reset, programming the
      phy mode through external support logic, then deasserts reset through
      the socfpga reset manager driver.
      Signed-off-by: default avatarVince Bridgers <vbridgers2013@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d871aa0
    • David S. Miller's avatar
      Merge branch 'mlx5-next' · 7aa06bf5
      David S. Miller authored
      Eli Cohen says:
      
      ====================
      mlx5 driver changes related to PCI handling ***
      
      The first of these patches is changing the pci device driver from mlx5_ib to
      mlx5_core in a similar manner it is done in mlx4. This set the grounds for us
      to introduce Ethernet driver for HW which uses mlx5.
      
      The other two patches contain minor fixes.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7aa06bf5
    • Jack Morgenstein's avatar
      mlx5: Adjust events to use unsigned long param instead of void * · 4d2f9bbb
      Jack Morgenstein authored
      In the event flow, we currently pass only a port number in the
      void *data argument.  Rather than pass a pointer to the event handlers,
      we should use an "unsigned long" parameter, and pass the port number
      value directly.
      
      In the future, if necessary for some events, we can use the unsigned long
      parameter to pass a pointer.
      
      Based on a patch by Eli Cohen <eli@mellanox.com>
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarEli Cohen <eli@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4d2f9bbb
    • Jack Morgenstein's avatar
      mlx5: minor fixes (mainly avoidance of hidden casts) · f241e749
      Jack Morgenstein authored
      There were many places where parameters which should be u8/u16 were
      integer type.
      
      Additionally, in 2 places, a check for a non-null pointer was added
      before dereferencing the pointer (this is actually a bug fix).
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarEli Cohen <eli@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f241e749
    • Jack Morgenstein's avatar
      mlx5: Move pci device handling from mlx5_ib to mlx5_core · 9603b61d
      Jack Morgenstein authored
      In preparation for a new mlx5 device which is VPI (i.e., ports can be
      either IB or ETH), move the pci device functionality from mlx5_ib
      to mlx5_core.
      
      This involves the following changes:
      1. Move mlx5_core_dev struct out of mlx5_ib_dev. mlx5_core_dev
         is now an independent structure maintained by mlx5_core.
         mlx5_ib_dev now has a pointer to that struct.
         This requires changing a lot of places where the core_dev
         struct was accessed via mlx5_ib_dev (now, this needs to
         be a pointer dereference).
      2. All PCI initializations are now done in mlx5_core. Thus,
         it is now mlx5_core which does pci_register_device (and not
         mlx5_ib, as was previously).
      3. mlx5_ib now registers itself with mlx5_core as an "interface"
         driver. This is very similar to the mechanism employed for
         the mlx4 (ConnectX) driver. Once the HCA is initialized
         (by mlx5_core), it invokes the interface drivers to do
         their initializations.
      4. There is a new event handler which the core registers:
         mlx5_core_event(). This event handler invokes the
         event handlers registered by the interfaces.
      
      Based on a patch by Eli Cohen <eli@mellanox.com>
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarEli Cohen <eli@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9603b61d