[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-backports
Subject:    Re: [PATCH v2 2/2] backports: add skb_list_del_init
From:       "Coelho, Luciano" <luciano.coelho () intel ! com>
Date:       2020-09-28 9:12:40
Message-ID: 761d13bdc1b162ed574c6b3c3bb9b6635ad696f7.camel () intel ! com
[Download RAW message or body]

On Mon, 2020-09-28 at 09:20 +0200, Johannes Berg wrote:
> On Mon, 2020-09-28 at 08:31 +0200, Felix Fietkau wrote:
> > > The list member was only added in kernel 4.19 to the sk_buff structure,
> > > see here:
> > > https://git.kernel.org/linus/d4546c2509b1e9cd082e3682dcec98472e37ee5a
> > I guess it was working for me on 4.14 because the list member was
> > backported in 4.14.71.
> > So it works for kernels with that backport, and I guess other versions
> > which don't have that will need a more intrusive backport that patches
> > mac80211 anyway.
> 
> I think Luca (+) just made some internally - we should push that out.

This is what I have (I'm planning to send my updates later this week):

diff --cc backport-include/linux/skbuff.h
index 0843446bd2d5,be2f955cc24e..ae504f0703e1
--- a/backport-include/linux/skbuff.h
+++ b/backport-include/linux/skbuff.h
@@@ -383,19 -375,19 +383,25 @@@ static inline void skb_put_u8(struct sk
  }
  #endif
  
++#if LINUX_VERSION_IS_LESS(4,20,0) && !LINUX_VERSION_IN_RANGE(4,19,10, 4,20,0)
++static inline void skb_mark_not_on_list(struct sk_buff *skb)
++{
++      skb->next = NULL;
++}
++#endif /* < 4.20 || 4.19.10 <= x < 4.20 */
++
  #if LINUX_VERSION_IS_LESS(4,20,0)
  static inline struct sk_buff *__skb_peek(const struct sk_buff_head *list_)
  {
        return list_->next;
  }
- #endif
  
- #if LINUX_VERSION_IS_LESS(4,20,0) && !LINUX_VERSION_IN_RANGE(4,19,10, 4,20,0)
 -#if !LINUX_VERSION_IN_RANGE(4,19,10, 4,20,0)
--static inline void skb_mark_not_on_list(struct sk_buff *skb)
++static inline void skb_list_del_init(struct sk_buff *skb)
  {
--      skb->next = NULL;
++      __list_del_entry((struct list_head *)&skb->next);
++      skb_mark_not_on_list(skb);
  }
- #endif /* < 4.20 || 4.19.10 <= x < 4.20 */
 -#endif /* 4.19.10 <= x < 4.20 */
+ #endif
  
  #if LINUX_VERSION_IS_LESS(4,11,0)
  #define skb_mac_offset LINUX_BACKPORT(skb_mac_offset)

--
Cheers,
Luca.
--
To unsubscribe from this list: send the line "unsubscribe backports" in
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic