From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6AE22A034F; Mon, 7 Feb 2022 15:03:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06E6E410F3; Mon, 7 Feb 2022 15:03:52 +0100 (CET) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by mails.dpdk.org (Postfix) with ESMTP id BBDBD410EA for ; Mon, 7 Feb 2022 15:03:50 +0100 (CET) Received: by mail-io1-f42.google.com with SMTP id 9so16892027iou.2 for ; Mon, 07 Feb 2022 06:03:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wqnnZ9tfd4XCpkX3Qys36rKTjVaFJsalFshQPazzPuI=; b=VeaBsyHuXfzwb7w1KJvqX9Dh/7KKPND2HZyc89s0mVqPQemaeMVLIXTjqjfTn600NI aIKFoObDajY8kqI0PYLfInZTtyuFhCa4TkMCjlm+j/JzPRhuJKcmle94TXblZQwEJr9e hN3MFvkQIEACIciP9ZLjO3/Hd1whGqChgH3S+VzhB0y8vlzsLPE9mMs4dS/YYVf0S0YE p2RNG4k02losXF9KTUigNgoNMxL9xpSz3birvGXRA/ZZQ8jQTpHUM9Sy+CGaZmypNoK9 gNuTHyhObexWbSvxWtzM9Y2ZF46XFrBdHESYlOnPQxmK5NmXwBzcE0vNWFp9KtQ+kID2 AxxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wqnnZ9tfd4XCpkX3Qys36rKTjVaFJsalFshQPazzPuI=; b=BiwyLrkm0NomgDnHCFdynaNZ76Qv1lE93dDgziKyjN1xGf10nP+fRjzwrt8UiiuA27 hf7fZEtXvgmH1fhKWhrTRTphhm7LBlyTXQSUyKDAObPPbB1NBlOhr9eZArvHZtJ5tahv fQl8CZeF11OZj66dEAbF6Ee4ndhh1N/jnX31NjN2lDkugRotDgxgQrnmv+09wOptI/lC IVVp/yjy5MJxYDWJ8sImq1H5/eRv9NqmWFbwes4/saDWvGn63eYGuZMQQw6+AcKiGEad mTaXbm8lRhm+/ft7lTiI/wk4dKnMl5VFpm6u1MajcpsCW9vkb5krbNOPB9HaDce1F6WO 1Hng== X-Gm-Message-State: AOAM531e0no6u/Qka7ap3Er4KRNGnDeb1RDqlyobblbteph9O8YchAk2 5cDM0RW5hjHNA1zq2lilTvmK+xLJ5rNfEQ4s5pwKDzqf0pT6pQJA X-Google-Smtp-Source: ABdhPJyEcMhYkmcfFRSCg2oXykbojfq2KueqE5TgvPKQJzSDrUIXBnX7O6akdzBe3sKwdRxPGcpFJeQ2mqdilp9TpKA= X-Received: by 2002:a05:6638:10ea:: with SMTP id g10mr5975818jae.79.1644242629825; Mon, 07 Feb 2022 06:03:49 -0800 (PST) MIME-Version: 1.0 References: <20220119071323.3650-1-pbhagavatula@marvell.com> In-Reply-To: <20220119071323.3650-1-pbhagavatula@marvell.com> From: Jerin Jacob Date: Mon, 7 Feb 2022 19:33:23 +0530 Message-ID: Subject: Re: [PATCH v2 1/4] net/cnxk: avoid command copy from Tx queue To: Pavan Nikhilesh Cc: Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj , Shijith Thotton , dpdk-dev Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Jan 19, 2022 at 12:43 PM wrote: > > From: Pavan Nikhilesh > > 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 > --- > 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