All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] backports: add netif_receive_skb_list
@ 2020-08-14 14:29 Felix Fietkau
  2020-08-14 14:29 ` [PATCH v2 2/2] backports: add skb_list_del_init Felix Fietkau
  0 siblings, 1 reply; 8+ messages in thread
From: Felix Fietkau @ 2020-08-14 14:29 UTC (permalink / raw)
  To: backports

It is needed for mac80211

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 backport/backport-include/linux/netdevice.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index edb0aaf33cde..fc69c2165e38 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -372,6 +372,18 @@ static inline int _bp_netdev_upper_dev_link(struct net_device *dev,
 	macro_dispatcher(netdev_upper_dev_link, __VA_ARGS__)(__VA_ARGS__)
 #endif
 
+#if LINUX_VERSION_IS_LESS(4,19,0)
+static inline void netif_receive_skb_list(struct list_head *head)
+{
+	struct sk_buff *skb, *next;
+
+	list_for_each_entry_safe(skb, next, head, list) {
+		skb_list_del_init(skb);
+		netif_receive_skb(skb);
+	}
+}
+#endif
+
 #if LINUX_VERSION_IS_LESS(5,0,0)
 static inline int backport_dev_open(struct net_device *dev, struct netlink_ext_ack *extack)
 {
-- 
2.28.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

* [PATCH v2 2/2] backports: add skb_list_del_init
  2020-08-14 14:29 [PATCH v2 1/2] backports: add netif_receive_skb_list Felix Fietkau
@ 2020-08-14 14:29 ` Felix Fietkau
  2020-08-31 18:46   ` Hauke Mehrtens
  0 siblings, 1 reply; 8+ messages in thread
From: Felix Fietkau @ 2020-08-14 14:29 UTC (permalink / raw)
  To: backports

It is needed for mac80211

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 backport/backport-include/linux/skbuff.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 3ed990d0d2ef..7b825630d391 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -384,6 +384,12 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
 {
 	skb->next = NULL;
 }
+
+static inline void skb_list_del_init(struct sk_buff *skb)
+{
+	__list_del_entry(&skb->list);
+	skb_mark_not_on_list(skb);
+}
 #endif /* 4.19.10 <= x < 4.20 */
 #endif
 
-- 
2.28.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

* Re: [PATCH v2 2/2] backports: add skb_list_del_init
  2020-08-14 14:29 ` [PATCH v2 2/2] backports: add skb_list_del_init Felix Fietkau
@ 2020-08-31 18:46   ` Hauke Mehrtens
  2020-09-28  6:31     ` Felix Fietkau
  0 siblings, 1 reply; 8+ messages in thread
From: Hauke Mehrtens @ 2020-08-31 18:46 UTC (permalink / raw)
  To: Felix Fietkau, backports

On 8/14/20 4:29 PM, Felix Fietkau wrote:
> It is needed for mac80211
> 
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
>  backport/backport-include/linux/skbuff.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
> index 3ed990d0d2ef..7b825630d391 100644
> --- a/backport/backport-include/linux/skbuff.h
> +++ b/backport/backport-include/linux/skbuff.h
> @@ -384,6 +384,12 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
>  {
>  	skb->next = NULL;
>  }
> +
> +static inline void skb_list_del_init(struct sk_buff *skb)
> +{
> +	__list_del_entry(&skb->list);
> +	skb_mark_not_on_list(skb);
> +}
>  #endif /* 4.19.10 <= x < 4.20 */
>  #endif
>  
> 

Hi Felix,

These two backports are not working.

The list member was only added in kernel 4.19 to the sk_buff structure,
see here:
https://git.kernel.org/linus/d4546c2509b1e9cd082e3682dcec98472e37ee5a

Hauke
--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

