diff mbox series

[1/4] net: mana: Use napi_build_skb in RX path

Message ID 20230418155617.153531-2-tim.gardner@canonical.com
State New
Headers show
Series Azure: Enable MANA Jumbo Frame Support | expand

Commit Message

Tim Gardner April 18, 2023, 3:56 p.m. UTC
From: Haiyang Zhang <haiyangz@microsoft.com>

BugLink: https://bugs.launchpad.net/bugs/2016898

Use napi_build_skb() instead of build_skb() to take advantage of the
NAPI percpu caches to obtain skbuff_head.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ce518bc3e9ca342309995c9270c3ec4892963695 linux-next)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Roxana Nicolescu April 19, 2023, 8:21 a.m. UTC | #1
On 18/04/2023 17:56, Tim Gardner wrote:
> From: Haiyang Zhang <haiyangz@microsoft.com>
>
> BugLink: https://bugs.launchpad.net/bugs/2016898
>
> Use napi_build_skb() instead of build_skb() to take advantage of the
> NAPI percpu caches to obtain skbuff_head.
>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (cherry picked from commit ce518bc3e9ca342309995c9270c3ec4892963695 linux-next)
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>   drivers/net/ethernet/microsoft/mana/mana_en.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index 55bf40e5ee71..a1b7905ed2f7 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -1188,7 +1188,7 @@ static void mana_post_pkt_rxq(struct mana_rxq *rxq)
>   static struct sk_buff *mana_build_skb(void *buf_va, uint pkt_len,
>   				      struct xdp_buff *xdp)
>   {
> -	struct sk_buff *skb = build_skb(buf_va, PAGE_SIZE);
> +	struct sk_buff *skb = napi_build_skb(buf_va, PAGE_SIZE);
>   
>   	if (!skb)
>   		return NULL;
>

This does not apply to jammy because commit "net: mana: Add XDP support" 
is missing, thus `mana_build_skb` func is not defined.

Roxana
Tim Gardner April 19, 2023, 1:42 p.m. UTC | #2
On 4/19/23 2:21 AM, Roxana Nicolescu wrote:
> 
> On 18/04/2023 17:56, Tim Gardner wrote:
>> From: Haiyang Zhang <haiyangz@microsoft.com>
>>
>> BugLink: https://bugs.launchpad.net/bugs/2016898
>>
>> Use napi_build_skb() instead of build_skb() to take advantage of the
>> NAPI percpu caches to obtain skbuff_head.
>>
>> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
>> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
>> Signed-off-by: David S. Miller <davem@davemloft.net>
>> (cherry picked from commit ce518bc3e9ca342309995c9270c3ec4892963695 
>> linux-next)
>> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
>> ---
>>   drivers/net/ethernet/microsoft/mana/mana_en.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c 
>> b/drivers/net/ethernet/microsoft/mana/mana_en.c
>> index 55bf40e5ee71..a1b7905ed2f7 100644
>> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
>> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
>> @@ -1188,7 +1188,7 @@ static void mana_post_pkt_rxq(struct mana_rxq *rxq)
>>   static struct sk_buff *mana_build_skb(void *buf_va, uint pkt_len,
>>                         struct xdp_buff *xdp)
>>   {
>> -    struct sk_buff *skb = build_skb(buf_va, PAGE_SIZE);
>> +    struct sk_buff *skb = napi_build_skb(buf_va, PAGE_SIZE);
>>       if (!skb)
>>           return NULL;
>>
> 
> This does not apply to jammy because commit "net: mana: Add XDP support" 
> is missing, thus `mana_build_skb` func is not defined.
> 
> Roxana
> 
> 

So I just built against Ubuntu-azure-5.15.0-1036.43 with the 4 
aforementioned patches. No problems. Is your repo clean ?
Roxana Nicolescu April 19, 2023, 2:58 p.m. UTC | #3
On 19/04/2023 15:42, Tim Gardner wrote:
> On 4/19/23 2:21 AM, Roxana Nicolescu wrote:
>>
>> On 18/04/2023 17:56, Tim Gardner wrote:
>>> From: Haiyang Zhang <haiyangz@microsoft.com>
>>>
>>> BugLink: https://bugs.launchpad.net/bugs/2016898
>>>
>>> Use napi_build_skb() instead of build_skb() to take advantage of the
>>> NAPI percpu caches to obtain skbuff_head.
>>>
>>> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
>>> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
>>> Signed-off-by: David S. Miller <davem@davemloft.net>
>>> (cherry picked from commit ce518bc3e9ca342309995c9270c3ec4892963695 
>>> linux-next)
>>> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
>>> ---
>>>   drivers/net/ethernet/microsoft/mana/mana_en.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c 
>>> b/drivers/net/ethernet/microsoft/mana/mana_en.c
>>> index 55bf40e5ee71..a1b7905ed2f7 100644
>>> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
>>> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
>>> @@ -1188,7 +1188,7 @@ static void mana_post_pkt_rxq(struct mana_rxq 
>>> *rxq)
>>>   static struct sk_buff *mana_build_skb(void *buf_va, uint pkt_len,
>>>                         struct xdp_buff *xdp)
>>>   {
>>> -    struct sk_buff *skb = build_skb(buf_va, PAGE_SIZE);
>>> +    struct sk_buff *skb = napi_build_skb(buf_va, PAGE_SIZE);
>>>       if (!skb)
>>>           return NULL;
>>>
>>
>> This does not apply to jammy because commit "net: mana: Add XDP 
>> support" is missing, thus `mana_build_skb` func is not defined.
>>
>> Roxana
>>
>>
>
> So I just built against Ubuntu-azure-5.15.0-1036.43 with the 4 
> aforementioned patches. No problems. Is your repo clean ?
>

I need to change my glasses, I was in looking at linux-main.

I am sorry, all commits look fine.
Tim Gardner April 19, 2023, 3:08 p.m. UTC | #4
On 4/19/23 08:58, Roxana Nicolescu wrote:
> 
> On 19/04/2023 15:42, Tim Gardner wrote:
>> On 4/19/23 2:21 AM, Roxana Nicolescu wrote:
>>>
>>> On 18/04/2023 17:56, Tim Gardner wrote:
>>>> From: Haiyang Zhang <haiyangz@microsoft.com>
>>>>
>>>> BugLink: https://bugs.launchpad.net/bugs/2016898
>>>>
>>>> Use napi_build_skb() instead of build_skb() to take advantage of the
>>>> NAPI percpu caches to obtain skbuff_head.
>>>>
>>>> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
>>>> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
>>>> Signed-off-by: David S. Miller <davem@davemloft.net>
>>>> (cherry picked from commit ce518bc3e9ca342309995c9270c3ec4892963695 
>>>> linux-next)
>>>> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
>>>> ---
>>>>   drivers/net/ethernet/microsoft/mana/mana_en.c | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c 
>>>> b/drivers/net/ethernet/microsoft/mana/mana_en.c
>>>> index 55bf40e5ee71..a1b7905ed2f7 100644
>>>> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
>>>> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
>>>> @@ -1188,7 +1188,7 @@ static void mana_post_pkt_rxq(struct mana_rxq 
>>>> *rxq)
>>>>   static struct sk_buff *mana_build_skb(void *buf_va, uint pkt_len,
>>>>                         struct xdp_buff *xdp)
>>>>   {
>>>> -    struct sk_buff *skb = build_skb(buf_va, PAGE_SIZE);
>>>> +    struct sk_buff *skb = napi_build_skb(buf_va, PAGE_SIZE);
>>>>       if (!skb)
>>>>           return NULL;
>>>>
>>>
>>> This does not apply to jammy because commit "net: mana: Add XDP 
>>> support" is missing, thus `mana_build_skb` func is not defined.
>>>
>>> Roxana
>>>
>>>
>>
>> So I just built against Ubuntu-azure-5.15.0-1036.43 with the 4 
>> aforementioned patches. No problems. Is your repo clean ?
>>
> 
> I need to change my glasses, I was in looking at linux-main.
> 
> I am sorry, all commits look fine.
> 

Then I will take that as an ACK.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index 55bf40e5ee71..a1b7905ed2f7 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -1188,7 +1188,7 @@  static void mana_post_pkt_rxq(struct mana_rxq *rxq)
 static struct sk_buff *mana_build_skb(void *buf_va, uint pkt_len,
 				      struct xdp_buff *xdp)
 {
-	struct sk_buff *skb = build_skb(buf_va, PAGE_SIZE);
+	struct sk_buff *skb = napi_build_skb(buf_va, PAGE_SIZE);
 
 	if (!skb)
 		return NULL;