From patchwork Wed Oct 9 21:22:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1174099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="q7mHO2Qv"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46pS1n0Bjsz9sCJ for ; Thu, 10 Oct 2019 08:25:48 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D01C7D97; Wed, 9 Oct 2019 21:22:31 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id EC02AD83 for ; Wed, 9 Oct 2019 21:22:29 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 97F7414D for ; Wed, 9 Oct 2019 21:22:29 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id r1so1046082pgj.12 for ; Wed, 09 Oct 2019 14:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=V4MoJMKdisY9H7Uhani+c0mhr/y5gmh+KyTP2AW23ro=; b=q7mHO2QvopJz6xbyVBdmp9+vNkgI4RwwXtDueM8GN1N+tXLROD/ZrFihSLY6wRw/vI FHQlLlomwJlbsAXMlKO4+1S6m84i3SOpcYi9V3E8lpwvqQyo6PwX/L841omupd2wpJrR +KrP4ihstVcyGCkpNknUfAWUOpzRwbbO0RyNZ5JsfERP05MV7EVHMXrRDsu+1kvYBEK7 l+STNabqaE7PjgvaBfExocq6y3eCsBeLM6qv0IYKUz4pGZCEd0HEchSVFS2QCI+CLYUA nOYh17chgFZ3wQIqdXlD874VoXkQXlyIfXGMUv4Nx93Szd9c6imka5VG+s/QkdaCRQrr 3ZiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=V4MoJMKdisY9H7Uhani+c0mhr/y5gmh+KyTP2AW23ro=; b=L/r+dseMmLw1OWzxuFLiY/3sEwNUztyn/6QiX0MtUjISmhLqRF8rv7cm4s2t1mMZsq McWOBN2CZhacHrXDxj8sq01WWUumlI3k6Xwo7eWRJdo+R0w1BMZ3eW8RYxCblTS+MUgi OtqqkbtuOfBFyshCa01U2SCo+8xLzJVVIJTX8jw2J2eXfLwWtuTSa2rs3pZoq5DPnGKP U0QGTR8UysJ3yo4Fz/TeZWabTorpNrf0DPAJM8qj/siDTXL5QRt9FqJNmZ+VldwRO2NE oMJFDdjEkqV5wlbVQHO9dgqd07/ivY0bWijg/RrPogEs8u6+CM/nTUo5ThG+EiKcQB3v 9C2A== X-Gm-Message-State: APjAAAWga3FynmZZtbiByEIVgSqa1h5IVZCu0CRQHWjCF0a6c0hgYqnd QBxIdtIsmfTiiYETvwTkAR1GqL64 X-Google-Smtp-Source: APXvYqz/ft48uIkS4Zv/Nx2ky7lE7kHKG3Ytc6iO+WjrtCLd72FAd/MGEeXkwcwiQCrGw80s0jTHKQ== X-Received: by 2002:a63:6883:: with SMTP id d125mr6634212pgc.350.1570656148689; Wed, 09 Oct 2019 14:22:28 -0700 (PDT) Received: from gizo.domain (97-115-119-26.ptld.qwest.net. [97.115.119.26]) by smtp.gmail.com with ESMTPSA id a13sm5191756pfg.10.2019.10.09.14.22.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Oct 2019 14:22:27 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Wed, 9 Oct 2019 14:22:14 -0700 Message-Id: <1570656134-11957-6-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1570656134-11957-1-git-send-email-gvrose8192@gmail.com> References: <1570656134-11957-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Florian Westphal Subject: [ovs-dev] [PATCH 5/5] datapath: compat: drop bridge nf reset from nf_reset X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Upstream commmit: commit 895b5c9f206eb7d25dc1360a8ccfc5958895eb89 Author: Florian Westphal Date: Sun Sep 29 20:54:03 2019 +0200 netfilter: drop bridge nf reset from nf_reset commit 174e23810cd31 ("sk_buff: drop all skb extensions on free and skb scrubbing") made napi recycle always drop skb extensions. The additional skb_ext_del() that is performed via nf_reset on napi skb recycle is not needed anymore. Most nf_reset() calls in the stack are there so queued skb won't block 'rmmod nf_conntrack' indefinitely. This removes the skb_ext_del from nf_reset, and renames it to a more fitting nf_reset_ct(). In a few selected places, add a call to skb_ext_reset to make sure that no active extensions remain. I am submitting this for "net", because we're still early in the release cycle. The patch applies to net-next too, but I think the rename causes needless divergence between those trees. Suggested-by: Eric Dumazet Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Added some compat layer fixups for nf_reset_ct. This is just a portion of the upstream commit that applies to openvswitch. Cc: Florian Westphal Signed-off-by: Greg Rose Acked-by: Yi-Hung Wei --- acinclude.m4 | 1 + datapath/linux/compat/include/linux/skbuff.h | 4 ++++ datapath/vport-internal_dev.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index c729266..b1de8c9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -740,6 +740,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_FIND_PARAM_IFELSE([$KSRC/include/net/rtnetlink.h], [rtnl_create_link], [extack], [OVS_DEFINE([HAVE_RTNL_CREATE_LINK_TAKES_EXTACK])]) + OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [nf_reset_ct]) # Check for the proto_data_valid member in struct sk_buff. The [^@] # is necessary because some versions of this header remove the diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h index 4a6ac23..6397289 100644 --- a/datapath/linux/compat/include/linux/skbuff.h +++ b/datapath/linux/compat/include/linux/skbuff.h @@ -452,4 +452,8 @@ static inline void skb_set_inner_ipproto(struct sk_buff *skb, } #endif +#ifndef HAVE_NF_RESET_CT +#define nf_reset_ct nf_reset +#endif + #endif diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index 0318f58..dbc2002 100644 --- a/datapath/vport-internal_dev.c +++ b/datapath/vport-internal_dev.c @@ -281,7 +281,7 @@ static netdev_tx_t internal_dev_recv(struct sk_buff *skb) } skb_dst_drop(skb); - nf_reset(skb); + nf_reset_ct(skb); secpath_reset(skb); skb->pkt_type = PACKET_HOST;