datapath: Drop padding from struct odp_flow_key.
authorBen Pfaff <blp@nicira.com>
Fri, 10 Sep 2010 18:18:53 +0000 (11:18 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 11 Oct 2010 20:31:43 +0000 (13:31 -0700)
Breaking this out as a separate commit should make it easier to see what
needs to change later, if we need to reintroduce padding at some point.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/datapath.c
include/openvswitch/datapath-protocol.h
lib/odp-util.c

index e2d005e..46497c6 100644 (file)
@@ -1040,8 +1040,6 @@ static int do_put_flow(struct datapath *dp, struct odp_flow_put *uf,
        struct tbl *table;
        int error;
 
-       memset(uf->flow.key.reserved, 0, sizeof uf->flow.key.reserved);
-
        table = rcu_dereference(dp->table);
        flow_node = tbl_lookup(table, &uf->flow.key, flow_hash(&uf->flow.key), flow_cmp);
        if (!flow_node) {
@@ -1200,7 +1198,6 @@ static struct sw_flow *do_del_flow(struct datapath *dp, struct odp_flow_key *key
        struct tbl_node *flow_node;
        int error;
 
-       memset(key->reserved, 0, sizeof key->reserved);
        flow_node = tbl_lookup(table, key, flow_hash(key), flow_cmp);
        if (!flow_node)
                return ERR_PTR(-ENOENT);
@@ -1250,7 +1247,6 @@ static int do_query_flows(struct datapath *dp, const struct odp_flowvec *flowvec
 
                if (copy_from_user(&uf, ufp, sizeof uf))
                        return -EFAULT;
-               memset(uf.key.reserved, 0, sizeof uf.key.reserved);
 
                flow_node = tbl_lookup(table, &uf.key, flow_hash(&uf.key), flow_cmp);
                if (!flow_node)
index 0cadc82..1aa8066 100644 (file)
@@ -226,7 +226,6 @@ struct odp_flow_key {
     uint8_t  nw_proto;          /* IP protocol or lower 8 bits of
                                    ARP opcode. */
     uint8_t  nw_tos;            /* IP ToS (DSCP field, 6 bits). */
-    uint32_t reserved[1];          /* Reserved for later use. */
 };
 
 /* Flags for ODP_FLOW. */
index 16a40de..b497538 100644 (file)
@@ -198,7 +198,6 @@ odp_flow_key_from_flow(struct odp_flow_key *key, const struct flow *flow)
     memcpy(key->dl_dst, flow->dl_dst, ETH_ADDR_LEN);
     key->nw_proto = flow->nw_proto;
     key->nw_tos = flow->nw_tos;
-    memset(key->reserved, 0, sizeof key->reserved);
 }
 
 void