From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matan Azrad Subject: [PATCH] net/mlx4: fix targetless internal rule creation Date: Tue, 24 Oct 2017 08:45:30 +0000 Message-ID: <1508834730-30271-1-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org To: Adrien Mazarguil Return-path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0070.outbound.protection.outlook.com [104.47.0.70]) by dpdk.org (Postfix) with ESMTP id E6F3F1B756 for ; Tue, 24 Oct 2017 10:45:48 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The corrupted code allowed to create internal rule with no any target queue in case the rule creation ocured before queues creation. For example, when user calls rte_eth_dev_default_mac_addr_set after probe and before dev_configure, mlx4 failis because the RSS queue number was 0. The fix prevents internal rules creation before queues creation based on future creation before traffic start. Fixes: 7d8675956f57 ("net/mlx4: add RSS support outside flow API") Signed-off-by: Matan Azrad --- drivers/net/mlx4/mlx4_flow.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index a0f431b..7a6097f 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -1290,6 +1290,9 @@ struct mlx4_drop { unsigned int i; int err = 0; + /* Nothing to be done if there are no Rx queues. */ + if (!queues) + goto error; /* Prepare default RSS configuration. */ *rss_conf = (struct rte_flow_action_rss){ .rss_conf = NULL, /* Rely on default fallback settings. */ -- 1.8.3.1