1. 23 Apr, 2019 5 commits
  2. 22 Apr, 2019 5 commits
  3. 21 Apr, 2019 7 commits
  4. 20 Apr, 2019 15 commits
  5. 19 Apr, 2019 8 commits
    • Eric Dumazet's avatar
      tcp: properly reset skb->truesize for tx recycling · d7cc399e
      Eric Dumazet authored
      tcp sendmsg() and sendpage() normally advance skb->data_len
      and skb->truesize by the payload added to an skb.
      
      But sendmsg(fd, ..., MSG_ZEROCOPY) has to account for whole pages,
      even if a single byte of payload is used in the page.
      
      This means that we can not assume skb->truesize can be adjusted
      by skb->data_len. We must instead overwrite its value.
      
      Otherwise skb->truesize is too big and can hit socket sndbuf limit,
      especially if the skb is recycled multiple times :/
      
      Fixes: 472c2e07 ("tcp: add one skb cache for tx")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Soheil Hassas Yeganeh <soheil@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d7cc399e
    • Jiri Pirko's avatar
      mlxsw: spectrum: Assume CONFIG_NET_DEVLINK is always enabled · 0a9798c1
      Jiri Pirko authored
      Since commit f6b19b35 ("net: devlink: select NET_DEVLINK
      from drivers") adds implicit select of NET_DEVLINK for
      mlxsw, the code does not have to deal with the case
      when CONFIG_NET_DEVLINK is not enabled. So remove the ifcase
      and adjust Makefile.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Reviewed-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0a9798c1
    • Tung Nguyen's avatar
      tipc: introduce new socket option TIPC_SOCK_RECVQ_USED · 42e5425a
      Tung Nguyen authored
      When using TIPC_SOCK_RECVQ_DEPTH for getsockopt(), it returns the
      number of buffers in receive socket buffer which is not so helpful
      for user space applications.
      
      This commit introduces the new option TIPC_SOCK_RECVQ_USED which
      returns the current allocated bytes of the receive socket buffer.
      This helps user space applications dimension its buffer usage to
      avoid buffer overload issue.
      Signed-off-by: default avatarTung Nguyen <tung.q.nguyen@dektech.com.au>
      Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      42e5425a
    • Andrew Lunn's avatar
      net: dsa: mv88e6xxx: Only reconfigure MAC when something changes · a26deec6
      Andrew Lunn authored
      phylink will call the mac_config() callback once per second when
      polling a PHY or a fixed link. The MAC driver is not supposed to
      reconfigure the MAC if nothing has changed.
      
      Make the mv88e6xxx driver look at the current configuration of the
      port, and return early if nothing has changed.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a26deec6
    • Arnd Bergmann's avatar
      net: socket: implement 64-bit timestamps · 0768e170
      Arnd Bergmann authored
      The 'timeval' and 'timespec' data structures used for socket timestamps
      are going to be redefined in user space based on 64-bit time_t in future
      versions of the C library to deal with the y2038 overflow problem,
      which breaks the ABI definition.
      
      Unlike many modern ioctl commands, SIOCGSTAMP and SIOCGSTAMPNS do not
      use the _IOR() macro to encode the size of the transferred data, so it
      remains ambiguous whether the application uses the old or new layout.
      
      The best workaround I could find is rather ugly: we redefine the command
      code based on the size of the respective data structure with a ternary
      operator. This lets it get evaluated as late as possible, hopefully after
      that structure is visible to the caller. We cannot use an #ifdef here,
      because inux/sockios.h might have been included before any libc header
      that could determine the size of time_t.
      
      The ioctl implementation now interprets the new command codes as always
      referring to the 64-bit structure on all architectures, while the old
      architecture specific command code still refers to the old architecture
      specific layout. The new command number is only used when they are
      actually different.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0768e170
    • Arnd Bergmann's avatar
      asm-generic: generalize asm/sockios.h · 5ce5d8a5
      Arnd Bergmann authored
      ia64, parisc and sparc just use a copy of the generic version
      of asm/sockios.h, and x86 is a redirect to the same file, so we
      can just let the header file be generated.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5ce5d8a5
    • Arnd Bergmann's avatar
      net: rework SIOCGSTAMP ioctl handling · c7cbdbf2
      Arnd Bergmann authored
      The SIOCGSTAMP/SIOCGSTAMPNS ioctl commands are implemented by many
      socket protocol handlers, and all of those end up calling the same
      sock_get_timestamp()/sock_get_timestampns() helper functions, which
      results in a lot of duplicate code.
      
      With the introduction of 64-bit time_t on 32-bit architectures, this
      gets worse, as we then need four different ioctl commands in each
      socket protocol implementation.
      
      To simplify that, let's add a new .gettstamp() operation in
      struct proto_ops, and move ioctl implementation into the common
      sock_ioctl()/compat_sock_ioctl_trans() functions that these all go
      through.
      
      We can reuse the sock_get_timestamp() implementation, but generalize
      it so it can deal with both native and compat mode, as well as
      timeval and timespec structures.
      Acked-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Acked-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Link: https://lore.kernel.org/lkml/CAK8P3a038aDQQotzua_QtKGhq8O9n+rdiz2=WDCp82ys8eUT+A@mail.gmail.com/Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c7cbdbf2
    • David S. Miller's avatar
      Merge branch 'net-support-binding-vlan-dev-link-state-to-vlan-member-bridge-ports' · 1ab83928
      David S. Miller authored
      Mike Manning says:
      
      ====================
      net: support binding vlan dev link state to vlan member bridge ports
      
      For vlan filtering on bridges, the bridge may also have vlan devices
      as upper devices. For switches, these are used to provide L3 packet
      processing for ports that are members of a given vlan.
      
      While it is correct that the admin state for these vlan devices is
      either set directly for the device or inherited from the lower device,
      the link state is also transferred from the lower device. So this is
      always up if the bridge is in admin up state and there is at least one
      bridge port that is up, regardless of the vlan that the port is in.
      
      The link state of the vlan device may need to track only the state of
      the subset of ports that are also members of the corresponding vlan,
      rather than that of all ports.
      
      This series provides an optional vlan flag so that the link state of
      the vlan device is only up if there is at least one bridge port that is
      up AND is a member of the corresponding vlan.
      
      v2:
         - Address review comments from Nikolay Aleksandrov
           in patches 3 & 4 and add patch 5 to address bridge link down due to STP
      v3:
         - Address review comment from Nikolay Aleksandrov
           in patch 4 so as to remove unnecessary inline #ifdef
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ab83928