diff options
author | Jan Scheurich <jan.scheurich@ericsson.com> | 2017-06-02 16:16:17 +0000 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-06-02 10:15:20 -0700 |
commit | beb75a40fdc295bfd6521b0068b4cd12f6de507c (patch) | |
tree | 3f7997c2e2d627f36287d8bec8c4600232cdef20 /include/openvswitch/match.h | |
parent | 5978c2e31574cb5a97931e36e6725ce3ab7d7df6 (diff) | |
download | openvswitch-beb75a40fdc295bfd6521b0068b4cd12f6de507c.tar.gz |
userspace: Switching of L3 packets in L2 pipeline
Ports have a new layer3 attribute if they send/receive L3 packets.
The packet_type included in structs dp_packet and flow is considered in
ofproto-dpif. The classical L2 match fields (dl_src, dl_dst, dl_type, and
vlan_tci, vlan_vid, vlan_pcp) now have Ethernet as pre-requisite.
A dummy ethernet header is pushed to L3 packets received from L3 ports
before the the pipeline processing starts. The ethernet header is popped
before sending a packet to a L3 port.
For datapath ports that can receive L2 or L3 packets, the packet_type
becomes part of the flow key for datapath flows and is handled
appropriately in dpif-netdev.
In the 'else' branch in flow_put_on_pmd() function, the additional check
flow_equal(&match.flow, &netdev_flow->flow) was removed, as a) the dpcls
lookup is sufficient to uniquely identify a flow and b) it caused false
negatives because the flow in netdev->flow may not properly masked.
In dpif_netdev_flow_put() we now use the same method for constructing the
netdev_flow_key as the one used when adding the flow to the dplcs to make sure
these always match. The function netdev_flow_key_from_flow() used so far was
not only inefficient but sometimes caused mismatches and subsequent flow
update failures.
The kernel datapath does not support the packet_type match field.
Instead it encodes the packet type implictly by the presence or absence of
the Ethernet attribute in the flow key and mask.
This patch filters the PACKET_TYPE attribute out of netlink flow key and
mask to be sent to the kernel datapath.
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com>
Co-authored-by: Zoltan Balogh <zoltan.balogh@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include/openvswitch/match.h')
-rw-r--r-- | include/openvswitch/match.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/openvswitch/match.h b/include/openvswitch/match.h index ca1dc7df9..9e15da24d 100644 --- a/include/openvswitch/match.h +++ b/include/openvswitch/match.h @@ -116,6 +116,7 @@ void match_set_ct_ipv6_dst(struct match *, const struct in6_addr *); void match_set_ct_ipv6_dst_masked(struct match *, const struct in6_addr *, const struct in6_addr *); +void match_set_packet_type(struct match *, ovs_be32 packet_type); void match_set_skb_priority(struct match *, uint32_t skb_priority); void match_set_dl_type(struct match *, ovs_be16); void match_set_dl_src(struct match *, const struct eth_addr ); |