13 Jul, 2010

2 commits

  • a new boolean flag no_autobind is added to structure proto to avoid the autobind
    calls when the protocol is TCP. Then sock_rps_record_flow() is called int the
    TCP's sendmsg() and sendpage() pathes.

    Signed-off-by: Changli Gao
    ----
    include/net/inet_common.h | 4 ++++
    include/net/sock.h | 1 +
    include/net/tcp.h | 8 ++++----
    net/ipv4/af_inet.c | 15 +++++++++------
    net/ipv4/tcp.c | 11 +++++------
    net/ipv4/tcp_ipv4.c | 3 +++
    net/ipv6/af_inet6.c | 8 ++++----
    net/ipv6/tcp_ipv6.c | 3 +++
    8 files changed, 33 insertions(+), 20 deletions(-)
    Signed-off-by: David S. Miller

    Changli Gao
     
  • remove useless blanks.

    Signed-off-by: Changli Gao
    ----
    include/net/inet_common.h | 55 ++++-------
    include/net/tcp.h | 222 +++++++++++++++++-----------------------------
    include/net/udp.h | 38 +++----
    3 files changed, 123 insertions(+), 192 deletions(-)
    Signed-off-by: David S. Miller

    Changli Gao
     

10 Jul, 2010

2 commits

  • Document that dev_get_stats() returns the same stats pointer it was
    given. Remove const qualification from the returned pointer since the
    caller may do what it likes with that structure.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • In commit be1f3c2c027cc5ad735df6a45a542ed1db7ec48b "net: Enable 64-bit
    net device statistics on 32-bit architectures" I redefined struct
    net_device_stats so that it could be used in a union with struct
    rtnl_link_stats64, avoiding the need for explicit copying or
    conversion between the two. However, this is unsafe because there is
    no locking required and no lock consistently held around calls to
    dev_get_stats() and use of the statistics structure it returns.

    In commit 28172739f0a276eb8d6ca917b3974c2edb036da3 "net: fix 64 bit
    counters on 32 bit arches" Eric Dumazet dealt with that problem by
    requiring callers of dev_get_stats() to provide storage for the
    result. This means that the net_device::stats64 field and the padding
    in struct net_device_stats are now redundant, so remove them.

    Update the comment on net_device_ops::ndo_get_stats64 to reflect its
    new usage.

    Change dev_txq_stats_fold() to use struct rtnl_link_stats64, since
    that is what all its callers are really using and it is no longer
    going to be compatible with struct net_device_stats.

    Eric Dumazet suggested the separate function for the structure
    conversion.

    Signed-off-by: Ben Hutchings
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Ben Hutchings
     

09 Jul, 2010

1 commit

  • Add notifier chain for changes in atm_dev.

    Clients like br2684 will call register_atmdevice_notifier() to be notified of
    changes. Drivers will call atm_dev_signal_change() to notify clients like
    br2684 of the change.

    On DSL and ATM devices it's usefull to have a know if you have a carrier
    signal. netdevice LOWER_UP changes can be propagated to userspace via netlink
    monitor.

    Signed-off-by: Karl Hiramoto
    Signed-off-by: David S. Miller

    Karl Hiramoto
     

08 Jul, 2010

2 commits


06 Jul, 2010

1 commit

  • netif_vdbg() was originally defined as entirely equivalent to
    netdev_vdbg(), but I assume that it was intended to take the same
    parameters as netif_dbg() etc. (Currently it is only used by the
    sfc driver, in which I worked on that assumption.)

    In commit a4ed89c I changed the definition used when VERBOSE_DEBUG is
    not defined, but I failed to notice that the definition used when
    VERBOSE_DEBUG is defined was also not as I expected. Change that to
    match netif_dbg() as well.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     

05 Jul, 2010

