]> git.proxmox.com Git - mirror_ovs.git/commitdiff
flow: Make room after ct_state.
authorJarno Rajahalme <jarno@ovn.org>
Thu, 9 Mar 2017 01:18:23 +0000 (17:18 -0800)
committerJarno Rajahalme <jarno@ovn.org>
Thu, 9 Mar 2017 01:22:56 +0000 (17:22 -0800)
'ct_state' currently only needs 8 bits, so we can make room for a new
CT field introduced in the next patch.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
include/openvswitch/flow.h
lib/flow.c
lib/match.c
lib/packets.h
ofproto/ofproto-dpif.c
tests/ovs-ofctl.at

index df80dfe461994fd1919fdd9e04a680754b5d14ac..91692723ff459fddb1f34414a8ebe1fae3bca052 100644 (file)
@@ -91,7 +91,8 @@ struct flow {
                                  * computation is opaque to the user space. */
     union flow_in_port in_port; /* Input port.*/
     uint32_t recirc_id;         /* Must be exact match. */
-    uint16_t ct_state;          /* Connection tracking state. */
+    uint8_t ct_state;           /* Connection tracking state. */
+    uint8_t pad0;
     uint16_t ct_zone;           /* Connection tracking zone. */
     uint32_t ct_mark;           /* Connection mark.*/
     uint8_t pad1[4];            /* Pad to 64 bits. */
index fb7bfeb9441ea842a9bc650be7a52dfc566a8bde..0c95b75075d53f57744150eeb52c141e38b3d0e9 100644 (file)
@@ -593,7 +593,8 @@ miniflow_extract(struct dp_packet *packet, struct miniflow *dst)
     miniflow_push_uint32(mf, in_port, odp_to_u32(md->in_port.odp_port));
     if (md->recirc_id || md->ct_state) {
         miniflow_push_uint32(mf, recirc_id, md->recirc_id);
-        miniflow_push_uint16(mf, ct_state, md->ct_state);
+        miniflow_push_uint8(mf, ct_state, md->ct_state);
+        miniflow_push_uint8(mf, pad0, 0);
         miniflow_push_uint16(mf, ct_zone, md->ct_zone);
     }
 
index 3fcaec5b08ca4117a769d71eef460cb67a135e45..882bf0c7c7ee804a81ed41b341ec01f6332af777 100644 (file)
@@ -340,8 +340,8 @@ match_set_ct_state(struct match *match, uint32_t ct_state)
 void
 match_set_ct_state_masked(struct match *match, uint32_t ct_state, uint32_t mask)
 {
-    match->flow.ct_state = ct_state & mask & UINT16_MAX;
-    match->wc.masks.ct_state = mask & UINT16_MAX;
+    match->flow.ct_state = ct_state & mask & UINT8_MAX;
+    match->wc.masks.ct_state = mask & UINT8_MAX;
 }
 
 void
@@ -1111,7 +1111,7 @@ match_format(const struct match *match, struct ds *s, int priority)
     }
 
     if (wc->masks.ct_state) {
-        if (wc->masks.ct_state == UINT16_MAX) {
+        if (wc->masks.ct_state == UINT8_MAX) {
             ds_put_format(s, "%sct_state=%s", colors.param, colors.end);
             if (f->ct_state) {
                 format_flags(s, ct_state_to_string, f->ct_state, '|');
@@ -1120,7 +1120,7 @@ match_format(const struct match *match, struct ds *s, int priority)
             }
         } else {
             format_flags_masked(s, "ct_state", ct_state_to_string,
-                                f->ct_state, wc->masks.ct_state, UINT16_MAX);
+                                f->ct_state, wc->masks.ct_state, UINT8_MAX);
         }
         ds_put_char(s, ',');
     }
index 850f192597161440988a8955c09b68f5eb783db3..cbf04965196118a52f8d109d0687542b880c84d9 100644 (file)
@@ -99,7 +99,7 @@ struct pkt_metadata {
                                    action. */
     uint32_t skb_priority;      /* Packet priority for QoS. */
     uint32_t pkt_mark;          /* Packet mark. */
-    uint16_t ct_state;          /* Connection state. */
+    uint8_t  ct_state;          /* Connection state. */
     uint16_t ct_zone;           /* Connection zone. */
     uint32_t ct_mark;           /* Connection mark. */
     ovs_u128 ct_label;          /* Connection label. */
index bf6b50c63abf58569c6d67ff15cdb69422b0f826..ca07d8c7e0ae16e7823e428e1d1adf2dcf42d266 100644 (file)
@@ -3996,7 +3996,7 @@ check_mask(struct ofproto_dpif *ofproto, const struct miniflow *flow)
     uint32_t ct_mark;
 
     support = &ofproto->backer->support.odp;
-    ct_state = MINIFLOW_GET_U16(flow, ct_state);
+    ct_state = MINIFLOW_GET_U8(flow, ct_state);
     if (support->ct_state && support->ct_zone && support->ct_mark
         && support->ct_label && support->ct_state_nat) {
         return ct_state & CS_UNSUPPORTED_MASK ? OFPERR_OFPBMC_BAD_MASK : 0;
index 354878f61384f4085526af9c8987451b8b314713..737f6097e4df381799da854239ca2ec60b99e3b1 100644 (file)
@@ -1213,9 +1213,9 @@ NXM_NX_REG0(a0e0d050)
 
 # Connection tracking fields,
 dnl
-dnl When re-serialising, bits 16-31 are wildcarded, because current OVS userspace
+dnl When re-serialising, bits 8-31 are wildcarded, because current OVS userspace
 dnl doesn't understand (or store) those bits.
-NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/0000ffff)
+NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/000000ff)
 nx_pull_match() returned error OFPBMC_BAD_VALUE
 NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/00000020)
 NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/000000f0)