DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: Liangxing Wang <liangxing.wang@arm.com>,
	Jakub Grajciar <jgrajcia@cisco.com>
Cc: dev@dpdk.org, nd@arm.com, Ruifeng Wang <ruifeng.wang@arm.com>
Subject: Re: [PATCH v1] net/memif: remove extra mbuf refcnt update in zero copy Tx
Date: Thu, 8 Feb 2024 01:06:34 +0000	[thread overview]
Message-ID: <de299779-6968-42fe-8129-75ecd7f9cc67@amd.com> (raw)
In-Reply-To: <4a0e96d3-9370-4954-b2a6-abc4b37a8659@amd.com>

On 12/8/2023 1:44 PM, Ferruh Yigit wrote:
> On 12/8/2023 2:38 AM, Liangxing Wang wrote:
>> The refcnt update of stored mbufs in memif driver is redundant since
>> those mbufs are only freed in eth_memif_tx_zc(). No other place
>> can free those stored mbufs quietly. So remove the redundant mbuf
>> refcnt update in dpdk memif driver to avoid extra heavy cost.
>> Performance of dpdk memif zero copy tx is improved with this change.
>>
> 
> As mentioned above, since free is called only from 'eth_memif_tx_zc()',
> this change looks good to me.
> Did you measure the performance improvement, if so can you please share it?
> 
> 
> 
> And addition to this being an optimization, it may be a required fix,
> can you please check following case:
> 
> - When 'memif_tx_one_zc()' called, it has number of free slot
> information as parameter
> - If the mbuf is chained mbuf, only first mbuf reference is increased
> - If number of segment in the mbuf chain is bigger than free slot,
> function returns 0
> - in this error case 'eth_memif_tx_zc()' breaks the sending look and returns
> - In this scenario application gives the decision to either free the
> mbuf or re-send it. But for this case application can't free the mbuf
> because of reference count which may cause memory leak
> - If application decides to re-send, reference count increased again, I
> guess eventually 'memif_free_stored_mbufs()' will decrease the refcount
> to be able to free it
> 
> Assuming above is not done intentionally to make sure all mbufs are sent.
> 
> This refcount prevent application discretion to drop packets, so your
> change is required to fix this. Can you please double check if I am
> missing anything?
> 
> 

Hi Liangxing,

Let me summarize two points above,

1. Can you quantify performance improvement and document this commit log
of next version?

2. For some cases this optimization can be required as fix, can you
please make this a fix patch with fixes tag etc in next version?


  reply	other threads:[~2024-02-08  1:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  2:38 Liangxing Wang
2023-12-08 13:44 ` Ferruh Yigit
2024-02-08  1:06   ` Ferruh Yigit [this message]
2024-02-14  0:36 ` [PATCH V2] net/memif: fix " Wathsala Vithanage
2024-02-14 11:09   ` Ferruh Yigit

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=de299779-6968-42fe-8129-75ecd7f9cc67@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=dev@dpdk.org \
    --cc=jgrajcia@cisco.com \
    --cc=liangxing.wang@arm.com \
    --cc=nd@arm.com \
    --cc=ruifeng.wang@arm.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;
as well as URLs for NNTP newsgroup(s).