12 Jun, 2013

1 commit

  • We currently allow for numa-node aware skb allocation only within the
    fill_packet_ipv4() path, but not in fill_packet_ipv6(). Consolidate that
    code to a common allocation helper to enable numa-node aware skb
    allocation for ipv6, and use it in both paths. This also makes both
    functions a bit more readable.

    Signed-off-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

05 Jun, 2013

1 commit

  • skb_set_network_header() expects an offset based on the data pointer
    whereas skb_tail_offset() also includes the headroom. This resulted
    in the ip header being written in a wrong location.

    Use return values of skb_put() directly and rely on skb->len to
    set mac, network, and transport header.

    Cc: Simon Horman
    Cc: Daniel Borkmann
    Assisted-by: Daniel Borkmann
    Signed-off-by: Thomas Graf
    Acked-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    Thomas Graf
     

29 May, 2013

2 commits

  • This corrects an regression introduced by "net: Use 16bits for *_headers
    fields of struct skbuff" when NET_SKBUFF_DATA_USES_OFFSET is not set. In
    that case skb->tail will be a pointer however skb->network_header is now
    an offset.

    This patch corrects the problem by adding a wrapper to return skb tail as
    an offset regardless of the value of NET_SKBUFF_DATA_USES_OFFSET. It seems
    that skb->tail that this offset may be more than 64k and some care has been
    taken to treat such cases as an error.

    Signed-off-by: Simon Horman
    Signed-off-by: David S. Miller

    Simon Horman
     
  • So far, only net_device * could be passed along with netdevice notifier
    event. This patch provides a possibility to pass custom structure
    able to provide info that event listener needs to know.

    Signed-off-by: Jiri Pirko

    v2->v3: fix typo on simeth
    shortened dev_getter
    shortened notifier_info struct name
    v1->v2: fix notifier_call parameter in call_netdevice_notifier()
    Signed-off-by: David S. Miller

    Jiri Pirko
     

02 May, 2013

2 commits

  • Pull VFS updates from Al Viro,

    Misc cleanups all over the place, mainly wrt /proc interfaces (switch
    create_proc_entry to proc_create(), get rid of the deprecated
    create_proc_read_entry() in favor of using proc_create_data() and
    seq_file etc).

    7kloc removed.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits)
    don't bother with deferred freeing of fdtables
    proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h
    proc: Make the PROC_I() and PDE() macros internal to procfs
    proc: Supply a function to remove a proc entry by PDE
    take cgroup_open() and cpuset_open() to fs/proc/base.c
    ppc: Clean up scanlog
    ppc: Clean up rtas_flash driver somewhat
    hostap: proc: Use remove_proc_subtree()
    drm: proc: Use remove_proc_subtree()
    drm: proc: Use minor->index to label things, not PDE->name
    drm: Constify drm_proc_list[]
    zoran: Don't print proc_dir_entry data in debug
    reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show()
    proc: Supply an accessor for getting the data from a PDE's parent
    airo: Use remove_proc_subtree()
    rtl8192u: Don't need to save device proc dir PDE
    rtl8187se: Use a dir under /proc/net/r8180/
    proc: Add proc_mkdir_data()
    proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h}
    proc: Move PDE_NET() to fs/proc/proc_net.c
    ...

    Linus Torvalds
     
  • Supply a function (proc_remove()) to remove a proc entry (and any subtree
    rooted there) by proc_dir_entry pointer rather than by name and (optionally)
    root dir entry pointer. This allows us to eliminate all remaining pde->name
    accesses outside of procfs.

    Signed-off-by: David Howells
    Acked-by: Grant Likely
    cc: linux-acpi@vger.kernel.org
    cc: openipmi-developer@lists.sourceforge.net
    cc: devicetree-discuss@lists.ozlabs.org
    cc: linux-pci@vger.kernel.org
    cc: netdev@vger.kernel.org
    cc: netfilter-devel@vger.kernel.org
    cc: alsa-devel@alsa-project.org
    Signed-off-by: Al Viro

    David Howells
     

