[PATCH v2 1/4] net/cnxk: avoid command copy from Tx queue
Jerin Jacob
jerinjacobk at gmail.com
Mon Feb 7 15:03:23 CET 2022
On Wed, Jan 19, 2022 at 12:43 PM <pbhagavatula at marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula at 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 at 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
More information about the dev
mailing list