1. 17 10月, 2010 4 次提交
  2. 14 10月, 2010 2 次提交
  3. 13 10月, 2010 1 次提交
    • E
      net: percpu net_device refcount · 29b4433d
      Eric Dumazet 提交于
      We tried very hard to remove all possible dev_hold()/dev_put() pairs in
      network stack, using RCU conversions.
      
      There is still an unavoidable device refcount change for every dst we
      create/destroy, and this can slow down some workloads (routers or some
      app servers, mmap af_packet)
      
      We can switch to a percpu refcount implementation, now dynamic per_cpu
      infrastructure is mature. On a 64 cpus machine, this consumes 256 bytes
      per device.
      
      On x86, dev_hold(dev) code :
      
      before
              lock    incl 0x280(%ebx)
      after:
              movl    0x260(%ebx),%eax
              incl    fs:(%eax)
      
      Stress bench :
      
      (Sending 160.000.000 UDP frames,
      IP route cache disabled, dual E5540 @2.53GHz,
      32bit kernel, FIB_TRIE)
      
      Before:
      
      real    1m1.662s
      user    0m14.373s
      sys     12m55.960s
      
      After:
      
      real    0m51.179s
      user    0m15.329s
      sys     10m15.942s
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29b4433d
  4. 12 10月, 2010 11 次提交
    • G
      dccp: cosmetics - warning format · 2f34b329
      Gerrit Renker 提交于
      This  omits the redundant "DCCP:" in warning messages, since DCCP_WARN() already
      echoes the function name, avoiding messages like
      
         kernel: [10988.766503] dccp_close: DCCP: ABORT -- 209 bytes unread
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      2f34b329
    • G
      dccp: schedule an Ack when receiving timestamps · ecdfbdab
      Gerrit Renker 提交于
      This schedules an Ack when receiving a timestamp, exploiting the
      existing inet_csk_schedule_ack() function, saving one case in the
      `dccp_ack_pending()' function.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      ecdfbdab
    • I
      dccp: generalise data-loss condition · d196c9a5
      Ivo Calado 提交于
      This patch generalises the task of determining data loss from RFC 4340, 7.7.1.
      
      Let S_A, S_B be sequence numbers such that S_B is "after" S_A, and let
      N_B be the NDP count of packet S_B. Then, using modulo-2^48 arithmetic,
       D = S_B - S_A - 1  is an upper bound of the number of lost data packets,
       D - N_B            is an approximation of the number of lost data packets
                          (there are cases where this is not exact).
      
      The patch implements this as
       dccp_loss_count(S_A, S_B, N_B) := max(S_B - S_A - 1 - N_B, 0)
      Signed-off-by: NIvo Calado <ivocalado@embedded.ufcg.edu.br>
      Signed-off-by: NErivaldo Xavier <desadoc@gmail.com>
      Signed-off-by: NLeandro Sales <leandroal@gmail.com>
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      d196c9a5
    • G
      dccp: remove unused argument in CCID tx function · baf9e782
      Gerrit Renker 提交于
      This removes the argument `more' from ccid_hc_tx_packet_sent, since it was
      nowhere used in the entire code.
      
      (Btw, this argument was not even used in the original KAME code where the
       function initially came from; compare the variable moreToSend in the
       freebsd61-dccp-kame-28.08.2006.patch kept by Emmanuel Lochin.)
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      baf9e782
    • G
      dccp: merge now-reduced connect_init() function · 93344af4
      Gerrit Renker 提交于
      After moving the assignment of GAR/ISS from dccp_connect_init() to
      dccp_transmit_skb(), the former function becomes very small, so that
      a merger with dccp_connect() suggests itself.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      93344af4
    • G
      dccp: fix the adjustments to AWL and SWL · 0b53d460
      Gerrit Renker 提交于
      This fixes a problem and a potential loophole with regard to seqno/ackno
      validity: currently the initial adjustments to AWL/SWL are only performed
      once at the begin of the connection, during the handshake.
      
      Since the Sequence Window feature is always greater than Wmin=32 (7.5.2),
      it is however necessary to perform these adjustments at least for the first
      W/W' (variables as per 7.5.1) packets in the lifetime of a connection.
      
      This requirement is complicated by the fact that W/W' can change at any time
      during the lifetime of a connection.
      
      Therefore it is better to perform that safety check each time SWL/AWL are
      updated, as implemented by the patch.
      
      A second problem solved by this patch is that the remote/local Sequence Window
      feature values (which set the bounds for AWL/SWL/SWH) are undefined until the
      feature negotiation has completed.
      
      During the initial handshake we have more stringent sequence number protection;
      the changes added by this patch effect that {A,S}W{L,H} are within the correct
      bounds at the instant that feature negotiation completes (since the SeqWin
      feature activation handlers call dccp_update_gsr/gss()).
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      0b53d460
    • E
      net dst: use a percpu_counter to track entries · fc66f95c
      Eric Dumazet 提交于
      struct dst_ops tracks number of allocated dst in an atomic_t field,
      subject to high cache line contention in stress workload.
      
      Switch to a percpu_counter, to reduce number of time we need to dirty a
      central location. Place it on a separate cache line to avoid dirtying
      read only fields.
      
      Stress test :
      
      (Sending 160.000.000 UDP frames,
      IP route cache disabled, dual E5540 @2.53GHz,
      32bit kernel, FIB_TRIE, SLUB/NUMA)
      
      Before:
      
      real    0m51.179s
      user    0m15.329s
      sys     10m15.942s
      
      After:
      
      real	0m45.570s
      user	0m15.525s
      sys	9m56.669s
      
      With a small reordering of struct neighbour fields, subject of a
      following patch, (to separate refcnt from other read mostly fields)
      
      real	0m41.841s
      user	0m15.261s
      sys	8m45.949s
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fc66f95c
    • E
      neigh: Protect neigh->ha[] with a seqlock · 0ed8ddf4
      Eric Dumazet 提交于
      Add a seqlock in struct neighbour to protect neigh->ha[], and avoid
      dirtying neighbour in stress situation (many different flows / dsts)
      
      Dirtying takes place because of read_lock(&n->lock) and n->used writes.
      
      Switching to a seqlock, and writing n->used only on jiffies changes
      permits less dirtying.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0ed8ddf4
    • K
      net: clear heap allocations for privileged ethtool actions · b00916b1
      Kees Cook 提交于
      Several other ethtool functions leave heap uncleared (potentially) by
      drivers. Some interfaces appear safe (eeprom, etc), in that the sizes
      are well controlled. In some situations (e.g. unchecked error conditions),
      the heap will remain unchanged in areas before copying back to userspace.
      Note that these are less of an issue since these all require CAP_NET_ADMIN.
      
      Cc: stable@kernel.org
      Signed-off-by: NKees Cook <kees.cook@canonical.com>
      Acked-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b00916b1
    • J
      ATM: mpc, fix use after free · 5518b29f
      Jiri Slaby 提交于
      Stanse found that mpc_push frees skb and then it dereferences it. It
      is a typo, new_skb should be dereferenced there.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5518b29f
    • E
      neigh: speedup neigh_hh_init() · 34d101dd
      Eric Dumazet 提交于
      When a new dst is used to send a frame, neigh_resolve_output() tries to
      associate an struct hh_cache to this dst, calling neigh_hh_init() with
      the neigh rwlock write locked.
      
      Most of the time, hh_cache is already known and linked into neighbour,
      so we find it and increment its refcount.
      
      This patch changes the logic so that we call neigh_hh_init() with
      neighbour lock read locked only, so that fast path can be run in
      parallel by concurrent cpus.
      
      This brings part of the speedup we got with commit c7d4426a
      (introduce DST_NOCACHE flag) for non cached dsts, even for cached ones,
      removing one of the contention point that routers hit on multiqueue
      enabled machines.
      
      Further improvements would need to use a seqlock instead of an rwlock to
      protect neigh->ha[], to not dirty neigh too often and remove two atomic
      ops.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      34d101dd
  5. 11 10月, 2010 4 次提交
  6. 10 10月, 2010 1 次提交
  7. 09 10月, 2010 7 次提交
  8. 08 10月, 2010 3 次提交
  9. 07 10月, 2010 7 次提交