01 Nov, 2011

1 commit


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
     

23 Apr, 2011

1 commit


29 Nov, 2010

1 commit

  • jhash is widely used in the kernel and because the functions
    are inlined, the cost in size is significant. Also, the new jhash
    functions are slightly larger than the previous ones so better un-inline.
    As a preparation step, the calls to the internal macros are replaced
    with the plain jhash function calls.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: David S. Miller

    Jozsef Kadlecsik
     

09 Nov, 2010

1 commit

  • The type of FRAG6_CB(prev)->offset is int, skb->len is *unsigned* int,
    and offset is int.

    Without this patch, type conversion occurred to this expression, when
    (FRAG6_CB(prev)->offset + prev->len) is less than offset.

    Signed-off-by: Shan Wei
    Signed-off-by: David S. Miller

    Shan Wei
     

10 Sep, 2010

1 commit


08 Sep, 2010

1 commit


23 Aug, 2010

1 commit

  • SKBs can be "fragmented" in two ways, via a page array (called
    skb_shinfo(skb)->frags[]) and via a list of SKBs (called
    skb_shinfo(skb)->frag_list).

    Since skb_has_frags() tests the latter, it's name is confusing
    since it sounds more like it's testing the former.

    Signed-off-by: David S. Miller

    David S. Miller
     

01 Jul, 2010

1 commit

  • add fast path for in-order fragments

    As the fragments are sent in order in most of OSes, such as Windows, Darwin and
    FreeBSD, it is likely the new fragments are at the end of the inet_frag_queue.
    In the fast path, we check if the skb at the end of the inet_frag_queue is the
    prev we expect.

    Signed-off-by: Changli Gao
    ----
    include/net/inet_frag.h | 1 +
    net/ipv4/ip_fragment.c | 12 ++++++++++++
    net/ipv6/reassembly.c | 11 +++++++++++
    3 files changed, 24 insertions(+)
    Signed-off-by: David S. Miller

    Changli Gao
     

16 Jun, 2010

2 commits


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

19 Feb, 2010

1 commit


17 Feb, 2010

1 commit


16 Feb, 2010

1 commit

  • When no more memory can be allocated, fq_find() will return NULL and
    increase the value of IPSTATS_MIB_REASMFAILS. In this case,
    ipv6_frag_rcv() also increase the value of IPSTATS_MIB_REASMFAILS.

    So, the patch deletes redundant counter of IPSTATS_MIB_REASMFAILS in fq_find().
    and deletes the unused parameter of idev.

    Signed-off-by: Shan Wei
    Signed-off-by: David S. Miller

    Shan Wei
     

10 Feb, 2010

1 commit


20 Jan, 2010

1 commit


18 Jan, 2010

1 commit


19 Dec, 2009

