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 16F6DA0350; Mon, 28 Feb 2022 09:10:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A27304068C; Mon, 28 Feb 2022 09:09:59 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2052.outbound.protection.outlook.com [40.107.244.52]) by mails.dpdk.org (Postfix) with ESMTP id 3C1EA4068A for ; Mon, 28 Feb 2022 09:09:58 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BZmeGxYEFsEh0TaOHpYDeMYK0CJVvT6CKobuTmHpt/+JTif5sdr296FU/F3SQdw+cm16IFO8PQs7IZMM64jR4EmLKGoA0DR3hdKzFQckJbyAzQQu59MkDnxVEdQ65RzBfqLTdfiyX0JA3aPhVN9O+GQJ3LefgCLkqiXOmepyZQh1bAG30nrrn/83AELGKzd2SgK+13VJkY/8QspixgXO9MzESk9Ly9kGSFZ7ozhY21/gFtEBR1KHswAGwQsxzRRiT1oKRQ8nCcObU5ufQs3SjC6iNHsoCWSJLsrTFqFWCyGpX1g2R3FXbpLo4GZgdmoDPZ5Dvaey/aIkpKUmVUrfYA== 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=oiIp1QbCd8O2tguy60QyqQGSuU1wwXzcSIHnyGogBgU=; b=IcHJcfEFDELzxALg20gQbg9DuBpS3v2STrRzuwdH+WbwQhmv9rW90rDaM1OhwcAmp946aBbfUBslriyLz+/yWPmP2X3pHTQlfQJ2ymWdKcyCkQRPfF8ZD4AXb8rxTj52NhVB9XWD0fVagk/y6e0wmFEGRRoeqDuianclpljbEHvOPaltLT9GYgrDkU5pbRl1D8T+0gjgfsaQ+dZbS8xAqANhVD3n0+kubxfzz3MJkoy4aQLGa/UazYJONBc2PR37OiDmn+1GKIXZmpGVVBDOPLdGZXNeCoieNzbUfSSNoWjieTXu37wqGIfhW55BKXOX8Rj09QbC0jikorKZ+f7Gxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=oiIp1QbCd8O2tguy60QyqQGSuU1wwXzcSIHnyGogBgU=; b=UH0DElIIVAQkVrTo0QXudbbOv2FkdN5dgBMaQ3prVfjeWquyFyAiIbvyYXb3vbv07whtDHIBQ89Kgl/8FbNL8VeqDpHotGx/6tpcYrUinfthzUC3dUrTluKwT23wAIwf5B+XkcSpM1SZzRsgpjyA2leUaQfj+mLy0NBtBeKlqTyCW0Yl1/Rs9Z+nPs0Lye3/3hIOLx6idY5cnmGDQhFru+BBoPNtyxy3Ezmbze+EXcgt6mulEoQLkebA/5RxTsALKdQDSdisAi2yQgmHh09Y8Gq9S8WBjzx/ViSIMxPflTxJFBcjZSqW9VCFhdU1WUrynf82ZFsOCe8Rk38nUDCoEw== Received: from BN0PR03CA0058.namprd03.prod.outlook.com (2603:10b6:408:e7::33) by MW2PR12MB2569.namprd12.prod.outlook.com (2603:10b6:907:11::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.26; Mon, 28 Feb 2022 08:09:55 +0000 Received: from BN8NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e7:cafe::c) by BN0PR03CA0058.outlook.office365.com (2603:10b6:408:e7::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.23 via Frontend Transport; Mon, 28 Feb 2022 08:09:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by BN8NAM11FT021.mail.protection.outlook.com (10.13.177.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5017.22 via Frontend Transport; Mon, 28 Feb 2022 08:09:54 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 28 Feb 2022 08:09:53 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Mon, 28 Feb 2022 00:09:51 -0800 From: Asaf Penso To: CC: , , , Subject: [PATCH v2] doc: add steps to configure VF interface as trusted Date: Mon, 28 Feb 2022 10:09:33 +0200 Message-ID: <20220228080933.3012467-1-asafp@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20220228073947.3009246-1-asafp@nvidia.com> References: <20220228073947.3009246-1-asafp@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c050945c-7092-4d8f-71d8-08d9fa91b415 X-MS-TrafficTypeDiagnostic: MW2PR12MB2569:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr 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: pibZRTW/WfTRfAgz0EMeXodQvMmgU5MP5WUBqU7oyGqd1KopQJ0ZpzD5VPuAClp3jaRwigsnFyHbVHlhwt4XHRQyVLdMRGw7tLykJcDgXEKCEWlcowxXQj4Xad4eH5SYB6TBXnvXxdC2hu7b5nV4wU4WPyQRfvBX/R2ZPvKoQh3Zg9OTuzAd7x6pevSHlF/Q5spw8FIUozO2UsLk4aaLp8PaeEL1R+Cx/RfNtepxQ04kg5z0g19sZFIZk5LPpnpfo4KKn6m1jcjE+3qVfXV32ftCfHbmLPk4L8fray22DcgdvETkZ73rVNKO/yKuO25XvXgTbo6KBNJpmVm4B5pAIj3HmwMVktxAnfCplXYgofMxZjZ97n2BUzxQGDgWb1ASl0/j5p85iLXeah4WWfrTBzhZglnF8zQbbVfcykeH0YRAOjyTxWkh5lABrl7cE1S/wAxzbrFWC+W7ODMf2r5Ki4ORT7eaq6L85SHd1lKeEnmBl4PoYbXQzhoLzKJQSsAWsB1tkWF6SAUYtEYk2nD4c5tqkVffRv8AE0AeJ9fOQwKX2Td8//afK5cgkj6VsQbsAOVbAZJCSCpbjGeZmOOQfHtnfMbfPcle/p1stxmwcNnxWV7LkC8oGtMhEzc5Ed85ElAKqXpfsEvlzNXS9n1NawSVEnaRLKngiaQ0kcc6L5VP0k+2gGGbs8G4J2a0RHvgDN2yzLDPkmebfQRtGH3o+Q== X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(2616005)(70206006)(70586007)(8676002)(82310400004)(107886003)(4326008)(5660300002)(36860700001)(8936002)(7696005)(47076005)(6666004)(2906002)(6916009)(36756003)(86362001)(81166007)(54906003)(40460700003)(356005)(55016003)(83380400001)(336012)(426003)(316002)(6286002)(16526019)(508600001)(26005)(1076003)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2022 08:09:54.6579 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c050945c-7092-4d8f-71d8-08d9fa91b415 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2569 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 Trusted VF is needed to offload rules with rte_flow to a group that is bigger than 0. The configuration is done in two parts: driver and FW. This patch adds the needed steps to configure a VF to be trusted. Signed-off-by: Asaf Penso Reviewed-by: Raslan Darawsheh --- v3: cleanup the patches v2: added new line at the end of the file - comment from Stephen Hemminger --- doc/guides/nics/mlx5.rst | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index c31a154181..a28b31d751 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -1613,3 +1613,53 @@ both the meters in hierarchy on that flow. add port meter policy 0 2 g_actions meter mtr_id M / end y_actions end r_actions drop / end create port meter 0 N 2 2 yes 0xffff 1 0 flow create 0 ingress group 1 pattern eth / end actions meter mtr_id N / end + +How to configure a VF as trusted +-------------------------------- + +This section demonstrates how to configure a virtual function (VF) interface as trusted. +Trusted VF is needed to offload rules with rte_flow to a group that is bigger than 0. +The configuration is done in two parts: driver and FW. + +The procedure below is an example of using a ConnectX-5 adapter card (pf0) with 2 VFs: + +#. Create 2 VFs on the PF pf0 when in Legacy SR-IOV mode:: + + $ echo 2 > /sys/class/net/pf0/device/mlx5_num_vfs + +#. Verify the VFs are created: + + .. code-block:: console + + $ lspci | grep Mellanox + 82:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5] + 82:00.1 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5] + 82:00.2 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5 Virtual Function] + 82:00.3 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5 Virtual Function] + +#. Unbind all VFs. For each VF PCIe, using the following command to unbind the driver:: + + $ echo "0000:82:00.2" >> /sys/bus/pci/drivers/mlx5_core/unbind + +#. Set the VFs to be trusted for the kernel by using one of the methods below: + - Using sysfs file:: + + $ echo ON | tee /sys/class/net/pf0/device/sriov/0/trust + $ echo ON | tee /sys/class/net/pf0/device/sriov/1/trust + + - Using “ip link” command:: + + $ ip link set p0 vf 0 trust on + $ ip link set p0 vf 1 trust on + +#. Configure all VFs using mlxreg:: + + $ mlxreg -d /dev/mst/mt4121_pciconf0 --reg_name VHCA_TRUST_LEVEL --yes --set "all_vhca=0x1,trust_level=0x1" + + .. note:: + + Firmware version used must be >= xx.29.1016 and MFT >= 4.18 + +#. For each VF PCIe, using the following command to bind the driver:: + + $ echo "0000:82:00.2" >> /sys/bus/pci/drivers/mlx5_core/bind -- 2.18.2