backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: backports@vger.kernel.org
Cc: Arend van Spriel <arend.vanspriel@broadcom.com>,
	Eric Dumazet <edumazet@google.com>
Subject: [PATCH 3/3] backport-include: deal with struct sock::sk_pacing_shift
Date: Mon, 30 Apr 2018 13:15:46 +0200	[thread overview]
Message-ID: <1525086946-6352-4-git-send-email-arend.vanspriel@broadcom.com> (raw)
In-Reply-To: <1525086946-6352-1-git-send-email-arend.vanspriel@broadcom.com>

In kernel 4.15 the field sk_pacing_shift was introduced to allow
(wifi) drivers to change the behaviour of TSQ. In 4.16 a helper
function was added which mac80211 is using. So backport the helper
which is just a stub for kernels prior to 4.15.

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
As noted in the commit message this patch makes the helper function
an empty stub for kernels prior to 4.15, which introduced the field
sk_pacing_shift. Maybe it would be possible to accomplish similar
thing by modifying struct sk_buff::true_size, but I am not too familiar
with TSQ so I did not go there.

Regards,
Arend
---
 backport/backport-include/net/sock.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h
index 89191f3..39bf008 100644
--- a/backport/backport-include/net/sock.h
+++ b/backport/backport-include/net/sock.h
@@ -63,4 +63,16 @@ static inline void sk_clear_bit(int nr, struct sock *sk)
 }
 #endif /* < 4.5 */
 
+#if LINUX_VERSION_IS_LESS(4,16,0)
+#define sk_pacing_shift_update LINUX_BACKPORT(sk_pacing_shift_update)
+static inline void sk_pacing_shift_update(struct sock *sk, int val)
+{
+#if LINUX_VERSION_IS_GEQ(4,15,0)
+	if (!sk || !sk_fullsock(sk) || sk->sk_pacing_shift == val)
+		return;
+	sk->sk_pacing_shift = val;
+#endif /* >= 4.15 */
+}
+#endif /* < 4.16 */
+
 #endif /* __BACKPORT_NET_SOCK_H */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

      parent reply	other threads:[~2018-04-30 11:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30 11:15 [PATCH 0/3] backports: enable building v4.17 kernel Arend van Spriel
2018-04-30 11:15 ` [PATCH 1/3] patches: update patches for v4.17-rc1 Arend van Spriel
2018-04-30 11:15 ` [PATCH 2/3] backport-include: add ETH_P_PREAUTH definition in if_ether.h Arend van Spriel
2018-04-30 11:15 ` Arend van Spriel [this message]

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=1525086946-6352-4-git-send-email-arend.vanspriel@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=backports@vger.kernel.org \
    --cc=edumazet@google.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).