1. 01 4月, 2013 1 次提交
    • K
      net: add option to enable error queue packets waking select · 7d4c04fc
      Keller, Jacob E 提交于
      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: NJacob 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: NDavid S. Miller <davem@davemloft.net>
      7d4c04fc
  2. 31 3月, 2013 5 次提交
    • D
      doc: packet: add minimal TPACKET_V3 example code · 4eb06148
      Daniel Borkmann 提交于
      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: NDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4eb06148
    • E
      macvlan: use the right RCU api · e052f7e6
      Eric Dumazet 提交于
      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: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e052f7e6
    • E
      net: reorder some fields of net_device · 4c3d5e7b
      Eric Dumazet 提交于
      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: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4c3d5e7b
    • D
      cdc_ncm: return -ENOMEM if kzalloc fails · 8f0923c1
      Devendra Naga 提交于
      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: NDevendra Naga <devendra.aaru@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8f0923c1
    • A
      ip_gre: don't overwrite iflink during net_dev init · 537aadc3
      Antonio Quartulli 提交于
      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: NFengguang Wu <fengguang.wu@intel.com>
      Cc: Pravin B Shelar <pshelar@nicira.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NAntonio Quartulli <ordex@autistici.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      537aadc3
  3. 30 3月, 2013 15 次提交
  4. 29 3月, 2013 13 次提交
  5. 28 3月, 2013 6 次提交