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 ECC2AA0547; Fri, 10 Sep 2021 06:24:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D7FE40041; Fri, 10 Sep 2021 06:24:07 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2048.outbound.protection.outlook.com [40.107.236.48]) by mails.dpdk.org (Postfix) with ESMTP id F12884003E for ; Fri, 10 Sep 2021 06:24:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=La+JTva7GtG7Y2WuO3wf+tUL2mRiV1ilD54cS4uminERA/0dfD8cucJ4c3s/K57Ej9eyVDEXAlElqp5nMUzvouB5ezhBhKIjl43YA34qDBw/piVTjsJyxqGJjfsgUBSrALqxrNZDS3xbbnRZ5Kjbce+ccwyeCMJbIMtavuOzqz12YiSE0eTZ5cKwuayr2xyblSf0tiNBnHcfR0HCc09Mj9sz8WbOH/ffuuJxGMk55bw3GiI/xeDK+mLiBJav9nJIdePn7Txyo5nh4/c3Z7EmuqfDJXLVrWdvWsTcRckIH9ZesH0aH9xn00EKP7PT4iQrFpSdFboLB3uacqo2RFEoyg== 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; bh=CsHvgJzfGek6q3ZlD09kRyLwsbCXGeS5DcogYj/HLkY=; b=l2zfQupzjwlNFlJSLfYwZ0+Ia6dbehvTKizZGy+qPmvHFcelcZW6jWBGagiFf11hDeIQ6aeawx5vE9v86LHN3WjBFLaR15AwM5pWVMM5cjYiVkw+GH1985OEYzDr9aWaKzroDGZcvaZFQ3YcK1gq4Bh25yji9qjzVBdQoajRGWl+gJ6n9SXRc4MVvLfPTRipoNUWql+Be/LidBN7Ip5HvlBn9xROjnmNCvOPx8KqPQE16VNKe2M0Ce6DfOu3QjOHxQb8AxoJU7OyaDqW5xXY9JfJqQ3zhwbrNyCvgunx1GOcM/TbP/9qOtPHEAj5JXsWx4KsX+00dumG/GVmrvO+EA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CsHvgJzfGek6q3ZlD09kRyLwsbCXGeS5DcogYj/HLkY=; b=ahcZoIsDGKYcw1W4gKdlo8TToYRSQ9ewAAxKOY6DyibhqbTAzESNn39FEvuHhV5b0nLm7duTxybm2RjxW5La9041zu5puIIQNCeYie4eY2+2lv4VRJ744Kclob4SrdfiO/rveoOSpdvhfAxkcvwPVOAoo/QkLk+LCyd3WPG61HXiVhfyoLv65h3ovSgWNjdk97Om8YmeHdSYKH0T/M+f+GqLgAvHbpTc8EBuhN7BKeAwkp2FtD8aPdVLSFamQ9aUK3soElCf0l6nrj4fF2LGfDSBJbf4AhBZPknoKAxRSLufjneV4k5ahJt44gvaTwcCn/sW5rKnKCvAHAgdXwRw7w== Received: from BN1PR10CA0022.namprd10.prod.outlook.com (2603:10b6:408:e0::27) by DM5PR12MB1243.namprd12.prod.outlook.com (2603:10b6:3:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Fri, 10 Sep 2021 04:24:04 +0000 Received: from BN8NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e0:cafe::10) by BN1PR10CA0022.outlook.office365.com (2603:10b6:408:e0::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16 via Frontend Transport; Fri, 10 Sep 2021 04:24:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT035.mail.protection.outlook.com (10.13.177.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4500.14 via Frontend Transport; Fri, 10 Sep 2021 04:24:04 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 10 Sep 2021 04:24:03 +0000 Received: from nvidia.com (172.20.187.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 10 Sep 2021 04:24:00 +0000 From: Rongwei Liu To: , , , CC: , Date: Fri, 10 Sep 2021 07:23:46 +0300 Message-ID: <20210910042347.12820-1-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c357d788-a26e-4786-2485-08d97412d2bb X-MS-TrafficTypeDiagnostic: DM5PR12MB1243: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7N5u8D9fu9ePpGfxPJ4fhczwqfy+kXGw/6uT5QHCN0NLn6m8hzi/lEgccHWDh+LHG4cRMgMX8K7JMlzhaf8uGHT6/yi4HBYtJIoZme1fzUFprbwMfvqv7TVN9kgGYDSMtJ81AZdetzbqgwvw6rjc1mHGniRNyZ/4yFgAYwAJtlaWm2TI8Dnw5z/4LYWYN4zST6U462nlSQgyj9pLPjPFcNqK7Cd0oJxTcgl2EQnm+ota8F/X/ZVAnMc1AYwuRlgEDcXTQ1QZJxLHU4l5CPdY8oMM1gF8UVr+4AzJNs0pLW+AxGbFDaXzDz3sMKgo5qMpQzBdfogS14RqPJr1VwfdlWr46jBKRLoZw05K8bgRFWBS+Z8W1P44IU13GNH2HZEN9CIRglJc/iT5k7V+1R/Re8AhMMUwZiJSNdJ948jyKZRtFXuO7Zue0j5jI4mOwJo/YDQ/BowtuoZJJ7a96l9H9b6AcXymIuryI9YlG/kbuky4HBWWz/S278xtLZCjG4/l/iJv2+qmpmAznIP9py2QvkahMqJ7PSqC2UKMnM7V3/rKqhiyLY5G8lT0GE2nkpOtIFMA9ks9rwymLy8os4JdgR14j+vBE2ZRRv9jGrx0ApQDdJSXJPS275HaDAlktwRWGeP2NFBn8niwY1mpG1zFbDFVBpFyftABdHmBdUM9d7rdE2/61nczEXbEBWVszEwSiKziZAQNFuZupFo+lxpGRA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(39860400002)(346002)(376002)(136003)(396003)(36840700001)(46966006)(6666004)(5660300002)(86362001)(36756003)(8676002)(36906005)(2906002)(54906003)(110136005)(6286002)(16526019)(316002)(55016002)(70586007)(186003)(70206006)(426003)(2616005)(336012)(4326008)(82310400003)(26005)(8936002)(47076005)(82740400003)(83380400001)(356005)(36860700001)(478600001)(1076003)(7636003)(107886003)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2021 04:24:04.1660 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c357d788-a26e-4786-2485-08d97412d2bb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1243 Subject: [dpdk-dev] [RFC 0/1] net/mlx5: set txq affinity in round-robin 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" Previously, we set txq affinity to 0 and let firmware to perform round-robin when bonding. Firmware uses a global counter to assign txq affinity to different physical ports accord to remainder after division. There are three dis-advantages: 1. The global counter is shared between kernel and dpdk. 2. After restarting pmd or port, the previous counter value is reused, so the new affinity is unpredictable. 3. There is no way to get what affinity is set by firmware. In this update, we will create several TISs up to the number of bonding ports and bind each TIS to one PF port. For each port, it will start to pick up TIS using its port index. Upper layer application can quickly calculate each txq's affinity without querying. At DPDK layer, when creating txq with 2 bonding ports, the affinity is set like: port 0: 1-->2-->1-->2 port 1: 2-->1-->2-->1 port 2: 1-->2-->1-->2 Note: Only applicable to Devx api. Rongwei Liu (1): net/mlx5: set txq affinity in round-robin drivers/common/mlx5/mlx5_devx_cmds.c | 38 ++++++++++++++++++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 12 +++++++ drivers/common/mlx5/mlx5_prm.h | 26 +++++++++++++++ drivers/common/mlx5/version.map | 1 + drivers/net/mlx5/linux/mlx5_os.c | 37 ++++++++++++++++++++++ drivers/net/mlx5/mlx5.c | 17 +++------- drivers/net/mlx5/mlx5.h | 8 ++++- drivers/net/mlx5/mlx5_devx.c | 47 ++++++++++++++++++++++++++-- drivers/net/mlx5/mlx5_tx.h | 1 + drivers/net/mlx5/mlx5_txpp.c | 4 +-- 10 files changed, 174 insertions(+), 17 deletions(-) -- 2.27.0