14 May, 2011

4 commits

  • Adapt new API.

    Signed-off-by: KOSAKI Motohiro
    Signed-off-by: Frank Blaschka
    Signed-off-by: David S. Miller

    KOSAKI Motohiro
     
  • -Wunused-but-set-variable generates compile warnings. The affected
    variables are removed.

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

    Ursula Braun
     
  • -Wunused-but-set-variable generates a compile warning. The affected
    variable is removed.

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

    Ursula Braun
     
  • Added code to take FW dump via ethtool. Dump level can be controlled via setting the
    dump flag. A get function is provided to query the current setting of the dump flag.
    Dump data is obtained from the driver via a separate get function.

    Changes from v3:
    Fixed buffer length issue in ethtool_get_dump_data function.
    Updated kernel doc for ethtool_dump struct and get_dump_flag function.

    Changes from v2:
    Provided separate commands for get flag and data.
    Check for minimum of the two buffer length obtained via ethtool and driver and
    use that for dump buffer
    Pass up the driver return error codes up to the caller.
    Added kernel doc comments.

    Signed-off-by: Anirban Chakraborty
    Reviewed-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Anirban Chakraborty
     

13 May, 2011

15 commits


12 May, 2011

2 commits


11 May, 2011

19 commits

  • David S. Miller
     
  • Unlike the standard case, disabled anti replay detection needs some
    nontrivial extra treatment on ESN. RFC 4303 states:

    Note: If a receiver chooses to not enable anti-replay for an SA, then
    the receiver SHOULD NOT negotiate ESN in an SA management protocol.
    Use of ESN creates a need for the receiver to manage the anti-replay
    window (in order to determine the correct value for the high-order
    bits of the ESN, which are employed in the ICV computation), which is
    generally contrary to the notion of disabling anti-replay for an SA.

    So return an error if an ESN state with disabled anti replay detection
    is inserted for now and add the extra treatment later if we need it.

    Signed-off-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Steffen Klassert
     
  • As it is, we assign the outer modes output function to the dst entry
    when we create the xfrm bundle. This leads to two problems on interfamily
    scenarios. We might insert ipv4 packets into ip6_fragment when called
    from xfrm6_output. The system crashes if we try to fragment an ipv4
    packet with ip6_fragment. This issue was introduced with git commit
    ad0081e4 (ipv6: Fragment locally generated tunnel-mode IPSec6 packets
    as needed). The second issue is, that we might insert ipv4 packets in
    netfilter6 and vice versa on interfamily scenarios.

    With this patch we assign the inner mode output function to the dst entry
    when we create the xfrm bundle. So xfrm4_output/xfrm6_output from the inner
    mode is used and the right fragmentation and netfilter functions are called.
    We switch then to outer mode with the output_finish functions.

    Signed-off-by: Steffen Klassert
    Signed-off-by: David S. Miller

    Steffen Klassert
     
  • Commit 443457242beb (factorize sync-rcu call in
    unregister_netdevice_many) mistakenly removed one test from dev_close()

    Following actions trigger a BUG :

    modprobe bonding
    modprobe dummy
    ifconfig bond0 up
    ifenslave bond0 dummy0
    rmmod dummy

    dev_close() must not close a non IFF_UP device.

    With help from Frank Blaschka and Einar EL Lueck

    Reported-by: Frank Blaschka
    Reported-by: Einar EL Lueck
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • ip link add link eth2 eth2.103 type vlan id 103 gvrp on loose_binding on
    ip link set eth2.103 up
    rmmod tg3 # driver providing eth2

    BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: [] garp_request_leave+0x3e/0xc0 [garp]
    PGD 11d251067 PUD 11b9e0067 PMD 0
    Oops: 0000 [#1] SMP
    last sysfs file: /sys/devices/virtual/net/eth2.104/ifindex
    CPU 0
    Modules linked in: tg3(-) 8021q garp nfsd lockd auth_rpcgss sunrpc libphy sg [last unloaded: x_tables]

    Pid: 11494, comm: rmmod Tainted: G W 2.6.39-rc6-00261-gfd71257-dirty #580 HP ProLiant BL460c G6
    RIP: 0010:[] [] garp_request_leave+0x3e/0xc0 [garp]
    RSP: 0018:ffff88007a19bae8 EFLAGS: 00010286
    RAX: 0000000000000000 RBX: ffff88011b5e2000 RCX: 0000000000000002
    RDX: 0000000000000000 RSI: 0000000000000175 RDI: ffffffffa0030d5b
    RBP: ffff88007a19bb18 R08: 0000000000000001 R09: ffff88011bd64a00
    R10: ffff88011d34ec00 R11: 0000000000000000 R12: 0000000000000002
    R13: ffff88007a19bc48 R14: ffff88007a19bb88 R15: 0000000000000001
    FS: 0000000000000000(0000) GS:ffff88011fc00000(0063) knlGS:00000000f77d76c0
    CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
    CR2: 0000000000000000 CR3: 000000011a675000 CR4: 00000000000006f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process rmmod (pid: 11494, threadinfo ffff88007a19a000, task ffff8800798595c0)
    Stack:
    ffff88007a19bb36 ffff88011c84b800 ffff88011b5e2000 ffff88007a19bc48
    ffff88007a19bb88 0000000000000006 ffff88007a19bb38 ffffffffa003a5f6
    ffff88007a19bb38 670088007a19bba8 ffff88007a19bb58 ffffffffa00397e7
    Call Trace:
    [] vlan_gvrp_request_leave+0x46/0x50 [8021q]
    [] vlan_dev_stop+0xb7/0xc0 [8021q]
    [] __dev_close_many+0x87/0xe0
    [] dev_close_many+0x87/0x110
    [] rollback_registered_many+0xa0/0x240
    [] unregister_netdevice_many+0x19/0x60
    [] vlan_device_event+0x53b/0x550 [8021q]
    [] ? ip6mr_device_event+0xa8/0xd0
    [] notifier_call_chain+0x53/0x80
    [] __raw_notifier_call_chain+0x9/0x10
    [] raw_notifier_call_chain+0x11/0x20
    [] call_netdevice_notifiers+0x32/0x60
    [] rollback_registered_many+0x10f/0x240
    [] rollback_registered+0x2f/0x40
    [] unregister_netdevice_queue+0x58/0x90
    [] unregister_netdev+0x1b/0x30
    [] tg3_remove_one+0x6f/0x10b [tg3]

    We should call vlan_gvrp_request_leave() from unregister_vlan_dev(),
    not from vlan_dev_stop(), because vlan_gvrp_uninit_applicant()
    is called right after unregister_netdevice_queue(). In batch mode,
    unregister_netdevice_queue() doesn’t immediately call vlan_dev_stop().

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

    Eric Dumazet
     
  • Commit e67f88dd12f6 (net: dont hold rtnl mutex during netlink dump
    callbacks) switched rtnl protection to RCU, but we forgot to adjust two
    rcu_dereference() lockdep annotations :

    inet_get_link_af_size() or inet_fill_link_af() might be called with
    rcu_read_lock or rtnl held, so use rcu_dereference_rtnl()
    instead of rtnl_dereference()

    Reported-by: Valdis Kletnieks
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Rearrange xfrm4_dst_lookup() so that it works by calling a helper
    function __xfrm_dst_lookup() that takes an explicit flow key storage
    area as an argument.

    Use this new helper in xfrm4_get_saddr() so we can fetch the selected
    source address from the flow instead of from rt->rt_src

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Flow key is available, so fetch it from there.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • We already track and pass around the correct flow key,
    so simply use it in udp_send_skb().

    Signed-off-by: David S. Miller

    David S. Miller
     
  • On input packets, rt->rt_src always equals ip_hdr(skb)->saddr

    Anything that mangles or otherwise changes the IP header must
    relookup the route found at skb_rtable(). Therefore this
    invariant must always hold true.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This eliminates an access to rt->rt_src.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Revises the algorithm governing the sending of link request messages
    to take into account the number of nodes each bearer is currently in
    contact with, and to ensure more rapid rediscovery of neighboring nodes
    if a bearer fails and then recovers.

    The discovery object now sends requests at least once a second if it
    is not in contact with any other nodes, and at least once a minute if
    it has at least one neighbor; if contact with the only neighbor is
    lost, the object immediately reverts to its initial rapid-fire search
    timing to accelerate the rediscovery process.

    In addition, the discovery object now stops issuing link request
    messages if it is in contact with the only neighboring node it is
    configured to communicate with, since further searching is unnecessary.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Augments TIPC's discovery object to track the number of neighboring nodes
    having an active link to the associated bearer.

    This means tipc_disc_update_link_req() becomes either one of:

    tipc_disc_add_dest()
    or:
    tipc_disc_remove_dest()

    depending on the code flow direction of things.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Augments TIPC's discovery object to send its initial neighbor discovery
    request message as soon as the associated bearer is created, rather than
    waiting for its first periodic timeout to occur, thereby speeding up the
    discovery process. Also adds a check to suppress the initial request or
    subsequent requests if the bearer is blocked at the time the request is
    scheduled for transmission.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Modifies bearer creation and deletion code to improve handling of
    scenarios when a neighbor discovery object cannot be created. The
    creation routine now aborts the creation of a bearer if its discovery
    object cannot be created, and deletes the newly created bearer, rather
    than failing quietly and leaving an unusable bearer hanging around.

    Since the exit via the goto label really isn't a definitive failure
    in all cases, relabel it appropriately.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Create a helper routine to enqueue a chain of sk_buffs to a link's
    transmit queue. It improves readability and the new function is
    anticipated to be used more than just once in the future as well.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Rework TIPC's message sending routines to take advantage of the total
    amount of data value passed to it by the kernel socket infrastructure.
    This change eliminates the need for TIPC to compute the size of outgoing
    messages itself, as well as the check for an oversize message in
    tipc_msg_build(). In addition, this change warrants an explanation:

    - res = send_packet(NULL, sock, &my_msg, 0);
    + res = send_packet(NULL, sock, &my_msg, bytes_to_send);

    Previously, the final argument to send_packet() was ignored (since the
    amount of data being sent was recalculated by a lower-level routine)
    and we could just pass in a dummy value (0). Now that the
    recalculation is being eliminated, the argument value being passed to
    send_packet() is significant and we have to supply the actual amount
    of data we want to send.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Adds checks to TIPC's socket send routines to promptly detect and
    abort attempts to send more than 66,000 bytes in a single TIPC
    message or more than 2**31-1 bytes in a single TIPC byte stream request.
    In addition, this ensures that the number of iovecs in a send request
    does not exceed the limits of a standard integer variable.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens
     
  • Enhances existing checks on the discovery domain associated with a TIPC
    bearer. A bearer can no longer be configured to accept links from itself
    only (which would be pointless), or to nodes outside its own cluster
    (since multi-cluster support has now been removed from TIPC). Also, the
    neighbor discovery routine now validates link setup requests against the
    configured discovery domain for the bearer, rather than simply ensuring
    the requesting node belongs to the node's own cluster.

    Signed-off-by: Allan Stephens
    Signed-off-by: Paul Gortmaker

    Allan Stephens