All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v7 0/6] move CAN skb headroom content to skb extensions
@ 2026-01-31 13:25 ` Oliver Hartkopp via B4 Relay
  0 siblings, 0 replies; 17+ messages in thread
From: Oliver Hartkopp @ 2026-01-31 13:25 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Oliver Hartkopp,
	Robin van der Gracht, Oleksij Rempel, kernel, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: linux-can, linux-kernel, netdev

CAN bus related skbuffs (ETH_P_CAN/ETH_P_CANFD/ETH_P_CANXL) simply contain
CAN frame structs for CAN CC/FD/XL of skb->len length at skb->data. Those
CAN skbs do not have network/mac/transport headers nor other such
references for encapsulated protocols like ethernet/IP protocols.

To store data for CAN specific use-cases all CAN bus related skbuffs are
created with a 16 byte private skb headroom (struct can_skb_priv). Using
the skb headroom and accessing skb->head for this private data led to
several problems in the past likely due to "The struct can_skb_priv
business is highly unconventional for the networking stack." [1]

This patch set aims to remove the unconventional skb headroom usage for CAN
bus related skbuffs and use the common skb extensions instead.

[1] https://lore.kernel.org/linux-can/20260104074222.29e660ac@kernel.org/

---
Changes in v2:
- Patch#1: use u32 instead of __u32 for "struct uniqframe::hash"
- Patch#3: use u{8,16} instead of __u{8,16} for "struct can_skb_ext"
- Patch#6: add missing patch
- Link to v1: https://patch.msgid.link/20260125201601.5018-1-socketcan@hartkopp.net

Changes in v3:
- Patch#2: new patch: rename dev_put() in CAN subsystem suggested by Checkpatch
- Patch#3: use netdev_put() instead of dev_put() suggested by Checkpatch
- Patch#3: initialize can_gw_hops in can_skb_ext_add() suggested by AI-bot
- Patch#6: add linebreak in sock_alloc_send_skb() to fit the 80 columns (Checkpatch)
- Link to v2: https://lore.kernel.org/linux-can/20260128-can-skb-ext-v2-0-fe64aa152c8a@pengutronix.de/

Changes in v4:
Solve the netdev_put() / dev_put() suggestion from Checkpatch in a separate
patch set. Therefore these changes are based on V2 again. 
- Patch#2: initialize can_gw_hops in can_skb_ext_add() suggested by AI-bot
- Patch#5: add linebreak in sock_alloc_send_skb() to fit the 80 columns
- Link to v2: https://lore.kernel.org/linux-can/20260128-can-skb-ext-v2-0-fe64aa152c8a@pengutronix.de/

Changes in v5:
- Patch#2: use skb_ext_add() for the cloned skb suggested by AI-bot
- Patch#2: use netdev_put() instead of dev_put() suggested by Checkpatch
- managed to get the receipient list with b4 prep --auto-to-cc
- Link to v4: https://lore.kernel.org/netdev/20260128-can_skb_ext-v1-0-330f60fd5d7e@hartkopp.net/

Changes in v6:
- Patch#1: drop extern prototype in header file (Checkpatch)
- Patch#6: vxcan: correctly reset drop counter with skb extensions (AI-bot)
- Link to v5: https://patch.msgid.link/20260129-can_skb_ext-v5-0-21252fdc8900@hartkopp.net

Changes in v7:
- Patch#2: common handling for cloned skbs in gw.c j1939/transport.c vxcan.c
- Patch#6: vxcan: correctly reset drop counter based on updated Patch#2
- Link to v6: https://patch.msgid.link/20260130-can_skb_ext-v6-0-8fceafab7f26@hartkopp.net

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

---
Oliver Hartkopp (6):
      can: use skb hash instead of private variable in headroom
      can: add CAN skb extension infrastructure
      can: move ifindex to CAN skb extensions
      can: move frame_len to CAN skb extensions
      can: remove private CAN skb headroom infrastructure
      can: gw: use can_gw_hops instead of sk_buff::csum_start

 MAINTAINERS               |   1 +
 drivers/net/can/dev/skb.c | 123 +++++++++++++++++++++++++++++-----------------
 drivers/net/can/vxcan.c   |  16 +++++-
 include/linux/can/core.h  |   1 +
 include/linux/can/skb.h   |  38 +++++---------
 include/linux/skbuff.h    |   3 ++
 include/net/can.h         |  28 +++++++++++
 net/can/Kconfig           |   1 +
 net/can/af_can.c          |  23 ++++++---
 net/can/bcm.c             |  26 +++++++---
 net/can/gw.c              |  42 +++++++++-------
 net/can/isotp.c           |  45 +++++++++++------
 net/can/j1939/socket.c    |  15 ++++--
 net/can/j1939/transport.c |  41 ++++++++++++----
 net/can/raw.c             |  22 ++++++---
 net/core/skbuff.c         |   4 ++
 16 files changed, 286 insertions(+), 143 deletions(-)
---
base-commit: 239f09e258b906deced5c2a7c1ac8aed301b558b
change-id: 20260128-can_skb_ext-0e7a99ed1984

Best regards,
--  
Oliver Hartkopp <socketcan@hartkopp.net>


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

end of thread, other threads:[~2026-02-01 10:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-31 13:25 [PATCH net-next v7 0/6] move CAN skb headroom content to skb extensions Oliver Hartkopp
2026-01-31 13:25 ` Oliver Hartkopp via B4 Relay
2026-01-31 13:25 ` [PATCH net-next v7 1/6] can: use skb hash instead of private variable in headroom Oliver Hartkopp
2026-01-31 13:25   ` Oliver Hartkopp via B4 Relay
2026-01-31 13:25 ` [PATCH net-next v7 2/6] can: add CAN skb extension infrastructure Oliver Hartkopp
2026-01-31 13:25   ` Oliver Hartkopp via B4 Relay
2026-01-31 18:00   ` [net-next,v7,2/6] " Jakub Kicinski
2026-02-01 10:19     ` Oliver Hartkopp
2026-01-31 21:02   ` [PATCH net-next v7 2/6] " kernel test robot
2026-01-31 13:25 ` [PATCH net-next v7 3/6] can: move ifindex to CAN skb extensions Oliver Hartkopp
2026-01-31 13:25   ` Oliver Hartkopp via B4 Relay
2026-01-31 13:25 ` [PATCH net-next v7 4/6] can: move frame_len " Oliver Hartkopp
2026-01-31 13:25   ` Oliver Hartkopp via B4 Relay
2026-01-31 13:25 ` [PATCH net-next v7 5/6] can: remove private CAN skb headroom infrastructure Oliver Hartkopp
2026-01-31 13:25   ` Oliver Hartkopp via B4 Relay
2026-01-31 13:25 ` [PATCH net-next v7 6/6] can: gw: use can_gw_hops instead of sk_buff::csum_start Oliver Hartkopp
2026-01-31 13:25   ` Oliver Hartkopp via B4 Relay

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.