From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 035181C70C for ; Wed, 4 Apr 2018 16:58:02 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id r82so43755873wme.0 for ; Wed, 04 Apr 2018 07:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hm46OSpCw/gEBJh2VFnN1qG4BjOj1UonvsTiUpJ0OMA=; b=dZ7SJhUwbEtSxJb8a4c+ENMGMnR3JTeS3e2Acf40JB1rtR0ZzfZE2Ze+vdu5xRQubL 6fsKOg4oLSyWiodFJwdylVSA/x4ekJHCvwo1RbUp1aGd5ih5cUDCIu4NKH5j7kRa1fv0 4bcOV7DqCIf2jYQe+luObi+HyFMhr3tOX0gHziT0jG5RwZ4yMAG9D6jvurxRsrXBkC/B IBRGuttHTtQZ021txUcx6v7YEPytC+73fzr7zSmJICzVu7boTMGdkjVY8/IO049DQGGM jaWRYcOozJJVL9GOqdA+nD3ew43M1BdXP4hThTT7RlD8OXz/uD0lZKY6U4ZB7QcY/2xs e0HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hm46OSpCw/gEBJh2VFnN1qG4BjOj1UonvsTiUpJ0OMA=; b=TexT7TS6cZoJ1ojoxjDDQKoWsIZOxmGXWiFjsxMgZt4YvxAgryShjdMy6zvE0mOdwM L8UxW5gYOV0uRRg2uOXXWnalMVntdQPLYxkyHSC2Ef5dekzDKskPARRKLqgXd33yLWod ziB76FyEQYTIVWxdH9UiH4V+N56+mkhhKUIOMekqYj+4SK6oEhJ2GyUqU/8SHNy7BiB2 0iwsgAeOvX+og5orJh1OdfvOCQQWQUr6CRToYN/dZNXF1+MZMZ79gAmt5obZRZX8ckY+ LvZ8o2InHOnkwWCYRWcUQEYbzkvzuCl59ewW9EAS98PR+Gq/oVTWCi1JqkIhc32RK4GM GvSA== X-Gm-Message-State: ALQs6tCsgGDtAY9nuv0OuIvU6xAJXZaBClEZL/vYmxKal8gohCbslMZg kNHVMRUvjPAXO9DduenOxOw0AfQq X-Google-Smtp-Source: AIpwx4/k2QzrkHurXFlwMmmW2xxVXnPWNhSYmzHA60YSD1qger4SqVqByjj89BmC1Lb4iiHm/6J8YA== X-Received: by 10.28.126.69 with SMTP id z66mr7459998wmc.56.1522853882669; Wed, 04 Apr 2018 07:58:02 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id p5sm1643166wmf.37.2018.04.04.07.58.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 07:58:02 -0700 (PDT) Date: Wed, 4 Apr 2018 16:57:49 +0200 From: Adrien Mazarguil To: dev@dpdk.org Cc: stable@dpdk.org, Shahaf Shuler Message-ID: <20180404144805.11966-3-adrien.mazarguil@6wind.com> References: <20180323124725.15806-1-adrien.mazarguil@6wind.com> <20180404144805.11966-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180404144805.11966-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v2 02/13] net/mlx4: fix ignored RSS hash types 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: Wed, 04 Apr 2018 14:58:03 -0000 When an unsupported hash type is part of a RSS configuration structure, it is silently ignored instead of triggering an error. This may lead applications to assume that such types are accepted, while they are in fact not part of the resulting flow rules. Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support") Cc: stable@dpdk.org Signed-off-by: Adrien Mazarguil Cc: Shahaf Shuler --- drivers/net/mlx4/mlx4_flow.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index a3b4480b4..4d26df326 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -706,6 +706,7 @@ mlx4_flow_prepare(struct priv *priv, const struct rte_flow_action_queue *queue; const struct rte_flow_action_rss *rss; const struct rte_eth_rss_conf *rss_conf; + uint64_t fields; unsigned int i; case RTE_FLOW_ACTION_TYPE_VOID: @@ -780,10 +781,15 @@ mlx4_flow_prepare(struct priv *priv, " of the context size"; goto exit_action_not_supported; } + rte_errno = 0; + fields = mlx4_conv_rss_hf(priv, rss_conf->rss_hf); + if (fields == (uint64_t)-1 && rte_errno) { + msg = "unsupported RSS hash type requested"; + goto exit_action_not_supported; + } flow->rss = mlx4_rss_get - (priv, - mlx4_conv_rss_hf(priv, rss_conf->rss_hf), - rss_conf->rss_key, rss->num, rss->queue); + (priv, fields, rss_conf->rss_key, rss->num, + rss->queue); if (!flow->rss) { msg = "either invalid parameters or not enough" " resources for additional multi-queue" -- 2.11.0