From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3C693A04BC; Thu, 8 Oct 2020 20:49:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4103F1B870; Thu, 8 Oct 2020 20:49:27 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 70D561B868 for ; Thu, 8 Oct 2020 20:49:25 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 098IUxYg023886 for ; Thu, 8 Oct 2020 11:49:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=pfpt0220; bh=o7aKn2WQ2tU1xRIFtULSR/JlRr+YAghH1TLndeG89Ms=; b=GmsA+XmT7hv/N1t65yxofhjg1ODmnXb2paXuK7y2PMT52Gel6/eeHPUVZOS+17WlW/KS fbrOFKySrPPDeBYI6czNI04arH7mu33lMDZn+tnRiYQx8WytGGnThki6cA3aZlOADrnc d7IgIZ4d2gv/nZAim9XLwt+ifedotz4ET9FjgXA9LyfrAJXpFUOCrzTSVhDOV4f55xLd G9QO3mbmvi8vzZJqaonfmMQ2z6M+qJFfQ7zULKUN3/xIK/CD5vHcFRJZSfI9WUPu1iFf J2Xc+emNEgvSV5w/tBR2y27hE74jogdUcHssRaI6IZNiyxurTAVpFwWjpLgaR3E2atQj nA== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 33xrtns6k1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 08 Oct 2020 11:49:23 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 8 Oct 2020 11:49:21 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 8 Oct 2020 11:49:21 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 8 Oct 2020 11:49:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=flCPPXHFY6YBacVMe9102eQhIuC5jKHRrXvFppLs79VRCiZwE638tMGvMqySMf35bxef6YzUVWQjl45CXw5vmP42UVa5xLINBlGHu0Z0NI9ZHUj6PiNxpeSRNIsD0lvPBypoFiYmhXc5f2RcOzpJdJn0GEnyK926t2vQkZo0PeBCYNfN3UUhh33afaWZsDIhXo+1br/onM4jZSeVkMC6kOWySRgRY1bP8Sz6VlD7VDkyaEcp/6phYOHWHouyEXLFwtossAOmjdflHnM0fcEmhcjgDprAPilS5nzZRttG0naQlblneduwhCEirmsq1G1bF6za+rc3Iky+X5bLapNfrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o7aKn2WQ2tU1xRIFtULSR/JlRr+YAghH1TLndeG89Ms=; b=iFljDzjXO4pr3O1klfsaRMUQbEe2kJ0WLdOd/Z7Y/Q8MF3fyuFLPxaH4Ps9YF0Q5FvRjqblc5j2Z+Yby8L/wveidhTvvXQslZv+Gvoz5e1t8hqubUXIEd/s3BtmM112H4pBYfSehfosjM4wA4mOHeqFUef3+YRrPtxwX6va0eNSsANoFfncViIrFXSVEWZgvZ+G3evvYNsxtTeEfpls2r0Psm7KOBbZ4g82poHd0wTLvHgcqeynGFPA5xIAEYb5pV4B63ajkIxZoOnV/Q6mJMEU8HUyQqyAEJul924RSmDzeFrN7ZfRq2jR4Zv5YTtSW/prQq7DYxQSDbUncZPcuqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o7aKn2WQ2tU1xRIFtULSR/JlRr+YAghH1TLndeG89Ms=; b=gKStEh9Bp0kaAI0enAMBV4ix5a5vvPtcOmpYsxi3miS9GL8m0fwUbYcQE6nIYI0hRyRMtnp0N4XBIZhnJRXIuHixgggy+TlDdY5BVbgqyt7DzZvicumdZOyuKyJLExhTSXIY/w0LRlkiWvSZgNbs0JCeredB8szurmhlBJNhDWM= Received: from CO6PR18MB3842.namprd18.prod.outlook.com (2603:10b6:5:341::16) by MW2PR18MB2169.namprd18.prod.outlook.com (2603:10b6:907:5::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32; Thu, 8 Oct 2020 18:49:19 +0000 Received: from CO6PR18MB3842.namprd18.prod.outlook.com ([fe80::b960:6770:a1:2a19]) by CO6PR18MB3842.namprd18.prod.outlook.com ([fe80::b960:6770:a1:2a19%7]) with mapi id 15.20.3455.023; Thu, 8 Oct 2020 18:49:19 +0000 From: Harman Kalra To: Pavan Nikhilesh , Jerin Jacob , Nithin Dabilpuram , "Kiran Kumar K" CC: Date: Fri, 9 Oct 2020 00:18:44 +0530 Message-ID: <1602182927-18254-2-git-send-email-hkalra@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1602182927-18254-1-git-send-email-hkalra@marvell.com> References: <1602182927-18254-1-git-send-email-hkalra@marvell.com> Content-Type: text/plain X-Originating-IP: [1.6.215.26] X-ClientProxiedBy: BMXPR01CA0093.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::33) To CO6PR18MB3842.namprd18.prod.outlook.com (2603:10b6:5:341::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from hkarlara-OptiPlex-3046.marvell.com (1.6.215.26) by BMXPR01CA0093.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3455.21 via Frontend Transport; Thu, 8 Oct 2020 18:49:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d86e6272-9894-4e4c-8129-08d86bbadd15 X-MS-TrafficTypeDiagnostic: MW2PR18MB2169: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: moUL5ZEA0Pxokw7jHsN6tOUGPArmd/Mn8ijFqAUdRsTdsw1cV6VOrfsBdWcC1DsfzSFEsmfMPPzSkeajaFf9IJGnGc69OkwB09BILIlXJs6b+C7/BfYlkDQjLbo8kfFfl1OQaho4Z/7zHGKVLVE5UodQAJx8VDJudCMQrTcOqr4TgWhJlPVUim98CZdh8OCup7QdkFL9xqz8PZveQKfQMHyMVRZiylw0ZBtsXN7EvUIJKS261ttWFCQRhjInDHQ9bvCj7E9CqZodQfrYn/QL5AhBtJtrY1+I22GP1PK3mix/csedx3lr2wtnsuu0dF7qZum+QQbzLx4BowjemgqD9Q0OJlRNFIHI8XD0pPHgaQvANMpO/23KwjoVUDBS2avhXRISF/FMQK/5Oxsp3OvFPg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB3842.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(136003)(366004)(346002)(376002)(396003)(956004)(6636002)(8936002)(86362001)(6486002)(2616005)(478600001)(8676002)(83380400001)(4326008)(7696005)(2906002)(316002)(110136005)(6666004)(52116002)(1006002)(66946007)(26005)(186003)(36756003)(66476007)(66556008)(16526019)(5660300002)(36456003)(42976004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ZwpWK0tegzLaaoE4n5gQyQkM+rZe9GLNlvYujcbw6bztE1H5X1UywetEvX3LR0/3lUfhmSi+8L4VhKZcbXGcF7gP51+e8DiHvU6XASQR/eGLWYk0ln0OrFxi58Qz5g4IZtK428RhFzBPvWkTSsy1sNAQBmaKx/yvJ5BNjc+wZI/GoTzRlCcxOaS6DOtiP5aJLbGmcFsm1ApwSEFSp9uC0ShdYFlNUcQNMtnG0EsGVVJzn/hQLh7j+qJ3rQftw62da3lo0g6zrZ/MpUYJbA0jpM0I5Uq3XC6Nvlo4951hNbpvFXPFMlSbm3J7fjnwU4dG5NQEssgj0MXxT9jQ7Yc2bRNOFyQ8Xy0yKhwpGJjy5IXrGSOwFWhI2iIFo6jCi9mG553nDO9e6IqjrqAPw+PMGdS6RbNzvnP48K3GNjSakNKu+ygMIRPWKPxSxNUJkwfk38p0LrjlRG3Vlzj+TaXCMrVGJdaSC2muC+JJTNAtC/VF0Bp3DNBo79f363+m2o0fjxNPiiSWuugunBH2FlzR3DWqmHsOKLd0jLN5ZAoFMKy2edvy2S9kZN/Hk29zDDQNK8kVqZUlnUOYORpjdrlUgoohz5gZ9eOqQMm4/8smtw50JujuS94W/ltOGkB9E2OJLJWcI2YfspGgTiMsOI2fmQ== X-MS-Exchange-CrossTenant-Network-Message-Id: d86e6272-9894-4e4c-8129-08d86bbadd15 X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB3842.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2020 18:49:19.1731 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fxXZAcD4GhDbsDj1pTQOqmQcU3PJD5Pp7VduMfsR19pg+Y7KHLeiornI6Zw1pQHbTHCvxLH9bFY1xVCyjkv8QA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR18MB2169 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-08_12:2020-10-08, 2020-10-08 signatures=0 Subject: [dpdk-dev] [PATCH v2 2/4] event/octeontx2: improve single flow performance X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Improve single flow performance by moving the point of coherence to the end of transmit sequence. Signed-off-by: Pavan Nikhilesh --- V2: * replace rte_cio_wmb with rte_io_wmb drivers/event/octeontx2/otx2_worker.h | 35 +++++++++++++++++---------- drivers/net/octeontx2/otx2_tx.h | 18 ++++++++++++++ 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/drivers/event/octeontx2/otx2_worker.h b/drivers/event/octeontx2/otx2_worker.h index 80dfe3e73..757fa6fe5 100644 --- a/drivers/event/octeontx2/otx2_worker.h +++ b/drivers/event/octeontx2/otx2_worker.h @@ -247,15 +247,6 @@ otx2_ssogws_head_wait(struct otx2_ssogws *ws) #endif } -static __rte_always_inline void -otx2_ssogws_order(struct otx2_ssogws *ws, const uint8_t wait_flag) -{ - if (wait_flag) - otx2_ssogws_head_wait(ws); - - rte_io_wmb(); -} - static __rte_always_inline const struct otx2_eth_txq * otx2_ssogws_xtract_meta(struct rte_mbuf *m, const uint64_t txq_data[][RTE_MAX_QUEUES_PER_PORT]) @@ -287,10 +278,9 @@ otx2_ssogws_event_tx(struct otx2_ssogws *ws, struct rte_event ev[], return otx2_sec_event_tx(ws, ev, m, txq, flags); } - rte_prefetch_non_temporal(&txq_data[m->port][0]); /* Perform header writes before barrier for TSO */ otx2_nix_xmit_prepare_tso(m, flags); - otx2_ssogws_order(ws, !ev->sched_type); + rte_io_wmb(); txq = otx2_ssogws_xtract_meta(m, txq_data); otx2_ssogws_prepare_pkt(txq, m, cmd, flags); @@ -298,12 +288,31 @@ otx2_ssogws_event_tx(struct otx2_ssogws *ws, struct rte_event ev[], const uint16_t segdw = otx2_nix_prepare_mseg(m, cmd, flags); otx2_nix_xmit_prepare_tstamp(cmd, &txq->cmd[0], m->ol_flags, segdw, flags); - otx2_nix_xmit_mseg_one(cmd, txq->lmt_addr, txq->io_addr, segdw); + if (!ev->sched_type) { + otx2_nix_xmit_mseg_prep_lmt(cmd, txq->lmt_addr, segdw); + otx2_ssogws_head_wait(ws); + if (otx2_nix_xmit_submit_lmt(txq->io_addr) == 0) + otx2_nix_xmit_mseg_one(cmd, txq->lmt_addr, + txq->io_addr, segdw); + } else { + otx2_nix_xmit_mseg_one(cmd, txq->lmt_addr, txq->io_addr, + segdw); + } } else { /* Passing no of segdw as 4: HDR + EXT + SG + SMEM */ otx2_nix_xmit_prepare_tstamp(cmd, &txq->cmd[0], m->ol_flags, 4, flags); - otx2_nix_xmit_one(cmd, txq->lmt_addr, txq->io_addr, flags); + + if (!ev->sched_type) { + otx2_nix_xmit_prep_lmt(cmd, txq->lmt_addr, flags); + otx2_ssogws_head_wait(ws); + if (otx2_nix_xmit_submit_lmt(txq->io_addr) == 0) + otx2_nix_xmit_one(cmd, txq->lmt_addr, + txq->io_addr, flags); + } else { + otx2_nix_xmit_one(cmd, txq->lmt_addr, txq->io_addr, + flags); + } } otx2_write64(0, ws->swtag_flush_op); diff --git a/drivers/net/octeontx2/otx2_tx.h b/drivers/net/octeontx2/otx2_tx.h index 3c4317092..caf170fd1 100644 --- a/drivers/net/octeontx2/otx2_tx.h +++ b/drivers/net/octeontx2/otx2_tx.h @@ -383,6 +383,18 @@ otx2_nix_xmit_one(uint64_t *cmd, void *lmt_addr, } while (lmt_status == 0); } +static __rte_always_inline void +otx2_nix_xmit_prep_lmt(uint64_t *cmd, void *lmt_addr, const uint32_t flags) +{ + otx2_lmt_mov(lmt_addr, cmd, otx2_nix_tx_ext_subs(flags)); +} + +static __rte_always_inline uint64_t +otx2_nix_xmit_submit_lmt(const rte_iova_t io_addr) +{ + return otx2_lmt_submit(io_addr); +} + static __rte_always_inline uint16_t otx2_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags) { @@ -453,6 +465,12 @@ otx2_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags) return segdw; } +static __rte_always_inline void +otx2_nix_xmit_mseg_prep_lmt(uint64_t *cmd, void *lmt_addr, uint16_t segdw) +{ + otx2_lmt_mov_seg(lmt_addr, (const void *)cmd, segdw); +} + static __rte_always_inline void otx2_nix_xmit_mseg_one(uint64_t *cmd, void *lmt_addr, rte_iova_t io_addr, uint16_t segdw) -- 2.18.0