Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ppp: use IFF_NO_QUEUE in virtual interfaces

For PPPoE, PPTP, and PPPoL2TP, the start_xmit() function directly
forwards packets to the underlying network stack and never returns
anything other than 1. So these interfaces do not require a qdisc,
and the IFF_NO_QUEUE flag should be set.

Introduces a direct_xmit flag in struct ppp_channel to indicate when
IFF_NO_QUEUE should be applied. The flag is set in ppp_connect_channel()
for relevant protocols.

While at it, remove the usused latency member from struct ppp_channel.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://patch.msgid.link/20250301135517.695809-1-dqfext@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Qingfang Deng and committed by
Jakub Kicinski
95d0d094 00d66b5f

+8 -2
+4
drivers/net/ppp/ppp_generic.c
··· 3493 3493 ret = -ENOTCONN; 3494 3494 goto outl; 3495 3495 } 3496 + if (pch->chan->direct_xmit) 3497 + ppp->dev->priv_flags |= IFF_NO_QUEUE; 3498 + else 3499 + ppp->dev->priv_flags &= ~IFF_NO_QUEUE; 3496 3500 spin_unlock_bh(&pch->downl); 3497 3501 if (pch->file.hdrlen > ppp->file.hdrlen) 3498 3502 ppp->file.hdrlen = pch->file.hdrlen;
+1
drivers/net/ppp/pppoe.c
··· 693 693 po->chan.mtu = dev->mtu - sizeof(struct pppoe_hdr) - 2; 694 694 po->chan.private = sk; 695 695 po->chan.ops = &pppoe_chan_ops; 696 + po->chan.direct_xmit = true; 696 697 697 698 error = ppp_register_net_channel(dev_net(dev), &po->chan); 698 699 if (error) {
+1
drivers/net/ppp/pptp.c
··· 465 465 po->chan.mtu -= PPTP_HEADER_OVERHEAD; 466 466 467 467 po->chan.hdrlen = 2 + sizeof(struct pptp_gre_header); 468 + po->chan.direct_xmit = true; 468 469 error = ppp_register_channel(&po->chan); 469 470 if (error) { 470 471 pr_err("PPTP: failed to register PPP channel (%d)\n", error);
+1 -2
include/linux/ppp_channel.h
··· 42 42 int hdrlen; /* amount of headroom channel needs */ 43 43 void *ppp; /* opaque to channel */ 44 44 int speed; /* transfer rate (bytes/second) */ 45 - /* the following is not used at present */ 46 - int latency; /* overhead time in milliseconds */ 45 + bool direct_xmit; /* no qdisc, xmit directly */ 47 46 }; 48 47 49 48 #ifdef __KERNEL__
+1
net/l2tp/l2tp_ppp.c
··· 806 806 po->chan.private = sk; 807 807 po->chan.ops = &pppol2tp_chan_ops; 808 808 po->chan.mtu = pppol2tp_tunnel_mtu(tunnel); 809 + po->chan.direct_xmit = true; 809 810 810 811 error = ppp_register_net_channel(sock_net(sk), &po->chan); 811 812 if (error) {