mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qingfang Deng <qingfang.deng@linux.dev>
To: Pablo Neira Ayuso <pablo@netfilter.org>,
	Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Felix Fietkau <nbd@nbd.name>, Qingfang Deng <qingfang.deng@linux.dev>
Subject: [PATCH nf-next 1/2] netfilter: flowtable: use PPPoE GSO handler
Date: Thu, 15 Oct 2026 16:56:01 +0800	[thread overview]
Message-ID: <20261015085603.1170-1-qingfang.deng@linux.dev> (raw)

Flowtable currently segments GSO packets before adding encapsulation
headers, calling nf_flow_encap_push() separately for each segment.

Since commit 55a5d8fca836 ("net: pppoe: implement GRO/GSO support"), the
PPPoE GSO handler can segment encapsulated packets and update the PPPoE
payload length in each resulting segment.

Push the encapsulation headers before segmentation and let the PPPoE GSO
handler update them. This removes the per-segment encapsulation step
from nf_flow_encap_gso_xmit() while keeping the software segmentation.

Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
---
 net/netfilter/nf_flow_table_ip.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c
index c8c29a9a1684..ce69f4e741e2 100644
--- a/net/netfilter/nf_flow_table_ip.c
+++ b/net/netfilter/nf_flow_table_ip.c
@@ -767,12 +767,6 @@ static unsigned int nf_flow_encap_gso_xmit(struct net *net, struct sk_buff *skb,
 
 	skb_list_walk_safe(segs, segs, nskb) {
 		skb_mark_not_on_list(segs);
-
-		if (nf_flow_encap_push(segs, xmit->tuple, xmit->outdev) < 0) {
-			kfree_skb(segs);
-			kfree_skb_list(nskb);
-			return NF_STOLEN;
-		}
 		__nf_flow_queue_xmit(net, segs, xmit);
 	}
 
@@ -783,11 +777,12 @@ static unsigned int nf_flow_queue_xmit(struct net *net, struct sk_buff *skb,
 				       struct nf_flow_xmit *xmit)
 {
 	if (xmit->tuple->encap_num) {
+		if (nf_flow_encap_push(skb, xmit->tuple, xmit->outdev) < 0)
+			return NF_DROP;
+
 		if (skb_is_gso(skb) && xmit->needs_gso_segment)
 			return nf_flow_encap_gso_xmit(net, skb, xmit);
 
-		if (nf_flow_encap_push(skb, xmit->tuple, xmit->outdev) < 0)
-			return NF_DROP;
 	}
 
 	__nf_flow_queue_xmit(net, skb, xmit);
-- 
2.43.0


             reply	other threads:[~2026-10-15  8:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  8:56 Qingfang Deng [this message]
2026-10-15  8:56 ` [PATCH nf-next 2/2] netfilter: flowtable: avoid unnecessary linearization for PPPoE Qingfang Deng

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=20261015085603.1170-1-qingfang.deng@linux.dev \
    --to=qingfang.deng@linux.dev \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=fw@strlen.de \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=phil@nwl.cc \
    /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

all inboxes | Powered by JetHome®