From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id A318AA49B for ; Tue, 13 Mar 2018 15:18:57 +0100 (CET) Received: by mail-wr0-f194.google.com with SMTP id z12so23197875wrg.4 for ; Tue, 13 Mar 2018 07:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=iR7gbh+OYCnga6wirmZGLZj7+urrWR54gI3TzoJgwp4=; b=imRFv9IfZtLRDE1EpH/BE9DkCQ6789jz5JaZ6ssqGEnaAmzFFUmC/3SYmAJzAQz3JM tTOo7YlDUPK1/FAZ6fWUFs8I7Y5QsJml2COkeXQozGu/Qd2V9vcwOu/MeFqkWjJ+IedE vkYRDc97AWGzOOeJCne5aUroGYpS+6uTiNLRUXOHxLPn12TH1oGy77cgvVZRg+3zQWpv biUyv80Gl4k5okFs/w4rIhBpED2Ln9Bp4mDCm2NKQwUEv+b+NSVHtqrqERhq2pUkODsy sUz6VTfSk8QjaZ/aKXF/Fvnkbf+ipyp980WnNILKUwSUQV5OuEj3yz+xJQt0JFtslGOa D8LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=iR7gbh+OYCnga6wirmZGLZj7+urrWR54gI3TzoJgwp4=; b=uGH2pKlXgMz+2pSIdlzq6TMQ1lGf/43JY6bMxv8WpG+xr05lNKcGAkydngH5lBoE3N MLHlzBPJYaDxnh1rgj3GmklAP8zm2MIz8SGNBdqaaijFyUBntIKVukB9EOCX3NgtSH7q uaDrHxVxWt7eYzSAHXGXc+4lVVO1wveGegd/YzOXmn5evdLtBUG/o/w3/yKjpjb2zIsn 0V7FfMpO+Aj609+jBNlAh9cwalGKToxbfsEw9PyrBApdCaf/nZ0NgvstDwKRwdP4vLSf ZSayxrl0yj8dHFtz3ctPMP9e/XOanOVc8K+skxZ4l6X41vkS/JMQHtN7BXyp8WS3OPEm RI0A== X-Gm-Message-State: AElRT7E3GPLeoXuszrYVvro5x6w/p+Yw/HgS98dnXdEQOR2iN765vUIf AmOHOV4Vy7gtGmv2hul2QIkN X-Google-Smtp-Source: AG47ELv6duVMg+wgmmvNi9OqMukf2IDGeWTjDlILHDanRm5gdB1dzOhT2ulYs6QHitGkJDxcUJBJ8Q== X-Received: by 10.223.189.8 with SMTP id j8mr815565wrh.20.1520950737400; Tue, 13 Mar 2018 07:18:57 -0700 (PDT) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id x78sm466302wmd.2.2018.03.13.07.18.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 07:18:56 -0700 (PDT) From: Nelio Laranjeiro To: Adrien Mazarguil , Yongseok Koh Cc: dev@dpdk.org, stable@dpdk.org Date: Tue, 13 Mar 2018 15:17:37 +0100 Message-Id: <07145c9505263ba30de44a5c5186431935b98884.1520950386.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: <7aeb54018d1a8dd06638632076f25fbc88945afd.1518686582.git.nelio.laranjeiro@6wind.com> Subject: [dpdk-dev] [PATCH 2/4] net/mlx5: fix flow single queue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 14:18:57 -0000 The flow is created with any steering being applied in the NIC when the device is handling a single Rx queue. Fixes: cede123a158f ("net/mlx5: fix flow creation with a single target queue") Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow") Cc: stable@dpdk.org Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_flow.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index e1ffb38a5..e7040daad 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -937,11 +937,12 @@ mlx5_flow_convert_finalise(struct mlx5_flow_parse *parser) /* Remove any other flow not matching the pattern. */ if (parser->queues_n == 1) { for (i = 0; i != hash_rxq_init_n; ++i) { - if (i == parser->layer || !parser->queue[i].ibv_attr) + if (i == HASH_RXQ_ETH) continue; rte_free(parser->queue[i].ibv_attr); parser->queue[i].ibv_attr = NULL; } + return; } if (parser->layer == HASH_RXQ_ETH) { goto fill; @@ -1807,6 +1808,7 @@ mlx5_flow_create_action_queue(struct rte_eth_dev *dev, struct priv *priv = dev->data->dev_private; int ret; unsigned int i; + unsigned int flows_n = 0; assert(priv->pd); assert(priv->ctx); @@ -1830,12 +1832,18 @@ mlx5_flow_create_action_queue(struct rte_eth_dev *dev, NULL, "flow rule creation failure"); goto error; } + ++flows_n; DRV_LOG(DEBUG, "port %u %p type %d QP %p ibv_flow %p", dev->data->port_id, (void *)flow, i, (void *)flow->frxq[i].hrxq, (void *)flow->frxq[i].ibv_flow); } + if (!flows_n) { + rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_HANDLE, + NULL, "internal error in flow creation"); + goto error; + } for (i = 0; i != parser->queues_n; ++i) { struct mlx5_rxq_data *q = (*priv->rxqs)[parser->queues[i]]; -- 2.11.0