@@ -1856,18 +1856,34 @@ netdev_flow_key_from_flow(struct netdev_flow_key
*dst,
/* Initialize a netdev_flow_key 'mask' from 'match'. */
static inline void
netdev_flow_mask_init(struct netdev_flow_key *mask,
- const struct match *match)
+ const struct match *match,
+ char * port_type)
It’s better to handle all this in the caller and not modify this function
at all.
{
uint64_t *dst = miniflow_values(&mask->mf);
struct flowmap fmap;
uint32_t hash = 0;
size_t idx;
+ bool phy_port = false;
+
+ if (port_type && !strcmp(port_type, "dpdk")) {
+ phy_port = true;
+ }
/* Only check masks that make sense for the flow. */
flow_wc_map(&match->flow, &fmap);
flowmap_init(&mask->mf.map);
+ /* Check that dp_hash and in_port must be into the same structure
chunk. */
+ BUILD_ASSERT_DECL(offsetof(struct flow, dp_hash)/sizeof(*dst) ==
+ offsetof(struct flow, in_port)/sizeof(*dst));
+#define DPHASH_INPORT_MAP_IDX (offsetof(struct flow,
dp_hash)/sizeof(*dst))