1. 22 7月, 2015 2 次提交
  2. 02 6月, 2015 1 次提交
    • N
      openvswitch: include datapath actions with sampled-packet upcall to userspace · ccea7445
      Neil McKee 提交于
      If new optional attribute OVS_USERSPACE_ATTR_ACTIONS is added to an
      OVS_ACTION_ATTR_USERSPACE action, then include the datapath actions
      in the upcall.
      
      This Directly associates the sampled packet with the path it takes
      through the virtual switch. Path information currently includes mangling,
      encapsulation and decapsulation actions for tunneling protocols GRE,
      VXLAN, Geneve, MPLS and QinQ, but this extension requires no further
      changes to accommodate datapath actions that may be added in the
      future.
      
      Adding path information enhances visibility into complex virtual
      networks.
      Signed-off-by: NNeil McKee <neil.mckee@inmon.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ccea7445
  3. 08 2月, 2015 1 次提交
    • J
      net: openvswitch: Support masked set actions. · 83d2b9ba
      Jarno Rajahalme 提交于
      OVS userspace already probes the openvswitch kernel module for
      OVS_ACTION_ATTR_SET_MASKED support.  This patch adds the kernel module
      implementation of masked set actions.
      
      The existing set action sets many fields at once.  When only a subset
      of the IP header fields, for example, should be modified, all the IP
      fields need to be exact matched so that the other field values can be
      copied to the set action.  A masked set action allows modification of
      an arbitrary subset of the supported header bits without requiring the
      rest to be matched.
      
      Masked set action is now supported for all writeable key types, except
      for the tunnel key.  The set tunnel action is an exception as any
      input tunnel info is cleared before action processing starts, so there
      is no tunnel info to mask.
      
      The kernel module converts all (non-tunnel) set actions to masked set
      actions.  This makes action processing more uniform, and results in
      less branching and duplicating the action processing code.  When
      returning actions to userspace, the fully masked set actions are
      converted back to normal set actions.  We use a kernel internal action
      code to be able to tell the userspace provided and converted masked
      set actions apart.
      Signed-off-by: NJarno Rajahalme <jrajahalme@nicira.com>
      Acked-by: NPravin B Shelar <pshelar@nicira.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      83d2b9ba
  4. 14 1月, 2015 1 次提交
  5. 24 12月, 2014 1 次提交
  6. 22 11月, 2014 4 次提交
  7. 15 11月, 2014 2 次提交
  8. 10 11月, 2014 4 次提交
  9. 06 11月, 2014 3 次提交
  10. 29 10月, 2014 1 次提交
  11. 06 10月, 2014 1 次提交
  12. 16 9月, 2014 4 次提交
  13. 23 8月, 2014 1 次提交
    • J
      openvswitch: fix panic with multiple vlan headers · 2ba5af42
      Jiri Benc 提交于
      When there are multiple vlan headers present in a received frame, the first
      one is put into vlan_tci and protocol is set to ETH_P_8021Q. Anything in the
      skb beyond the VLAN TPID may be still non-linear, including the inner TCI
      and ethertype. While ovs_flow_extract takes care of IP and IPv6 headers, it
      does nothing with ETH_P_8021Q. Later, if OVS_ACTION_ATTR_POP_VLAN is
      executed, __pop_vlan_tci pulls the next vlan header into vlan_tci.
      
      This leads to two things:
      
      1. Part of the resulting ethernet header is in the non-linear part of the
         skb. When eth_type_trans is called later as the result of
         OVS_ACTION_ATTR_OUTPUT, kernel BUGs in __skb_pull. Also, __pop_vlan_tci
         is in fact accessing random data when it reads past the TPID.
      
      2. network_header points into the ethernet header instead of behind it.
         mac_len is set to a wrong value (10), too.
      Reported-by: NYulong Pei <ypei@redhat.com>
      Signed-off-by: NJiri Benc <jbenc@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2ba5af42
  14. 25 7月, 2014 2 次提交
    • A
      openvswitch: Add skb_clone NULL check for the sampling action. · d9e0ecb8
      Andy Zhou 提交于
      Fix a bug where skb_clone() NULL check is missing in sample action
      implementation.
      Signed-off-by: NAndy Zhou <azhou@nicira.com>
      Signed-off-by: NPravin B Shelar <pshelar@nicira.com>
      d9e0ecb8
    • S
      openvswitch: Sample action without side effects · 651887b0
      Simon Horman 提交于
      The sample action is rather generic, allowing arbitrary actions to be
      executed based on a probability. However its use, within the Open
      vSwitch
      code-base is limited: only a single user-space action is ever nested.
      
      A consequence of the current implementation of sample actions is that
      depending on weather the sample action executed (due to its probability)
      any side-effects of nested actions may or may not be present before
      executing subsequent actions.  This has the potential to complicate
      verification of valid actions by the (kernel) datapath. And indeed
      adding support for push and pop MPLS actions inside sample actions
      is one case where such case.
      
      In order to allow all supported actions to be continue to be nested
      inside sample actions without the potential need for complex
      verification code this patch changes the implementation of the sample
      action in the kernel datapath so that sample actions are more like
      a function call and any side effects of nested actions are not
      present when executing subsequent actions.
      
      With the above in mind the motivation for this change is twofold:
      
      * To contain side-effects the sample action in the hope of making it
        easier to deal with in the future and;
      * To avoid some rather complex verification code introduced in the MPLS
        datapath patch.
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      Signed-off-by: NJesse Gross <jesse@nicira.com>
      Signed-off-by: NPravin B Shelar <pshelar@nicira.com>
      651887b0
  15. 30 6月, 2014 1 次提交
  16. 17 5月, 2014 1 次提交
  17. 15 1月, 2014 1 次提交
  18. 18 12月, 2013 1 次提交
    • T
      net: Add utility functions to clear rxhash · 7539fadc
      Tom Herbert 提交于
      In several places 'skb->rxhash = 0' is being done to clear the
      rxhash value in an skb.  This does not clear l4_rxhash which could
      still be set so that the rxhash wouldn't be recalculated on subsequent
      call to skb_get_rxhash.  This patch adds an explict function to clear
      all the rxhash related information in the skb properly.
      
      skb_clear_hash_if_not_l4 clears the rxhash only if it is not marked as
      l4_rxhash.
      
      Fixed up places where 'skb->rxhash = 0' was being called.
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7539fadc
  19. 27 8月, 2013 1 次提交
  20. 24 8月, 2013 1 次提交
    • A
      openvswitch: Mega flow implementation · 03f0d916
      Andy Zhou 提交于
      Add wildcarded flow support in kernel datapath.
      
      Wildcarded flow can improve OVS flow set up performance by avoid sending
      matching new flows to the user space program. The exact performance boost
      will largely dependent on wildcarded flow hit rate.
      
      In case all new flows hits wildcard flows, the flow set up rate is
      within 5% of that of linux bridge module.
      
      Pravin has made significant contributions to this patch. Including API
      clean ups and bug fixes.
      Signed-off-by: NPravin B Shelar <pshelar@nicira.com>
      Signed-off-by: NAndy Zhou <azhou@nicira.com>
      Signed-off-by: NJesse Gross <jesse@nicira.com>
      03f0d916
  21. 15 8月, 2013 1 次提交
    • J
      openvswitch: Reset tunnel key between input and output. · 36bf5cc6
      Jesse Gross 提交于
      It doesn't make sense to output a tunnel packet using the same
      parameters that it was received with since that will generally
      just result in the packet going back to us. As a result, userspace
      assumes that the tunnel key is cleared when transitioning through
      the switch. In the majority of cases this doesn't matter since a
      packet is either going to a tunnel port (in which the key is
      overwritten with new values) or to a non-tunnel port (in which
      case the key is ignored). However, it's theoreticaly possible that
      userspace could rely on the documented behavior, so this corrects
      it.
      Signed-off-by: NJesse Gross <jesse@nicira.com>
      36bf5cc6
  22. 20 6月, 2013 1 次提交
  23. 15 6月, 2013 1 次提交
  24. 20 4月, 2013 1 次提交
  25. 23 2月, 2013 1 次提交
    • C
      openvswitch: fix the calculation of checksum for vlan header · 7b024082
      Cong Wang 提交于
      In vlan_insert_tag(), we insert a 4-byte VLAN header _after_
      mac header:
      
              memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN);
              ...
              veth->h_vlan_proto = htons(ETH_P_8021Q);
              ...
              veth->h_vlan_TCI = htons(vlan_tci);
      
      so after it, we should recompute the checksum to include these 4 bytes.
      skb->data still points to the mac header, therefore VLAN header is at
      (2 * ETH_ALEN = 12) bytes after it, not (ETH_HLEN = 14) bytes.
      
      This can also be observed via tcpdump:
      
               0x0000:  ffff ffff ffff 5254 005d 6f6e 8100 000a
               0x0010:  0806 0001 0800 0604 0001 5254 005d 6f6e
               0x0020:  c0a8 026e 0000 0000 0000 c0a8 0282
      
      Similar for __pop_vlan_tci(), the vlan header we remove is the one
      overwritten in:
      
      	memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN);
      
      Therefore the VLAN_HLEN = 4 bytes after 2 * ETH_ALEN is the part
      we want to sub from checksum.
      
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jesse Gross <jesse@nicira.com>
      Signed-off-by: NCong Wang <amwang@redhat.com>
      Signed-off-by: NJesse Gross <jesse@nicira.com>
      7b024082
  26. 27 11月, 2012 1 次提交