18 May, 2010

40 commits

  • This patch removes from net/ (but not any netfilter files)
    all the unnecessary return; statements that precede the
    last closing brace of void functions.

    It does not remove the returns that are immediately
    preceded by a label as gcc doesn't like that.

    Done via:
    $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
    xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     
  • If the user has a bad classification configuration, and gets a packet
    that goes through too many steps. Chances are more packets will arrive,
    and the message spew will overrun syslog because it is not rate limited.
    And because it is not tagged with appropriate priority it can't not be screened.

    Added the qdisc to the message to try and give some more context when
    the message does arrive.

    Signed-off-by: Stephen Hemminger
    Acked-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • Put severity level on pfkey printk messages

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • Serious oh sh*t messages converted to WARN().
    Add KERN_NOTICE severity to the unknown policy type messages.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • The previous patch encourage me to go look at all the messages in
    the network scheduler and fix them. Many messages were missing
    any severity level. Some serious ones that should never happen
    were turned into WARN(), and the random noise messages that were
    handled changed to pr_debug().

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • Hi,
    - This patch removes pppoe_ioctl() declaration in
    drivers/net/pppoe.c as it is unneeded.

    Regards,
    Rami Rosen

    Signed-off-by: Rami Rosen
    Signed-off-by: David S. Miller

    Rami Rosen
     
  • Use kcalloc or kzalloc rather than the combination of kmalloc and memset.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression x,y,flags;
    statement S;
    type T;
    @@

    x =
    - kmalloc
    + kcalloc
    (
    - y * sizeof(T),
    + y, sizeof(T),
    flags);
    if (x == NULL) S
    -memset(x, 0, y * sizeof(T));

    @@
    expression x,size,flags;
    statement S;
    @@

    -x = kmalloc(size,flags);
    +x = kzalloc(size,flags);
    if (x == NULL) S
    -memset(x, 0, size);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • Use kzalloc rather than the combination of kmalloc and memset.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression x,size,flags;
    statement S;
    @@

    -x = kmalloc(size,flags);
    +x = kzalloc(size,flags);
    if (x == NULL) S
    -memset(x, 0, size);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Bhavesh Davda
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • Use kzalloc rather than the combination of kmalloc and memset.

    A simplified version of the semantic patch that makes this change is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression x,size,flags;
    statement S;
    @@

    -x = kmalloc(size,flags);
    +x = kzalloc(size,flags);
    if (x == NULL) S
    -memset(x, 0, size);
    //

    Signed-off-by: Julia Lawall
    Acked-by: Sjur Brændeland
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • Use kzalloc rather than the combination of kmalloc and memset.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression x,size,flags;
    statement S;
    @@

    -x = kmalloc(size,flags);
    +x = kzalloc(size,flags);
    if (x == NULL) S
    -memset(x, 0, size);
    //

    Signed-off-by: Julia Lawall
    Acked-by: Lennert Buytenhek
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • commit 5fa782c2f5ef6c2e4f04d3e228412c9b4a4c8809
    sctp: Fix skb_over_panic resulting from multiple invalid \
    parameter errors (CVE-2010-1173) (v4)

    cause 'error cause' never be add the the ERROR chunk due to
    some typo when check valid length in sctp_init_cause_fixed().

    Signed-off-by: Wei Yongjun
    Reviewed-by: Neil Horman
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Wei Yongjun
     
  • Add enic ndo_{set|get}_vf_port ops to support setting/getting
    port-profile for enic dynamic devices. Enic dynamic devices are just like
    normal enic eth devices except dynamic enics require an extra configuration
    step to assign a port-profile identifier to the interface before the
    interface is useable. Once a port-profile is assigned, link comes up on the
    interface and is ready for I/O. The port-profile is used to configure the
    network port assigned to the interface. The network port configuration
    includes VLAN membership, QoS policies, and port security settings typical
    of a data center network.

    A dynamic enic initially has a zero-mac address. Before a port-profile is
    assigned, a valid non-zero unicast mac address should be assign to the
    dynamic enic interface.

    Signed-off-by: Scott Feldman
    Signed-off-by: Roopa Prabhu

    Scott Feldman
     
  • Add new netdev ops ndo_{set|get}_vf_port to allow setting of
    port-profile on a netdev interface. Extends netlink socket RTM_SETLINK/
    RTM_GETLINK with two new sub msgs called IFLA_VF_PORTS and IFLA_PORT_SELF
    (added to end of IFLA_cmd list). These are both nested atrtibutes
    using this layout:

    [IFLA_NUM_VF]
    [IFLA_VF_PORTS]
    [IFLA_VF_PORT]
    [IFLA_PORT_*], ...
    [IFLA_VF_PORT]
    [IFLA_PORT_*], ...
    ...
    [IFLA_PORT_SELF]
    [IFLA_PORT_*], ...

    These attributes are design to be set and get symmetrically. VF_PORTS
    is a list of VF_PORTs, one for each VF, when dealing with an SR-IOV
    device. PORT_SELF is for the PF of the SR-IOV device, in case it wants
    to also have a port-profile, or for the case where the VF==PF, like in
    enic patch 2/2 of this patch set.

    A port-profile is used to configure/enable the external switch virtual port
    backing the netdev interface, not to configure the host-facing side of the
    netdev. A port-profile is an identifier known to the switch. How port-
    profiles are installed on the switch or how available port-profiles are
    made know to the host is outside the scope of this patch.

    There are two types of port-profiles specs in the netlink msg. The first spec
    is for 802.1Qbg (pre-)standard, VDP protocol. The second spec is for devices
    that run a similar protocol as VDP but in firmware, thus hiding the protocol
    details. In either case, the specs have much in common and makes sense to
    define the netlink msg as the union of the two specs. For example, both specs
    have a notition of associating/deassociating a port-profile. And both specs
    require some information from the hypervisor manager, such as client port
    instance ID.

    The general flow is the port-profile is applied to a host netdev interface
    using RTM_SETLINK, the receiver of the RTM_SETLINK msg communicates with the
    switch, and the switch virtual port backing the host netdev interface is
    configured/enabled based on the settings defined by the port-profile. What
    those settings comprise, and how those settings are managed is again
    outside the scope of this patch, since this patch only deals with the
    first step in the flow.

    Signed-off-by: Scott Feldman
    Signed-off-by: Roopa Prabhu
    Signed-off-by: David S. Miller

    Scott Feldman
     
  • switch and while statements don't need semicolons at end of statement

    [ Fixup minor conflicts with recent wimax merge... -DaveM ]

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     
  • The qeth driver is enabled to support the new OSA CHPID types OSX
    and OSM.

    Signed-off-by: Ursula Braun
    Signed-off-by: Frank Blaschka
    Signed-off-by: David S. Miller

    Ursula Braun
     
  • Drop cast on the result of kmalloc and similar functions.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    type T;
    @@

    - (T *)
    (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|
    kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...))
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Frank Blaschka
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • USB device ID definition for I-O Data ETX-US2 is wrong.
    Correct ID is 0x093a. Here's snippet from /proc/bus/usb/devices;

    T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
    D: Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=00 MxPS=64 #Cfgs= 1
    P: Vendor=04bb ProdID=093a Rev= 1.01
    S: Manufacturer=I-O DATA DEVICE,INC.
    S: Product=I-O DATA ETX2-US2
    S: SerialNumber=A26427
    C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=224mA
    I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=00 Driver=pegasus
    E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E: Ad=83(I) Atr=03(Int.) MxPS= 8 Ivl=125us

    This patch enables pegasus driver to work fine with ETX-US2.

    Signed-off-by: Tadashi Abe
    Signed-off-by: David S. Miller

    Tadashi Abe
     
  • The member "clock" of struct "sja1000_platform_data" is documented as
    "CAN bus oscillator frequency in Hz" but it's actually used as the CAN
    clock frequency, which is half of it. To avoid further confusion, this
    patch fixes it by renaming the member to "osc_freq". That way, also
    non mainline users will notice the change. The platform code for the
    relevant boards is updated accordingly. Furthermore, pre-defined
    values are now used for the members "ocr" and "cdr".

    Signed-off-by: Wolfgang Grandegger
    Acked-by: Marc Kleine-Budde
    Signed-off-by: David S. Miller

    Wolfgang Grandegger
     
  • skb rxhash should be cleared when a skb is handled by a tunnel before
    being delivered again, so that correct packet steering can take place.

    There are other cleanups and accounting that we can factorize in a new
    helper, skb_tunnel_rx()

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

    Eric Dumazet
     
  • Commit 33ad798c924b4a (tcp: options clean up) introduced a problem
    if MD5+SACK+timestamps were used in initial SYN message.

    Some stacks (old linux for example) try to negotiate MD5+SACK+TSTAMP
    sessions, but since 40 bytes of tcp options space are not enough to
    store all the bits needed, we chose to disable timestamps in this case.

    We send a SYN-ACK _without_ timestamp option, but socket has timestamps
    enabled and all further outgoing messages contain a TS block, all with
    the initial timestamp of the remote peer.

    Fix is to really disable timestamps option for the whole session.

    Reported-by: Bijay Singh
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • The duplicate address check code got broken in the conversion
    to hlist (2.6.35). The earlier patch did not fix the case where
    two addresses match same hash value. Use two exit paths,
    rather than depending on state of loop variables (from macro).

    Based on earlier fix by Shan Wei.

    Signed-off-by: Stephen Hemminger
    Reviewed-by: Shan Wei
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • David S. Miller
     
  • dm9000_set_rx_csum and dm9000_hash_table are called from atomic context (in
    dm9000_init_dm9000), and from non-atomic context (via ethtool_ops and
    net_device_ops respectively). This causes a spinlock recursion BUG. Fix this by
    renaming these functions to *_unlocked for the atomic context, and make the
    original functions locking wrappers for use in the non-atomic context.

    Signed-off-by: Baruch Siach
    Signed-off-by: David S. Miller

    Baruch Siach
     
  • Use kmemdup when some other buffer is immediately copied into the
    allocated region.

    A simplified version of the semantic patch that makes this change is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    statement S;
    @@

    - to = \(kmalloc\|kzalloc\)(size,flag);
    + to = kmemdup(from,size,flag);
    if (to==NULL || ...) S
    - memcpy(to, from, size);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • Use kmemdup when some other buffer is immediately copied into the
    allocated region.

    A simplified version of the semantic patch that makes this change is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    statement S;
    @@

    - to = \(kmalloc\|kzalloc\)(size,flag);
    + to = kmemdup(from,size,flag);
    if (to==NULL || ...) S
    - memcpy(to, from, size);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • Use kmemdup when some other buffer is immediately copied into the
    allocated region.

    A simplified version of the semantic patch that makes this change is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    statement S;
    @@

    - to = \(kmalloc\|kzalloc\)(size,flag);
    + to = kmemdup(from,size,flag);
    if (to==NULL || ...) S
    - memcpy(to, from, size);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • The driver could return success code even if mdiobus_alloc() failed.
    This patch fixes the issue.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: David S. Miller

    Anton Vorontsov
     
  • When attaching filters to a class pointing to a class higher up in the
    hierarchy, classification may enter an endless loop. Currently this is
    prevented for filters that are already resolved, but not for filters
    resolved at runtime.

    Only allow filters to point downwards in the hierarchy, similar to what
    CBQ does.

    Reported-by: Pawel Staszewski
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • solos-pci uses request_firmware() for firmware upgrades

    Signed-off-by: Nathan Williams
    Signed-off-by: David S. Miller

    Nathan Williams
     
  • The current link checking logic only works for one port, which is not correct
    for swiches were multiple ports can have different link status. As a result
    we would only check for link status on port 1 of the switch. Move the calls
    to mii_check_media in r6040_timer which will be polling a single PHY chip
    correctly and assume link is up for switches.

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

    Florian Fainelli
     
  • These callbacks were needed because dev_pm_ops support for OF
    platform devices was in the powerpc tree, and the patch that
    added dev_pm_ops for gianfar driver was in the netdev tree. Now
    that netdev and powerpc trees have merged into Linus' tree, we
    can remove the legacy hooks.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: David S. Miller

    Anton Vorontsov
     
  • Several netem users use TBF for rate control. But every time the parameters
    of TBF are changed it destroys the child qdisc, requiring reconfigation.
    Better to just keep child qdisc and just notify it of changed limit.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • Also added an explicit break; to avoid
    a fallthrough in net/ipv4/tcp_input.c

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     
  • Removes the BKL in x25 setsock and getsockopts.

    Signed-off-by: Andrew Hendry
    Signed-off-by: David S. Miller

    andrew hendry
     
  • Moves the x25 accept approve flag from char into bitfield.

    Signed-off-by: Andrew Hendry
    Signed-off-by: David S. Miller

    andrew hendry
     
  • Moves the x25 interrupt flag from char into bitfield.

    Signed-off-by: Andrew Hendry
    Signed-off-by: David S. Miller

    andrew hendry
     
  • Moves the X25 q bit flag from char into a bitfield to allow BKL cleanup.

    Signed-off-by: Andrew Hendry
    Signed-off-by: David S. Miller

    andrew hendry
     
  • When stop device call netif_carrier_off() just after disabling TX queue to
    avoid possibility of netdev watchdog warning and ->ndo_tx_timeout() invocation.

    Signed-off-by: Stanislaw Gruszka
    Acked-by: Eilon Greenstein
    Signed-off-by: David S. Miller

    Stanislaw Gruszka
     
  • Based on original patch from Stanislaw Gruszka .

    Using netif_carrier_off() is better than updating all the ->trans_start
    on all the tx queues.

    netif_carrier_off() needs to be called after bnx2_disable_int_sync()
    to guarantee no race conditions with the serdes timers that can
    modify the carrier state.

    If the chip or phy is reset, carrier will turn back on when we get the
    link interrupt. If there is no reset, we need to turn carrier back on
    in bnx2_netif_start(). Again, the phy_lock prevents race conditions with
    the serdes timers.

    Signed-off-by: Michael Chan
    Signed-off-by: Matt Carlson
    Signed-off-by: David S. Miller

    Michael Chan
     
  • New firmware fixes a performance regression on small packets.

    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller

    Michael Chan