30 Apr, 2013

2 commits


10 Apr, 2013

1 commit

  • The only part of proc_dir_entry the code outside of fs/proc
    really cares about is PDE(inode)->data. Provide a helper
    for that; static inline for now, eventually will be moved
    to fs/proc, along with the knowledge of struct proc_dir_entry
    layout.

    Signed-off-by: Al Viro

    Al Viro
     

19 Feb, 2013

1 commit

  • proc_net_remove is only used to remove proc entries
    that under /proc/net,it's not a general function for
    removing proc entries of netns. if we want to remove
    some proc entries which under /proc/net/stat/, we still
    need to call remove_proc_entry.

    this patch use remove_proc_entry to replace proc_net_remove.
    we can remove proc_net_remove after this patch.

    Signed-off-by: Gao feng
    Signed-off-by: David S. Miller

    Gao feng
     

06 Feb, 2013

1 commit

  • Conflicts:
    drivers/net/ethernet/intel/e1000e/ethtool.c
    drivers/net/vmxnet3/vmxnet3_drv.c
    drivers/net/wireless/iwlwifi/dvm/tx.c
    net/ipv6/route.c

    The ipv6 route.c conflict is simple, just ignore the 'net' side change
    as we fixed the same problem in 'net-next' by eliminating cached
    neighbours from ipv6 routes.

    The e1000e conflict is an addition of a new statistic in the ethtool
    code, trivial.

    The vmxnet3 conflict is about one change in 'net' removing a guarding
    conditional, whilst in 'net-next' we had a netdev_info() conversion.

    The iwlwifi conflict is dealing with a WARN_ON() conversion in
    'net-next' vs. a revert happening in 'net'.

    Signed-off-by: David S. Miller

    David S. Miller
     

30 Jan, 2013

2 commits

  • The return value of pktgen_add_device() is not checked, so
    even if we fail to add some device, for example, non-exist one,
    we still see "OK:...". This patch fixes it.

    After this patch, I got:

    # echo "add_device non-exist" > /proc/net/pktgen/kpktgend_0
    -bash: echo: write error: No such device
    # cat /proc/net/pktgen/kpktgend_0
    Running:
    Stopped:
    Result: ERROR: can not add device non-exist
    # echo "add_device eth0" > /proc/net/pktgen/kpktgend_0
    # cat /proc/net/pktgen/kpktgend_0
    Running:
    Stopped: eth0
    Result: OK: add_device=eth0

    (Candidate for -stable)

    Cc: David S. Miller
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     
  • v3: make pktgen_threads list per-namespace
    v2: remove a useless check

    This patch add net namespace to pktgen, so that
    we can use pktgen in different namespaces.

    Cc: Eric W. Biederman
    Cc: David S. Miller
    Signed-off-by: Cong Wang
    Acked-by: "Eric W. Biederman"
    Signed-off-by: David S. Miller

    Cong Wang
     

04 Nov, 2012

1 commit

  • Some years ago, the ktime_t helper functions ktime_now() and ktime_lt()
    have been introduced. Instead of defining them inside pktgen.c, they
    should either use ktime_t library functions or, if not available, they
    should be defined in ktime.h, so that also others can benefit from them.
    ktime_compare() is introduced with a similar notion as in timespec_compare().

    Signed-off-by: Daniel Borkmann
    Cc: Cong Wang
    Cc: Stephen Hemminger
    Cc: Thomas Gleixner
    Acked-by: Thomas Gleixner
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

22 Oct, 2012

1 commit


11 Oct, 2012

5 commits


14 Sep, 2012

