Skip to content

net: move skb->dropcount to skb->cb[]

Eyal Birger linux-bluetooth netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 of 7 patches 1 replyIn review
  2. v25 of 7 patches 0 repliesSuperseded
  3. v17 patches 22 repliesSuperseded

Changes in v3 from the cover letter

- Rebase
- Compact af_packet use of skb->cb[] instead of aliasing skb->dev for creating room per Willem de Bruijn suggestion

3 of 7 patches are in this archive. The cover letter announces 7.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
2/7net: bluetooth: compact struct bt_skb_cb by converting boolean fields to bit fieldsinclude/net/bluetooth/bluetooth.h net/bluetooth/hci_core.c net/bluetooth/hci_request.c +1 more+6 -60 replies
4/7net: packet: use sockaddr_ll fields as storage for skb original length in recvmsg pathnet/packet/af_packet.c+24 -60 replies
6/7net: add common accessor for setting dropcount on packetsinclude/net/sock.h net/core/sock.c net/packet/af_packet.c+8 -20 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchShmulik Ladkani
SeriesR-b
2/7
4/7
6/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net-next v3 0/7] net: move skb->dropcount to skb->cb[]

Commit 977750076d98 ("af_packet: add interframe drop cmsg (v6)") unionized skb->mark and skb->dropcount in order to allow recording of the socket drop count while maintaining struct sk_buff size.

skb->dropcount was introduced since there was no available room in skb->cb[] in packet sockets. However, its introduction led to the inability to export skb->mark to userspace.

It was considered to alias skb->priority instead of skb->mark. However, that would lead to the inabilty to export skb->priority to userspace if desired. Such change may also lead to hard-to-find issues as skb->priority is assumed to be alias free, and, as noted by Shmulik Ladkani, is not 'naturally orthogonal' with other skb fields.

This patch series follows the suggestions made by Eric Dumazet moving the dropcount metric to skb->cb[], eliminating this problem at the expense of 4 bytes less in skb->cb[] for protocol families using it.

The patch series include compactization of bluetooth and packet use of skb->cb[] as well as the infrastructure for placing dropcount in skb->cb[].

---
Changes in v3:
- Rebase
- Compact af_packet use of skb->cb[] instead of aliasing skb->dev for creating room per Willem de Bruijn suggestion
Changes in v2:
- Rebase
- Receive const struct sock * in sock_skb_set_dropcount() per Eric Dumazet's suggestion
- struct bt_skb_cb compactization code improvements following suggestions from Shmulik Landani and David Laight
- Fix incorrect asignment to skb->dev in packet_rcv()
---

Eyal Birger (7):
net: bluetooth: compact struct bt_skb_cb by inlining struct
hci_req_ctrl
net: bluetooth: compact struct bt_skb_cb by converting boolean fields
to bit fields
net: rxrpc: change call to sock_recv_ts_and_drops() on rxrpc recvmsg
to sock_recv_timestamp()
net: packet: use sockaddr_ll fields as storage for skb original length
in recvmsg path
net: use common macro for assering skb->cb[] available size in
protocol families
net: add common accessor for setting dropcount on packets
net: move skb->dropcount to skb->cb[]

 include/linux/skbuff.h            |  2 --
 include/net/bluetooth/bluetooth.h | 14 +++++---------
 include/net/sock.h                | 23 +++++++++++++++++++++++
 net/bluetooth/af_bluetooth.c      |  3 +--
 net/bluetooth/hci_core.c          | 12 ++++++------
 net/bluetooth/hci_event.c         |  4 ++--
 net/bluetooth/hci_request.c       |  6 +++---
 net/bluetooth/hci_sock.c          |  2 +-
 net/can/bcm.c                     |  2 +-
 net/can/raw.c                     |  6 +++---
 net/core/sock.c                   |  2 +-
 net/ipv4/af_inet.c                |  2 +-
 net/ipv4/tcp.c                    |  3 +--
 net/ipv6/af_inet6.c               |  2 +-
 net/packet/af_packet.c            | 35 ++++++++++++++++++++++++++---------
 net/rxrpc/ar-recvmsg.c            |  2 +-
 net/sctp/protocol.c               |  3 +--
 net/socket.c                      |  4 ++--
 18 files changed, 79 insertions(+), 48 deletions(-)
Signature · 1 line
2.1.4