1. 04 12月, 2011 4 次提交
  2. 03 12月, 2011 1 次提交
  3. 02 12月, 2011 11 次提交
  4. 01 12月, 2011 16 次提交
  5. 30 11月, 2011 8 次提交
    • R
      ipv4: remove useless codes in ipmr_device_event() · e92036a6
      RongQing.Li 提交于
      Commit 7dc00c82 added a 'notify' parameter for vif_delete() to
      distinguish whether to unregister the device.
      
      When notify=1 means we does not need to unregister the device,
      so calling unregister_netdevice_many is useless.
      Signed-off-by: NRongQing.Li <roy.qing.li@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e92036a6
    • I
      net: Fix skb_update_prio RCU usage. · 6977a79d
      Igor Maravic 提交于
      Change function rcu_dereference to rcu_dereference_bh to avoid warning
      
      [ INFO: suspicious RCU usage. ]
      -------------------------------
      net/core/dev.c:2459 suspicious rcu_dereference_check() usage!
      
      because we are locking with
      
      rcu_read_lock_bh();
      
      in function dev_queue_xmit(struct sk_buff *skb)
      Signed-off-by: NIgor Maravic <igorm@etf.rs>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6977a79d
    • P
      netlabel: Fix build problems when IPv6 is not enabled · 1281bc25
      Paul Moore 提交于
      A recent fix to the the NetLabel code caused build problem with
      configurations that did not have IPv6 enabled; see below:
      
       netlabel_kapi.c: In function 'netlbl_cfg_unlbl_map_add':
       netlabel_kapi.c:165:4:
        error: implicit declaration of function 'netlbl_af6list_add'
      
      This patch fixes this problem by making the IPv6 specific code conditional
      on the IPv6 configuration flags as we done in the rest of NetLabel and the
      network stack as a whole.  We have to move some variable declarations
      around as a result so things may not be quite as pretty, but at least it
      builds cleanly now.
      
      Some additional IPv6 conditionals were added to the NetLabel code as well
      for the sake of consistency.
      Reported-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NPaul Moore <pmoore@redhat.com>
      Acked-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1281bc25
    • X
      sctp: better integer overflow check in sctp_auth_create_key() · c89304b8
      Xi Wang 提交于
      The check from commit 30c2235c is incomplete and cannot prevent
      cases like key_len = 0x80000000 (INT_MAX + 1).  In that case, the
      left-hand side of the check (INT_MAX - key_len), which is unsigned,
      becomes 0xffffffff (UINT_MAX) and bypasses the check.
      
      However this shouldn't be a security issue.  The function is called
      from the following two code paths:
      
       1) setsockopt()
      
       2) sctp_auth_asoc_set_secret()
      
      In case (1), sca_keylength is never going to exceed 65535 since it's
      bounded by a u16 from the user API.  As such, the key length will
      never overflow.
      
      In case (2), sca_keylength is computed based on the user key (1 short)
      and 2 * key_vector (3 shorts) for a total of 7 * USHRT_MAX, which still
      will not overflow.
      
      In other words, this overflow check is not really necessary.  Just
      make it more correct.
      Signed-off-by: NXi Wang <xi.wang@gmail.com>
      Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c89304b8
    • E
      sch_choke: use skb_flow_dissect() · 2bcc34bb
      Eric Dumazet 提交于
      Instead of using a custom flow dissector, use skb_flow_dissect() and
      benefit from tunnelling support.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2bcc34bb
    • E
      sch_sfq: use skb_flow_dissect() · 11fca931
      Eric Dumazet 提交于
      Instead of using a custom flow dissector, use skb_flow_dissect() and
      benefit from tunnelling support.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      11fca931
    • E
      tcp: avoid frag allocation for small frames · f07d960d
      Eric Dumazet 提交于
      tcp_sendmsg() uses select_size() helper to choose skb head size when a
      new skb must be allocated.
      
      If GSO is enabled for the socket, current strategy is to force all
      payload data to be outside of headroom, in PAGE fragments.
      
      This strategy is not welcome for small packets, wasting memory.
      
      Experiments show that best results are obtained when using 2048 bytes
      for skb head (This includes the skb overhead and various headers)
      
      This patch provides better len/truesize ratios for packets sent to
      loopback device, and reduce memory needs for in-flight loopback packets,
      particularly on arches with big pages.
      
      If a sender sends many 1-byte packets to an unresponsive application,
      receiver rmem_alloc will grow faster and will stop queuing these packets
      sooner, or will collapse its receive queue to free excess memory.
      
      netperf -t TCP_RR results are improved by ~4 %, and many workloads are
      improved as well (tbench, mysql...)
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f07d960d
    • E
      flow_dissector: use a 64bit load/store · 4d77d2b5
      Eric Dumazet 提交于
      Le lundi 28 novembre 2011 à 19:06 -0500, David Miller a écrit :
      > From: Dimitris Michailidis <dm@chelsio.com>
      > Date: Mon, 28 Nov 2011 08:25:39 -0800
      >
      > >> +bool skb_flow_dissect(const struct sk_buff *skb, struct flow_keys
      > >> *flow)
      > >> +{
      > >> +	int poff, nhoff = skb_network_offset(skb);
      > >> +	u8 ip_proto;
      > >> +	u16 proto = skb->protocol;
      > >
      > > __be16 instead of u16 for proto?
      >
      > I'll take care of this when I apply these patches.
      
      ( CC trimmed )
      
      Thanks David !
      
      Here is a small patch to use one 64bit load/store on x86_64 instead of
      two 32bit load/stores.
      
      [PATCH net-next] flow_dissector: use a 64bit load/store
      
      gcc compiler is smart enough to use a single load/store if we
      memcpy(dptr, sptr, 8) on x86_64, regardless of
      CONFIG_CC_OPTIMIZE_FOR_SIZE
      
      In IP header, daddr immediately follows saddr, this wont change in the
      future. We only need to make sure our flow_keys (src,dst) fields wont
      break the rule.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4d77d2b5