1. 31 Mar, 2013 1 commit
    • Keller, Jacob E's avatar
      net: add option to enable error queue packets waking select · 7d4c04fc
      Keller, Jacob E authored
      Currently, when a socket receives something on the error queue it only wakes up
      the socket on select if it is in the "read" list, that is the socket has
      something to read. It is useful also to wake the socket if it is in the error
      list, which would enable software to wait on error queue packets without waking
      up for regular data on the socket. The main use case is for receiving
      timestamped transmit packets which return the timestamp to the socket via the
      error queue. This enables an application to select on the socket for the error
      queue only instead of for the regular traffic.
      
      -v2-
      * Added the SO_SELECT_ERR_QUEUE socket option to every architechture specific file
      * Modified every socket poll function that checks error queue
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Cc: Jeffrey Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Matthew Vick <matthew.vick@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d4c04fc
  2. 30 Mar, 2013 6 commits
    • Daniel Borkmann's avatar
      doc: packet: add minimal TPACKET_V3 example code · 4eb06148
      Daniel Borkmann authored
      Lost in space for a long time, but it finally came back to us from
      some ancient code tombs. This patch adds a minimal runnable example
      of Linux' packet mmap(2) from Chetan Loke's TPACKET_V3. Special
      thanks to David S. Miller, and also Eric Leblond and Victor Julien!
      
      Cc: Eric Leblond <eric@regit.org>
      Cc: Victor Julien <victor@inliniac.net>
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4eb06148
    • Eric Dumazet's avatar
      macvlan: use the right RCU api · e052f7e6
      Eric Dumazet authored
      Make sure we use proper API to fetch dev->rx_handler_data,
      instead of ugly casts.
      
      Rename macvlan_port_get() to macvlan_port_get_rtnl() to document fact
      that we hold RTNL when needed, with lockdep support.
      
      This removes sparse warnings as well (CONFIG_SPARSE_RCU_POINTER=y)
      
      CHECK   drivers/net/macvlan.c
      drivers/net/macvlan.c:706:37: warning: cast removes address space of expression
      drivers/net/macvlan.c:775:16: warning: cast removes address space of expression
      drivers/net/macvlan.c:924:16: warning: cast removes address space of expression
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e052f7e6
    • Eric Dumazet's avatar
      net: reorder some fields of net_device · 4c3d5e7b
      Eric Dumazet authored
      As time passed, some fields were added in net_device, and not
      at sensible offsets.
      
      Lets reorder some fields to reduce number of cache lines in RX path.
      Fields not used in data path should be moved out of this critical cache
      line.
      
      In particular, move broadcast[] to the end of the rx section,
      as it is less used, and ethernet uses only the beginning of the 32bytes
      field.
      
      Before patch :
      
      offsetof(struct net_device,dev_addr)=0x258
      offsetof(struct net_device,rx_handler)=0x2b8
      offsetof(struct net_device,ingress_queue)=0x2c8
      offsetof(struct net_device,broadcast)=0x278
      
      After :
      
      offsetof(struct net_device,dev_addr)=0x280
      offsetof(struct net_device,rx_handler)=0x298
      offsetof(struct net_device,ingress_queue)=0x2a8
      offsetof(struct net_device,broadcast)=0x2b0
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4c3d5e7b
    • Devendra Naga's avatar
      cdc_ncm: return -ENOMEM if kzalloc fails · 8f0923c1
      Devendra Naga authored
      return -ENOMEM instead if kzalloc of cdc_ncm_ctx structure is failed.
      
      and also remove the comparision of ctx structure with NULL and make
      it as !ctx.
      Signed-off-by: default avatarDevendra Naga <devendra.aaru@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8f0923c1
    • Antonio Quartulli's avatar
      ip_gre: don't overwrite iflink during net_dev init · 537aadc3
      Antonio Quartulli authored
      iflink is currently set to 0 in __gre_tunnel_init(). This
      function is invoked in gre_tap_init() and
      ipgre_tunnel_init() which are both used to initialise the
      ndo_init field of the respective net_device_ops structs
      (ipgre.. and gre_tap..) used by GRE interfaces.
      
      However, in netdevice_register() iflink is first set to -1,
      then ndo_init is invoked and then iflink is assigned to a
      proper value if and only if it still was -1.
      
      Assigning 0 to iflink in ndo_init is therefore first
      preventing netdev_register() to correctly assign it a proper
      value and then breaking iflink at all since 0 has not
      correct meaning.
      
      Fix this by removing the iflink assignment in
      __gre_tunnel_init().
      
      Introduced by c5441932
      ("GRE: Refactor GRE tunneling code.")
      Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Cc: Pravin B Shelar <pshelar@nicira.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarAntonio Quartulli <ordex@autistici.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      537aadc3
    • Chen Gang's avatar
      include/linux: printk is needed in filter.h when CONFIG_BPF_JIT is defined · a691ce7f
      Chen Gang authored
      for make V=1 EXTRA_CFLAGS=-W ARCH=arm allmodconfig
          printk is need when CONFIG_BPF_JIT is defined
          or it will report pr_err and print_hex_dump are implicit declaration
      Signed-off-by: default avatarChen Gang <gang.chen@asianux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a691ce7f
  3. 29 Mar, 2013 14 commits
  4. 28 Mar, 2013 19 commits