* Re: [PATCH v2 2/2] backports: add skb_list_del_init
  2020-08-31 18:46   ` Hauke Mehrtens
@ 2020-09-28  6:31     ` Felix Fietkau
  2020-09-28  7:20       ` Johannes Berg
  0 siblings, 1 reply; 8+ messages in thread
From: Felix Fietkau @ 2020-09-28  6:31 UTC (permalink / raw)
  To: Hauke Mehrtens, backports


On 2020-08-31 20:46, Hauke Mehrtens wrote:
> On 8/14/20 4:29 PM, Felix Fietkau wrote:
>> It is needed for mac80211
>> 
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> ---
>>  backport/backport-include/linux/skbuff.h | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
>> index 3ed990d0d2ef..7b825630d391 100644
>> --- a/backport/backport-include/linux/skbuff.h
>> +++ b/backport/backport-include/linux/skbuff.h
>> @@ -384,6 +384,12 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
>>  {
>>  	skb->next = NULL;
>>  }
>> +
>> +static inline void skb_list_del_init(struct sk_buff *skb)
>> +{
>> +	__list_del_entry(&skb->list);
>> +	skb_mark_not_on_list(skb);
>> +}
>>  #endif /* 4.19.10 <= x < 4.20 */
>>  #endif
>>  
>> 
> 
> Hi Felix,
> 
> These two backports are not working.
> 
> 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.

- Felix
--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

* Re: [PATCH v2 2/2] backports: add skb_list_del_init
  2020-09-28  6:31     ` Felix Fietkau
@ 2020-09-28  7:20       ` Johannes Berg
  2020-09-28  9:12         ` Coelho, Luciano
  0 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2020-09-28  7:20 UTC (permalink / raw)
  To: Felix Fietkau, Hauke Mehrtens, backports; +Cc: luciano.coelho

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.

johannes

--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

* Re: [PATCH v2 2/2] backports: add skb_list_del_init
  2020-09-28  7:20       ` Johannes Berg
@ 2020-09-28  9:12         ` Coelho, Luciano
  2020-11-10 23:24           ` Hauke Mehrtens
  0 siblings, 1 reply; 8+ messages in thread
From: Coelho, Luciano @ 2020-09-28  9:12 UTC (permalink / raw)
  To: nbd, hauke, johannes, backports

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.

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

* Re: [PATCH v2 2/2] backports: add skb_list_del_init
  2020-09-28  9:12         ` Coelho, Luciano
@ 2020-11-10 23:24           ` Hauke Mehrtens
  2020-11-11  7:43             ` Johannes Berg
  0 siblings, 1 reply; 8+ messages in thread
From: Hauke Mehrtens @ 2020-11-10 23:24 UTC (permalink / raw)
  To: Coelho, Luciano, nbd, johannes, backports


[-- Attachment #1.1.1: Type: text/plain, Size: 1009 bytes --]

On 9/28/20 11:12 AM, Coelho, Luciano wrote:
> 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):
> 

Hi,

I have something which looks good to me and is compiling, I have to test 
it on some devices and send the patches soon.

With kernel 5.10 I see some changes in netlink again. Do you already 
have some patches for that?

Hauke

[-- Attachment #1.1.2: OpenPGP_0x93DD20630910B515.asc --]
[-- Type: application/pgp-keys, Size: 10027 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2 2/2] backports: add skb_list_del_init
  2020-11-10 23:24           ` Hauke Mehrtens
@ 2020-11-11  7:43             ` Johannes Berg
  0 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2020-11-11  7:43 UTC (permalink / raw)
  To: Hauke Mehrtens, Coelho, Luciano, nbd, backports

On Wed, 2020-11-11 at 00:24 +0100, Hauke Mehrtens wrote:
> 
> With kernel 5.10 I see some changes in netlink again. Do you already 
> have some patches for that?

Not yet. It's likely going to be rather tricky, though in nl80211 we
don't have multiple policies, so we could just basically revert commit
66a9b9287d24 ("genetlink: move to smaller ops wherever possible").

johannes

--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

end of thread, other threads:[~2020-11-11  7:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-14 14:29 [PATCH v2 1/2] backports: add netif_receive_skb_list Felix Fietkau
2020-08-14 14:29 ` [PATCH v2 2/2] backports: add skb_list_del_init Felix Fietkau
2020-08-31 18:46   ` Hauke Mehrtens
2020-09-28  6:31     ` Felix Fietkau
2020-09-28  7:20       ` Johannes Berg
2020-09-28  9:12         ` Coelho, Luciano
2020-11-10 23:24           ` Hauke Mehrtens
2020-11-11  7:43             ` Johannes Berg

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.