flow: Rename 'priority' to 'skb_priority'.
authorBen Pfaff <blp@nicira.com>
Wed, 21 Dec 2011 23:52:23 +0000 (15:52 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 21 Dec 2011 23:52:38 +0000 (15:52 -0800)
This priority's mean is completely different from the priority of an
OpenFlow rule, so it is confusing for it to have the same name.

We should be on the lookout for a less Linux-specific name, but this one
seems fine for now.

Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/classifier.c
lib/flow.c
lib/flow.h
lib/odp-util.c
ofproto/ofproto-dpif.c

index dab8f620fbb6622422c8e6a37cdcf604462aec14..26751ca496485846f4e625035a816b30371a48c5 100644 (file)
@@ -74,7 +74,7 @@ cls_rule_init_exact(const struct flow *flow,
                     unsigned int priority, struct cls_rule *rule)
 {
     rule->flow = *flow;
-    rule->flow.priority = 0;
+    rule->flow.skb_priority = 0;
     flow_wildcards_init_exact(&rule->wc);
     rule->priority = priority;
 }
index 922412fd8ce53cdb24e32c47ff69b447fc27ed25..fa7ae4f178327fa681b05c5e37832037f313e5fd 100644 (file)
@@ -312,7 +312,9 @@ invalid:
 
 }
 
-/* Initializes 'flow' members from 'packet', 'tun_id', and 'ofp_in_port'.
+/* Initializes 'flow' members from 'packet', 'skb_priority', 'tun_id', and
+ * 'ofp_in_port'.
+ *
  * Initializes 'packet' header pointers as follows:
  *
  *    - packet->l2 to the start of the Ethernet header.
@@ -328,7 +330,7 @@ invalid:
  *      present and has a correct length, and otherwise NULL.
  */
 void
