Skip to content

Commit 8a886b1

Browse files
Paolo Abenidavem330
authored andcommitted
sk_buff: track dst status in slow_gro
Similar to the previous patch, but covering the dst field: the slow_gro flag is additionally set when a dst is attached to the skb RFC -> v1: - use the existing flag instead of adding a new one Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5fc88f9 commit 8a886b1

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎include/linux/skbuff.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
992992
*/
993993
static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
994994
{
995+
skb->slow_gro |= !!dst;
995996
skb->_skb_refdst = (unsigned long)dst;
996997
}
997998

@@ -1008,6 +1009,7 @@ static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
10081009
static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst)
10091010
{
10101011
WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held());
1012+
skb->slow_gro = !!dst;
10111013
skb->_skb_refdst = (unsigned long)dst | SKB_DST_NOREF;
10121014
}
10131015

‎include/net/dst.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ static inline void skb_dst_drop(struct sk_buff *skb)
277277

278278
static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
279279
{
280+
nskb->slow_gro |= !!refdst;
280281
nskb->_skb_refdst = refdst;
281282
if (!(nskb->_skb_refdst & SKB_DST_NOREF))
282283
dst_clone(skb_dst(nskb));
@@ -316,6 +317,7 @@ static inline bool skb_dst_force(struct sk_buff *skb)
316317
dst = NULL;
317318

318319
skb->_skb_refdst = (unsigned long)dst;
320+
skb->slow_gro |= !!dst;
319321
}
320322

321323
return skb->_skb_refdst != 0UL;

0 commit comments

Comments
 (0)