Re: [PATCH net] ppp: linearize bridged packets when required

From: Eric Dumazet

Date: Wed Oct 21 2026 - 13:59:14 EST


Le mer. 21 oct. 2026 à 19:04, Qingfang Deng <qingfang.deng@xxxxxxxxx> a écrit :
>
> On 10/22/2026 12:31 AM, Eric Dumazet wrote:
> > Le mer. 21 oct. 2026 à 12:27, Qingfang Deng <qingfang.deng@xxxxxxxxx> a écrit :
> >>> + case PPP_IP:
> >>> + skb->protocol = htons(ETH_P_IP);
> >>> + break;
> >>> + case PPP_IPV6:
> >>> + skb->protocol = htons(ETH_P_IPV6);
> >>> + break;
> >>> + default:
> >>> + goto drop;
> >>> + }
> >>> + skb_set_network_header(skb, PPP_PROTO_LEN);
> >>> +
> >>> + segs = skb_gso_segment(skb, 0);
> >>
> >> Passing zero features to skb_gso_segment will linearize every segment
> >> prematurely.
> >
> > Good point, PPTP and L2TP do not need linear packets.
> > I will pass NETIF_F_SG: checksums are still computed in software by
> > skb_segment(), as openvswitch does, and ppp_bridge_xmit() linearizes
> > segments only for channels without direct_xmit.
>
> What about NETIF_F_FRAGLIST?

I do not see your point. Can you elaborate?

There’s also nothing left to gain on fraglist packets.

SKB_GSO_FRAGLIST packets already go through skb_segment_list(),
which just unchains the original skbs without copying, as the fraglist
test run showed.

Frag_list skbs that aren’t fraglist GRO go through skb_segment(),
which with NETIF_F_SG already shares the pages of the chained skbs
instead of copying them.