-flow_extract(struct ofpbuf *packet, uint32_t priority, ovs_be64 tun_id,
+flow_extract(struct ofpbuf *packet, uint32_t skb_priority, ovs_be64 tun_id,
              uint16_t ofp_in_port, struct flow *flow)
 {
     struct ofpbuf b = *packet;
@@ -339,7 +341,7 @@ flow_extract(struct ofpbuf *packet, uint32_t priority, ovs_be64 tun_id,
     memset(flow, 0, sizeof *flow);
     flow->tun_id = tun_id;
     flow->in_port = ofp_in_port;
-    flow->priority = priority;
+    flow->skb_priority = skb_priority;
 
     packet->l2 = b.data;
     packet->l3 = NULL;
@@ -502,7 +504,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;
+    flow->skb_priority = 0;
 }
 
 char *
@@ -519,7 +521,7 @@ flow_format(struct ds *ds, const struct flow *flow)
     ds_put_format(ds, "priority%"PRIu32
                       ":tunnel%#"PRIx64
                       ":in_port%04"PRIx16,
-                      flow->priority,
+                      flow->skb_priority,
                       ntohll(flow->tun_id),
                       flow->in_port);
 
index 7606cb3d92c1d5fcd08cebbe2d02d4f98b4fb1ba..32492e8fc9ae6bd166d551ec7b54c7539c59dfe4 100644 (file)
@@ -57,7 +57,7 @@ struct flow {
     struct in6_addr ipv6_src;   /* IPv6 source address. */
     struct in6_addr ipv6_dst;   /* IPv6 destination address. */
     struct in6_addr nd_target;  /* IPv6 neighbor discovery (ND) target. */
-    uint32_t priority;          /* Packet priority for QoS. */
+    uint32_t skb_priority;      /* Packet priority for QoS. */
     uint32_t regs[FLOW_N_REGS]; /* Registers. */
     ovs_be32 nw_src;            /* IPv4 source address. */
     ovs_be32 nw_dst;            /* IPv4 destination address. */
index ee1c3784320f3e5b04f51ff868fdb90cce235ebe..490d35eb252a06dc283082b4ba7942e4035d99f0 100644 (file)
@@ -1163,8 +1163,8 @@ odp_flow_key_from_flow(struct ofpbuf *buf, const struct flow *flow)
     struct ovs_key_ethernet *eth_key;
     size_t encap;
 
-    if (flow->priority) {
-        nl_msg_put_u32(buf, OVS_KEY_ATTR_PRIORITY, flow->priority);
+    if (flow->skb_priority) {
+        nl_msg_put_u32(buf, OVS_KEY_ATTR_PRIORITY, flow->skb_priority);
     }
 
     if (flow->tun_id != htonll(0)) {
@@ -1655,7 +1655,7 @@ odp_flow_key_to_flow(const struct nlattr *key, size_t key_len,
 
     /* Metadata. */
     if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_PRIORITY)) {
-        flow->priority = nl_attr_get_u32(attrs[OVS_KEY_ATTR_PRIORITY]);
+        flow->skb_priority = nl_attr_get_u32(attrs[OVS_KEY_ATTR_PRIORITY]);
         expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_PRIORITY;
     }
 
@@ -1859,13 +1859,13 @@ static void
 commit_set_priority_action(const struct flow *flow, struct flow *base,
                            struct ofpbuf *odp_actions)
 {
-    if (base->priority == flow->priority) {
+    if (base->skb_priority == flow->skb_priority) {
         return;
     }
-    base->priority = flow->priority;
+    base->skb_priority = flow->skb_priority;
 
     commit_set_action(odp_actions, OVS_KEY_ATTR_PRIORITY,
-                      &base->priority, sizeof(base->priority));
+                      &base->skb_priority, sizeof(base->skb_priority));
 }
 
 /* If any of the flow key data that ODP actions can modify are different in
index 7dc8caea0cc12d5c7ce1028393537e4b401f05ea..56c3bafe82b0bfc6ee033a72791ea38074ec0998 100644 (file)
@@ -227,7 +227,7 @@ struct action_xlate_ctx {
 
     int recurse;                /* Recursion level, via xlate_table_action. */
     struct flow base_flow;      /* Flow at the last commit. */
-    uint32_t original_priority; /* Priority when packet arrived. */
+    uint32_t orig_skb_priority; /* Priority when packet arrived. */
     uint8_t table_id;           /* OpenFlow table ID where flow was found. */
     uint32_t sflow_n_outputs;   /* Number of output ports. */
     uint16_t sflow_odp_port;    /* Output port for composing sFlow action. */
@@ -2673,7 +2673,7 @@ handle_miss_upcalls(struct ofproto_dpif *ofproto, struct dpif_upcall *upcalls,
             ofpbuf_delete(upcall->packet);
             continue;
         }
-        flow_extract(upcall->packet, flow.priority, flow.tun_id,
+        flow_extract(upcall->packet, flow.skb_priority, flow.tun_id,
                      flow.in_port, &flow);
 
         /* Handle 802.1ag, LACP, and STP specially. */
@@ -4161,7 +4161,7 @@ compose_output_action__(struct action_xlate_ctx *ctx, uint16_t ofp_port,
             return;
         }
 
-        pdscp = get_priority(ofport, ctx->flow.priority);
+        pdscp = get_priority(ofport, ctx->flow.skb_priority);
         if (pdscp) {
             ctx->flow.nw_tos &= ~IP_DSCP_MASK;
             ctx->flow.nw_tos |= pdscp->dscp;
@@ -4390,10 +4390,10 @@ xlate_enqueue_action(struct action_xlate_ctx *ctx,
     }
 
     /* Add datapath actions. */
-    flow_priority = ctx->flow.priority;
-    ctx->flow.priority = priority;
+    flow_priority = ctx->flow.skb_priority;
+    ctx->flow.skb_priority = priority;
     compose_output_action(ctx, ofp_port);
-    ctx->flow.priority = flow_priority;
+    ctx->flow.skb_priority = flow_priority;
 
     /* Update NetFlow output port. */
     if (ctx->nf_output_iface == NF_OUT_DROP) {
@@ -4418,7 +4418,7 @@ xlate_set_queue_action(struct action_xlate_ctx *ctx,
         return;
     }
 
-    ctx->flow.priority = priority;
+    ctx->flow.skb_priority = priority;
 }
 
 struct xlate_reg_state {
@@ -4616,7 +4616,7 @@ do_xlate_actions(const union ofp_action *in, size_t n_in,
             break;
 
         case OFPUTIL_NXAST_POP_QUEUE:
-            ctx->flow.priority = ctx->original_priority;
+            ctx->flow.skb_priority = ctx->orig_skb_priority;
             break;
 
         case OFPUTIL_NXAST_REG_MOVE:
@@ -4721,7 +4721,7 @@ xlate_actions(struct action_xlate_ctx *ctx,
     ctx->nf_output_iface = NF_OUT_DROP;
     ctx->mirrors = 0;
     ctx->recurse = 0;
-    ctx->original_priority = ctx->flow.priority;
+    ctx->orig_skb_priority = ctx->flow.skb_priority;
     ctx->table_id = 0;
     ctx->exit = false;