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 AC7F8A04C7; Tue, 15 Sep 2020 20:57:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7AFEE1C0D8; Tue, 15 Sep 2020 20:57:19 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id E83AE1C0CF for ; Tue, 15 Sep 2020 20:57:17 +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 08FIsxxr018896 for ; Tue, 15 Sep 2020 11:57:17 -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=VDEEM+R1AI4+WhQKEdAjdUU2y5dEOlx1/2Rcbpo7xaQ=; b=bYu3DwVIyrfozvCP91xkj8CtGRxogwMHU6B4pFJcvldUTl3j3fGVz11mb9Kgtc60S69V n7/UA9r2dSATec6YKEuT4/3j+SIKs/0kvfnjjYNpmjIZDNb+f/xy7DRsxBVcGAwjHnU6 Z9lHJeilpm5mZMLGS0MKwa1KfTwVgUBflElOqOy++E71mcW2zof+GxWn9L1+7eXwhlDG P4kElBTbuTelObU4wpGlsex08aG+ewIaJlKaz6f9xrmLbWNS7vaWoirKvkKjnoFU4iOu 8AVsjt18sEJOrMzuInsXZ2s6RKlIMx0W7i5d3Ail7HlIVPzzNXSfJ14cveYz8XcEMUkn kw== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 33gwun25w5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 15 Sep 2020 11:57:17 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 15 Sep 2020 11:57:15 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.175) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 15 Sep 2020 11:57:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LSYJ0MOs7MjII06cJTNn4Ml1RkiJCiJfqNbjkF35Cr3FvWa88ZzD2Npvqx9aZDimlGjhHji9hORVW3uFG8toWVPrtPBfZ9uz4fWiTUdNZAErdwZ87RJY9t5aJt94bWP7FEXWrbcCdGyCnQ4Dc4bn5T/b503Lxk1P3K2sy1YZEo2vUnqmgiVyS32P3BCcErQD1OHMTFNeLnyNCDRkmWDkADeBdMunX8+ho4pa7vH+ebDwIzU4XVFyeJGAfSjslBjQ2rMpEXsvo2oTQcOifYNshb7f41kSLY+3ecmRvZm2CITH8CzRgPVIxfyl3/KONZsd59RWdiBJeenXAgM7iFU7qQ== 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=VDEEM+R1AI4+WhQKEdAjdUU2y5dEOlx1/2Rcbpo7xaQ=; b=fjDOoBDcdau/s/ztj//duEmXYLvKYLkxsEV4L8gs1bc20ZZVLhfneJII5lGSaTLdqTV3UknzVK6APtQLY4Qng4MNQGxFS1icEM3rUcGi96pPeKMDyYSlQa9ij8fJz4e1IXMWZmc/JEZCp/ZzZFuXK3qH3SBAkgciE7ofWLrJX2VHcSVeOI377IqHWZxaHpDxOURVX6l7p+Y2n61sYkBEF5GLQHz6rRtcvm+hjdM2zr4+UsiPo08iG2ueyz56d2YrQd5FKnzXZqY3E/h8ocXmdE24tIoqQ8Ox6wXhQhAz+LPOPSw03ZHlW+VXUgsjrfQQAqImfwCFnZbeOd865w/nvA== 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=VDEEM+R1AI4+WhQKEdAjdUU2y5dEOlx1/2Rcbpo7xaQ=; b=t82k5KTr2GH32emJoMoLL4inBfkcDwRE1WkkOBzVLe/85UtuqQfJCuIwnn+jjXEAHsgUVXBAAqj8CFQ2/3WJHSoOqOqPjXLAUCsaH3F8L6j0GPBofZl2YYdHBD3wsyY6/qEWQRFh8MX2/ZdISbhI7p/YpUYBoE+QYfhMOjy1gHc= Received: from MWHPR18MB1070.namprd18.prod.outlook.com (2603:10b6:300:a5::11) by MW3PR18MB3643.namprd18.prod.outlook.com (2603:10b6:303:5a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Tue, 15 Sep 2020 18:57:14 +0000 Received: from MWHPR18MB1070.namprd18.prod.outlook.com ([fe80::4838:1132:399f:ea55]) by MWHPR18MB1070.namprd18.prod.outlook.com ([fe80::4838:1132:399f:ea55%12]) with mapi id 15.20.3370.019; Tue, 15 Sep 2020 18:57:14 +0000 From: Harman Kalra To: Pavan Nikhilesh , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K CC: Date: Wed, 16 Sep 2020 00:26:44 +0530 Message-ID: <1600196207-31258-2-git-send-email-hkalra@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600196207-31258-1-git-send-email-hkalra@marvell.com> References: <1600196207-31258-1-git-send-email-hkalra@marvell.com> Content-Type: text/plain X-ClientProxiedBy: BMXPR01CA0070.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:2c::34) To MWHPR18MB1070.namprd18.prod.outlook.com (2603:10b6:300:a5::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from hkarlara-OptiPlex-3046.marvell.com (115.113.156.2) by BMXPR01CA0070.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3370.16 via Frontend Transport; Tue, 15 Sep 2020 18:57:12 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [115.113.156.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b4169b71-bb77-4dc1-9c66-08d859a92888 X-MS-TrafficTypeDiagnostic: MW3PR18MB3643: 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: vr8rooQQaO+Jfy5XEHt+Okf2mIyNuZ4bAKdYwZSPjoPKUXTQVdOc1XJi+Z7lZlFKlDW8nC51xO+KOxfePlG3hMMCUq4oS5umy3aHpMld+jNfuiCJjwP2ekTzYJ6ERts/MoIlKsfkl2hfqXzTEyLHyJ+G/J82JSdB/bV4ZvE0LwwT1KED4YZWgUSrypClcDZXUDKJRu1AIxNGhywoR7tIKkL+DTHrOtm2WftfTz/2aMOP8/8JG/l7SHKNd6a4pozbnlSP4MAycqPrLaIdVkUUXxVcHq/lyOu4SdSBacDgdKWEdtWG+n+7m49ShRbufg9p X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR18MB1070.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(2906002)(8676002)(83380400001)(186003)(16526019)(66946007)(66476007)(8936002)(52116002)(5660300002)(66556008)(7696005)(55236004)(6666004)(86362001)(956004)(478600001)(6486002)(2616005)(110136005)(6636002)(316002)(36756003)(4326008)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 5HBxCxe132Xdtdgdsd6qbfXXBxg12aBsPATOpPqfDmTsQbo8M28mKSFE4dJgxfmVNlFg0BM8hhNlkHtPVnFHlmnRKLJ4OSptDFJoMt4kkE6Ua0D+aNWDb749cAOS6ETg2lPbZauvsVixc0a+ONk6SI7Vm8P3CtHIabIBHZf93i9hlQ+HzVo4/a4mX0b8oPYEAOVwczXa7NhkuF04hKgBJFX2Ru7lYV/jushVx5I+JfO9Fc/rkIuCs9z1ZvWeasgTDqTM5/bnqYPhNjOa+AkLrG0UDFUpebwGzvgabkFs5LbGAuARVAZGAF7WWTl6C/oRkJj6X8ekkGzcJbTe7fUNjdWjanKVvoujjRpuu75ovoYwnWa/MA4KQOAJQQde48d8MCPOkF7s8ZceN4NbbDu9IND3Jj8ZKvE4O9/ScrzXC2VA9xnCyKdbJjYWScvPcOnkPPiHPbnKgvIIDRWyVlCo7a0AlbWfbl9JAc+PuETQn8hN22Ptk0j7AJOqtsyO3W3c19nX/GK5XHZaxUWEQp/5ceNcsX0W21iPw0a203LOuqzyXYbLRj9PY3daqqivy6bxSQ6CXGu9cf8I0tKmSR1jFODDBMghwzfC6hy+5IHjVlv5OWBx1ae1uleEQnr8P5tnC9s87YjBshIUtY2tCliDUA== X-MS-Exchange-CrossTenant-Network-Message-Id: b4169b71-bb77-4dc1-9c66-08d859a92888 X-MS-Exchange-CrossTenant-AuthSource: MWHPR18MB1070.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2020 18:57:14.1150 (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: MGESP0dp8tuI3faxxFnkrjn1bvsmQ+sHFSKQzSbY+BM4ucq97mGMgLf4kZUeW39h+DwWgMrn6gHtJY6bDpk0Mw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR18MB3643 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-15_13:2020-09-15, 2020-09-15 signatures=0 Subject: [dpdk-dev] [PATCH 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 --- 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 1bf8afedf..32d611458 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_cio_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_cio_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