1. 01 Dec, 2012 24 commits
  2. 30 Nov, 2012 16 commits
    • Eric Dumazet's avatar
      net: move inet_dport/inet_num in sock_common · ce43b03e
      Eric Dumazet authored
      commit 68835aba (net: optimize INET input path further)
      moved some fields used for tcp/udp sockets lookup in the first cache
      line of struct sock_common.
      
      This patch moves inet_dport/inet_num as well, filling a 32bit hole
      on 64 bit arches and reducing number of cache line misses in lookups.
      
      Also change INET_MATCH()/INET_TW_MATCH() to perform the ports match
      before addresses match, as this check is more discriminant.
      
      Remove the hash check from MATCH() macros because we dont need to
      re validate the hash value after taking a refcount on socket, and
      use likely/unlikely compiler hints, as the sk_hash/hash check
      makes the following conditional tests 100% predicted by cpu.
      
      Introduce skc_addrpair/skc_portpair pair values to better
      document the alignment requirements of the port/addr pairs
      used in the various MATCH() macros, and remove some casts.
      
      The namespace check can also be done at last.
      
      This slightly improves TCP/UDP lookup times.
      
      IP/TCP early demux needs inet->rx_dst_ifindex and
      TCP needs inet->min_ttl, lets group them together in same cache line.
      
      With help from Ben Hutchings & Joe Perches.
      
      Idea of this patch came after Ling Ma proposal to move skc_hash
      to the beginning of struct sock_common, and should allow him
      to submit a final version of his patch. My tests show an improvement
      doing so.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Ben Hutchings <bhutchings@solarflare.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Ling Ma <ling.ma.program@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ce43b03e
    • Haiyang Zhang's avatar
      hyperv: Add an error message to rndis_filter_set_device_mac() · b02a8067
      Haiyang Zhang authored
      This message indicates an error returned from the host when changing MAC address.
      Reported-by: default avatarMichal Kubecek <mkubecek@suse.com>
      Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
      Reviewed-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b02a8067
    • Andrew Gallatin's avatar
      myri10ge: Add vlan rx for better GRO perf. · 1b4c44e6
      Andrew Gallatin authored
      Unlike LRO, GRO requires that vlan tags be removed before
      aggregation can occur.  Since the myri10ge NIC does not support
      hardware vlan tag offload, we must remove the tag in the driver
      to achieve performance comparable to LRO for vlan tagged frames.
      
      Thanks to Eric Duzamet for his help simplifying the original patch.
      Signed-off-by: default avatarAndrew Gallatin <gallatin@myri.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1b4c44e6
    • Andrew Gallatin's avatar
      myri10ge: Convert from LRO to GRO · 4ca3221f
      Andrew Gallatin authored
      Convert myri10ge from LRO to GRO, and simplify the driver by removing
      various LRO-related code which is no longer needed including
      ndo_fix_features op, custom skb building from frags, and LRO
      header parsing.
      Signed-off-by: default avatarAndrew Gallatin <gallatin@myri.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ca3221f
    • Jiri Slaby's avatar
      MAINTAINERS: fix bouncing tun/tap entries · ba57b6f2
      Jiri Slaby authored
      Delivery to the following recipient failed permanently:
      
           vtun@office.satix.net
      
      Technical details of permanent failure:
      DNS Error: Domain name not found
      
      Of course:
      $ host office.satix.net
      Host office.satix.net not found: 3(NXDOMAIN)
      
      ===========
      
      And "Change of Email Address Notification":
      Old Address        New Address           Email Subject
      ------------------------------------------------------
      maxk@qualcomm.com  maxk@qti.qualcomm.com "tuntap: multiqueue...
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Maxim Krasnyansky <maxk@qti.qualcomm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ba57b6f2
    • Steve Glendinning's avatar
      smsc95xx: expand check_ macros · b052e073
      Steve Glendinning authored
      These macros, while reducing the amount of code, hide flow control
      and make the code more confusing to follow and review.  This patch
      expands them.  It should have no functional effect on the driver.
      Signed-off-by: default avatarSteve Glendinning <steve.glendinning@shawell.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b052e073
    • Steve Glendinning's avatar
      smsc95xx: fix smsc_crc return type · 068bb1a7
      Steve Glendinning authored
      This patch fixes a bug introduced in bbd9f9ee which could prevent
      some wakeups from working correctly if multiple wol options were
      selected.
      
      This helper function calculates a 16-bit crc and shifts it into
      either the high or low 16 bits of a u32 so the caller can or it
      directly into place.  The function previously had a u16 return
      type so would always have returned zero when filter was odd.
      Signed-off-by: default avatarSteve Glendinning <steve.glendinning@shawell.net>
      Reported-by: default avatarBjorn Mork <bjorn@mork.no>
      Cc: Joe Perches <joe@perches.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      068bb1a7
    • Steve Glendinning's avatar
      smsc95xx: don't enable remote wakeup directly · 3b14692c
      Steve Glendinning authored
      As pointed out by Bjorn Mork, the generic "usb" driver sets this
      for us so no need to directly set it in this driver.
      Signed-off-by: default avatarSteve Glendinning <steve.glendinning@shawell.net>
      Cc: Bjorn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b14692c
    • Steve Glendinning's avatar
      smsc95xx: fix error handling in suspend failure case · 3b9f7d8c
      Steve Glendinning authored
      This patch ensures that if we fail to suspend the LAN9500 device
      we call usbnet_resume before returning failure, instead of
      leaving the usbnet driver in an unusable state.
      Signed-off-by: default avatarSteve Glendinning <steve.glendinning@shawell.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b9f7d8c
    • Steve Glendinning's avatar
      smsc95xx: fix suspend buffer overflow · eed9a729
      Steve Glendinning authored
      This patch fixes a buffer overflow introduced by bbd9f9ee, where
      the filter_mask array is accessed beyond its bounds.
      
      Updated to also add a check for kzalloc failure, as reported by
      Bjorn Mork and Joe Perches.
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarSteve Glendinning <steve.glendinning@shawell.net>
      Cc: Bjorn Mork <bjorn@mork.no>
      Cc: Joe Perches <joe@perches.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eed9a729
    • Steve Glendinning's avatar
      smsc75xx: expand check_ macros · e3c678e6
      Steve Glendinning authored
      These macros, while reducing the amount of code, hide flow control
      and make the code more confusing to follow and review.  This patch
      expands them.  It should have no functional effect on the driver.
      Signed-off-by: default avatarSteve Glendinning <steve.glendinning@shawell.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e3c678e6
    • Steve Glendinning's avatar
      smsc75xx: don't call usbnet_resume if usbnet_suspend fails · 2305c54f
      Steve Glendinning authored
      If usbnet_suspend returns an error we don't want to call
      usbnet_resume to clean up, but instead just return the error.
      
      If usbnet_suspend *does* succeed, and we have a problem further
      on, the desired behaviour is still to call usbnet_resume
      to clean up before returning.
      Signed-off-by: default avatarSteve Glendinning <steve.glendinning@shawell.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2305c54f
    • Thomas Graf's avatar
      sctp: verify length provided in heartbeat information parameter · 06a31e2b
      Thomas Graf authored
      If the variable parameter length provided in the mandatory
      heartbeat information parameter exceeds the calculated payload
      length the packet has been corrupted. Reply with a parameter
      length protocol violation message.
      Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06a31e2b
    • Rami Rosen's avatar
      rtnelink: remove unused parameter from rtnl_create_link(). · c0713563
      Rami Rosen authored
      This patch removes an unused parameter (src_net) from rtnl_create_link()
      method and from the method single invocation, in veth.
      This parameter was used in the past when calling
      ops->get_tx_queues(src_net, tb) in rtnl_create_link().
      The get_tx_queues() member of rtnl_link_ops was replaced by two methods,
      get_num_tx_queues() and get_num_rx_queues(), which do not get any
      parameter. This was done in commit d40156aa by
      Jiri Pirko ("rtnl: allow to specify different num for rx and tx queue count").
      Signed-off-by: default avatarRami Rosen <ramirose@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c0713563
    • David S. Miller's avatar
      Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge · dad52fd9
      David S. Miller authored
      Included changes:
      - Use the new ETH_P_BATMAN define instead of the private BATADV_ETH_P_BATMAN
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dad52fd9
    • Tommi Rantala's avatar
      sctp: fix CONFIG_SCTP_DBG_MSG=y null pointer dereference in sctp_v6_get_dst() · ee3f34e8
      Tommi Rantala authored
      Trinity (the syscall fuzzer) triggered the following BUG, reproducible
      only when the kernel is configured with CONFIG_SCTP_DBG_MSG=y.
      
      When CONFIG_SCTP_DBG_MSG is not set, the null pointer is never
      dereferenced.
      
      ---[ end trace a4de0bfcb38a3642 ]---
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000100
      IP: [<ffffffff8136796e>] ip6_string+0x1e/0xa0
      PGD 4eead067 PUD 4e472067 PMD 0
      Oops: 0000 [#1] PREEMPT SMP
      Modules linked in:
      CPU 3
      Pid: 21324, comm: trinity-child11 Tainted: G        W    3.7.0-rc7+ #61 ASUSTeK Computer INC. EB1012/EB1012
      RIP: 0010:[<ffffffff8136796e>]  [<ffffffff8136796e>] ip6_string+0x1e/0xa0
      RSP: 0018:ffff88004e4637a0  EFLAGS: 00010046
      RAX: ffff88004e4637da RBX: ffff88004e4637da RCX: 0000000000000000
      RDX: ffffffff8246e92a RSI: 0000000000000100 RDI: ffff88004e4637da
      RBP: ffff88004e4637a8 R08: 000000000000ffff R09: 000000000000ffff
      R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff8289d600
      R13: ffffffff8289d230 R14: ffffffff8246e928 R15: ffffffff8289d600
      FS:  00007fed95153700(0000) GS:ffff88005fd80000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000100 CR3: 000000004eeac000 CR4: 00000000000007e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process trinity-child11 (pid: 21324, threadinfo ffff88004e462000, task ffff8800524b0000)
      Stack:
       ffff88004e4637da ffff88004e463828 ffffffff81368eee 000000004e4637d8
       ffffffff0000ffff ffff88000000ffff 0000000000000000 000000004e4637f8
       ffffffff826285d8 ffff88004e4637f8 0000000000000000 ffff8800524b06b0
      Call Trace:
       [<ffffffff81368eee>] ip6_addr_string.isra.11+0x3e/0xa0
       [<ffffffff81369183>] pointer.isra.12+0x233/0x2d0
       [<ffffffff810a413a>] ? vprintk_emit+0x1ba/0x450
       [<ffffffff8110953d>] ? trace_hardirqs_on_caller+0x10d/0x1a0
       [<ffffffff81369757>] vsnprintf+0x187/0x5d0
       [<ffffffff81369c62>] vscnprintf+0x12/0x30
       [<ffffffff810a4028>] vprintk_emit+0xa8/0x450
       [<ffffffff81e5cb00>] printk+0x49/0x4b
       [<ffffffff81d17221>] sctp_v6_get_dst+0x731/0x780
       [<ffffffff81d16e15>] ? sctp_v6_get_dst+0x325/0x780
       [<ffffffff81d00a96>] sctp_transport_route+0x46/0x120
       [<ffffffff81cff0f1>] sctp_assoc_add_peer+0x161/0x350
       [<ffffffff81d0fd8d>] sctp_sendmsg+0x6cd/0xcb0
       [<ffffffff81b55bf0>] ? inet_create+0x670/0x670
       [<ffffffff81b55cfb>] inet_sendmsg+0x10b/0x220
       [<ffffffff81b55bf0>] ? inet_create+0x670/0x670
       [<ffffffff81a72a64>] ? sock_update_classid+0xa4/0x2b0
       [<ffffffff81a72ab0>] ? sock_update_classid+0xf0/0x2b0
       [<ffffffff81a6ac1c>] sock_sendmsg+0xdc/0xf0
       [<ffffffff8118e9e5>] ? might_fault+0x85/0x90
       [<ffffffff8118e99c>] ? might_fault+0x3c/0x90
       [<ffffffff81a6e12a>] sys_sendto+0xfa/0x130
       [<ffffffff810a9887>] ? do_setitimer+0x197/0x380
       [<ffffffff81e960d5>] ? sysret_check+0x22/0x5d
       [<ffffffff81e960a9>] system_call_fastpath+0x16/0x1b
      Code: 01 eb 89 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 f8 31 c9 48 89 e5 53 eb 12 0f 1f 40 00 48 83 c1 01 48 83 c0 04 48 83 f9 08 74 70 <0f> b6 3c 4e 89 fb 83 e7 0f c0 eb 04 41 89 d8 41 83 e0 0f 0f b6
      RIP  [<ffffffff8136796e>] ip6_string+0x1e/0xa0
       RSP <ffff88004e4637a0>
      CR2: 0000000000000100
      ---[ end trace a4de0bfcb38a3643 ]---
      Signed-off-by: default avatarTommi Rantala <tt.rantala@gmail.com>
      Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ee3f34e8