1. 04 11月, 2012 5 次提交
    • A
      ipv6: introduce ip6_rt_put() · 94e187c0
      Amerigo Wang 提交于
      As suggested by Eric, we could introduce a helper function
      for ipv6 too, to avoid checking if rt is NULL before
      dst_release().
      
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NCong Wang <amwang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      94e187c0
    • E
      ipv4: avoid a test in ip_rt_put() · 6da025fa
      Eric Dumazet 提交于
      We can save a test in ip_rt_put(), considering dst_release() accepts
      a NULL parameter, and dst is first element in rtable.
      
      Add a BUILD_BUG_ON() to catch any change that could break this
      assertion.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Cong Wang <amwang@redhat.com>
      Acked-by: NCong Wang <amwang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6da025fa
    • N
      sctp: Clean up type-punning in sctp_cmd_t union · b26ddd81
      Neil Horman 提交于
      Lots of points in the sctp_cmd_interpreter function treat the sctp_cmd_t arg as
      a void pointer, even though they are written as various other types.  Theres no
      need for this as doing so just leads to possible type-punning issues that could
      cause crashes, and if we remain type-consistent we can actually just remove the
      void * member of the union entirely.
      
      Change Notes:
      
      v2)
      	* Dropped chunk that modified SCTP_NULL to create a marker pattern
      	 should anyone try to use a SCTP_NULL() assigned sctp_arg_t, Assigning
      	 to .zero provides the same effect and should be faster, per Vlad Y.
      
      v3)
      	* Reverted part of V2, opting to use memset instead of .zero, so that
      	 the entire union is initalized thus avoiding the i164 speculative load
      	 problems previously encountered, per Dave M..  Also rewrote
      	 SCTP_[NO]FORCE so as to use common infrastructure a little more
      
      Signed-off-by: Neil Horman <nhorman@tuxdriver.com
      CC: Vlad Yasevich <vyasevich@gmail.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: linux-sctp@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b26ddd81
    • D
      pktgen: clean up ktime_t helpers · 398f382c
      Daniel Borkmann 提交于
      Some years ago, the ktime_t helper functions ktime_now() and ktime_lt()
      have been introduced. Instead of defining them inside pktgen.c, they
      should either use ktime_t library functions or, if not available, they
      should be defined in ktime.h, so that also others can benefit from them.
      ktime_compare() is introduced with a similar notion as in timespec_compare().
      Signed-off-by: NDaniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      398f382c
    • E
      tcp: better retrans tracking for defer-accept · e6c022a4
      Eric Dumazet 提交于
      For passive TCP connections using TCP_DEFER_ACCEPT facility,
      we incorrectly increment req->retrans each time timeout triggers
      while no SYNACK is sent.
      
      SYNACK are not sent for TCP_DEFER_ACCEPT that were established (for
      which we received the ACK from client). Only the last SYNACK is sent
      so that we can receive again an ACK from client, to move the req into
      accept queue. We plan to change this later to avoid the useless
      retransmit (and potential problem as this SYNACK could be lost)
      
      TCP_INFO later gives wrong information to user, claiming imaginary
      retransmits.
      
      Decouple req->retrans field into two independent fields :
      
      num_retrans : number of retransmit
      num_timeout : number of timeouts
      
      num_timeout is the counter that is incremented at each timeout,
      regardless of actual SYNACK being sent or not, and used to
      compute the exponential timeout.
      
      Introduce inet_rtx_syn_ack() helper to increment num_retrans
      only if ->rtx_syn_ack() succeeded.
      
      Use inet_rtx_syn_ack() from tcp_check_req() to increment num_retrans
      when we re-send a SYNACK in answer to a (retransmitted) SYN.
      Prior to this patch, we were not counting these retransmits.
      
      Change tcp_v[46]_rtx_synack() to increment TCP_MIB_RETRANSSEGS
      only if a synack packet was successfully queued.
      Reported-by: NYuchung Cheng <ycheng@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Julian Anastasov <ja@ssi.bg>
      Cc: Vijay Subramanian <subramanian.vijay@gmail.com>
      Cc: Elliott Hughes <enh@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e6c022a4
  2. 03 11月, 2012 4 次提交
  3. 02 11月, 2012 4 次提交
  4. 01 11月, 2012 10 次提交
    • R
      time: remove the timecompare code. · 65f8f9a1
      Richard Cochran 提交于
      This patch removes the timecompare code from the kernel. The top five
      reasons to do this are:
      
      1. There are no more users of this code.
      2. The original idea was a bit weak.
      3. The original author has disappeared.
      4. The code was not general purpose but tuned to a particular hardware,
      5. There are better ways to accomplish clock synchronization.
      Signed-off-by: NRichard Cochran <richardcochran@gmail.com>
      Acked-by: NJohn Stultz <john.stultz@linaro.org>
      Tested-by: NBob Liu <lliubbo@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      65f8f9a1
    • R
      ptp: add an ioctl to compare PHC time with system time · 215b13dd
      Richard Cochran 提交于
      This patch adds an ioctl for PTP Hardware Clock (PHC) devices that allows
      user space to measure the time offset between the PHC and the system
      clock. Rather than hard coding any kind of estimation algorithm into the
      kernel, this patch takes the more flexible approach of just delivering
      an array of raw clock readings. In that way, the user space clock servo
      may be adapted to new and different hardware clocks.
      Signed-off-by: NRichard Cochran <richardcochran@gmail.com>
      Acked-by: NJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      215b13dd
    • P
      sk-filter: Add ability to get socket filter program (v2) · a8fc9277
      Pavel Emelyanov 提交于
      The SO_ATTACH_FILTER option is set only. I propose to add the get
      ability by using SO_ATTACH_FILTER in getsockopt. To be less
      irritating to eyes the SO_GET_FILTER alias to it is declared. This
      ability is required by checkpoint-restore project to be able to
      save full state of a socket.
      
      There are two issues with getting filter back.
      
      First, kernel modifies the sock_filter->code on filter load, thus in
      order to return the filter element back to user we have to decode it
      into user-visible constants. Fortunately the modification in question
      is interconvertible.
      
      Second, the BPF_S_ALU_DIV_K code modifies the command argument k to
      speed up the run-time division by doing kernel_k = reciprocal(user_k).
      Bad news is that different user_k may result in same kernel_k, so we
      can't get the original user_k back. Good news is that we don't have
      to do it. What we need to is calculate a user2_k so, that
      
        reciprocal(user2_k) == reciprocal(user_k) == kernel_k
      
      i.e. if it's re-loaded back the compiled again value will be exactly
      the same as it was. That said, the user2_k can be calculated like this
      
        user2_k = reciprocal(kernel_k)
      
      with an exception, that if kernel_k == 0, then user2_k == 1.
      
      The optlen argument is treated like this -- when zero, kernel returns
      the amount of sock_fprog elements in filter, otherwise it should be
      large enough for the sock_fprog array.
      
      changes since v1:
      * Declared SO_GET_FILTER in all arch headers
      * Added decode of vlan-tag codes
      Signed-off-by: NPavel Emelyanov <xemul@parallels.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a8fc9277
    • J
      tuntap: add ioctl to attach or detach a file form tuntap device · cde8b15f
      Jason Wang 提交于
      Sometimes usespace may need to active/deactive a queue, this could be done by
      detaching and attaching a file from tuntap device.
      
      This patch introduces a new ioctls - TUNSETQUEUE which could be used to do
      this. Flag IFF_ATTACH_QUEUE were introduced to do attaching while
      IFF_DETACH_QUEUE were introduced to do the detaching.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cde8b15f
    • J
      tuntap: introduce multiqueue flags · bbb00994
      Jason Wang 提交于
      Add flags to be used by creating multiqueue tuntap device.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bbb00994
    • E
      net: filter: add vlan tag access · f3335031
      Eric Dumazet 提交于
      BPF filters lack ability to access skb->vlan_tci
      
      This patch adds two new ancillary accessors :
      
      SKF_AD_VLAN_TAG         (44) mapped to vlan_tx_tag_get(skb)
      
      SKF_AD_VLAN_TAG_PRESENT (48) mapped to vlan_tx_tag_present(skb)
      
      This allows libpcap/tcpdump to use a kernel filter instead of
      having to fallback to accept all packets, then filter them in
      user space.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Suggested-by: NAni Sinha <ani@aristanetworks.com>
      Suggested-by: NDaniel Borkmann <danborkmann@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f3335031
    • W
      net: compute skb->rxhash if nic hash may be 3-tuple · ecd5cf5d
      Willem de Bruijn 提交于
      Network device drivers can communicate a Toeplitz hash in skb->rxhash,
      but devices differ in their hashing capabilities. All compute a 5-tuple
      hash for TCP over IPv4, but for other connection-oriented protocols,
      they may compute only a 3-tuple. This breaks RPS load balancing, e.g.,
      for TCP over IPv6 flows. Additionally, for GRE and other tunnels,
      the kernel computes a 5-tuple hash over the inner packet if possible,
      but devices do not.
      
      This patch recomputes the rxhash in software in all cases where it
      cannot be certain that a 5-tuple was computed. Device drivers can avoid
      recomputation by setting the skb->l4_rxhash flag.
      
      Recomputing adds cycles to each packet when RPS is enabled or the
      packet arrives over a tunnel. A comparison of 200x TCP_STREAM between
      two servers running unmodified netnext with rxhash computation
      in hardware vs software (using ethtool -K eth0 rxhash [on|off]) shows
      how much time is spent in __skb_get_rxhash in this worst case:
      
           0.03%          swapper  [kernel.kallsyms]     [k] __skb_get_rxhash
           0.03%          swapper  [kernel.kallsyms]     [k] __skb_get_rxhash
           0.05%          swapper  [kernel.kallsyms]     [k] __skb_get_rxhash
      
      With 200x TCP_RR it increases to
      
           0.10%          netperf  [kernel.kallsyms]     [k] __skb_get_rxhash
           0.10%          netperf  [kernel.kallsyms]     [k] __skb_get_rxhash
           0.10%          netperf  [kernel.kallsyms]     [k] __skb_get_rxhash
      
      I considered having the patch explicitly skips recomputation when it knows
      that it will not improve the hash (TCP over IPv4), but that conditional
      complicates code without saving many cycles in practice, because it has
      to take place after flow dissector.
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ecd5cf5d
    • J
      ixgbe: add setlink, getlink support to ixgbe and ixgbevf · 815cccbf
      John Fastabend 提交于
      This adds support for the net device ops to manage the embedded
      hardware bridge on ixgbe devices. With this patch the bridge
      mode can be toggled between VEB and VEPA to support stacking
      macvlan devices or using the embedded switch without any SW
      component in 802.1Qbg/br environments.
      
      Additionally, this adds source address pruning to the ixgbevf
      driver to prune any frames sent back from a reflective relay on
      the switch. This is required because the existing hardware does
      not support this. Without it frames get pushed into the stack
      with its own src mac which is invalid per 802.1Qbg VEPA
      definition.
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      815cccbf
    • J
      net: set and query VEB/VEPA bridge mode via PF_BRIDGE · 2469ffd7
      John Fastabend 提交于
      Hardware switches may support enabling and disabling the
      loopback switch which puts the device in a VEPA mode defined
      in the IEEE 802.1Qbg specification. In this mode frames are
      not switched in the hardware but sent directly to the switch.
      SR-IOV capable NICs will likely support this mode I am
      aware of at least two such devices. Also I am told (but don't
      have any of this hardware available) that there are devices
      that only support VEPA modes. In these cases it is important
      at a minimum to be able to query these attributes.
      
      This patch adds an additional IFLA_BRIDGE_MODE attribute that can be
      set and dumped via the PF_BRIDGE:{SET|GET}LINK operations. Also
      anticipating bridge attributes that may be common for both embedded
      bridges and software bridges this adds a flags attribute
      IFLA_BRIDGE_FLAGS currently used to determine if the command or event
      is being generated to/from an embedded bridge or software bridge.
      Finally, the event generation is pulled out of the bridge module and
      into rtnetlink proper.
      
      For example using the macvlan driver in VEPA mode on top of
      an embedded switch requires putting the embedded switch into
      a VEPA mode to get the expected results.
      
      	--------  --------
              | VEPA |  | VEPA |       <-- macvlan vepa edge relays
              --------  --------
                 |        |
                 |        |
              ------------------
              |      VEPA      |       <-- embedded switch in NIC
              ------------------
                      |
                      |
              -------------------
              | external switch |      <-- shiny new physical
      	-------------------          switch with VEPA support
      
      A packet sent from the macvlan VEPA at the top could be
      loopbacked on the embedded switch and never seen by the
      external switch. So in order for this to work the embedded
      switch needs to be set in the VEPA state via the above
      described commands.
      
      By making these attributes nested in IFLA_AF_SPEC we allow
      future extensions to be made as needed.
      
      CC: Lennert Buytenhek <buytenh@wantstofly.org>
      CC: Stephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2469ffd7
    • J
      net: create generic bridge ops · e5a55a89
      John Fastabend 提交于
      The PF_BRIDGE:RTM_{GET|SET}LINK nlmsg family and type are
      currently embedded in the ./net/bridge module. This prohibits
      them from being used by other bridging devices. One example
      of this being hardware that has embedded bridging components.
      
      In order to use these nlmsg types more generically this patch
      adds two net_device_ops hooks. One to set link bridge attributes
      and another to dump the current bride attributes.
      
      	ndo_bridge_setlink()
      	ndo_bridge_getlink()
      
      CC: Lennert Buytenhek <buytenh@wantstofly.org>
      CC: Stephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e5a55a89
  5. 30 10月, 2012 1 次提交
  6. 29 10月, 2012 3 次提交
  7. 26 10月, 2012 5 次提交
  8. 24 10月, 2012 1 次提交
  9. 23 10月, 2012 6 次提交
  10. 22 10月, 2012 1 次提交