From patchwork Mon May 3 08:39:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 430604 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2647162jao; Mon, 3 May 2021 01:41:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjvQEui8LlYm1l13Lv69f7F59dQyhUS5/hhKRAmqOogCpkM24uWSzIA+iDKcPsb75O762X X-Received: by 2002:a5d:4a48:: with SMTP id v8mr23728996wrs.204.1620031293138; Mon, 03 May 2021 01:41:33 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id a10si9288644wrn.40.2021.05.03.01.41.32; Mon, 03 May 2021 01:41:33 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=cr1Ghr9h; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0DACB40691; Mon, 3 May 2021 10:41:32 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00084.outbound.protection.outlook.com [40.107.0.84]) by mails.dpdk.org (Postfix) with ESMTP id A591040041; Mon, 3 May 2021 10:41:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gqds26va9qaqbHwbOZ/tT5GKgTtql2mAXnd/GFIWjnPeyA/Pgt+WEjHJ8dGdS0QVpQq84P6u73Wj9x9alrgCeBIyfOahnUm0wWko5VqmOeG/rlVUSPWcIdNLch9Hq28ddaJYQY3F+7hFdHIPfpelDTpcSKq/ItEVBTsQ2VtWybIgO43Ukg1mLYlB60lD2kDl3lkjxBKQRYi/Qnkraw1K+7QWTbTWItAra4Ug5EHuQ1hEPKaC1kfJ909DplyNdmUirplhHHO9FwQOznJJmUWtZ/QSRpy0+hZSgOhsgv92Jmx8lCzvJxCBSVpClUf1+sWKXTrfeuagtC/wc4wBU5553A== 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=mahD6CC0ogrjoH8rT4L1/5MFM08ENWCsznQty1dCeps=; b=efA/SXiOSLoDpB2+XPnmcHkAJck2G0UG+CVD1Zu4Ee94OfMYNUOnyJNvovpoeTzwo6xJiOYP7umAiZrLQtT2jbVxjby9jYQlUFJ+8qIWICpySqdH6v0gDFqJfHX+AmokKrIcwIiELY6FpNddcyY4OXcav32YRza0FOWaY9Fcki6+KX3Cc5x6G0kXKXD60XXUAHs6gOJQTus7gv0BC2p5IhZ3jXuMQZ0w2KjdfaRB5aKd6GdlLYafzD/lkq4Ej149LQnb+Y6MKkxJxoXAZLBXjcY8PD5hNDu+os/BQNQMaMWjk+w/z2n5bwIBNV6WStgSVaWFZHZ4TMSvVcY70q8Olw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mahD6CC0ogrjoH8rT4L1/5MFM08ENWCsznQty1dCeps=; b=cr1Ghr9heFPFVrx0MVz766d/omLq/G3NXqzw7LIah2hrX0BAWr2kVYvcdVPIlAfjyV6A7ui4jPHNtBb1ODH9cQ20p2rRojN5Jxk7Ph6eaTiYqW69L+u85szn2ULkVdk0zYB+2BHQjARbHpsOSATu2XsprgekD76xKIxJYtsWYAE= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) by AM6PR0402MB3895.eurprd04.prod.outlook.com (2603:10a6:209:1a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.44; Mon, 3 May 2021 08:41:29 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55%6]) with mapi id 15.20.4065.037; Mon, 3 May 2021 08:41:29 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Hemant Agrawal , stable@dpdk.org Date: Mon, 3 May 2021 14:09:53 +0530 Message-Id: <20210503083953.13570-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [92.120.0.67] X-ClientProxiedBy: HK2PR0401CA0001.apcprd04.prod.outlook.com (2603:1096:202:2::11) To AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by HK2PR0401CA0001.apcprd04.prod.outlook.com (2603:1096:202:2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.33 via Frontend Transport; Mon, 3 May 2021 08:41:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e54d7c78-ee03-4ac3-9654-08d90e0f3ec8 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3895: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rR6Vw3V5wLnh1fq9Mwb/x690lzyM9TKrdyvtrfRMvVm1YqidyebVNk8z3B1zPZiej1aalXPf1qvRsZpCmjFRH918/XlY01W9BRVHwlGrcuezguZezF4APNxAfI0btggRA5FkmVDe6uogiIgvlha20ceRjPBjWtMZgrUUK9oKgeO3lix/e7t+/+Ky6wp0De30A1dz2BkyLAA0Qvj6PHGNHrNi2bk3b9OeovI8/Tm4qA+483I2Q5Hv7TtHez6xxuy7+ds1KJ8bxfpM2ZFOgZYGgMJh+Y+srZR4f+OGlnE02CQT1cBM+Ypvpn6lpaQ/zk50Cx/zdAAQehXhSwX9S6Aa32EYS/sLEbgsD3YZuWyMq1vfrD7xQHmb4LfMgeU33tChODL/svorIwzHiTMJMPLapDPiHFauHJlvfzKN7d24ca19Ahc5fZ/7QmV+3ygOewybV43aFi2d3UeC6Vc52r2Eha8rX+8kwHjzFgo2YydJxytK1ivpNNOP7wq31TM9eTwHjgW8YfbqF2hreyyxHBgtz6uWnddZS7OrgHImUAHxsEOOUGM4VAX3zeEP1sxY0uWzr/cGI1XIxQOzSMsXvywI8N1/+jtwvhGBx6jm1Q9rxrLZuSYTyMmy5/zaG9ILS3NA5p4OEmK7/YJaLh16S9/0B550ChHMnGxx2Px3gf/stIA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4456.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(39860400002)(346002)(366004)(136003)(396003)(38350700002)(38100700002)(83380400001)(6506007)(36756003)(6666004)(16526019)(2906002)(44832011)(186003)(26005)(316002)(478600001)(6486002)(6512007)(4326008)(8676002)(66946007)(8936002)(52116002)(2616005)(66476007)(66556008)(956004)(5660300002)(1076003)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: b/L9MZKX4r+EFn6wujzEzMDQyc2Yw5L92qiAdZK/XdoodQDxJF+aT43ooPFZJVNWcNTKDX3SdIF3jUy67WDqcpv8mnjp++hrRcIhlcp+MWgyWTovz1bV7MN+BTAt6o8lGPUSG9ffpZD03GvnzT97wWJlJ7ykxlp/1UIScjn5DkbN6PjC2CIpcsm66hz21IcKDdrl23ADYJhjfrphNe0R43jCHclRInB0JbxKTU88Ai2DoH/wcuuMNlceBgqwz9zBhSt96oiyO6x3MMC+MZJYzZ29ruFsLaIkgszxLq//+ecD52C7uyN4dQpeGsryrgzWeANgOl7n+sJoyIisTqZk/E2VU82kRygSdF0T3ZlJyBr5VestsJeiNtommk4ILtHL6uc02COwMd1+6lQHnVQ2XrOQc9rObwVBcdYjUi40NuLfre1erA6q5jg7jJR2pfdhPi+OUK2eQXIBwDEgdOSikM3NotyiySY2+e3B8nvSucFdoplqfGiTW931hQj+U1ABGZ8BRtvN+PawmhmqbmihznTyKtDyFIMcl9tvBrGMZmuEx91vur1G1uW82zIptodzE9YQSQ45vugIEabdpOPIYUvT5AXKO2YXLTiZGIoocpQwEOhP1+Hf3OW6PMcOrAOSfH4FkGSlcoqFS044B6tHs+F5OXiBzFk7A0OlI2p6B/o6JSsNAYcv6rct9/8oLf+WVZQm19K1ZBAeyVvgddyBqryAWuSgvllsRheQs9B9Xxewndg43JJy9erreOA/e/+nxIS/+Hn9toFWwWYyLLb5l1kbQqZwWwP+Ducmvo20hIWh77DZwLCcaA/VfU79RZk5xqUoEtJZTh9ljqMV2Pdi/e0le62LgtGBc4/Og+V2PaqCaNnKEcPZYixGU5VW5wPMN5vkKla5HHRriwHTCJNr55GtJruTTubDxim9YaSvCrb3ACshtenpanbtHM77/GGqwGH27JG9cb+faHqDHlYEBtZVk+p5u5djseUU4n4tI8MB62elyf1m3+uMLtKhzeA+5d44fT8YXfs0RHoiFMwsMk757bd9fCP+ShKgTDUnP7GgF9R5cKumpGT2b9TbmZ51pPcbVIjmFpsjxlZHN9clnt53heq7MD0/fbgO13jMihZoWaXCLQEqVtJHd0HoUJPWDJGrVuU0xOd+85mbnVrdIKCt6E4wcY6Kerp5MA4qGdrUfHWkqnoQkt3wP7hM+S7c+1AJ0mfn21EREFz+P62hyK5zCneBJyq/MzojJBRFCODyxloZKaZ81cLxqtWIDlbz9rciu4LYNYd0+5rgLdt06GOEoeCbZ/VVj6Axnihwck0xSUcnmQw2KQTkuj+LPss3 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e54d7c78-ee03-4ac3-9654-08d90e0f3ec8 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2021 08:41:29.3515 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kFt6QE+/1eDZu+TQtd5b4MsC0aPM8vBgKJbqHYV5wu+FIh0VQEXptxNzdG5wCBq9ji9V97GiohdcI66Vfrkf/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3895 Subject: [dpdk-dev] [PATCH] crypto/dpaa_sec: fix to affine the thread portal affinity 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 Sender: "dev" DPAA requires the I/O shall be done in a HW portal context only. The portal affinity is currently only being done in session create and config APIs with the assumption that same thread will be used for IO. This is causing issue. This patch add support during I/O to check the HW portal affinity and affine portal- if not affined already. Fixes: 9a984458f755 ("crypto/dpaa_sec: rewrite Rx/Tx path") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa_sec/dpaa_sec.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.17.1 diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 43363ba6ba..19d4684e24 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -1717,6 +1717,13 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, uint32_t index, flags[DPAA_SEC_BURST] = {0}; struct qman_fq *inq[DPAA_SEC_BURST]; + if (unlikely(!DPAA_PER_LCORE_PORTAL)) { + if (rte_dpaa_portal_init((void *)0)) { + DPAA_SEC_ERR("Failure in affining portal"); + return 0; + } + } + while (nb_ops) { frames_to_send = (nb_ops > DPAA_SEC_BURST) ? DPAA_SEC_BURST : nb_ops; @@ -1917,6 +1924,13 @@ dpaa_sec_dequeue_burst(void *qp, struct rte_crypto_op **ops, uint16_t num_rx; struct dpaa_sec_qp *dpaa_qp = (struct dpaa_sec_qp *)qp; + if (unlikely(!DPAA_PER_LCORE_PORTAL)) { + if (rte_dpaa_portal_init((void *)0)) { + DPAA_SEC_ERR("Failure in affining portal"); + return 0; + } + } + num_rx = dpaa_sec_deq(dpaa_qp, ops, nb_ops); dpaa_qp->rx_pkts += num_rx;