mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ujwal Kundur <ujwal.kundur@gmail.com>
To: allison.henderson@oracle.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	horms@kernel.org
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org,
	Ujwal Kundur <ujwal.kundur@gmail.com>
Subject: [PATCH net-next v2 3/4] rds: Fix endianness annotation for RDS_MPATH_HASH
Date: Wed, 20 Aug 2025 23:25:49 +0530	[thread overview]
Message-ID: <20250820175550.498-4-ujwal.kundur@gmail.com> (raw)
In-Reply-To: <20250820175550.498-1-ujwal.kundur@gmail.com>

jhash_1word accepts host endian inputs while rs_bound_port is a be16
value (sockaddr_in6.sin6_port). Use ntohs() for consistency.

Flagged by Sparse.

Signed-off-by: Ujwal Kundur <ujwal.kundur@gmail.com>
---
 net/rds/rds.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rds/rds.h b/net/rds/rds.h
index dc360252c515..5b1c072e2e7f 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -93,7 +93,7 @@ enum {
 
 /* Max number of multipaths per RDS connection. Must be a power of 2 */
 #define	RDS_MPATH_WORKERS	8
-#define	RDS_MPATH_HASH(rs, n) (jhash_1word((rs)->rs_bound_port, \
+#define	RDS_MPATH_HASH(rs, n) (jhash_1word(ntohs((rs)->rs_bound_port), \
 			       (rs)->rs_hash_initval) & ((n) - 1))
 
 #define IS_CANONICAL(laddr, faddr) (htonl(laddr) < htonl(faddr))
-- 
2.30.2


  parent reply	other threads:[~2025-08-20 17:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20 17:55 [PATCH net-next v2 0/4] rds: Fix semantic annotations Ujwal Kundur
2025-08-20 17:55 ` [PATCH net-next v2 1/4] rds: Replace POLLERR with EPOLLERR Ujwal Kundur
2025-08-22  0:56   ` Allison Henderson
2025-08-20 17:55 ` [PATCH net-next v2 2/4] rds: Fix endianness annotation of jhash wrappers Ujwal Kundur
2025-08-22  0:56   ` Allison Henderson
2025-08-20 17:55 ` Ujwal Kundur [this message]
2025-08-22  0:56   ` [PATCH net-next v2 3/4] rds: Fix endianness annotation for RDS_MPATH_HASH Allison Henderson
2025-08-20 17:55 ` [PATCH net-next v2 4/4] rds: Fix endianness annotations for RDS extension headers Ujwal Kundur
2025-08-22  0:56   ` Allison Henderson
2025-08-22 23:50 ` [PATCH net-next v2 0/4] rds: Fix semantic annotations patchwork-bot+netdevbpf

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=20250820175550.498-4-ujwal.kundur@gmail.com \
    --to=ujwal.kundur@gmail.com \
    --cc=allison.henderson@oracle.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rds-devel@oss.oracle.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

all inboxes | Powered by JetHome®