4 commits

  • Reduces text ~300 bytes of text (woohoo!) in an x86 defconfig

    $ size vmlinux*
    text data bss dec hex filename
    7198526 720112 1366288 9284926 8dad3e vmlinux
    7198862 720112 1366288 9285262 8dae8e vmlinux.netdev

    Signed-off-by: Joe Perches
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Joe Perches
     
  • Reduces an x86 defconfig text and data ~2k.
    text is smaller, data is larger.

    $ size vmlinux*
    text data bss dec hex filename
    7198862 720112 1366288 9285262 8dae8e vmlinux
    7205273 716016 1366288 9287577 8db799 vmlinux.device_h

    Uses %pV and struct va_format
    Format arguments are verified before printk

    Signed-off-by: Joe Perches
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Joe Perches
     
  • Reduces an x86 defconfig text and data ~55k, .6% smaller.

    $ size vmlinux*
    text data bss dec hex filename
    7205273 716016 1366288 9287577 8db799 vmlinux
    7258890 719768 1366288 9344946 8e97b2 vmlinux.master

    Uses %pV and struct va_format
    Format arguments are verified before printk

    The dev_info macro is converted to _dev_info because there are
    existing uses of variables named dev_info in the kernel tree
    like drivers/net/pcmcia/pcnet_cs.c

    A dev_info macro is created to call _dev_info

    Signed-off-by: Joe Perches
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Joe Perches
     
  • Add the ability to print a format and va_list from a structure pointer

    Allows __dev_printk to be implemented as a single printk while
    minimizing string space duplication.

    %pV should not be used without some mechanism to verify the
    format and argument use ala __attribute__(format (printf(...))).

    Signed-off-by: Joe Perches
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Joe Perches
     

03 Jul, 2010

4 commits

  • David S. Miller
     
  • Fix kernel-doc warnings in linux/net.h:

    Warning(include/linux/net.h:151): No description found for parameter 'wq'
    Warning(include/linux/net.h:151): Excess struct/union/enum/typedef member 'fasync_list' description in 'socket'
    Warning(include/linux/net.h:151): Excess struct/union/enum/typedef member 'wait' description in 'socket'

    Signed-off-by: Randy Dunlap
    Signed-off-by: David S. Miller

    Randy Dunlap
     
  • Reducing real_num_queues needs to flush the qdisc otherwise
    skbs with queue_mappings greater then real_num_tx_queues can
    be sent to the underlying driver.

    The flow for this is,

    dev_queue_xmit()
    dev_pick_tx()
    skb_tx_hash() => hash using real_num_tx_queues
    skb_set_queue_mapping()
    ...
    qdisc_enqueue_root() => enqueue skb on txq from hash
    ...
    dev->real_num_tx_queues -= n
    ...
    sch_direct_xmit()
    dev_hard_start_xmit()
    ndo_start_xmit(skb,dev) => skb queue set with old hash

    skbs are enqueued on the qdisc with skb->queue_mapping set
    0 < queue_mappings < real_num_tx_queues. When the driver
    decreases real_num_tx_queues skb's may be dequeued from the
    qdisc with a queue_mapping greater then real_num_tx_queues.

    This fixes a case in ixgbe where this was occurring with DCB
    and FCoE. Because the driver is using queue_mapping to map
    skbs to tx descriptor rings we can potentially map skbs to
    rings that no longer exist.

    Signed-off-by: John Fastabend
    Tested-by: Ross Brattain
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    John Fastabend
     
  • When calling qdisc_reset() the qdisc lock needs to be held. In
    this case there is at least one driver i4l which is using this
    without holding the lock. Add the locking here.

    Signed-off-by: John Fastabend
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    John Fastabend
     

02 Jul, 2010

1 commit


01 Jul, 2010

8 commits

  • Many NICs use an indirection table to map an RX flow hash value to one
    of an arbitrary number of queues (not necessarily a power of 2). It
    can be useful to remove some queues from this indirection table so
    that they are only used for flows that are specifically filtered
    there. It may also be useful to weight the mapping to account for
    user processes with the same CPU-affinity as the RX interrupts.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • ethtool_op_set_flags() does not check for unsupported flags, and has
    no way of doing so. This means it is not suitable for use as a
    default implementation of ethtool_ops::set_flags.

    Add a 'supported' parameter specifying the flags that the driver and
    hardware support, validate the requested flags against this, and
    change all current callers to pass this parameter.

    Change some other trivial implementations of ethtool_ops::set_flags to
    call ethtool_op_set_flags().

    Signed-off-by: Ben Hutchings
    Reviewed-by: Stanislaw Gruszka
    Acked-by: Jeff Garzik
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • 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
     
  • /proc/net/snmp and /proc/net/netstat expose SNMP counters.

    Width of these counters is either 32 or 64 bits, depending on the size
    of "unsigned long" in kernel.

    This means user program parsing these files must already be prepared to
    deal with 64bit values, regardless of user program being 32 or 64 bit.

    This patch introduces 64bit snmp values for IPSTAT mib, where some
    counters can wrap pretty fast if they are 32bit wide.

    # netstat -s|egrep "InOctets|OutOctets"
    InOctets: 244068329096
    OutOctets: 244069348848

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

    Eric Dumazet
     
  • Some controllers (KW, Dove) limits the TX IP/layer4 checksum offloading to a max size.

    Signed-off-by: Saeed Bishara
    Acked-by: Lennert Buytenhek
    Signed-off-by: David S. Miller

    Saeed Bishara
     
  • 'Shoul' must be 'should'.

    Signed-off-by: Kulikov Vasiliy
    Signed-off-by: David S. Miller

    Kulikov Vasiliy
     
  • Signed-off-by: Gertjan van Wingerde
    Signed-off-by: Ivo van Doorn
    Signed-off-by: John W. Linville

    Gertjan van Wingerde
     
  • Determine the size of the xfrm_mark struct, not of its pointer.

    Signed-off-by: Andreas Steffen
    Acked-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    Andreas Steffen
     

