From: Matan Azrad Date: Tue, 24 Oct 2017 10:05:59 +0000 (+0000) Subject: net/mlx4: fix targetless internal rule creation X-Git-Tag: spdx-start~1126 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a76bec521a1634abfba5d3f954ae89e2d978ead0;p=dpdk.git net/mlx4: fix targetless internal rule creation The corrupted code allowed to create internal rule with no any target queue in case the rule creation occurred before queues creation. For example, when user calls rte_eth_dev_default_mac_addr_set after probe and before dev_configure, mlx4 fails 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") Fixes: bdcad2f4843a ("net/mlx4: refactor internal flow rules") Signed-off-by: Matan Azrad Acked-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index a0f431bf5e..7a6097faf5 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -1290,6 +1290,9 @@ mlx4_flow_internal(struct priv *priv, struct rte_flow_error *error) 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. */