X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Ftap%2Ftap_flow.c;h=76738239458a9b7dee0abe5f1e3dc85a0725990e;hb=c36ce7099c2187926cd62cff7ebd479823554929;hp=1538349e9c92db2c04a2d03394262244e91e586f;hpb=8451387df206f5ad34461280ab6a2e5bfe382b9b;p=dpdk.git diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c index 1538349e9c..7673823945 100644 --- a/drivers/net/tap/tap_flow.c +++ b/drivers/net/tap/tap_flow.c @@ -961,7 +961,7 @@ add_action(struct rte_flow *flow, size_t *act_index, struct action_data *adata) } /** - * Helper function to send a serie of TC actions to the kernel + * Helper function to send a series of TC actions to the kernel * * @param[in] flow * Pointer to rte flow containing the netlink message @@ -1300,10 +1300,16 @@ tap_flow_validate(struct rte_eth_dev *dev, static void tap_flow_set_handle(struct rte_flow *flow) { + union { + struct rte_flow *flow; + const void *key; + } tmp; uint32_t handle = 0; + tmp.flow = flow; + if (sizeof(flow) > 4) - handle = rte_jhash(&flow, sizeof(flow), 1); + handle = rte_jhash(tmp.key, sizeof(flow), 1); else handle = (uintptr_t)flow; /* must be at least 1 to avoid letting the kernel choose one for us */ @@ -2011,7 +2017,7 @@ static int bpf_rss_key(enum bpf_rss_key_e cmd, __u32 *key_idx) break; /* - * Subtract offest to restore real key index + * Subtract offset to restore real key index * If a non RSS flow is falsely trying to release map * entry 0 - the offset subtraction will calculate the real * map index as an out-of-range value and the release operation @@ -2160,35 +2166,20 @@ static int rss_add_actions(struct rte_flow *flow, struct pmd_internals *pmd, } /** - * Manage filter operations. + * Get rte_flow operations. * * @param dev * Pointer to Ethernet device structure. - * @param filter_type - * Filter type. - * @param filter_op - * Operation to perform. - * @param arg + * @param ops * Pointer to operation-specific structure. * * @return * 0 on success, negative errno value on failure. */ int -tap_dev_filter_ctrl(struct rte_eth_dev *dev, - enum rte_filter_type filter_type, - enum rte_filter_op filter_op, - void *arg) +tap_dev_flow_ops_get(struct rte_eth_dev *dev __rte_unused, + const struct rte_flow_ops **ops) { - switch (filter_type) { - case RTE_ETH_FILTER_GENERIC: - if (filter_op != RTE_ETH_FILTER_GET) - return -EINVAL; - *(const void **)arg = &tap_flow_ops; - return 0; - default: - TAP_LOG(ERR, "%p: filter type (%d) not supported", - dev, filter_type); - } - return -EINVAL; + *ops = &tap_flow_ops; + return 0; }