From patchwork Mon Apr 30 11:15:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 10371449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 60F8B6053E for ; Mon, 30 Apr 2018 11:16:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F75428A8A for ; Mon, 30 Apr 2018 11:16:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4454928A92; Mon, 30 Apr 2018 11:16:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E849C28A8A for ; Mon, 30 Apr 2018 11:16:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752616AbeD3LQG (ORCPT ); Mon, 30 Apr 2018 07:16:06 -0400 Received: from rnd-relay.smtp.broadcom.com ([192.19.229.170]:45782 "EHLO rnd-relay.smtp.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751822AbeD3LQG (ORCPT ); Mon, 30 Apr 2018 07:16:06 -0400 Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.224.233]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 312A630C00C; Mon, 30 Apr 2018 04:16:05 -0700 (PDT) Received: from bld-bun-01.bun.broadcom.com (bld-bun-01.bun.broadcom.com [10.176.128.83]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 3D25381EBD; Mon, 30 Apr 2018 04:16:05 -0700 (PDT) Received: by bld-bun-01.bun.broadcom.com (Postfix, from userid 25152) id E602CB02F79; Mon, 30 Apr 2018 13:15:56 +0200 (CEST) From: Arend van Spriel To: backports@vger.kernel.org Cc: Arend van Spriel , Eric Dumazet Subject: [PATCH 3/3] backport-include: deal with struct sock::sk_pacing_shift Date: Mon, 30 Apr 2018 13:15:46 +0200 Message-Id: <1525086946-6352-4-git-send-email-arend.vanspriel@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525086946-6352-1-git-send-email-arend.vanspriel@broadcom.com> References: <1525086946-6352-1-git-send-email-arend.vanspriel@broadcom.com> Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Arend van Spriel --- 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 */