mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
flow: Extend struct flow to contain tunnel outer header.
Soon the kernel will begin supplying the information about the outer IP header for tunneled packets and userspace will need to be able to track it as part of the flow. For the time being this is only used internally by OVS and not exposed outwards to OpenFlow. As a result, this threads the information throughout userspace but simply stores the existing tun_id in it. Signed-off-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
@@ -1260,8 +1260,8 @@ odp_flow_key_from_flow(struct ofpbuf *buf, const struct flow *flow)
|
||||
nl_msg_put_u32(buf, OVS_KEY_ATTR_PRIORITY, flow->skb_priority);
|
||||
}
|
||||
|
||||
if (flow->tun_id != htonll(0)) {
|
||||
nl_msg_put_be64(buf, OVS_KEY_ATTR_TUN_ID, flow->tun_id);
|
||||
if (flow->tunnel.tun_id != htonll(0)) {
|
||||
nl_msg_put_be64(buf, OVS_KEY_ATTR_TUN_ID, flow->tunnel.tun_id);
|
||||
}
|
||||
|
||||
if (flow->in_port != OFPP_NONE && flow->in_port != OFPP_CONTROLLER) {
|
||||
@@ -1753,7 +1753,7 @@ odp_flow_key_to_flow(const struct nlattr *key, size_t key_len,
|
||||
}
|
||||
|
||||
if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_TUN_ID)) {
|
||||
flow->tun_id = nl_attr_get_be64(attrs[OVS_KEY_ATTR_TUN_ID]);
|
||||
flow->tunnel.tun_id = nl_attr_get_be64(attrs[OVS_KEY_ATTR_TUN_ID]);
|
||||
expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_TUN_ID;
|
||||
}
|
||||
|
||||
@@ -1848,13 +1848,13 @@ static void
|
||||
commit_set_tun_id_action(const struct flow *flow, struct flow *base,
|
||||
struct ofpbuf *odp_actions)
|
||||
{
|
||||
if (base->tun_id == flow->tun_id) {
|
||||
if (base->tunnel.tun_id == flow->tunnel.tun_id) {
|
||||
return;
|
||||
}
|
||||
base->tun_id = flow->tun_id;
|
||||
base->tunnel.tun_id = flow->tunnel.tun_id;
|
||||
|
||||
commit_set_action(odp_actions, OVS_KEY_ATTR_TUN_ID,
|
||||
&base->tun_id, sizeof(base->tun_id));
|
||||
&base->tunnel.tun_id, sizeof(base->tunnel.tun_id));
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user