1 commit

  • If vlan option is being specified in the pktgen and packet size
    being requested is less than 46 bytes, despite being illogical
    request, pktgen should not crash the kernel.

    BUG: unable to handle kernel paging request at ffff88021fb82000
    Process kpktgend_0 (pid: 1184, threadinfo ffff880215f1a000, task ffff880218544530)
    Call Trace:
    [] ? pktgen_finalize_skb+0x222/0x300 [pktgen]
    [] ? build_skb+0x34/0x1c0
    [] pktgen_thread_worker+0x5d1/0x1790 [pktgen]
    [] ? igb_xmit_frame_ring+0xa30/0xa30 [igb]
    [] ? wake_up_bit+0x40/0x40
    [] ? wake_up_bit+0x40/0x40
    [] ? spin+0x240/0x240 [pktgen]
    [] kthread+0x93/0xa0
    [] kernel_thread_helper+0x4/0x10
    [] ? flush_kthread_worker+0x80/0x80
    [] ? gs_change+0x13/0x13

    The root cause of why pktgen is not able to handle this case is due
    to comparison of signed (datalen) and unsigned data (sizeof), which
    eventually passes a huge number to skb_put().

    Signed-off-by: Nishank Trivedi
    Signed-off-by: David S. Miller

    Nishank Trivedi
     

21 May, 2012

1 commit


19 May, 2012

1 commit

  • commit c57b5468406 (pktgen: fix crash at module unload) did a very poor
    job with list primitives.

    1) list_splice() arguments were in the wrong order

    2) list_splice(list, head) has undefined behavior if head is not
    initialized.

    3) We should use the list_splice_init() variant to clear pktgen_threads
    list.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

17 May, 2012

2 commits


16 May, 2012

1 commit


11 May, 2012

1 commit

  • commit 7d3d43dab4e9 (net: In unregister_netdevice_notifier unregister
    the netdevices.) makes pktgen crashing at module unload.

    [ 296.820578] BUG: spinlock bad magic on CPU#6, rmmod/3267
    [ 296.820719] lock: ffff880310c38000, .magic: ffff8803, .owner: /-1, .owner_cpu: -1
    [ 296.820943] Pid: 3267, comm: rmmod Not tainted 3.4.0-rc5+ #254
    [ 296.821079] Call Trace:
    [ 296.821211] [] spin_dump+0x8a/0x8f
    [ 296.821345] [] spin_bug+0x21/0x26
    [ 296.821507] [] do_raw_spin_lock+0x131/0x140
    [ 296.821648] [] _raw_spin_lock+0x1e/0x20
    [ 296.821786] [] __pktgen_NN_threads+0x4d/0x140 [pktgen]
    [ 296.821928] [] pktgen_device_event+0x10d/0x1e0 [pktgen]
    [ 296.822073] [] unregister_netdevice_notifier+0x7f/0x100
    [ 296.822216] [] pg_cleanup+0x48/0x73 [pktgen]
    [ 296.822357] [] sys_delete_module+0x17e/0x2a0
    [ 296.822502] [] system_call_fastpath+0x16/0x1b

    Hold the pktgen_thread_lock while splicing pktgen_threads, and test
    pktgen_exiting in pktgen_device_event() to make unload faster.

    Signed-off-by: Eric Dumazet
    Cc: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric Dumazet
     

16 Apr, 2012

1 commit


23 Jan, 2012

1 commit


08 Jan, 2012

1 commit

  • In 882716604ec "pktgen: fix multiple queue warning" we added special
    logic to handle the case where ntxq is zero. It's not clear to me that
    ntxq can actually be zero. But if it were then we would set
    ->queue_map_min and ->queue_map_max to USHRT_MAX when probably we want
    to set them to zero?

    Signed-off-by: David S. Miller

    Dan Carpenter
     

30 Nov, 2011

1 commit

  • Create separate queue state flags so that either the stack or drivers
    can turn on XOFF. Added a set of functions used in the stack to determine
    if a queue is really stopped (either by stack or driver)

    Signed-off-by: Tom Herbert
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Tom Herbert
     

23 Nov, 2011

1 commit


21 Oct, 2011

1 commit

  • Daniel Turull reported inaccuracies in pktgen when using low packet
    rates, because we call ndelay(val) with values bigger than 20000.

    Instead of calling ndelay() for delays < 100us, we can instead loop
    calling ktime_now() only.

    Reported-by: Daniel Turull
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

20 Oct, 2011