29 Jun, 2010

6 commits

  • struct ethtool_rxnfc was originally defined in 2.6.27 for the
    ETHTOOL_{G,S}RXFH command with only the cmd, flow_type and data
    fields. It was then extended in 2.6.30 to support various additional
    commands. These commands should have been defined to use a new
    structure, but it is too late to change that now.

    Since user-space may still be using the old structure definition
    for the ETHTOOL_{G,S}RXFH commands, and since they do not need the
    additional fields, only copy the originally defined fields to and
    from user-space.

    Signed-off-by: Ben Hutchings
    Cc: stable@kernel.org
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • This patch introduces the CAIF SPI Protocol Driver for
    CAIF Link Layer.

    This driver implements a platform driver to accommodate for a
    platform specific SPI device. A general platform driver is not
    possible as there are no SPI Slave side Kernel API defined.
    A sample CAIF SPI Platform device can be found in
    .../Documentation/networking/caif/spi_porting.txt

    Signed-off-by: Sjur Braendeland
    Signed-off-by: David S. Miller

    Sjur Braendeland
     
  • don't clone skb when skb isn't shared

    When the tcf_action is TC_ACT_STOLEN, and the skb isn't shared, we don't need
    to clone a new skb. As the skb will be freed after this function returns, we
    can use it freely once we get a reference to it.

    Signed-off-by: Changli Gao
    ----
    include/net/sch_generic.h | 11 +++++++++--
    net/sched/act_mirred.c | 6 +++---
    2 files changed, 12 insertions(+), 5 deletions(-)
    Signed-off-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    Changli Gao
     
  • Use u64_stats_sync infrastructure to implement 64bit stats.

    Signed-off-by: Eric Dumazet
    Acked-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • - Must disable preemption in case of 32bit UP in u64_stats_fetch_begin()
    and u64_stats_fetch_retry()

    - Add new u64_stats_fetch_begin_bh() and u64_stats_fetch_retry_bh() for
    network usage, disabling BH on 32bit UP only.

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

    Eric Dumazet
     
  • - Add a comment about interrupts:

    6) If counter might be written by an interrupt, readers should block
    interrupts.

    - Fix a typo in sample of use.

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

    Eric Dumazet
     

28 Jun, 2010

1 commit

  • The LOG targets print the entire MAC header as one long string, which is not
    readable very well:

    IN=eth0 OUT= MAC=00:15:f2:24:91:f8:00:1b:24:dc:61:e6:08:00 ...

    Add an option to decode known header formats (currently just ARPHRD_ETHER devices)
    in their individual fields:

    IN=eth0 OUT= MACSRC=00:1b:24:dc:61:e6 MACDST=00:15:f2:24:91:f8 MACPROTO=0800 ...
    IN=eth0 OUT= MACSRC=00:1b:24:dc:61:e6 MACDST=00:15:f2:24:91:f8 MACPROTO=86dd ...

    The option needs to be explicitly enabled by userspace to avoid breaking
    existing parsers.

    Signed-off-by: Patrick McHardy

    Patrick McHardy
     

27 Jun, 2010

1 commit

  • Allows use of ECN when syncookies are in effect by encoding ecn_ok
    into the syn-ack tcp timestamp.

    While at it, remove a uneeded #ifdef CONFIG_SYN_COOKIES.
    With CONFIG_SYN_COOKIES=nm want_cookie is ifdef'd to 0 and gcc
    removes the "if (0)".

    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal
     

26 Jun, 2010

