DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Pavan Nikhilesh <pbhagavatula@marvell.com>
Cc: Jerin Jacob <jerinj@marvell.com>,
	Nithin Dabilpuram <ndabilpuram@marvell.com>,
	 Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	 Satha Rao <skoteshwar@marvell.com>,
	Ankur Dwivedi <adwivedi@marvell.com>,
	 Anoob Joseph <anoobj@marvell.com>,
	Tejasree Kondoj <ktejasree@marvell.com>,
	 Shijith Thotton <sthotton@marvell.com>, dpdk-dev <dev@dpdk.org>
Subject: Re: [PATCH v2 1/4] net/cnxk: avoid command copy from Tx queue
Date: Mon, 7 Feb 2022 19:33:23 +0530	[thread overview]
Message-ID: <CALBAE1MGJwYQOTnAL84awRqKKDPOvXLabq85rJm9HpCpLGxz_w@mail.gmail.com> (raw)
In-Reply-To: <20220119071323.3650-1-pbhagavatula@marvell.com>

On Wed, Jan 19, 2022 at 12:43 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Tx command is prepared based on offloads enabled and stored in
> Tx queue structure at tx_queue_setup phase.
> In fastpath the command is copied from Tx queue to LMT line for
> all the packets.
> Since, the command contents are mostly constants we can move the
> command preparation to fastpath and avoid accessing Tx queue
> memory.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  Depends-on: Series-20922
>  Depends-on: Series-20928
>
>  v2 Changes:
>  - Rebase.
>  - Fix incorrect use of RoC API

# Please rebase to next-net-mrvl
# Please split this series as two, 1/4 can go through next-net-mrvl
and 2..4/4 can go through next-event
#

> +                       }
> +               }
> +       }
> +
> +       size *= sizeof(uint64_t);
> +
> +       if (size) {
> +               uint64_t *otxq_data = dev->tx_adptr_data;
> +
> +               txq_data = malloc(size);
>                 if (txq_data == NULL)
>                         return -ENOMEM;
> +               memset(txq_data, 0, size);
> +               txq_data[eth_port_id] = ((uint64_t)row) << 48;
> +               txq_data[row + tx_queue_id] = (uint64_t)txq;
> +
> +               if (otxq_data != NULL) {
> +                       for (i = 0; i < dev->max_queue_id[0] + 1; i++) {
> +                               txq_data[i] |= (otxq_data[i] &
> +                                               ~((BIT_ULL(16) - 1) << 48));
> +                       }
> +
> +                       if (eth_port_id > max_port_id) {
> +                               dev->max_queue_id[0] = RTE_MAX(
> +                                       dev->max_queue_id[0], eth_port_id);
> +                               dev->max_port_id =
> +                                       RTE_MAX(dev->max_port_id, eth_port_id);
> +
> +                               for (i = 1; i < eth_port_id; i++) {
> +                                       offset +=
> +                                               (dev->max_queue_id[i - 1] + 1);
> +                                       txq_data[i] |= offset << 48;
> +                                       for (j = 0;
> +                                            (i < dev->max_port_id) &&
> +                                            (j < dev->max_queue_id[i] + 1);
> +                                            j++) {
> +
> +                                               txq_data[offset + j] = otxq_data
> +                                                       [(otxq_data[i] >> 48) +
> +                                                        j];
> +                                       }
> +                               }
> +                               dev->max_queue_id[eth_port_id] =
> +                                       RTE_MAX(dev->max_queue_id[eth_port_id],
> +                                               tx_queue_id);
> +                       } else if (tx_queue_id > max_queue_id) {
> +                               dev->max_queue_id[eth_port_id] =
> +                                       RTE_MAX(dev->max_queue_id[eth_port_id],
> +                                               tx_queue_id);
> +                               dev->max_port_id =
> +                                       RTE_MAX(max_port_id, eth_port_id);
> +                               for (i = 1; i < max_port_id + 1; i++) {
> +                                       offset +=
> +                                               (dev->max_queue_id[i - 1] + 1);
> +                                       txq_data[i] |= offset << 48;
> +                                       for (j = 0;
> +                                            j < dev->max_queue_id[i] + 1;
> +                                            j++) {
> +                                               if (i == eth_port_id &&
> +                                                   j > max_queue_id)
> +                                                       continue;
> +                                               txq_data[offset + j] = otxq_data
> +                                                       [(otxq_data[i] >> 48) +
> +                                                        j];
> +                                       }

Please move to another function across the patch to reduce the clutter.

This will fix the following issue too
[for-next-net]dell[dpdk-next-net-mrvl] $ ./devtools/checkpatches.sh -n 1

### net/cnxk: avoid command copy from Tx queue

WARNING:DEEP_INDENTATION: Too many leading tabs - consider code refactoring
#742: FILE: drivers/event/cnxk/cnxk_eventdev_adptr.c:439:
+                                               if (i == eth_port_id &&

total: 0 errors, 1 warnings, 0 checks, 1412 lines checked

  parent reply	other threads:[~2022-02-07 14:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19  7:13 pbhagavatula
2022-01-19  7:13 ` [PATCH v2 2/4] event/cnxk: store and reuse workslot status pbhagavatula
2022-01-19  7:13 ` [PATCH v2 3/4] event/cnxk: disable default wait time for dequeue pbhagavatula
2022-01-19  7:13 ` [PATCH v2 4/4] net/cnxk: improve Rx performance pbhagavatula
2022-02-07 14:03 ` Jerin Jacob [this message]
2022-02-10 10:13 ` [PATCH v3] net/cnxk: avoid command copy from Tx queue pbhagavatula
2022-02-10 10:19   ` Jerin Jacob
2022-02-10 13:15   ` [PATCH v4] " pbhagavatula
2022-02-11 10:27     ` Jerin Jacob
2022-02-10 10:19 ` [PATCH v3 1/3] event/cnxk: store and reuse workslot status pbhagavatula
2022-02-10 10:19   ` [PATCH v3 2/3] event/cnxk: disable default wait time for dequeue pbhagavatula
2022-02-10 10:19   ` [PATCH v3 3/3] net/cnxk: improve Rx performance pbhagavatula
2022-02-10 13:20   ` [PATCH v4 1/3] event/cnxk: store and reuse workslot status pbhagavatula
2022-02-10 13:20     ` [PATCH v4 2/3] event/cnxk: disable default wait time for dequeue pbhagavatula
2022-02-10 13:20     ` [PATCH v4 3/3] event/cnxk: improve Rx performance pbhagavatula
2022-02-14  9:29     ` [PATCH v4 1/3] event/cnxk: store and reuse workslot status Jerin Jacob

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=CALBAE1MGJwYQOTnAL84awRqKKDPOvXLabq85rJm9HpCpLGxz_w@mail.gmail.com \
    --to=jerinjacobk@gmail.com \
    --cc=adwivedi@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ktejasree@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=pbhagavatula@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=sthotton@marvell.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).