From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 414C7354AE7 for ; Tue, 27 Jan 2026 12:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769517251; cv=none; b=Z1ScLGNOWnZVvChI70VdEoIlQlW1XgSON5mV3M1cTPnkefdRQSoDc+QN3sfF8C7vkXb+n7X22B1gc0h3bzpeSSv7/Q03NeUJ7F80cXDinLu5NpG7Ezxjc/QpjXjGgPCHShI8sIhvP20Z7ltESiMySjP6is2vkvIJo+Yt4QH7voI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769517251; c=relaxed/simple; bh=HJ7SANx1acYiar4uyTQpy+sl+uIifJg9nM93cmLUmYo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=b4YqU0TUA3yhFjT4aR/LfmtOj0gPcrXZx9rfGx8I/0uUBWzlKC5hacEsivtaYkVGGi5ZjCXScBkHGsdj8+YBZqQrUVllg8gJ1yMtH72QFu6udKKwXzdK03Ly7MWALgHj9aB+Gn43GezrSwdFXXVz3Q9N0A3qi+uLaRhUdPjJWuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ij8D8QwZ; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=ZKbQn1Ad; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ij8D8QwZ"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZKbQn1Ad" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769517248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/aly7Oa9P8CtJ7m7fooH55IGFySzvKDRQSyK9YnvJo4=; b=ij8D8QwZmiSg7lq0qZxRLeYka2XVuNRDbjg5E5Nl3ENL+GMSFjPfZsyEFzDUuJ/vsBus+d JHcP09TaTwyvJFGdQUZ5B/rZGSZCpzBFT+oFodujsVAVnQi/SmlDpV0fmPkANl4yP9kfyo Uv/19qEkvr+rpVDheBFozgeCdJwrUI4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-UXg_ZwkcOseV2d18_tKM7w-1; Tue, 27 Jan 2026 07:34:07 -0500 X-MC-Unique: UXg_ZwkcOseV2d18_tKM7w-1 X-Mimecast-MFC-AGG-ID: UXg_ZwkcOseV2d18_tKM7w_1769517246 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4806865a01bso5565835e9.0 for ; Tue, 27 Jan 2026 04:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1769517246; x=1770122046; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/aly7Oa9P8CtJ7m7fooH55IGFySzvKDRQSyK9YnvJo4=; b=ZKbQn1AdC1wx94XaToTWoYK2jNVg02kVe0LIhvJDKK+P6TqnQklBieEb1ZcInbRriW SWJDRoeP6QrR3AiFMQ10vnn/IZt2h5C6+tXOMyctBM5cidjrY9UbzmowwNa7rHyrPuFZ ozYaEnLVYVe5jbkAR41F4us7zMTI4wicW8p/lNFYcBvZCwFBp9ExYyopQWZd/9nRVasm q/1A3DpJE2CyKpOftqJ6gTx7z0sStIpCbIXlaC31DjOvYsJQ91jKymqSA3fqkWXlZY1t JNbDMtnIuwOQtUQ58ifNXOjOzKiF8VVNYL7Ozum4vqHmSAFains+sJCBsHxLW12ZBG+L a01A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769517246; x=1770122046; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/aly7Oa9P8CtJ7m7fooH55IGFySzvKDRQSyK9YnvJo4=; b=oCz7S5+yYWLcTXFj9uCknQrz+t87wpDNniO+cdhee0Is8FNzjR8arMCkOn3EjaWJMj y2WxMrTwh5UvdtgDgvWlpRrHfrGdBcmVRMETUefgiFmKeEcDTTWsUz2d5OmB91fiPBJx MS9agduHzQnldeeKKwON+F900RCXFmaExFRrRpqWNjkYdcXOzXYs23XbCKyBD8rKmB/m TJr3yPemAxrDV8olgFDwj9Wbsi5tSE3tAu9KgkPTDEOj0KYDYnfpT9xqMt51Phq2oqxk zwRZtJuin7fely5Mk2pyWdALyVnxRzcRZ59348i7+m0oQ8JnhnduaZ95mD8c/CCH++bq +MSw== X-Forwarded-Encrypted: i=1; AJvYcCXV8f9or72yCOQhd691MLD5O2DiViDHoiILkGatzlSUzh/YtSwOU1sasVVKneL5fuo7yirdle04YlleCws=@vger.kernel.org X-Gm-Message-State: AOJu0YyCd8LjKgEP1SMVsRq79RqBnrKaUnbLq6+SxCV5E3eqIAgejYWb 45jIRfmf4bWSUXxLwLefDVFwnZFH70ySiuGFtUhyQhMCRJeALgHKYY7qfnelA+0CPbiVUQY2EzG 7sr8S3PRLRVU4DIO6KchSudGWLXDZAkFk9mI2wedKE8HZmhBL1M+QtTzAtVUDPasSYA== X-Gm-Gg: AZuq6aKdfeDBjtwTZBVYPGXQvXXBSJ2hhwgE5WyXyPRPsjzmHC7lNjFhrozZ1laDj8u ZRhBIzz2tKVdXJgIfgT5RtEySRf2qpSu0j9wVmI7Ld9iNQBL22QKNGcfNy2fT7y8MaFvn3TpRTO 6BYrO654xLhdTA0fuEX50aNelA6e6bOSwvwH+NZfoSkQQ8sKdqJqaGCUd8v5z09l5jofrk7IJLE qXYr1V2FCEH8JouvjHWc2tibicqt86Xty2C8Z/S6SXJT/06LhfeCTV93T9ZcT5YImOYnGzNCwNN LHIKmnI6ZD1Fbl5R/m7z42LNncWy2omEIOV88kTtKPe+Q7fhoRgMdWOamXW+p/cD/8vvkbZUV5o t747OpHOKZ0Dq X-Received: by 2002:a05:600c:190c:b0:480:4a4f:c36f with SMTP id 5b1f17b1804b1-48069c4869bmr22272795e9.21.1769517245712; Tue, 27 Jan 2026 04:34:05 -0800 (PST) X-Received: by 2002:a05:600c:190c:b0:480:4a4f:c36f with SMTP id 5b1f17b1804b1-48069c4869bmr22272385e9.21.1769517245209; Tue, 27 Jan 2026 04:34:05 -0800 (PST) Received: from [192.168.88.32] ([212.105.155.22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066bf93cesm56353205e9.9.2026.01.27.04.34.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Jan 2026 04:34:04 -0800 (PST) Message-ID: Date: Tue, 27 Jan 2026 13:34:03 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v3] ppp: enable TX scatter-gather To: Qingfang Deng , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-ppp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?Q?Toke_H=C3=B8iland-J=C3=B8rgensen?= References: <20260123014214.225278-1-dqfext@gmail.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20260123014214.225278-1-dqfext@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/23/26 2:42 AM, Qingfang Deng wrote: > PPP channels using chan->direct_xmit prepend the PPP header to a skb and > call dev_queue_xmit() directly. In this mode the skb does not need to be > linear, but the PPP netdevice currently does not advertise > scatter-gather features, causing unnecessary linearization and > preventing GSO. > > Enable NETIF_F_SG and NETIF_F_FRAGLIST on PPP devices and add an > .ndo_fix_features() callback to disable them when the underlying PPP > channel is not using direct_xmit (i.e. IFF_NO_QUEUE is not set in > priv_flags). This allows the networking core to pass non-linear skbs > directly only when it is safe to do so. > > PPP compressors still require linear skbs, and their states can change > at runtime. In order to avoid races, instead of toggling features, call > skb_linearize() before passing buffers to them. Compressors are uncommon > on high-speed links, so this does not affect the fast path. > > Signed-off-by: Qingfang Deng > --- > v2 -> v3: > toggle features only if the underlying ppp_channel changes. Call > skb_linearize() if compressors are in use. > - https://lore.kernel.org/linux-ppp/20251103031501.404141-1-dqfext@gmail.com/ > > drivers/net/ppp/ppp_generic.c | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c > index f9f0f16c41d1..d706a175cea9 100644 > --- a/drivers/net/ppp/ppp_generic.c > +++ b/drivers/net/ppp/ppp_generic.c > @@ -1545,6 +1545,16 @@ ppp_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats64) > dev_fetch_sw_netstats(stats64, dev->tstats); > } > > +static netdev_features_t > +ppp_fix_features(struct net_device *dev, netdev_features_t features) > +{ > + /* Don't advertise SG/FRAGLIST when IFF_NO_QUEUE is absent */ > + if (!(dev->priv_flags & IFF_NO_QUEUE)) > + features &= ~(NETIF_F_SG | NETIF_F_FRAGLIST); I spent a little time trying to understanding the logic here and I think that enabling features depending on IFF_NO_QUEUE is fragile at best. It looks like that the IFF_NO_QUEUE bit is an inconsistent state for multilink devices using different type of channels. Moreover the user-space could attaching a qdisc to the ppp device after channel initialization. Instead you could always expose the features and linearize as needed when transmitting on !direct_xmit channel; no need to touch the individual channel implementation, you could do such check before calling the ops->start_xmit() calls (possibly creating a new wrapper/helper for that). /P