1 commit

  • When I do an ipv6 module force unload,I got the following oops:
    #rmmod -f ipv6
    ------------[ cut here ]------------
    kernel BUG at mm/slub.c:2969!
    invalid opcode: 0000 [#1] SMP
    last sysfs file: /sys/devices/pci0000:00/0000:00:11.0/0000:02:03.0/net/eth2/ifindex
    Modules linked in: ipv6(-) dm_multipath uinput ppdev tpm_tis tpm tpm_bios pcspkr pcnet32 mii parport_pc i2c_piix4 parport i2c_core floppy mptspi mptscsih mptbase scsi_transport_spi

    Pid: 2530, comm: rmmod Tainted: G R 2.6.32 #2 440BX Desktop Reference Platform/VMware Virtual Platform
    EIP: 0060:[] EFLAGS: 00010246 CPU: 0
    EIP is at kfree+0x6a/0xdd
    EAX: 00000000 EBX: c09e86bc ECX: c043e4dd EDX: c14293e0
    ESI: e141f1d8 EDI: e140fc31 EBP: dec58ef0 ESP: dec58ed0
    DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    Process rmmod (pid: 2530, ti=dec58000 task=decb1940 task.ti=dec58000)
    Stack:
    c14293e0 00000282 df624240 c0897d08 c09e86bc c09e86bc e141f1d8 dec58f1c
    dec58f00 e140fc31 c09e84c4 e141f1bc dec58f14 c0689d21 dec58f1c e141f1bc
    00000000 dec58f2c c0689eff c09e84d8 c09e84d8 e141f1bc bff33a90 dec58f38
    Call Trace:
    [] ? ipv6_frags_exit_net+0x22/0x32 [ipv6]
    [] ? ops_exit_list+0x19/0x3d
    [] ? unregister_pernet_operations+0x2a/0x51
    [] ? unregister_pernet_subsys+0x17/0x24
    [] ? ipv6_frag_exit+0x21/0x32 [ipv6]
    [] ? inet6_exit+0x47/0x122 [ipv6]
    [] ? sys_delete_module+0x198/0x1f6
    [] ? remove_vma+0x57/0x5d
    [] ? do_page_fault+0x2e7/0x315
    [] ? sysenter_do_call+0x12/0x28
    Code: 86 00 00 00 40 c1 e8 0c c1 e0 05 01 d0 89 45 e0 66 83 38 00 79 06 8b 40 0c 89 45 e0 8b 55 e0 8b 02 84 c0 78 14 66 a9 00 c0 75 04 0b eb fe 8b 45 e0 e8 35 15 fe ff eb 5d 8b 45 04 8b 55 e0 89
    EIP: [] kfree+0x6a/0xdd SS:ESP 0068:dec58ed0
    ---[ end trace 4475d1a5b0afa7e5 ]---

    It's because in ip6_frags_ns_sysctl_register,
    "table" only alloced when "net" is not equals
    to "init_net".So when we free "table" in
    ip6_frags_ns_sysctl_unregister,we should check
    this first.

    This patch fix the problem.

    Signed-off-by: Yang Hongyang
    Signed-off-by: David S. Miller

    Yang Hongyang
     

15 Dec, 2009

1 commit

  • Currently the same reassembly queue might be used for packets reassembled
    by conntrack in different positions in the stack (PREROUTING/LOCAL_OUT),
    as well as local delivery. This can cause "packet jumps" when the fragment
    completing a reassembled packet is queued from a different position in the
    stack than the previous ones.

    Add a "user" identifier to the reassembly queue key to seperate the queues
    of each caller, similar to what we do for IPv4.

    Signed-off-by: Patrick McHardy

    Patrick McHardy
     

08 Dec, 2009

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1815 commits)
    mac80211: fix reorder buffer release
    iwmc3200wifi: Enable wimax core through module parameter
    iwmc3200wifi: Add wifi-wimax coexistence mode as a module parameter
    iwmc3200wifi: Coex table command does not expect a response
    iwmc3200wifi: Update wiwi priority table
    iwlwifi: driver version track kernel version
    iwlwifi: indicate uCode type when fail dump error/event log
    iwl3945: remove duplicated event logging code
    b43: fix two warnings
    ipw2100: fix rebooting hang with driver loaded
    cfg80211: indent regulatory messages with spaces
    iwmc3200wifi: fix NULL pointer dereference in pmkid update
    mac80211: Fix TX status reporting for injected data frames
    ath9k: enable 2GHz band only if the device supports it
    airo: Fix integer overflow warning
    rt2x00: Fix padding bug on L2PAD devices.
    WE: Fix set events not propagated
    b43legacy: avoid PPC fault during resume
    b43: avoid PPC fault during resume
    tcp: fix a timewait refcnt race
    ...

    Fix up conflicts due to sysctl cleanups (dead sysctl_check code and
    CTL_UNNUMBERED removed) in
    kernel/sysctl_check.c
    net/ipv4/sysctl_net_ipv4.c
    net/ipv6/addrconf.c
    net/sctp/sysctl.c

    Linus Torvalds
     

26 Nov, 2009

1 commit

  • Generated with the following semantic patch

    @@
    struct net *n1;
    struct net *n2;
    @@
    - n1 == n2
    + net_eq(n1, n2)

    @@
    struct net *n1;
    struct net *n2;
    @@
    - n1 != n2
    + !net_eq(n1, n2)

    applied over {include,net,drivers/net}.

    Signed-off-by: Octavian Purdila
    Signed-off-by: David S. Miller

    Octavian Purdila
     

12 Nov, 2009

