From patchwork Thu Sep 20 11:28:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607537 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0968A1508 for ; Thu, 20 Sep 2018 11:29:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED0BE2D0AA for ; Thu, 20 Sep 2018 11:29:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1A1B2D0C0; Thu, 20 Sep 2018 11:29:05 +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 9489C2D0AA for ; Thu, 20 Sep 2018 11:29:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732441AbeITRMH (ORCPT ); Thu, 20 Sep 2018 13:12:07 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:51040 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRMH (ORCPT ); Thu, 20 Sep 2018 13:12:07 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8h-0004SQ-3l; Thu, 20 Sep 2018 14:28:55 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Johannes Berg , Luca Coelho Date: Thu, 20 Sep 2018 14:28:39 +0300 Message-Id: <20180920112842.27198-12-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 11/14] backports: improve skb->xmit_more handling Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Berg Replace the existing skb->xmit_more semantic patch rule with a more generic one that uses a helper inline function. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho --- backport/backport-include/linux/skbuff.h | 9 +++++++++ patches/0059-skb_xmit_more/skb_no_xmit_more.cocci | 10 +++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h index 034206b6649d..61133c4277cc 100644 --- a/backport/backport-include/linux/skbuff.h +++ b/backport/backport-include/linux/skbuff.h @@ -200,6 +200,15 @@ static inline struct sk_buff *__pskb_copy_fclone(struct sk_buff *skb, struct sk_buff *skb_clone_sk(struct sk_buff *skb); #endif +static inline bool skb_xmit_more(struct sk_buff *skb) +{ +#if LINUX_VERSION_IS_LESS(3,18,0) + return false; +#else + return skb->xmit_more; +#endif +} + #if LINUX_VERSION_IS_LESS(3,19,0) /** * __dev_alloc_pages - allocate page for network Rx diff --git a/patches/0059-skb_xmit_more/skb_no_xmit_more.cocci b/patches/0059-skb_xmit_more/skb_no_xmit_more.cocci index ab20c833af40..bf7f22e267a3 100644 --- a/patches/0059-skb_xmit_more/skb_no_xmit_more.cocci +++ b/patches/0059-skb_xmit_more/skb_no_xmit_more.cocci @@ -1,9 +1,5 @@ -@r1@ +@@ struct sk_buff *skb; -expression E1; @@ - if (E1 -+#if LINUX_VERSION_IS_GEQ(3,18,0) - || !skb->xmit_more -+#endif /* if LINUX_VERSION_IS_GEQ(3,18,0) */ - ) {...} +-skb->xmit_more ++skb_xmit_more(skb)