DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Radha Mohan <mohun106@gmail.com>
Cc: Radha Mohan Chintakuntla <radhac@marvell.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	 fengchengwen <fengchengwen@huawei.com>,
	Nithin Dabilpuram <ndabilpuram@marvell.com>,
	 Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	 Satha Koteswara Rao Kottidi <skoteshwar@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>,
	 Satananda Burla <sburla@marvell.com>, dpdk-dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 3/4] dma/cnxk: add dma channel operations
Date: Fri, 29 Oct 2021 20:24:20 +0530	[thread overview]
Message-ID: <CALBAE1P_eyG836HwahEBZmdQOJYeECtou0XM1gMMNnEuASYk2g@mail.gmail.com> (raw)
In-Reply-To: <CAC8NTUXaUi6Cv1abk8Xrn7VwzLDT8g=KH1F02_71m0cMhr5soQ@mail.gmail.com>

On Thu, Oct 28, 2021 at 11:48 PM Radha Mohan <mohun106@gmail.com> wrote:
>
> On Tue, Oct 26, 2021 at 1:49 AM Jerin Jacob <jerinjacobk@gmail.com> wrote:
> >
> > On Tue, Oct 26, 2021 at 9:43 AM Radha Mohan Chintakuntla
> > <radhac@marvell.com> wrote:
> > >
> > > Add functions for the dmadev vchan setup and DMA operations.
> > >
> > > Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>

> > > +static int
> > > +cnxk_dmadev_copy(void *dev_private, uint16_t vchan, rte_iova_t src,
> > > +                rte_iova_t dst, uint32_t length, uint64_t flags)
> > > +{
> > > +       uint64_t cmd[DPI_MAX_CMD_SIZE] = {0};
> > > +       union dpi_instr_hdr_s *header = (union dpi_instr_hdr_s *)&cmd[0];
> > > +       rte_iova_t fptr, lptr;
> > > +       struct cnxk_dpi_vf_s *dpivf = dev_private;
> > > +       struct cnxk_dpi_compl_s *comp_ptr;
> > > +       int num_words = 0;
> > > +       int rc;
> > > +
> > > +       RTE_SET_USED(vchan);
> > > +
> > > +       header->s.xtype = dpivf->conf.direction;
> > > +       header->s.pt = DPI_HDR_PT_ZBW_CA;
> > > +       comp_ptr = dpivf->conf.c_desc.compl_ptr[dpivf->conf.c_desc.tail];
> > > +       comp_ptr->cdata = DPI_REQ_CDATA;
> > > +       header->s.ptr = (uint64_t)comp_ptr;
> > > +       STRM_INC(dpivf->conf.c_desc);
> > > +
> > > +       /* pvfe should be set for inbound and outbound only */
> > > +       if (header->s.xtype <= 1)
> > > +               header->s.pvfe = 1;
> > > +       num_words += 4;
> > > +
> > > +       header->s.nfst = 1;
> > > +       header->s.nlst = 1;
> >
> > Including filling zeros in cmd and the rest of the filling can be
> > moved to slow path..
> >
> > Please change the logic to populate the static items based on
> > configure/channel setup
> > in slowpath and update only per transfer-specific items to have better
> > performance.
> >
> These are instruction header values that we are filling. If you look
> at it there is really one 64bit field that can be filled beforehand
> a.k.a slowpath in vchan_setup().
> Rest of the header can only be filled here like nlst, nfst (these are
> number of pointers to be DMA'ed) and completion pointer. So just for
> that I do not see a value in moving around the code.

Two things,

1) By dong like below,
> > > +       header->s.nfst = 1;
> > > +       header->s.nlst = 1;

it will generate multiple stores. One option is to have a local u64
variable and form the required descriptor and write it one shot.
It is a standard optimation strategy used in fastpath.

2) uint64_t cmd[DPI_MAX_CMD_SIZE] = {0}; This will result in memset of
64B, That reason for creating
template based on vchan make sense.

