From: Ben Pfaff Date: Fri, 10 Sep 2010 18:18:53 +0000 (-0700) Subject: datapath: Drop padding from struct odp_flow_key. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a01ef04ce;p=openvswitch datapath: Drop padding from struct odp_flow_key. 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 Acked-by: Jesse Gross --- diff --git a/datapath/datapath.c b/datapath/datapath.c index e2d005e9..46497c69 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -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) diff --git a/include/openvswitch/datapath-protocol.h b/include/openvswitch/datapath-protocol.h index 0cadc824..1aa8066c 100644 --- a/include/openvswitch/datapath-protocol.h +++ b/include/openvswitch/datapath-protocol.h @@ -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. */ diff --git a/lib/odp-util.c b/lib/odp-util.c index 16a40ded..b497538d 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -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