mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jijie Shao <shaojijie@huawei.com>
To: Paolo Abeni <pabeni@redhat.com>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>
Cc: <shaojijie@huawei.com>, <shenjian15@huawei.com>,
	<wangpeiyang1@huawei.com>, <liuyonglong@huawei.com>,
	<chenhao418@huawei.com>, <sudongming1@huawei.com>,
	<xujunsheng@huawei.com>, <shiyongbang@huawei.com>,
	<libaihan@huawei.com>, <andrew@lunn.ch>, <jdamato@fastly.com>,
	<horms@kernel.org>, <kalesh-anakkur.purayil@broadcom.com>,
	<christophe.jaillet@wanadoo.fr>, <jonathan.cameron@huawei.com>,
	<shameerali.kolothum.thodi@huawei.com>, <salil.mehta@huawei.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V12 net-next 07/10] net: hibmcge: Implement rx_poll function to receive packets
Date: Tue, 15 Oct 2024 19:41:26 +0800	[thread overview]
Message-ID: <44023e6f-5a52-4681-84fc-dd623cd9f09d@huawei.com> (raw)
In-Reply-To: <2dd71e95-5fb2-42c9-aff0-3189e958730a@redhat.com>

on 2024/10/15 18:28, Paolo Abeni wrote:
> On 10/10/24 16:21, Jijie Shao wrote:
>> @@ -124,6 +129,20 @@ static void hbg_buffer_free_skb(struct 
>> hbg_buffer *buffer)
>>       buffer->skb = NULL;
>>   }
>>   +static int hbg_buffer_alloc_skb(struct hbg_buffer *buffer)
>> +{
>> +    u32 len = hbg_spec_max_frame_len(buffer->priv, buffer->dir);
>> +    struct hbg_priv *priv = buffer->priv;
>> +
>> +    buffer->skb = netdev_alloc_skb(priv->netdev, len);
>> +    if (unlikely(!buffer->skb))
>> +        return -ENOMEM;
>
> It looks like I was not clear enough in my previous feedback: 
> allocating the sk_buff struct at packet reception time, will be much 
> more efficient, because the sk_buff contents will be hot in cache for 
> the RX path, while allocating it here, together with the data pointer 
> itself will almost ensure 2-4 cache misses per RX packet.
>
> You could allocate here the data buffer i.e. via a page allocator and
> at rx processing time use build_skb() on top of such data buffer.
>
> I understand it's probably such refactor would be painful at this 
> point, but you should consider it as a follow-up.

Thank you for your advice.
We're actually focusing on optimizing performance now.

But according to the test results, the current performance bottleneck
is not in the driver or protocol stack.

This driver is a PCIe driver, the device is on the BMC side.
All data transfer needs to pass through the PCIe DMA.
As a result, the maximum bandwidth cannot be reached.
Currently, we have a special task to track and optimize performance.
Your suggestion is reasonable and we will adopt it when optimizing performance.

If possible, we do not want to modify this patch for the time being.
Because patch set has been modified many times,
we hope it can be accepted as soon as possible if there are no other serious problems.
We have some other features waiting to be sent.

Some patches will be sent in the future to optimize performance.

Thank you.

>
> Side note: the above always uses the maximum MTU for the packet size, 
> if the device supports jumbo frames (8Kb size packets), it will 
> produce quite bad layout for the incoming packets... Is the device 
> able to use multiple buffers for the incoming packets?

In fact, jumbo frames are not supported in device, and the maximum MTU is 4Kb.

Thanks,

Jijie Shao


  reply	other threads:[~2024-10-15 11:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 14:21 [PATCH V12 net-next 00/10] Add support of HIBMCGE Ethernet Driver Jijie Shao
2024-10-10 14:21 ` [PATCH V12 net-next 01/10] net: hibmcge: Add pci table supported in this module Jijie Shao
2024-10-10 14:21 ` [PATCH V12 net-next 02/10] net: hibmcge: Add read/write registers supported through the bar space Jijie Shao
2024-10-10 14:21 ` [PATCH V12 net-next 03/10] net: hibmcge: Add mdio and hardware configuration supported in this module Jijie Shao
2024-10-10 14:21 ` [PATCH V12 net-next 04/10] net: hibmcge: Add interrupt " Jijie Shao
2024-10-10 14:21 ` [PATCH V12 net-next 05/10] net: hibmcge: Implement some .ndo functions Jijie Shao
2024-10-10 14:21 ` [PATCH V12 net-next 06/10] net: hibmcge: Implement .ndo_start_xmit function Jijie Shao
2024-10-10 14:21 ` [PATCH V12 net-next 07/10] net: hibmcge: Implement rx_poll function to receive packets Jijie Shao
2024-10-15 10:28   ` Paolo Abeni
2024-10-15 11:41     ` Jijie Shao [this message]
2024-10-15 11:57       ` Paolo Abeni
2024-10-15 12:05         ` Jijie Shao
2024-10-10 14:21 ` [PATCH V12 net-next 08/10] net: hibmcge: Implement some ethtool_ops functions Jijie Shao
2024-10-10 14:21 ` [PATCH V12 net-next 09/10] net: hibmcge: Add a Makefile and update Kconfig for hibmcge Jijie Shao
2024-10-10 14:21 ` [PATCH V12 net-next 10/10] net: hibmcge: Add maintainer " Jijie Shao
2024-10-15 10:30   ` Paolo Abeni
2024-10-15 11:43     ` Jijie Shao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44023e6f-5a52-4681-84fc-dd623cd9f09d@huawei.com \
    --to=shaojijie@huawei.com \
    --cc=andrew@lunn.ch \
    --cc=chenhao418@huawei.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=libaihan@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyonglong@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=salil.mehta@huawei.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=shenjian15@huawei.com \
    --cc=shiyongbang@huawei.com \
    --cc=sudongming1@huawei.com \
    --cc=wangpeiyang1@huawei.com \
    --cc=xujunsheng@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®