2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

datapath: Convert kernel priority actions into match/set.

Following patch adds skb-priority to flow key. So userspace will know
what was priority when packet arrived and we can remove the pop/reset
priority action. It's no longer necessary to have a special action for
pop that is based on the kernel remembering original skb->priority.
Userspace can just emit a set priority action with the original value.

Since the priority field is a match field with just a normal set action,
we can convert it into the new model for actions that are based on
matches.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>

Bug #7715
This commit is contained in:
Pravin B Shelar
2011-11-01 10:13:16 -07:00
parent 7f4ae491b0
commit abff858b5a
22 changed files with 159 additions and 114 deletions

View File

@@ -324,8 +324,8 @@ invalid:
* present and has a correct length, and otherwise NULL.
*/
void
flow_extract(struct ofpbuf *packet, ovs_be64 tun_id, uint16_t ofp_in_port,
struct flow *flow)
flow_extract(struct ofpbuf *packet, uint32_t priority, ovs_be64 tun_id,
uint16_t ofp_in_port, struct flow *flow)
{
struct ofpbuf b = *packet;
struct eth_header *eth;
@@ -335,6 +335,7 @@ flow_extract(struct ofpbuf *packet, ovs_be64 tun_id, uint16_t ofp_in_port,
memset(flow, 0, sizeof *flow);
flow->tun_id = tun_id;
flow->in_port = ofp_in_port;
flow->priority = priority;
packet->l2 = b.data;
packet->l3 = NULL;
@@ -484,6 +485,7 @@ flow_zero_wildcards(struct flow *flow, const struct flow_wildcards *wildcards)
if (wc & FWW_ND_TARGET) {
memset(&flow->nd_target, 0, sizeof flow->nd_target);
}
flow->priority = 0;
}
char *
@@ -499,8 +501,14 @@ flow_format(struct ds *ds, const struct flow *flow)
{
int frag;
ds_put_format(ds, "tunnel%#"PRIx64":in_port%04"PRIx16":tci(",
ntohll(flow->tun_id), flow->in_port);
ds_put_format(ds, "priority%"PRIu32
":tunnel%#"PRIx64
":in_port%04"PRIx16,
flow->priority,
ntohll(flow->tun_id),
flow->in_port);
ds_put_format(ds, ":tci(");
if (flow->vlan_tci) {
ds_put_format(ds, "vlan%"PRIu16",pcp%d",
vlan_tci_to_vid(flow->vlan_tci),