Looks like moving to a template-based scheme need a lot of rework in
the driver,
I will leave you to decide performance vs other aspects as you are
maintaining the driver.
No strong opinion.


>
> <snip>

  reply	other threads:[~2021-10-29 14:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26  4:12 [dpdk-dev] [PATCH 1/4] common/cnxk: add DPI DMA support Radha Mohan Chintakuntla
2021-10-26  4:12 ` [dpdk-dev] [PATCH 2/4] dma/cnxk: create and initialize dmadev on pci probe Radha Mohan Chintakuntla
2021-10-26  8:36   ` Jerin Jacob
2021-10-26 21:05     ` Radha Mohan
2021-10-26  4:12 ` [dpdk-dev] [PATCH 3/4] dma/cnxk: add dma channel operations Radha Mohan Chintakuntla
2021-10-26  8:41   ` Jerin Jacob
2021-10-28 18:18     ` Radha Mohan
2021-10-29 14:54       ` Jerin Jacob [this message]
2021-10-29 18:02         ` Radha Mohan
2021-10-26  4:13 ` [dpdk-dev] [PATCH 4/4] dma/cnxk: add copy_sg function Radha Mohan Chintakuntla
2021-10-26  8:42   ` Jerin Jacob
2021-10-26  8:33 ` [dpdk-dev] [PATCH 1/4] common/cnxk: add DPI DMA support Jerin Jacob
2021-10-26 15:57   ` Radha Mohan
2021-11-02  3:40 ` [dpdk-dev] [PATCH v2 " Radha Mohan Chintakuntla
2021-11-02  3:40   ` [dpdk-dev] [PATCH v2 2/4] dma/cnxk: create and initialize dmadev on pci probe Radha Mohan Chintakuntla
2021-11-02  4:02     ` Jerin Jacob
2021-11-02 11:49     ` fengchengwen
2021-11-02  3:40   ` [dpdk-dev] [PATCH v2 3/4] dma/cnxk: add dma channel operations Radha Mohan Chintakuntla
2021-11-02 11:59     ` fengchengwen
2021-11-02 18:11       ` Radha Mohan
2021-11-02  3:40   ` [dpdk-dev] [PATCH v2 4/4] dma/cnxk: add copy_sg function Radha Mohan Chintakuntla
2021-11-02 12:02     ` fengchengwen
2021-11-02 11:45   ` [dpdk-dev] [PATCH v2 1/4] common/cnxk: add DPI DMA support fengchengwen
2021-11-03 18:01   ` [dpdk-dev] [PATCH v3 1/5] " Radha Mohan Chintakuntla
2021-11-03 18:01     ` [dpdk-dev] [PATCH v3 2/5] dma/cnxk: create and initialize dmadev on pci probe Radha Mohan Chintakuntla
2021-11-07 20:55       ` Thomas Monjalon
2021-11-07 23:04       ` Thomas Monjalon
2021-11-09  3:52         ` Radha Mohan
2021-11-09  8:11           ` Thomas Monjalon
2021-11-03 18:01     ` [dpdk-dev] [PATCH v3 3/5] dma/cnxk: add dma channel operations Radha Mohan Chintakuntla
2021-11-03 18:01     ` [dpdk-dev] [PATCH v3 4/5] dma/cnxk: add copy_sg function Radha Mohan Chintakuntla
2021-11-03 18:01     ` [dpdk-dev] [PATCH v3 5/5] dma/cnxk: add stats function Radha Mohan Chintakuntla

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=CALBAE1P_eyG836HwahEBZmdQOJYeECtou0XM1gMMNnEuASYk2g@mail.gmail.com \
    --to=jerinjacobk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=mohun106@gmail.com \
    --cc=ndabilpuram@marvell.com \
    --cc=radhac@marvell.com \
    --cc=sburla@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=thomas@monjalon.net \
    /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).