netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <sameehj@amazon.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: Sameeh Jubran <sameehj@amazon.com>, <dwmw@amazon.com>,
	<zorik@amazon.com>, <matua@amazon.com>, <saeedb@amazon.com>,
	<msw@amazon.com>, <aliguori@amazon.com>, <nafea@amazon.com>,
	<gtzalik@amazon.com>, <netanel@amazon.com>, <alisaidi@amazon.com>,
	<benh@amazon.com>, <akiyano@amazon.com>
Subject: [PATCH V1 net 4/8] net: ena: fix incorrect test of supported hash function
Date: Wed, 1 May 2019 16:47:06 +0300	[thread overview]
Message-ID: <20190501134710.8938-5-sameehj@amazon.com> (raw)
In-Reply-To: <20190501134710.8938-1-sameehj@amazon.com>

From: Sameeh Jubran <sameehj@amazon.com>

ena_com_set_hash_function() tests if a hash function is supported
by the device before setting it.
The test returns the opposite result than needed.
Reverse the condition to return the correct value.
Also use the BIT macro instead of inline shift.

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")

Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
---
 drivers/net/ethernet/amazon/ena/ena_com.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c
index b17d435de09f..f9bc0b831a1a 100644
--- a/drivers/net/ethernet/amazon/ena/ena_com.c
+++ b/drivers/net/ethernet/amazon/ena/ena_com.c
@@ -2195,7 +2195,7 @@ int ena_com_set_hash_function(struct ena_com_dev *ena_dev)
 	if (unlikely(ret))
 		return ret;
 
-	if (get_resp.u.flow_hash_func.supported_func & (1 << rss->hash_func)) {
+	if (!(get_resp.u.flow_hash_func.supported_func & BIT(rss->hash_func))) {
 		pr_err("Func hash %d isn't supported by device, abort\n",
 		       rss->hash_func);
 		return -EOPNOTSUPP;
-- 
2.17.1


  parent reply	other threads:[~2019-05-01 13:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-01 13:47 [PATCH V1 net 0/8] Bug fixes for ENA Ethernet driver sameehj
2019-05-01 13:47 ` [PATCH V1 net 1/8] net: ena: fix swapped parameters when calling ena_com_indirect_table_fill_entry sameehj
2019-05-01 13:47 ` [PATCH V1 net 2/8] net: ena: fix: set freed objects to NULL to avoid failing future allocations sameehj
2019-05-01 13:47 ` [PATCH V1 net 3/8] net: ena: fix: Free napi resources when ena_up() fails sameehj
2019-05-01 13:47 ` sameehj [this message]
2019-05-01 13:47 ` [PATCH V1 net 5/8] net: ena: fix return value of ena_com_config_llq_info() sameehj
2019-05-01 13:47 ` [PATCH V1 net 6/8] net: ena: improve latency by disabling adaptive interrupt moderation by default sameehj
2019-05-01 13:47 ` [PATCH V1 net 7/8] net: ena: fix ena_com_fill_hash_function() implementation sameehj
2019-05-01 13:47 ` [PATCH V1 net 8/8] net: ena: gcc 8: fix compilation warning sameehj
2019-05-04  4:17 ` [PATCH V1 net 0/8] Bug fixes for ENA Ethernet driver David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190501134710.8938-5-sameehj@amazon.com \
    --to=sameehj@amazon.com \
    --cc=akiyano@amazon.com \
    --cc=aliguori@amazon.com \
    --cc=alisaidi@amazon.com \
    --cc=benh@amazon.com \
    --cc=davem@davemloft.net \
    --cc=dwmw@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=matua@amazon.com \
    --cc=msw@amazon.com \
    --cc=nafea@amazon.com \
    --cc=netanel@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedb@amazon.com \
    --cc=zorik@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).