From patchwork Tue Sep 15 18:56:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harman Kalra X-Patchwork-Id: 77781 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2FCAAA04C7; Tue, 15 Sep 2020 20:57:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2FACB1C0C6; Tue, 15 Sep 2020 20:57:17 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 1F1971C0C2 for ; Tue, 15 Sep 2020 20:57:14 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08FIuOXK009531 for ; Tue, 15 Sep 2020 11:57:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=pfpt0220; bh=FKH1aadeGa29m5WW8cxJW1GsVRsDcOXR/d4ddO/ST5A=; b=JL/ChW5dzOhONAU5b4n67C3hygzEwHE5eimtcDe9V/cA6UTs7pk3MGOOtOkK7beJtZq/ mf6LxKGgNpjM0gNj736C6mLeVYfUq3mQ7FYGxZqu7QSDVLmAgdJOSlnrAlQ2t2+tbQ+v uOaxB1QaUxbfCuPVJ3xUCCNx7b0gRrxqtWyMa1Oyxo9OojQCLU6WOZSA8sBj9jDjlH2p i94gSBfDbLq/QKgGfmjV2mZrMhJndfZnDtS9iF7m+tF+K/BaAiJmKPrgXcvAFYHT/xrH Bnx2TzNL7TjsTRYERb+t1Qjqd1jr0LMBNoxAo+HEFSZxGcbSCeVqrC+ju5U3LuMhvpwo ig== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 33gupq2mwk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 15 Sep 2020 11:57:13 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 15 Sep 2020 11:57:11 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 15 Sep 2020 11:57:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lHJYNw4SfUCYMcKTvxRIzdx1sF1sfJf6TiBE8O4Aoqj+6dIcvj6lFBZ3lWybZ6ABBVUI1ELMZI7LtMPhygYmY2RGQSGFU/S9QhuR32wfDJ4cS+Fxx7rHci+kEvIf+K9TRwtnZAcMZDhDGc0/Dl2Hoag6Lti22jbRZMNvbd6Z1ujMlQ0EKYHSYUZRmzWCEhvDDDUE2gGHMwBIFOgbSJerd3uMjmitah5YexZbUeQ8WmEEQA47lTqez3RyQx9eUxzHGw97fMX9ajrZjBdjN/TZRRiomO4DM6ZKtjmuJoTsyFRk7ou2Hn+GGm8J2GJMsOMEtW/yDY4viTzpNbl5kj80Ng== 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=FKH1aadeGa29m5WW8cxJW1GsVRsDcOXR/d4ddO/ST5A=; b=CDe4kIMf1Kvtd6moZhYT6/Cxa+2CxTAVqwxSyQDv6sELDpKrcPfWbRXSkqIdBkqLS/FFrJTrawYHw5uHoOAAUfwQA0cc4L+UNEyAz7NVHFnX014oK3Q3VHEitH2mjubTQUtbmVuX4TfWeRf4UtDyOMf/Or9uT9TMljXWooB7f/UNf84bAJRma4b5rOrc+vRq8527PZKp3vZ5VVq08Jmw1xMdIfFmxSsMiJjA439nskoQ/oE8Yy8VvC85S9n+yxyrYo8HoSzgqXrZBc12EWz59s3/9qXytxykQz9lkVkGF2Ehk/chdL443w/9h2FFca42N9p0NL2LIe1si+r2a+I43g== 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=FKH1aadeGa29m5WW8cxJW1GsVRsDcOXR/d4ddO/ST5A=; b=FXcSlBWZ7tWch2I9KKfdrT2gsfsyk3g07SidNoF5WXiiwHe9QSMd4+O5xSwUjxfyJs3DbddUsG9AC4FQUdpff+dbitrJIc58gujm+t2fuzd8YQqaXYbW25G8Ca7Xk1K1SjsWoH72AXDdCmXfDvAgsOTx7cE2ycNTw3EAI5zHEoU= 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:09 +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:09 +0000 From: Harman Kalra To: Pavan Nikhilesh , Jerin Jacob CC: Date: Wed, 16 Sep 2020 00:26:43 +0530 Message-ID: <1600196207-31258-1-git-send-email-hkalra@marvell.com> X-Mailer: git-send-email 2.7.4 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:07 +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: ec303af8-28a1-4169-f862-08d859a925be X-MS-TrafficTypeDiagnostic: MW3PR18MB3643: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aMMV+kIDo2/vgijL5a524c1J61mowdfliOkMpmfxVp6QEkRUZwncAi08F50X0lNkC6QhrZthxN0+HDPWy6UB1DfVo15+CHdJ/bO+6WZf0FXqfzlRHg4AXtg8pRU39/UlF76+fDpL+GYGc33YOyp5YI/YkgXM9umxagEMQ/T9wu4VlyuJvwIVYCaBByoE9vUxzOTZTGNwo1o9MlZ7X5oNBeSeEc1yV2sZIneI2RqOF12AfrRoPPCWUf/gzYbliCfdk4hC6u0U3/ilFMihg9jsRb5UUMjXbNhn4lS19zVt6bvDO2a5okgMW5vWAe02RzDUx+WrfObjZWn/gb6P/wtOBg== 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: qYIXNPraZJQgqhpWqXptduEdsPdW2lwlO3umCwbQ5jxyodTMBvaBZC+jXIAreA5nrC9PDuv5FO49hITaEVwDmqY9clCVLQOO5xJek1qWlFqQa6o1TfFe4kgEP6lQh7znej+Zvan+UaDDlgbDszR8mfYebFDpCJb9SzFZZzWZb6btsoTwWO9jT/Q9bpleNNxwlGYS0aK8T0o/XjARYWvZZpsNGfBqSpwtHOn+XmeBWSJqq6E7cPcLqzSoEuPMqeQr2IjRwIw6v/vxIM+QupTH+TZs7TqooYsSqjtae5C6a04JAEhPTvUpsew6bXuSljjDHvgC6g8EdSd5r+73YS+sJsZGw5+Vc0TtwYKv3jSWgTnyT0yk/7EWf05DFHXWb2HN/47aq3dkT/8Jtt0UkAdE921zR+jm9zHFDrNG77D+jooaKakZ0SSfbK6HTIWbANRuKVCNhPKTf4FuYeg6H8zPpt744inqAXOfOcns7fyerOffydt0o6Ng1MagHOY2Rh0AhAG8evjL/tNccLiv5bRM83YWfrttDAOot9NQc6ptjW6EN7HMphQUvpb9xHJ1wPsUrN8X7+NzU25hLjlXeySYrHFjuKwPpshnDxz+lOp3N6DwGHYU/TeKPLYoclo3XnTfE7cPX1uKTf2OixnigqU4xA== X-MS-Exchange-CrossTenant-Network-Message-Id: ec303af8-28a1-4169-f862-08d859a925be 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:09.4301 (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: tgWsZ82u1rQ2XNU+8efKTWfUZLGzL2QptCYkCQ85UArU15UlzrEiR6sJ4c4nDdVTuVvrF9UbNH6ewgHM/CjC1w== 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 1/4] event/octeontx2: add switch tag flush op 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 Add SWTAG flush operation at the end of transmit sequence to immediately release the tag held by the core. Reuse Tag address to check SWTAG completion status. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx2/otx2_evdev.c | 2 +- drivers/event/octeontx2/otx2_evdev.h | 18 +++++++++--------- drivers/event/octeontx2/otx2_worker.h | 27 +++++++++++++-------------- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/drivers/event/octeontx2/otx2_evdev.c b/drivers/event/octeontx2/otx2_evdev.c index b8b57c388..faf8a5f17 100644 --- a/drivers/event/octeontx2/otx2_evdev.c +++ b/drivers/event/octeontx2/otx2_evdev.c @@ -771,7 +771,7 @@ sso_set_port_ops(struct otx2_ssogws *ws, uintptr_t base) ws->tag_op = base + SSOW_LF_GWS_TAG; ws->wqp_op = base + SSOW_LF_GWS_WQP; ws->getwrk_op = base + SSOW_LF_GWS_OP_GET_WORK; - ws->swtp_op = base + SSOW_LF_GWS_SWTP; + ws->swtag_flush_op = base + SSOW_LF_GWS_OP_SWTAG_FLUSH; ws->swtag_norm_op = base + SSOW_LF_GWS_OP_SWTAG_NORM; ws->swtag_desched_op = base + SSOW_LF_GWS_OP_SWTAG_DESCHED; } diff --git a/drivers/event/octeontx2/otx2_evdev.h b/drivers/event/octeontx2/otx2_evdev.h index 873724dd4..9577d867d 100644 --- a/drivers/event/octeontx2/otx2_evdev.h +++ b/drivers/event/octeontx2/otx2_evdev.h @@ -162,15 +162,15 @@ struct otx2_sso_evdev { struct otx2_timesync_info *tstamp; } __rte_cache_aligned; -#define OTX2_SSOGWS_OPS \ - /* WS ops */ \ - uintptr_t getwrk_op; \ - uintptr_t tag_op; \ - uintptr_t wqp_op; \ - uintptr_t swtp_op; \ - uintptr_t swtag_norm_op; \ - uintptr_t swtag_desched_op; \ - uint8_t cur_tt; \ +#define OTX2_SSOGWS_OPS \ + /* WS ops */ \ + uintptr_t getwrk_op; \ + uintptr_t tag_op; \ + uintptr_t wqp_op; \ + uintptr_t swtag_flush_op; \ + uintptr_t swtag_norm_op; \ + uintptr_t swtag_desched_op; \ + uint8_t cur_tt; \ uint8_t cur_grp /* Event port aka GWS */ diff --git a/drivers/event/octeontx2/otx2_worker.h b/drivers/event/octeontx2/otx2_worker.h index 924ff7ff4..1bf8afedf 100644 --- a/drivers/event/octeontx2/otx2_worker.h +++ b/drivers/event/octeontx2/otx2_worker.h @@ -190,8 +190,7 @@ otx2_ssogws_swtag_untag(struct otx2_ssogws *ws) static __rte_always_inline void otx2_ssogws_swtag_flush(struct otx2_ssogws *ws) { - otx2_write64(0, OTX2_SSOW_GET_BASE_ADDR(ws->getwrk_op) + - SSOW_LF_GWS_OP_SWTAG_FLUSH); + otx2_write64(0, ws->swtag_flush_op); ws->cur_tt = SSO_SYNC_EMPTY; } @@ -208,20 +207,18 @@ otx2_ssogws_swtag_wait(struct otx2_ssogws *ws) #ifdef RTE_ARCH_ARM64 uint64_t swtp; - asm volatile ( - " ldr %[swtb], [%[swtp_loc]] \n" - " cbz %[swtb], done%= \n" - " sevl \n" - "rty%=: wfe \n" - " ldr %[swtb], [%[swtp_loc]] \n" - " cbnz %[swtb], rty%= \n" - "done%=: \n" - : [swtb] "=&r" (swtp) - : [swtp_loc] "r" (ws->swtp_op) - ); + asm volatile(" ldr %[swtb], [%[swtp_loc]] \n" + " tbz %[swtb], 62, done%= \n" + " sevl \n" + "rty%=: wfe \n" + " ldr %[swtb], [%[swtp_loc]] \n" + " tbnz %[swtb], 62, rty%= \n" + "done%=: \n" + : [swtb] "=&r" (swtp) + : [swtp_loc] "r" (ws->tag_op)); #else /* Wait for the SWTAG/SWTAG_FULL operation */ - while (otx2_read64(ws->swtp_op)) + while (otx2_read64(ws->tag_op) & BIT_ULL(62)) ; #endif } @@ -309,6 +306,8 @@ otx2_ssogws_event_tx(struct otx2_ssogws *ws, struct rte_event ev[], otx2_nix_xmit_one(cmd, txq->lmt_addr, txq->io_addr, flags); } + otx2_write64(0, ws->swtag_flush_op); + return 1; } From patchwork Tue Sep 15 18:56:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harman Kalra X-Patchwork-Id: 77782 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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> 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) From patchwork Tue Sep 15 18:56:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harman Kalra X-Patchwork-Id: 77783 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 74B3EA04C7; Tue, 15 Sep 2020 20:57:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DB5881C10C; Tue, 15 Sep 2020 20:57:27 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 2170C1C0C2; Tue, 15 Sep 2020 20:57:26 +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 08FIsqgs018316; Tue, 15 Sep 2020 11:57:25 -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=Y3hYMYSMyUVcoaRo1r83LkHgoCPYrynXQ/Rky0O/AxQ=; b=U4hyH9Crvw4gqOFf+UNXds3vcf6E65NMN3TYtd/1hEzFFiCsdvzf2gVvv8pN3Hf67kLv w0thNJxJxbR/DMUkHPDe1QI59BEL43kLtUntVOrBQyEEnKqOGyFBn2Hv6mAiCpU/G406 GjnEFJkfrGdMquyYG+5NOFVyb2WWK1z16g/wtmQcoH9zOqmoeqLjg79EeNjeQVSwiFXc yqCTPl1aRlxyh3C8crRFXmK6VcVUym3xktGGL1PK3mgNuahKGYufbMKBlbffYfPRTYXz c0A1lf3PRaStupzHTJ9r+4tX34u3ZA4cFIh5fKl9Y7AbHWdlE6fsiRRsxHGSCBGKtCe8 Xw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 33gwun25yt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 15 Sep 2020 11:57:25 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 15 Sep 2020 11:57:23 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 15 Sep 2020 11:57:23 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) 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:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FFUJE4iFn0AxWhK4pKskf9ViXC/mWMZA/wVcyvb4FXuC1NAT7E7x2dlQ6Lj9QkQWaMcsDN6Goa/uXvLi4bVlNkUgSXR9oj4f/smduIKQWVmPkIIJZ0VgOeUInNCtXN/4LGtYJoDbenwrcRji25j2VZ4+rgSrz6hgOkEIO2omRbiOIC/XNCjSoxmMWApTZoTeNitynQshUdXG6YP3kQL8RFnodIbyz5S12ZjtoBT9moUm2JWHNP/f49xctpWZUVApaUAES4UhXXhNuij0YObbFmgQe6GiCv9WX2BvsZf/yuj00n2RuCt2pNlAEEHZ9yHHIaVmy86yqmo9drvyRhQHiA== 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=Y3hYMYSMyUVcoaRo1r83LkHgoCPYrynXQ/Rky0O/AxQ=; b=oWs3VXKi82TEhhEsvcUIPJ0DGcRIhEexwzrnDMc78Aspzqn6XBJSsGySqKPb0vx47U7rgOPbBD2icFFpdIsgHT9Fy8Cf2VnDkKY47tjbsBuThFendHC7Gmy/QV5LpcMTeKmAyCJVL3ENhTpW4eACswmIQJMrayfda4QoyfKrdQuw5ZGZUweuTX0MCJ2q08MirOBOWTGgryQXYOkou9/wm/t3NTOOaTEIqKdEO/NQWKr2Q8f4tP93JOuXvRLMyhQE7I+koBlK25OLwPE7CGEXJOBvEt1E9uikgHKsKauQr9wq07qEeaExgDkzB8bQNWEVVMd2qEw1xq/QVH+q1DCYvA== 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=Y3hYMYSMyUVcoaRo1r83LkHgoCPYrynXQ/Rky0O/AxQ=; b=bwvQQHsPC9IwoR5/nUgXxug290hJUUqw06NCFTF0iZ4up+FQGlt5gXdBRgis849pmcrViedk3eh7U1dso2SwwTk1SQUikqF8+9tGxHSO7LYKxHOkRR3gGTosK8xwRjIUSldGV/laaSpI10pVyXsYd9otMUzmuF5Cujo/lerDUVo= 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:21 +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:21 +0000 From: Harman Kalra To: Jerin Jacob , Nithin Dabilpuram , Pavan Nikhilesh , "Kiran Kumar K" CC: , Harman Kalra , Date: Wed, 16 Sep 2020 00:26:45 +0530 Message-ID: <1600196207-31258-3-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> 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:19 +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: af60e4a9-5491-4ae7-d891-08d859a92d17 X-MS-TrafficTypeDiagnostic: MW3PR18MB3643: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:517; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tx/a4VVnl82PFfB43teUX3HYALRdZSubbEQmX+3cpnHKHRdM8XKv4M8P/16VSw8W0qSf+XUREC6rc47y0pkbsgiLw+u8KHFi8aSddx7MuNtS2b3WFuGJPDG3djJPzWcuM/+VRShG38HkCS7UNiBGAwZuGZOe4DKEJHbFRAXRtvCqZb6Gw/ieW74zaqMsT9KlyhltsBI+dG59V/f6qqQ827B2GhnMdMryvaHA0a/xthXea+fOU+DFX2wMMqYfss/QNZHx/WTJjYNNr3nKRcauQf+WLwQsW7i5LyMbGc0KqIEM0/ZRqTY1Th0uH0/6Cti0k95uv2SxfoNbXuYYOfag9A== 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)(450100002)(956004)(478600001)(6486002)(2616005)(110136005)(6636002)(316002)(36756003)(4326008)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: jOsHlCnoX43+ZpC7Q1k5ozQpSxnz+Sbpr9i35Eb0GhDL1GkyBIpG+/C2Bm6FgJzT8TDv2lekmReRFx9Ryn3/slLMXuqYp4AILvWWyVh1j8Uu0UymCbRdRcTwr8VRhw6kO+IyN2rwXUO94dI9kGqUp3rhcxBB5u2o+zfv2yP8M5ajtfFDyO6PKgOjBJokh8InHoE6LVFEHSRyCaU0Tn7CDKzPLNX+yjSoGl9LxCq3LyEvg2pn3JMnT8IGAFuMpKuJuCxSbAqOq8JxBPH5K4HyYa8g2mILqkMIox/lOJvCXmq+2IjSznmOrelQiKv3B1E3mGSss7F8wclhLZOt6ImiF4NxdGzCuAwkFLXJeVqvtUZLNwLVp9CiU2yZAtlHkpKrGQYSGoekMBN8UQYKNc6skkxNInbOyyojyZMWGiDStEVFQrB/tMHC9YcMXOrmPojWZ1vl5QB1crPioQnB3DxzVJ7LtYxsEiribTSTEOh2cWd1u0e+yOYdW+uiFMDIsGtRQ1yCLfSsTWKPVfcRdKfnb92rZLnl+FlBH13bII0w+i4fzhSo5oZTzjTIE34Rw823DczxqaKKgPuu78eo/amt265bswAkf36gBT6H2w0iykjjFo4zg31QStlI8wnDrtqy0y/lkUcAyi8IYWrJdMoOFg== X-MS-Exchange-CrossTenant-Network-Message-Id: af60e4a9-5491-4ae7-d891-08d859a92d17 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:21.6716 (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: hbvRrGVvuLtPpphkarhmBCgriTm54UrVMqGwCbwNKCMi2Ib3hUIs8Qg0LWSHlrgB5aIiUngmPJ9gHqfPj+EvBg== 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 3/4] net/octeontx2: fix jumbo frame crash 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" Issue has been observed in case of multi segments where mbuf data gets corrupted due to missing barriers. Changes made to mbuf just before LMTST by one core gets updatded when the same mbuf is in use by another core, leading to corruption. It should be ensured that all changes made to mbuf should be written before LMTST. Fixes: cbd5710db48d ("net/octeontx2: add Tx multi segment version") Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh Signed-off-by: Nithin Dabilpuram Signed-off-by: Harman Kalra --- drivers/common/octeontx2/otx2_io_arm64.h | 12 ++++++++++ drivers/common/octeontx2/otx2_io_generic.h | 16 +++++++++++--- drivers/event/octeontx2/otx2_worker.h | 20 +++++++++++++---- drivers/mempool/octeontx2/otx2_mempool_ops.c | 4 ++++ drivers/net/octeontx2/otx2_tx.c | 23 ++++++++++++++------ drivers/net/octeontx2/otx2_tx.h | 23 ++++++++++++++++++++ 6 files changed, 84 insertions(+), 14 deletions(-) diff --git a/drivers/common/octeontx2/otx2_io_arm64.h b/drivers/common/octeontx2/otx2_io_arm64.h index 7e45329b3..b5c85d9a6 100644 --- a/drivers/common/octeontx2/otx2_io_arm64.h +++ b/drivers/common/octeontx2/otx2_io_arm64.h @@ -63,6 +63,18 @@ otx2_lmt_submit(rte_iova_t io_address) return result; } +static __rte_always_inline uint64_t +otx2_lmt_submit_release(rte_iova_t io_address) +{ + uint64_t result; + + asm volatile ( + ".cpu generic+lse\n" + "ldeorl xzr,%x[rf],[%[rs]]" : + [rf] "=r"(result) : [rs] "r"(io_address)); + return result; +} + static __rte_always_inline void otx2_lmt_mov(void *out, const void *in, const uint32_t lmtext) { diff --git a/drivers/common/octeontx2/otx2_io_generic.h b/drivers/common/octeontx2/otx2_io_generic.h index b1d754008..da64c9b31 100644 --- a/drivers/common/octeontx2/otx2_io_generic.h +++ b/drivers/common/octeontx2/otx2_io_generic.h @@ -45,12 +45,22 @@ otx2_lmt_submit(uint64_t io_address) return 0; } +static inline int64_t +otx2_lmt_submit_release(uint64_t io_address) +{ + RTE_SET_USED(io_address); + + return 0; +} + static __rte_always_inline void otx2_lmt_mov(void *out, const void *in, const uint32_t lmtext) { - RTE_SET_USED(out); - RTE_SET_USED(in); - RTE_SET_USED(lmtext); + /* Copy four words if lmtext = 0 + * six words if lmtext = 1 + * eight words if lmtext =2 + */ + memcpy(out, in, (4 + (2 * lmtext)) * sizeof(uint64_t)); } static __rte_always_inline void diff --git a/drivers/event/octeontx2/otx2_worker.h b/drivers/event/octeontx2/otx2_worker.h index 32d611458..41e80182d 100644 --- a/drivers/event/octeontx2/otx2_worker.h +++ b/drivers/event/octeontx2/otx2_worker.h @@ -280,7 +280,19 @@ otx2_ssogws_event_tx(struct otx2_ssogws *ws, struct rte_event ev[], /* Perform header writes before barrier for TSO */ otx2_nix_xmit_prepare_tso(m, flags); - rte_cio_wmb(); + /* Lets commit any changes in the packet here in case of single seg as + * no further changes to mbuf will be done. + * While for multi seg all mbufs used are set to NULL in + * otx2_nix_prepare_mseg() after preparing the sg list and these changes + * should be committed before LMTST. + * Also in no fast free case some mbuf fields are updated in + * otx2_nix_prefree_seg + * Hence otx2_nix_xmit_submit_lmt_release/otx2_nix_xmit_mseg_one_release + * has store barrier for multiseg. + */ + if (!(flags & NIX_TX_MULTI_SEG_F) && + !(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)) + rte_cio_wmb(); txq = otx2_ssogws_xtract_meta(m, txq_data); otx2_ssogws_prepare_pkt(txq, m, cmd, flags); @@ -291,12 +303,12 @@ otx2_ssogws_event_tx(struct otx2_ssogws *ws, struct rte_event ev[], 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) + if (otx2_nix_xmit_submit_lmt_release(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); + otx2_nix_xmit_mseg_one_release(cmd, txq->lmt_addr, + txq->io_addr, segdw); } } else { /* Passing no of segdw as 4: HDR + EXT + SG + SMEM */ diff --git a/drivers/mempool/octeontx2/otx2_mempool_ops.c b/drivers/mempool/octeontx2/otx2_mempool_ops.c index 5229a7cfb..de67aa3bd 100644 --- a/drivers/mempool/octeontx2/otx2_mempool_ops.c +++ b/drivers/mempool/octeontx2/otx2_mempool_ops.c @@ -15,6 +15,10 @@ otx2_npa_enq(struct rte_mempool *mp, void * const *obj_table, unsigned int n) const uint64_t addr = npa_lf_aura_handle_to_base(aura_handle) + NPA_LF_AURA_OP_FREE0; + /* Ensure mbuf init changes are written before the free pointers + * are enqueued to the stack. + */ + rte_cio_wmb(); for (index = 0; index < n; index++) otx2_store_pair((uint64_t)obj_table[index], reg, addr); diff --git a/drivers/net/octeontx2/otx2_tx.c b/drivers/net/octeontx2/otx2_tx.c index 1af6fa649..ee5df48d3 100644 --- a/drivers/net/octeontx2/otx2_tx.c +++ b/drivers/net/octeontx2/otx2_tx.c @@ -38,8 +38,11 @@ nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, otx2_nix_xmit_prepare_tso(tx_pkts[i], flags); } - /* Lets commit any changes in the packet */ - rte_cio_wmb(); + /* Lets commit any changes in the packet here as no further changes + * to the packet will be done unless no fast free is enabled. + */ + if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)) + rte_cio_wmb(); for (i = 0; i < pkts; i++) { otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags); @@ -74,12 +77,11 @@ nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts, otx2_nix_xmit_prepare_tso(tx_pkts[i], flags); } - /* Lets commit any changes in the packet */ - rte_cio_wmb(); - for (i = 0; i < pkts; i++) { otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags); segdw = otx2_nix_prepare_mseg(tx_pkts[i], cmd, flags); + /* Lets commit any changes in the packet */ + rte_cio_wmb(); otx2_nix_xmit_prepare_tstamp(cmd, &txq->cmd[0], tx_pkts[i]->ol_flags, segdw, flags); @@ -127,8 +129,11 @@ nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts, /* Reduce the cached count */ txq->fc_cache_pkts -= pkts; - /* Lets commit any changes in the packet */ - rte_cio_wmb(); + /* Lets commit any changes in the packet here as no further changes + * to the packet will be done unless no fast free is enabled. + */ + if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)) + rte_cio_wmb(); senddesc01_w0 = vld1q_dup_u64(&txq->cmd[0]); senddesc23_w0 = senddesc01_w0; @@ -221,6 +226,10 @@ nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts, 1, 0); senddesc01_w0 = vorrq_u64(senddesc01_w0, xmask01); senddesc23_w0 = vorrq_u64(senddesc23_w0, xmask23); + /* Ensuring mbuf fields which got updated in + * otx2_nix_prefree_seg are written before LMTST. + */ + rte_cio_wmb(); } else { struct rte_mbuf *mbuf; /* Mark mempool object as "put" since diff --git a/drivers/net/octeontx2/otx2_tx.h b/drivers/net/octeontx2/otx2_tx.h index caf170fd1..5b78d2e2d 100644 --- a/drivers/net/octeontx2/otx2_tx.h +++ b/drivers/net/octeontx2/otx2_tx.h @@ -363,6 +363,10 @@ otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags) * DF bit = 0 otherwise */ send_hdr->w0.df = otx2_nix_prefree_seg(m); + /* Ensuring mbuf fields which got updated in + * otx2_nix_prefree_seg are written before LMTST. + */ + rte_cio_wmb(); } /* Mark mempool object as "put" since it is freed by NIX */ if (!send_hdr->w0.df) @@ -395,6 +399,12 @@ otx2_nix_xmit_submit_lmt(const rte_iova_t io_addr) return otx2_lmt_submit(io_addr); } +static __rte_always_inline uint64_t +otx2_nix_xmit_submit_lmt_release(const rte_iova_t io_addr) +{ + return otx2_lmt_submit_release(io_addr); +} + static __rte_always_inline uint16_t otx2_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags) { @@ -483,6 +493,19 @@ otx2_nix_xmit_mseg_one(uint64_t *cmd, void *lmt_addr, } while (lmt_status == 0); } +static __rte_always_inline void +otx2_nix_xmit_mseg_one_release(uint64_t *cmd, void *lmt_addr, + rte_iova_t io_addr, uint16_t segdw) +{ + uint64_t lmt_status; + + rte_cio_wmb(); + do { + otx2_lmt_mov_seg(lmt_addr, (const void *)cmd, segdw); + lmt_status = otx2_lmt_submit(io_addr); + } while (lmt_status == 0); +} + #define L3L4CSUM_F NIX_TX_OFFLOAD_L3_L4_CSUM_F #define OL3OL4CSUM_F NIX_TX_OFFLOAD_OL3_OL4_CSUM_F #define VLAN_F NIX_TX_OFFLOAD_VLAN_QINQ_F From patchwork Tue Sep 15 18:56:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harman Kalra X-Patchwork-Id: 77784 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C72C1A04C7; Tue, 15 Sep 2020 20:57:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AA1AB1C11F; Tue, 15 Sep 2020 20:57:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id EB6B91C112 for ; Tue, 15 Sep 2020 20:57:28 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08FIuWQj009746 for ; Tue, 15 Sep 2020 11:57:28 -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=zqwg3rp2XgRxgaLM7dVhhflEDvBRvZXw0yGrV9tkoUA=; b=jpL8gx7zTu7wcyhE8nxp4zgOxDyemLdT2QGQnKWimx+3LcLKVVTsEvhI4epvxa0FJ2s4 rHZ4dbJcCps1LTH8/iCL7PIc7Do/oRDHgZY83LyLtL+G6PUvnaGLSzcq3Bou+L6qdlSD CuPb7kmXsBEF/8QAlIdUc3i+ncxL2L3bgs8fbjZ+fJ/eJ986Tn7uVgbabrGUWEVPTt/T 3CX3NK46DwUNEHkPyylLJxuhmQqr8tL2wFvvzQWFgiL/vbJylOk2qulH9UDMFN+o/8iH RDCNLmhrr27H62U8kM0wKzk/YAOFhoRGhcJH10ivA109cIEf3A3DvxnQx71SQolYyjxx 3A== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 33gupq2n0u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 15 Sep 2020 11:57:28 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 15 Sep 2020 11:57:27 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 15 Sep 2020 11:57:26 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.171) 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:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eDc557QmKgGnl2UneLr1CGvJ82R2Kj7+MoMLm1eM+zRjoiWmYKTp9LVR+vcLu8vgmOT0Krpr9+SKp4Q8x4fGEbv+jQMtrIYZGZJPY1jDdiEiKa5rPUhhNmu/smwMo4sRVVA+nYbnlgUS8SwvWIFS9p55WEGjtIvgmkLbWLXHy/28IfdIaik8SMjl4PWDrwTmh8mYJZaAlbvPjYCbkyXv4fAWVuw/ewj/wbbjsGpKEbUA0AdPruCNyVM0b7PJ5air2eXATCghAfEm/a40CWyy66+ESQ7Bfn9fssCsU3y7ihayBC05+fS2gZxYPJvLIIJInF1XSls+u3STRuxFQjlwcA== 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=zqwg3rp2XgRxgaLM7dVhhflEDvBRvZXw0yGrV9tkoUA=; b=TlzHBcU+Jn089A91eUKLb9yZ3oW95KqsXBX3Ru9qdC83/1HeZqx9uRaH5Pg9ms0lwfhvCc+GppOAkLCLX3/kxZWonf93mjqRbkT52ASFz9y3kINzm4mpZdkPn/QPKBzsJ6CpdxQn6pfgCZzmQdmSOOkgssBc4CS1IsEtntYHde3p7843G60ceOT0ckGle8PN5Bx+dyHhJYlo5bqnGXOn64fs5ysGVbd6luX35eyc8c88B/sJ8td3pfjZYIg9HH1hA3GWKOom7xwrEYeKM1TO/takZ63CWrDyi39c3WHj6vW1t0uNE/LmQK0ZkL7AIEqaF6+aAlJdX3yyrsT6i3YE5Q== 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=zqwg3rp2XgRxgaLM7dVhhflEDvBRvZXw0yGrV9tkoUA=; b=i621cZAuwUvEOxgPRlXaJT9e8IJgZNZxvk3Aj9gK1Rn5/vx8Puqu2cbeBnzMe70sdW6dz7BRhXOdpeopUbKLO+2uJ8kPudF4F17f20Lp5d2jjnybj7jTqUTHOIVOloxIbSJAhkSGrxkNZW6RKtc7RlcV4gyzWFTvS6XDQYe5XJM= 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:26 +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:26 +0000 From: Harman Kalra To: Jerin Jacob CC: , Harman Kalra Date: Wed, 16 Sep 2020 00:26:46 +0530 Message-ID: <1600196207-31258-4-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> 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:24 +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: 85f27a63-8092-41b2-804d-08d859a92f7e X-MS-TrafficTypeDiagnostic: MW3PR18MB3643: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s1CbMl7BYSgQfNlfNpXVjzkUjRd1/Iq9IgmB1MhXDRgQd85n7t5y/PjcMfy2116G5Tuocmy4aD+hyPksT88j/Y5Egg+4RJi86h9Qd8iM7AgPVvH45IbOR7zQbYNtW68L2yCuEaBphkl8OWrplXOId4H1c10lFdcgm6qSuj7rhwgaQLUp0pfhbMs3zOyUzOKcBM/ZmR+48fxN6Kv0pDdQcokRlH39toEMzxgwLMR0yIbW/NxhXMcs2SMu5zv1gIDFEce+bH03pJlcXdwH5BfVJMc99gOLv3J21xIeOJ29QLePzTu2DnhYgf1qHBRJCCxNjzh9l/IElbLSYJfxyf3KAA== 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)(4744005)(6862004)(2906002)(8676002)(186003)(16526019)(66946007)(107886003)(66476007)(8936002)(52116002)(5660300002)(66556008)(7696005)(55236004)(6666004)(86362001)(956004)(478600001)(6486002)(2616005)(6636002)(37006003)(316002)(36756003)(4326008)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: H2ai9hyiH82yaISsJC6t+H/aw2Bv2rMsT2wRnGkVbzlEwmu2SivqodPzeLHFgYsAP7LyfbGN83fEvlfTe5m6HxsoMPFwwQ8j+2ddM8TEfgtD1TRyIHg+KtdUwC/hKDYpadjGqh/HmaLv82SyrsXv+yyuLK22eYZyYy0xvhwcXUECi83jqeMhQ7KBnbX9bAm4+/k2wzh5X9L7117NUDoPfs6uniFvz53Bclrxb9PTrQvwWI93542KXVJ1Uu4iqL45Jv8nvhIs7UwMk2YVt/AKZ8CIukZhKXZ3zeIF7DnJTzOkt84JhQD2fVSciNpTcVt40CZ2885SnOCtkkEzsRtoEc1GVAOyDvVAtEDSdPunadpimoVjDqnWPletgLdnG4Zq/00qswDEBEluLak8ETbWJBEOzUv/HzN1RBrvnvMoANuIj0QsJa8Mu8lEMJx0FE7hM4yZ2c1XyMJCLAymNvsVOOoHL0fhEFJBSO72ag90IlG4NslosD/grU38FNc7M8o3fvxhI++6c0BDoaGpPREpxr0p7NGfx+4z9Soa1da58g5frWp1noWdBJ4XHameE1ryrZIu1jTR5RJGH9hRxq3wTvB0UR0mCJNWrs8ExG51mOBmD1o1lVJ/qOvflAnS0cPcaoUClMMSuJBnZsd+NlbrwQ== X-MS-Exchange-CrossTenant-Network-Message-Id: 85f27a63-8092-41b2-804d-08d859a92f7e 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:25.8967 (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: XzAXmpE4sOdFggsM8aNrxV+gggkSZTOdjGIkhY+MgziVA/J3kaJtpWtw5dZIJI2i4OCcs6HhP14VjrH5lwZgJA== 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 4/4] app/eventdev: enable fast free offload 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" Since we are not holding the mbufs or creating any references in the app, hence mbuf fast free offload can be enabled. Signed-off-by: Harman Kalra Reviewed-by: Jerin Jacob --- app/test-eventdev/test_pipeline_common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index 17088b1b4..f0c0ffea7 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -219,6 +219,11 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) return ret; } + /* Enable mbuf fast free if PMD has the capability. */ + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + local_port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; + rx_conf = dev_info.default_rxconf; rx_conf.offloads = port_conf.rxmode.offloads;