1. 18 Nov, 2016 11 commits
    • Huy Nguyen's avatar
      net/mlx5: Add handling for port module event · d4eb4cd7
      Huy Nguyen authored
      For each asynchronous port module event:
        1. print with ratelimit to the dmesg log
        2. increment the corresponding event counter
      Signed-off-by: default avatarHuy Nguyen <huyn@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d4eb4cd7
    • Huy Nguyen's avatar
      net/mlx5: Port module event hardware structures · 4ce3bf2f
      Huy Nguyen authored
      Add hardware structures and constants definitions needed for module
      events support.
      Signed-off-by: default avatarHuy Nguyen <huyn@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ce3bf2f
    • Mohamad Haj Yahia's avatar
      net/mlx5: Make the command interface cache more flexible · 0ac3ea70
      Mohamad Haj Yahia authored
      Add more cache command size sets and more entries for each set based on
      the current commands set different sizes and commands frequency.
      
      Fixes: e126ba97 ('mlx5: Add driver for Mellanox Connect-IB adapters')
      Signed-off-by: default avatarMohamad Haj Yahia <mohamad@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ac3ea70
    • David S. Miller's avatar
      Merge branch 'sfc-tso-v2' · 7a8bca04
      David S. Miller authored
      Edward Cree says:
      
      ====================
      sfc: Firmware-Assisted TSO version 2
      
      The firmware on 8000 series SFC NICs supports a new TSO API ("FATSOv2"), and
       7000 series NICs will also support this in an imminent release.  This series
       adds driver support for this TSO implementation.
      The series also removes SWTSO, as it's now equivalent to GSO.  This does not
       actually remove very much code, because SWTSO was grotesquely intertwingled
       with FATSOv1, which will also be removed once 7000 series supports FATSOv2.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7a8bca04
    • Edward Cree's avatar
      sfc: remove Software TSO · 46d1efd8
      Edward Cree authored
      It gives no advantage over GSO now that xmit_more exists.  If we find
       ourselves unable to handle a TSO skb (because our TXQ doesn't have a
       TSOv2 context and the NIC doesn't support TSOv1), hand it back to GSO.
       Also do that if the TSO handler fails with EINVAL for any other reason.
      As Falcon-architecture NICs don't support any firmware-assisted TSO,
       they no longer advertise TSO feature flags at all.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46d1efd8
    • Edward Cree's avatar
      sfc: handle failure to allocate TSOv2 contexts · e638ee1d
      Edward Cree authored
      If we fail to init the TXQ because of insufficient TSOv2 contexts,
      try again with TSOv2 disabled.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e638ee1d
    • Bert Kenward's avatar
      sfc: Firmware-Assisted TSO version 2 · e9117e50
      Bert Kenward authored
      Add support for FATSOv2 to the driver. FATSOv2 offloads far more of the task
       of TCP segmentation to the firmware, such that we now just pass a single
       super-packet to the NIC. This means TSO has a great deal in common with a
       normal DMA transmit, apart from adding a couple of option descriptors.
       NIC-specific checks have been moved off the fast path and in to
       initialisation where possible.
      
      This also moves FATSOv1/SWTSO to a new file (tx_tso.c).  The end of transmit
       and some error handling is now outside TSO, since it is common with other
       code.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9117e50
    • Edward Cree's avatar
      e17705c4
    • Edward Cree's avatar
      ece0cc17
    • Alexey Dobriyan's avatar
      netns: make struct pernet_operations::id unsigned int · c7d03a00
      Alexey Dobriyan authored
      Make struct pernet_operations::id unsigned.
      
      There are 2 reasons to do so:
      
      1)
      This field is really an index into an zero based array and
      thus is unsigned entity. Using negative value is out-of-bound
      access by definition.
      
      2)
      On x86_64 unsigned 32-bit data which are mixed with pointers
      via array indexing or offsets added or subtracted to pointers
      are preffered to signed 32-bit data.
      
      "int" being used as an array index needs to be sign-extended
      to 64-bit before being used.
      
      	void f(long *p, int i)
      	{
      		g(p[i]);
      	}
      
        roughly translates to
      
      	movsx	rsi, esi
      	mov	rdi, [rsi+...]
      	call 	g
      
      MOVSX is 3 byte instruction which isn't necessary if the variable is
      unsigned because x86_64 is zero extending by default.
      
      Now, there is net_generic() function which, you guessed it right, uses
      "int" as an array index:
      
      	static inline void *net_generic(const struct net *net, int id)
      	{
      		...
      		ptr = ng->ptr[id - 1];
      		...
      	}
      
      And this function is used a lot, so those sign extensions add up.
      
      Patch snipes ~1730 bytes on allyesconfig kernel (without all junk
      messing with code generation):
      
      	add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730)
      
      Unfortunately some functions actually grow bigger.
      This is a semmingly random artefact of code generation with register
      allocator being used differently. gcc decides that some variable
      needs to live in new r8+ registers and every access now requires REX
      prefix. Or it is shifted into r12, so [r12+0] addressing mode has to be
      used which is longer than [r8]
      
      However, overall balance is in negative direction:
      
      	add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730)
      	function                                     old     new   delta
      	nfsd4_lock                                  3886    3959     +73
      	tipc_link_build_proto_msg                   1096    1140     +44
      	mac80211_hwsim_new_radio                    2776    2808     +32
      	tipc_mon_rcv                                1032    1058     +26
      	svcauth_gss_legacy_init                     1413    1429     +16
      	tipc_bcbase_select_primary                   379     392     +13
      	nfsd4_exchange_id                           1247    1260     +13
      	nfsd4_setclientid_confirm                    782     793     +11
      		...
      	put_client_renew_locked                      494     480     -14
      	ip_set_sockfn_get                            730     716     -14
      	geneve_sock_add                              829     813     -16
      	nfsd4_sequence_done                          721     703     -18
      	nlmclnt_lookup_host                          708     686     -22
      	nfsd4_lockt                                 1085    1063     -22
      	nfs_get_client                              1077    1050     -27
      	tcf_bpf_init                                1106    1076     -30
      	nfsd4_encode_fattr                          5997    5930     -67
      	Total: Before=154856051, After=154854321, chg -0.00%
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c7d03a00
    • Eric Dumazet's avatar
      udp: enable busy polling for all sockets · e68b6e50
      Eric Dumazet authored
      UDP busy polling is restricted to connected UDP sockets.
      
      This is because sk_busy_loop() only takes care of one NAPI context.
      
      There are cases where it could be extended.
      
      1) Some hosts receive traffic on a single NIC, with one RX queue.
      
      2) Some applications use SO_REUSEPORT and associated BPF filter
         to split the incoming traffic on one UDP socket per RX
      queue/thread/cpu
      
      3) Some UDP sockets are used to send/receive traffic for one flow, but
      they do not bother with connect()
      
      This patch records the napi_id of first received skb, giving more
      reach to busy polling.
      
      Tested:
      
      lpaa23:~# echo 70 >/proc/sys/net/core/busy_read
      lpaa24:~# echo 70 >/proc/sys/net/core/busy_read
      
      lpaa23:~# for f in `seq 1 10`; do ./super_netperf 1 -H lpaa24 -t UDP_RR -l 5; done
      
      Before patch :
         27867   28870   37324   41060   41215
         36764   36838   44455   41282   43843
      After patch :
         73920   73213   70147   74845   71697
         68315   68028   75219   70082   73707
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e68b6e50
  2. 17 Nov, 2016 22 commits
  3. 16 Nov, 2016 7 commits