All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni at redhat.com>
To: mptcp at lists.01.org
Subject: [MPTCP] [PATCH net-next] Squash-to: "mptcp: allow picking different xmit subflows"
Date: Fri, 11 Sep 2020 19:40:28 +0200	[thread overview]
Message-ID: <5acfec9d91567f606a7cad10ef425a80d9cb05bc.1599846013.git.pabeni@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1098 bytes --]

unbreak 32 bits build avoid unsing '/' on 64 bits arguments.

Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
 net/mptcp/protocol.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index e5ef7227c914..d848ade67a4a 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1082,8 +1082,9 @@ static struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk,
 	struct subflow_send_info send_info[2];
 	struct mptcp_subflow_context *subflow;
 	int i, nr_active = 0;
-	int64_t ratio, pace;
 	struct sock *ssk;
+	u64 ratio;
+	u32 pace;
 
 	sock_owned_by_me((struct sock *)msk);
 
@@ -1128,7 +1129,8 @@ static struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk,
 		if (!pace)
 			continue;
 
-		ratio = (int64_t)READ_ONCE(ssk->sk_wmem_queued) << 32 / pace;
+		ratio = div_u64((u64)READ_ONCE(ssk->sk_wmem_queued) << 32,
+				pace);
 		if (ratio < send_info[subflow->backup].ratio) {
 			send_info[subflow->backup].ssk = ssk;
 			send_info[subflow->backup].ratio = ratio;
-- 
2.26.2

             reply	other threads:[~2020-09-11 17:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 17:40 Paolo Abeni [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-09-10 23:30 [MPTCP] [PATCH net-next] Squash-to: "mptcp: allow picking different xmit subflows" Paolo Abeni

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=5acfec9d91567f606a7cad10ef425a80d9cb05bc.1599846013.git.pabeni@redhat.com \
    --to=unknown@example.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.