2 commits

  • In preparation for 64bit snmp counters for some mibs,
    add an 'align' parameter to snmp_mib_init(), instead
    of assuming mibs only contain 'unsigned long' fields.

    Callers can use __alignof__(type) to provide correct
    alignment.

    Signed-off-by: Eric Dumazet
    CC: Herbert Xu
    CC: Arnaldo Carvalho de Melo
    CC: Hideaki YOSHIFUJI
    CC: Vlad Yasevich
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Gcc is currenlty not in the ability to optimize the switch statement in
    sk_run_filter() because of dense case labels. This patch replace the
    OR'd labels with ordered sequenced case labels. The sk_chk_filter()
    function is modified to patch/replace the original OPCODES in a
    ordered but equivalent form. gcc is now in the ability to transform the
    switch statement in sk_run_filter into a jump table of complexity O(1).

    Until this patch gcc generates a sequence of conditional branches (O(n) of 567
    byte .text segment size (arch x86_64):

    7ff: 8b 06 mov (%rsi),%eax
    801: 66 83 f8 35 cmp $0x35,%ax
    805: 0f 84 d0 02 00 00 je adb
    80b: 0f 87 07 01 00 00 ja 918
    811: 66 83 f8 15 cmp $0x15,%ax
    815: 0f 84 c5 02 00 00 je ae0
    81b: 77 73 ja 890
    81d: 66 83 f8 04 cmp $0x4,%ax
    821: 0f 84 17 02 00 00 je a3e
    827: 77 29 ja 852
    829: 66 83 f8 01 cmp $0x1,%ax
    [...]

    With the modification the compiler translate the switch statement into
    the following jump table fragment:

    7ff: 66 83 3e 2c cmpw $0x2c,(%rsi)
    803: 0f 87 1f 02 00 00 ja a28
    809: 0f b7 06 movzwl (%rsi),%eax
    80c: ff 24 c5 00 00 00 00 jmpq *0x0(,%rax,8)
    813: 44 89 e3 mov %r12d,%ebx
    816: e9 43 03 00 00 jmpq b5e
    81b: 41 89 dc mov %ebx,%r12d
    81e: e9 3b 03 00 00 jmpq b5e

    Furthermore, I reordered the instructions to reduce cache line misses by
    order the most common instruction to the start.

    Signed-off-by: Hagen Paul Pfeifer
    Signed-off-by: David S. Miller

    Hagen Paul Pfeifer
     

25 Jun, 2010

5 commits

  • Check at rule install time that CT accounting is enabled. Force it
    to be enabled if not while also emitting a warning since this is not
    the default state.

    This is in preparation for deprecating CONFIG_NF_CT_ACCT upon which
    CONFIG_NETFILTER_XT_MATCH_CONNBYTES depended being set.

    Added 2 CT accounting support functions:

    nf_ct_acct_enabled() - Get CT accounting state.
    nf_ct_set_acct() - Enable/disable CT accountuing.

    Signed-off-by: Tim Gardner
    Acked-by: Jan Engelhardt
    Signed-off-by: Patrick McHardy

    Tim Gardner
     
  • This patch adds the 5241 PHY ID to the broadcom module.

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: David S. Miller

    Dmitry Baryshkov
     
  • Move all PHY IDs to brcmphy.h header for completeness and unification of code.

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: David S. Miller

    Dmitry Baryshkov
     
  • This patch adds transmit power setting type and transmit power level attributes
    to NL80211_CMD_SET_WIPHY in order to facilitate adjusting of the transmit power
    level of the device.

    The added attributes allow selection of automatic, limited or fixed transmit
    power level, with the level definable in signed mBm format.

    Signed-off-by: Juuso Oikarinen
    Signed-off-by: John W. Linville

    Juuso Oikarinen
     
  • In preparation for a TX power setting interface in the nl80211, change the
    .set_tx_power function to use mBm units instead of dBm for greater accuracy and
    smaller power levels.

    Also, already in advance move the tx_power_setting enumeration to nl80211.

    This change affects the .tx_set_power function prototype. As a result, the
    corresponding changes are needed to modules using it. These are mac80211,
    iwmc3200wifi and rndis_wlan.

    Cc: Samuel Ortiz
    Cc: Jussi Kivilinna
    Signed-off-by: Juuso Oikarinen
    Acked-by: Samuel Ortiz
    Acked-by: Jussi Kivilinna
    Signed-off-by: John W. Linville

    Juuso Oikarinen