1 commit

  • Now that sys_sysctl is a compatiblity wrapper around /proc/sys
    all sysctl strategy routines, and all ctl_name and strategy
    entries in the sysctl tables are unused, and can be
    revmoed.

    In addition neigh_sysctl_register has been modified to no longer
    take a strategy argument and it's callers have been modified not
    to pass one.

    Cc: "David Miller"
    Cc: Hideaki YOSHIFUJI
    Cc: netdev@vger.kernel.org
    Signed-off-by: Eric W. Biederman

    Eric W. Biederman
     

06 Nov, 2009

1 commit


15 Sep, 2009

1 commit


09 Jun, 2009

1 commit


03 Jun, 2009

1 commit

  • Define three accessors to get/set dst attached to a skb

    struct dst_entry *skb_dst(const struct sk_buff *skb)

    void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)

    void skb_dst_drop(struct sk_buff *skb)
    This one should replace occurrences of :
    dst_release(skb->dst)
    skb->dst = NULL;

    Delete skb->dst field

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

    Eric Dumazet
     

19 Mar, 2009

1 commit

  • dev can be NULL in ip[6]_frag_reasm for skb's coming from RAW sockets.

    Quagga's OSPFD sends fragmented packets on a RAW socket, when netfilter
    conntrack reassembles them on the OUTPUT path you hit this code path.

    You can test it with something like "hping2 -0 -d 2000 -f AA.BB.CC.DD"

    With help from Jarek Poplawski.

    Signed-off-by: Jorge Boncompte [DTI2]
    Signed-off-by: David S. Miller

    Jorge Boncompte [DTI2]
     

04 Nov, 2008

1 commit

  • I want to compile out proc_* and sysctl_* handlers totally and
    stub them to NULL depending on config options, however usage of &
    will prevent this, since taking adress of NULL pointer will break
    compilation.

    So, drop & in front of every ->proc_handler and every ->strategy
    handler, it was never needed in fact.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: David S. Miller

    Alexey Dobriyan
     

09 Oct, 2008

4 commits


01 Oct, 2008

1 commit

  • $ diff-funcs ip6qhashfn reassembly.c netfilter/nf_conntrack_reasm.c
    --- reassembly.c:ip6qhashfn()
    +++ netfilter/nf_conntrack_reasm.c:ip6qhashfn()
    @@ -1,5 +1,5 @@
    -static unsigned int ip6qhashfn(__be32 id, struct in6_addr *saddr,
    - struct in6_addr *daddr)
    +static unsigned int ip6qhashfn(__be32 id, const struct in6_addr *saddr,
    + const struct in6_addr *daddr)
    {
    u32 a, b, c;

    @@ -9,7 +9,7 @@

    a += JHASH_GOLDEN_RATIO;
    b += JHASH_GOLDEN_RATIO;
    - c += ip6_frags.rnd;
    + c += nf_frags.rnd;
    __jhash_mix(a, b, c);

    a += (__force u32)saddr->s6_addr32[3];

    And codiff xx.o.old xx.o.new:

    net/ipv6/netfilter/nf_conntrack_reasm.c:
    ip6qhashfn | -512
    nf_hashfn | +6
    nf_ct_frag6_gather | +36
    3 functions changed, 42 bytes added, 512 bytes removed, diff: -470
    net/ipv6/reassembly.c:
    ip6qhashfn | -512
    ip6_hashfn | +7
    ipv6_frag_rcv | +89
    3 functions changed, 96 bytes added, 512 bytes removed, diff: -416

    net/ipv6/reassembly.c:
    inet6_hash_frag | +510
    1 function changed, 510 bytes added, diff: +510

    Total: -376

    Compile tested.

    Signed-off-by: Ilpo Järvinen
    Acked-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Ilpo Järvinen
     

26 Jul, 2008

1 commit

  • Removes legacy reinvent-the-wheel type thing. The generic
    machinery integrates much better to automated debugging aids
    such as kerneloops.org (and others), and is unambiguous due to
    better naming. Non-intuively BUG_TRAP() is actually equal to
    WARN_ON() rather than BUG_ON() though some might actually be
    promoted to BUG_ON() but I left that to future.

    I could make at least one BUILD_BUG_ON conversion.

    Signed-off-by: Ilpo Järvinen
    Signed-off-by: David S. Miller

    Ilpo Järvinen
     

28 Jun, 2008

2 commits


12 Jun, 2008

1 commit


20 May, 2008

2 commits