linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.19 01/11] drivers/net/wan/hdlc_fr: Add needed_headroom for PVC devices
@ 2020-09-29  1:31 Sasha Levin
  2020-09-29  1:31 ` [PATCH AUTOSEL 4.19 02/11] drm/sun4i: mixer: Extend regmap max_register Sasha Levin
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Sasha Levin @ 2020-09-29  1:31 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Xie He, Krzysztof Halasa, Martin Schiller, Jakub Kicinski,
	Sasha Levin, netdev

From: Xie He <xie.he.0141@gmail.com>

[ Upstream commit 44a049c42681de71c783d75cd6e56b4e339488b0 ]

PVC devices are virtual devices in this driver stacked on top of the
actual HDLC device. They are the devices normal users would use.
PVC devices have two types: normal PVC devices and Ethernet-emulating
PVC devices.

When transmitting data with PVC devices, the ndo_start_xmit function
will prepend a header of 4 or 10 bytes. Currently this driver requests
this headroom to be reserved for normal PVC devices by setting their
hard_header_len to 10. However, this does not work when these devices
are used with AF_PACKET/RAW sockets. Also, this driver does not request
this headroom for Ethernet-emulating PVC devices (but deals with this
problem by reallocating the skb when needed, which is not optimal).

This patch replaces hard_header_len with needed_headroom, and set
needed_headroom for Ethernet-emulating PVC devices, too. This makes
the driver to request headroom for all PVC devices in all cases.

Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wan/hdlc_fr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index 038236a9c60ee..67f89917277ce 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -1044,7 +1044,7 @@ static void pvc_setup(struct net_device *dev)
 {
 	dev->type = ARPHRD_DLCI;
 	dev->flags = IFF_POINTOPOINT;
-	dev->hard_header_len = 10;
+	dev->hard_header_len = 0;
 	dev->addr_len = 2;
 	netif_keep_dst(dev);
 }
@@ -1096,6 +1096,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
 	dev->mtu = HDLC_MAX_MTU;
 	dev->min_mtu = 68;
 	dev->max_mtu = HDLC_MAX_MTU;
+	dev->needed_headroom = 10;
 	dev->priv_flags |= IFF_NO_QUEUE;
 	dev->ml_priv = pvc;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-09-29  1:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29  1:31 [PATCH AUTOSEL 4.19 01/11] drivers/net/wan/hdlc_fr: Add needed_headroom for PVC devices Sasha Levin
2020-09-29  1:31 ` [PATCH AUTOSEL 4.19 02/11] drm/sun4i: mixer: Extend regmap max_register Sasha Levin
2020-09-29  1:31 ` [PATCH AUTOSEL 4.19 03/11] net: dec: de2104x: Increase receive ring size for Tulip Sasha Levin
2020-09-29  1:31 ` [PATCH AUTOSEL 4.19 04/11] rndis_host: increase sleep time in the query-response loop Sasha Levin
2020-09-29  1:31 ` [PATCH AUTOSEL 4.19 05/11] nvme-core: get/put ctrl and transport module in nvme_dev_open/release() Sasha Levin
2020-09-29  1:31 ` [PATCH AUTOSEL 4.19 06/11] regmap: debugfs: Fix handling of name string for debugfs init delays Sasha Levin
2020-09-29  1:31 ` [PATCH AUTOSEL 4.19 07/11] drivers/net/wan/lapbether: Make skb->protocol consistent with the header Sasha Levin
2020-09-29  1:31 ` [PATCH AUTOSEL 4.19 08/11] drivers/net/wan/hdlc: Set skb->protocol before transmitting Sasha Levin
2020-09-29  1:31 ` [PATCH AUTOSEL 4.19 09/11] mac80211: do not allow bigger VHT MPDUs than the hardware supports Sasha Levin
2020-09-29  1:31 ` [PATCH AUTOSEL 4.19 10/11] spi: fsl-espi: Only process interrupts for expected events Sasha Levin
2020-09-29  1:31 ` [PATCH AUTOSEL 4.19 11/11] nvme-fc: fail new connections to a deleted host or remote port Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).