X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fmlx5%2Fmlx5_flow.c;h=f32dfdd3fa59f85257d3c2b6cd84c3e1bc015aed;hb=e138cb31d2ffb2af0aaf6c55120f73ad03667c01;hp=040f7fd4dc0d6974871164175fbc73511bc96fc5;hpb=9f9c37412ab53b9bcc7b4d77a491e580bbb22385;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 040f7fd4dc..f32dfdd3fa 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1781,7 +1781,7 @@ priv_flow_create_action_queue_rss(struct priv *priv, parser->rss_conf.rss_key_len, hash_fields, parser->queues, - hash_fields ? parser->queues_n : 1); + parser->queues_n); if (flow->frxq[i].hrxq) continue; flow->frxq[i].hrxq = @@ -1790,7 +1790,7 @@ priv_flow_create_action_queue_rss(struct priv *priv, parser->rss_conf.rss_key_len, hash_fields, parser->queues, - hash_fields ? parser->queues_n : 1); + parser->queues_n); if (!flow->frxq[i].hrxq) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE, @@ -1930,6 +1930,7 @@ priv_flow_create(struct priv *priv, flow->queues = (uint16_t (*)[])(flow + 1); memcpy(flow->queues, parser.queues, parser.queues_n * sizeof(uint16_t)); flow->queues_n = parser.queues_n; + flow->mark = parser.mark; /* Copy RSS configuration. */ flow->rss_conf = parser.rss_conf; flow->rss_conf.rss_key = flow->rss_key; @@ -2754,7 +2755,7 @@ priv_fdir_filter_convert(struct priv *priv, .spec = &attributes->l3, }; attributes->items[2] = (struct rte_flow_item){ - .type = RTE_FLOW_ITEM_TYPE_UDP, + .type = RTE_FLOW_ITEM_TYPE_TCP, .spec = &attributes->l4, }; break; @@ -2866,6 +2867,22 @@ priv_fdir_filter_delete(struct priv *priv, attributes.actions, &error, &parser); if (ret) goto exit; + /* + * Special case for drop action which is only set in the + * specifications when the flow is created. In this situation the + * drop specification is missing. + */ + if (parser.drop) { + struct ibv_flow_spec_action_drop *drop; + + drop = (void *)((uintptr_t)parser.drop_q.ibv_attr + + parser.drop_q.offset); + *drop = (struct ibv_flow_spec_action_drop){ + .type = IBV_FLOW_SPEC_ACTION_DROP, + .size = sizeof(struct ibv_flow_spec_action_drop), + }; + parser.drop_q.ibv_attr->num_of_specs++; + } TAILQ_FOREACH(flow, &priv->flows, next) { struct ibv_flow_attr *attr; struct ibv_spec_header *attr_h; @@ -2898,13 +2915,16 @@ priv_fdir_filter_delete(struct priv *priv, flow_h = flow_spec; if (memcmp(spec, flow_spec, RTE_MIN(attr_h->size, flow_h->size))) - continue; - spec = (void *)((uintptr_t)attr + attr_h->size); - flow_spec = (void *)((uintptr_t)flow_attr + + goto wrong_flow; + spec = (void *)((uintptr_t)spec + attr_h->size); + flow_spec = (void *)((uintptr_t)flow_spec + flow_h->size); } /* At this point, the flow match. */ break; +wrong_flow: + /* The flow does not match. */ + continue; } if (flow) priv_flow_destroy(priv, &priv->flows, flow);