Skip to content

net: define accessors to get/set skb->dst and skb->rtable

Eric Dumazet netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4net: add _skb_dst opaque fieldinclude/linux/skbuff.h+1 -00 replies
2/4net: skb->rtable accessordrivers/net/appletalk/ipddp.c include/linux/skbuff.h include/net/route.h +20 more+89 -730 replies
3/4net: skb->dst accessorsdrivers/infiniband/ulp/ipoib/ipoib_cm.c drivers/infiniband/ulp/ipoib/ipoib_main.c drivers/infiniband/ulp/ipoib/ipoib_multicast.c +80 more+414 -3900 replies
4/4net: skb cleanupinclude/linux/skbuff.h+1 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] net: define accessors to get/set skb->dst and skb->rtable

David

Here are patches I originally cooked to review all places that could need skb->dst

I believe they could be applied in net-next-2.6 because we could then implement what we discussed in last december, about avoiding refcounting on dst_entries in input path (thread about IP_PKTINFO stuff, and a patch we had to revert)

You suggested to use the low order bit of skb->dst to tell if we got a refcount or not.

These four patches implement grounding for this idea (no functional changes yet)

Next step is adding the low order bit handling (or another bit if it happens to be too expensive to check this bit each time we want skb->dst, we still have to benchmark this)

First patchs adds _skb_dst opaque field in existing union

Second patch removes skb->rtable field and implements skb_rtable() method :

struct rtable *skb_rtable(const struct sk_buff *skb)

Third patch removes skb->dst field and implements several methods :

struct dst_entry *skb_dst(const struct sk_buff *skb) void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) void skb_dst_drop(struct sk_buff *skb) (skb_dst_drop() is not yet necessary but prepares next patches)

Fourth patch is a cleanup, avoiding the mono-field anonymous union.

Thank you