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 215D1A0548; Thu, 2 Jun 2022 03:54:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 161DF40694; Thu, 2 Jun 2022 03:54:33 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2133.outbound.protection.outlook.com [40.107.100.133]) by mails.dpdk.org (Postfix) with ESMTP id CCB194021E for ; Thu, 2 Jun 2022 03:54:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YZAn3Dd/QafJ63sQUhUejYC4PivSZIu5y2oU1x5Mb0ymXDp69HZTSwPCmN/CyGBH+pTWye2d0oWiHIPOBRAFZnEvdZIFRTuStQ6snfgNLxw0ERBdpLYCiQLaUWkmFoZBMIpQKpbute5UUeI6lecFGZ9LqSYr17Pfg9EfqSWD0U3w8XhnPxfv94JAFwzUcR7uueF/IOxNDv8Of3VZ/73Hzye/cMiIxIsAuEc+pmzwVv2Z8Xbul/2rU3ohChXTsQCoaz0NO2BKvdHuXVzHx8+J8cc2sU+q/7y97tZ3rp1a8/ahD2kzNE4WH6QN8Rbasj1oRg/cod7OZoLGV/lGwoI/kw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6xNFDylXh5J/O7UCOgLdQdW9ilZ2J0GBIwhfDSV10Lg=; b=bQbdQ16CXV7sA5AuMgsHerU5+Vkrzd7Eu/HKirR5bNdQQOVCuahxRzgUvZoHOXe3OS/NKVqTlLMB/BiKWJbQzedSPl+l/ryROOzadiJcgTgfRD8zgWNCJyJ4tT2rIEz2iW4cMidrVwGmh3RFXEG0Xi7yZDhxFhWUKyea/8013EgKGg+1hRLhPA0ihcS7Od7zfEsi9IeEpCeOkf0sYmffr1uOMVd1hyAz7c6LN37pQ8Z2LrH718KRyYUOYCJYMv52FSTB89e4QOkFEPqacfSLekk717XsDcCenGqDNVxGL4EhfIVD913zpO6kUIO5n1eP6nKYlTEnB+l73uaU7UYXCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6xNFDylXh5J/O7UCOgLdQdW9ilZ2J0GBIwhfDSV10Lg=; b=iKgpSpQyop+CpN+S0Wsddb1DvYGwx6TJVXboEi3bZP5mMra1XrPWFuJACz7pAaJTPMqdvykpIjlBD2KftsphawVUd8Eh8/ljNDyUmey6Q+nIkpqYV2cml5FsZKio/cmdMfVBW/Gf5FRRtcsXLfe7tK8RZ2QvDOSN0wFpZs5ZcgI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB3004.namprd13.prod.outlook.com (2603:10b6:5:191::21) by CY4PR13MB1349.namprd13.prod.outlook.com (2603:10b6:903:a0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Thu, 2 Jun 2022 01:54:30 +0000 Received: from DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::d902:ed7d:82bb:c753]) by DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::d902:ed7d:82bb:c753%4]) with mapi id 15.20.5314.013; Thu, 2 Jun 2022 01:54:30 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Yinjun Zhang , Chaoyong He Subject: [PATCH 03/14] net/nfp: remove pessimistic limit Date: Thu, 2 Jun 2022 03:52:53 +0200 Message-Id: <20220602015304.710197-4-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220602015304.710197-1-jin.liu@corigine.com> References: <20220602015304.710197-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0457.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::12) To DM6PR13MB3004.namprd13.prod.outlook.com (2603:10b6:5:191::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b9334744-1bce-4be9-07bf-08da443ad50c X-MS-TrafficTypeDiagnostic: CY4PR13MB1349:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xZeRM/YlFz89IqPgPjl90RIK+Kc0JwjaZB2v1n2TadSpeozEwOh4gq/y8sP6AQzZxfXx3P36PPPTHmgaFsz38Jmvse952IQKGfFJKZRQ2UTlnwuPVyN0QY3yrpEPIxfkBrnHyDPMGnuUw7el+g+orv+6BJt+eabwLcv+oIqbKznfb2ornqhBq5TMPuN9pDtLkikPxyVMgSlYuSkl5kqGwQZHRTW6tY5+DKluFHkr3oSgtmD8+7PPpqGsiOyS/jK3vZ1fVh79Jsp8qrequm4f8GN7gyavG+oB+eFkLDcubVHkNuhYB5jMUypBlolSlWWuvYBu7Bmy/2iUfvFcOLQFkIfoneWONCtxnBlL17aFvGns+wm1DCAcIPbmjpaJoKsfedxnQeBMSvyJjybCjCE4CYb6ObuzMbqCjhrMst0/2r4cnDPL23f1Ygeg8bd2xSQj7cYhMpS+gGcGYQgm6CGPz9t49tUR+REcrzClQR6qT2auKSGkAegKTNQSGMBKLuCDk56OBCB7acsZXYMaKdhtDubAnGrj4I/sY5sDQtJapxgSHtS01vrsftwEyJb6HCQEgG9y05yK9LiQEnNJd+PjnRZ53042cYOi0YkOG0myt471fgtJF3mE8G2ZMAH+CN3x5jlkb+2k4bZoc6Prs3EnUDqjDSAiHMEkYgFAY7TimcqBW+leWnL4eWrOxohpeQu2wJOi1zji4kb26YSxiAzL5g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR13MB3004.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(39840400004)(136003)(376002)(346002)(396003)(6512007)(83380400001)(8936002)(38350700002)(8676002)(66476007)(316002)(4326008)(38100700002)(26005)(66946007)(66556008)(2906002)(6506007)(6486002)(5660300002)(508600001)(6666004)(52116002)(107886003)(1076003)(36756003)(186003)(86362001)(41300700001)(66574015)(44832011)(2616005)(54906003)(6916009); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cXFKRGgzY2QyNFZKOE5HM0hhZnhBa2hWSDBjZzZBWXY2VGo1Wll3TXQvczht?= =?utf-8?B?Q2IydjVIWXAza2ppT0drTE11dXhLMVIrbTZ6SldaQnduK2RUNUNqdEE1NTFi?= =?utf-8?B?a3h2S3dnaFBTMmxzbU9ZQXNYOXZZK1l5SVVzYi9DSnpNZXdHcWJiZm5UVWNt?= =?utf-8?B?dTNQOW9NaXFhbkRFbHJRV2FXbjMydGpkUWRKSE1PNXMxWDhKWDY4TzREb3E3?= =?utf-8?B?SjcrS2w2c2ptb3gzaThBMjF3UWhQWFRiaFExUGFCRmFSWG9SYzNrRi9kRzFG?= =?utf-8?B?MUhqdVFsaHZMK1JiZkplcFZHYjI3eFV2aVpEYWJkMUVSMnU2Z0R2K2J5TmFO?= =?utf-8?B?T0pBKzBreXNURTVq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KcHZHK3VsR09FU0k1QnJZ?= =?utf-8?B?TUw0Z0RNQVArQWJaZ0FaUWIvcFkvRHJIYUVucjRxQkg4UlI5QmlzZWdVTjMz?= =?utf-8?B?dThVUGEzeVVCTHkvT2xzUldnbHhJVTdnVjBCdnRiYTE0dHBqK2c4NEw5cURF?= =?utf-8?B?a0hBZXA4QW4yREFYWGxyMVZtOFRvTEpWQ1BSS0lDUXNsVVA3cUN1QT09?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9334744-1bce-4be9-07bf-08da443ad50c X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2022 01:54:30.4160 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gP6YgvMGewmnvN4SQzRX4oUsjl37YHTNCbnjeTpHGsWFh+RSLEgZ6axeQW29ksXFZgqli9mxzY7330kQ0SHKkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR13MB1349 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 Multiple writes cause intermediate pointer values that do not end on complete TX descriptors. The QCP peripheral on the NFP provides a number of access modes. In some access modes, the maximum amount to add must be restricted to a 6bit value. The particular access mode used by _nfp_qcp_ptr_add() has no such restrictions, so the "NFP_QCP_MAX_ADD" test is unnecessary. Note that trying to add more that the configured ring size in a single add will cause a QCP overflow, caught and handled by the QCP peripheral. Signed-off-by: Jin Liu Signed-off-by: Yinjun Zhang Signed-off-by: Chaoyong He Signed-off-by: Niklas Söderlund --- drivers/net/nfp/nfp_common.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h index 8b35fa119c..2ca3c0c30a 100644 --- a/drivers/net/nfp/nfp_common.h +++ b/drivers/net/nfp/nfp_common.h @@ -44,9 +44,6 @@ struct nfp_net_adapter; /* The offset of the queue controller queues in the PCIe Target */ #define NFP_PCIE_QUEUE(_q) (0x80000 + (NFP_QCP_QUEUE_ADDR_SZ * ((_q) & 0xff))) -/* Maximum value which can be added to a queue with one transaction */ -#define NFP_QCP_MAX_ADD 0x7f - /* Interrupt definitions */ #define NFP_NET_IRQ_LSC_IDX 0 @@ -304,8 +301,6 @@ nn_cfg_writeq(struct nfp_net_hw *hw, int off, uint64_t val) * @q: Base address for queue structure * @ptr: Add to the Read or Write pointer * @val: Value to add to the queue pointer - * - * If @val is greater than @NFP_QCP_MAX_ADD multiple writes are performed. */ static inline void nfp_qcp_ptr_add(uint8_t *q, enum nfp_qcp_ptr ptr, uint32_t val) @@ -317,12 +312,7 @@ nfp_qcp_ptr_add(uint8_t *q, enum nfp_qcp_ptr ptr, uint32_t val) else off = NFP_QCP_QUEUE_ADD_WPTR; - while (val > NFP_QCP_MAX_ADD) { - nn_writel(rte_cpu_to_le_32(NFP_QCP_MAX_ADD), q + off); - val -= NFP_QCP_MAX_ADD; -} - -nn_writel(rte_cpu_to_le_32(val), q + off); + nn_writel(rte_cpu_to_le_32(val), q + off); } /* -- 2.27.0