1 commit

  • I audited all of the callers in the tree and only one of them (pktgen) expects
    it to do so. Taking this reference is pretty obviously confusing and error
    prone.

    In particular I looked at the following commits which switched callers of
    (__)skb_frag_set_page to the skb paged fragment api:

    6a930b9f163d7e6d9ef692e05616c4ede65038ec cxgb3: convert to SKB paged frag API.
    5dc3e196ea21e833128d51eb5b788a070fea1f28 myri10ge: convert to SKB paged frag API.
    0e0634d20dd670a89af19af2a686a6cce943ac14 vmxnet3: convert to SKB paged frag API.
    86ee8130a46769f73f8f423f99dbf782a09f9233 virtionet: convert to SKB paged frag API.
    4a22c4c919c201c2a7f4ee09e672435a3072d875 sfc: convert to SKB paged frag API.
    18324d690d6a5028e3c174fc1921447aedead2b8 cassini: convert to SKB paged frag API.
    b061b39e3ae18ad75466258cf2116e18fa5bbd80 benet: convert to SKB paged frag API.
    b7b6a688d217936459ff5cf1087b2361db952509 bnx2: convert to SKB paged frag API.
    804cf14ea5ceca46554d5801e2817bba8116b7e5 net: xfrm: convert to SKB frag APIs
    ea2ab69379a941c6f8884e290fdd28c93936a778 net: convert core to skb paged frag APIs

    Signed-off-by: Ian Campbell
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Ian Campbell
     

19 Oct, 2011

1 commit

  • To ease skb->truesize sanitization, its better to be able to localize
    all references to skb frags size.

    Define accessors : skb_frag_size() to fetch frag size, and
    skb_frag_size_{set|add|sub}() to manipulate it.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

25 Aug, 2011

1 commit


28 Jul, 2011

1 commit

  • Pktgen attempts to transmit shared skbs to net devices, which can't be used by
    some drivers as they keep state information in skbs. This patch adds a flag
    marking drivers as being able to handle shared skbs in their tx path. Drivers
    are defaulted to being unable to do so, but calling ether_setup enables this
    flag, as 90% of the drivers calling ether_setup touch real hardware and can
    handle shared skbs. A subsequent patch will audit drivers to ensure that the
    flag is set properly

    Signed-off-by: Neil Horman
    Reported-by: Jiri Pirko
    CC: Robert Olsson
    CC: Eric Dumazet
    CC: Alexey Dobriyan
    CC: David S. Miller
    Signed-off-by: David S. Miller

    Neil Horman
     

23 May, 2011

2 commits


21 May, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1446 commits)
    macvlan: fix panic if lowerdev in a bond
    tg3: Add braces around 5906 workaround.
    tg3: Fix NETIF_F_LOOPBACK error
    macvlan: remove one synchronize_rcu() call
    networking: NET_CLS_ROUTE4 depends on INET
    irda: Fix error propagation in ircomm_lmp_connect_response()
    irda: Kill set but unused variable 'bytes' in irlan_check_command_param()
    irda: Kill set but unused variable 'clen' in ircomm_connect_indication()
    rxrpc: Fix set but unused variable 'usage' in rxrpc_get_transport()
    be2net: Kill set but unused variable 'req' in lancer_fw_download()
    irda: Kill set but unused vars 'saddr' and 'daddr' in irlan_provider_connect_indication()
    atl1c: atl1c_resume() is only used when CONFIG_PM_SLEEP is defined.
    rxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer().
    rxrpc: Kill set but unused variable 'local' in rxrpc_UDP_error_handler()
    rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection()
    rxrpc: Kill set but unused variable 'sp' in rxrpc_rotate_tx_window()
    pkt_sched: Kill set but unused variable 'protocol' in tc_classify()
    isdn: capi: Use pr_debug() instead of ifdefs.
    tg3: Update version to 3.119
    tg3: Apply rx_discards fix to 5719/5720
    ...

    Fix up trivial conflicts in arch/x86/Kconfig and net/mac80211/agg-tx.c
    as per Davem.

    Linus Torvalds