1. 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
  2. 29 Mar, 2013 14 commits
  3. 28 Mar, 2013 20 commits