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 B3C51A0350; Mon, 28 Feb 2022 09:11:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A73354068C; Mon, 28 Feb 2022 09:11:39 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2089.outbound.protection.outlook.com [40.107.220.89]) by mails.dpdk.org (Postfix) with ESMTP id 47D834068A for ; Mon, 28 Feb 2022 09:11:38 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VFlpTKHTsHCSHkblBEtmPw0tiytsns0F8QUGoT9L3WHZzle6XQ3kltbGvlPh7fGfVsehaxEFSP7aXEUrrCL8UYhFZzwvfcIPaOHC8J0nWwlxlmRJME16VOeq8Yw23HVaFBUC/RqNaGEKTEIM1Em49TsNOx0dyAH11AOvMes0yfILHzz6uGedasItD12lhUpiRa10/tD6Xt4mNJIuLgDpVcFRpKgpYAvEnR7s23etZVXN89phOQJj+ljEjGDdp5ZsoJvLW+7+sdy+yDvqL1qs4pL13U2/BqSTWUXD312rru1gZhNdS3YfWq6ALSFf8A0jiz4njq75UdCtqgP1GZR5MQ== 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=jtO4dmHUp4zdd76Um1bhIEuW912oQw6tGs08Msk/S/E=; b=StD6gmVLgTweRfSJaN8eH5jgq0h+knD015GZR6znFljKOsqAJ8hn1df93lUmqY7nghAPjzL5zmYqU3zNoSEjqz4CkIY5+SCqfnkI1UCzFOrLZAJwiYmqtj+YvQ/ugXcpHtmnMpklVUoGUZrNiPXWs3sAj8afG53RiFOsxf8XazUvX6e/GLkE4n+PrEY656z+0ofk9n58/Nlxe+GHqi2YvLAGpk9lV/Uzc43h0x6Q/tBlyegnfMBOCvOaYhbp1y0XSF+ZrlZD7atHZ0TTeNv6Bt6i2QKr/X4PPpKk5pQ/ybRUsYpl6apX5xeOg4lHsvzpQioRe+9kkKo0e8jtw6n2Uw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) 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=jtO4dmHUp4zdd76Um1bhIEuW912oQw6tGs08Msk/S/E=; b=jYs+V1vKCObaX9TdUw3g6x+XAGh8n2PNf6GKNRwkCmJ92heKM1H97nHTmiWfYxiA9sacfR7RMuSGJcXvo/I/bX5Zgl8amh5k3t5aYCtKFaBq7Cfy93JzqiklcZ10e1RFS+naDq0hJFa6aJK1WtROHzOEUnako83EvpRAOufC3tQJbYxR+OHpfkiJaalUxWOFh+wdZfw8MwfurpVs/BZo7yMxdZwrYPxjftTh/rkVOtCdubZOhKqd4NdXM6qax9kVeLa0pw+V2/cKVTvRgpiX2SmUDFtlVJaZmbOidlw/6VdE9p1q3JcD9VBjBOwDpnl28V6X/Ud60PeNdD4MO20b+w== Received: from BN6PR1201CA0008.namprd12.prod.outlook.com (2603:10b6:405:4c::18) by MN2PR12MB3405.namprd12.prod.outlook.com (2603:10b6:208:cb::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.25; Mon, 28 Feb 2022 08:11:36 +0000 Received: from BN8NAM11FT025.eop-nam11.prod.protection.outlook.com (2603:10b6:405:4c:cafe::68) by BN6PR1201CA0008.outlook.office365.com (2603:10b6:405:4c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21 via Frontend Transport; Mon, 28 Feb 2022 08:11:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.235) by BN8NAM11FT025.mail.protection.outlook.com (10.13.177.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5017.24 via Frontend Transport; Mon, 28 Feb 2022 08:11:35 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 28 Feb 2022 08:11:33 +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:11:29 -0800 From: Asaf Penso To: CC: , , , Subject: [PATCH v3] doc: add steps to configure VF interface as trusted Date: Mon, 28 Feb 2022 10:11:17 +0200 Message-ID: <20220228081117.3013452-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: 13e74159-d918-4d5c-0ac1-08d9fa91f07e X-MS-TrafficTypeDiagnostic: MN2PR12MB3405: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: xuGpg4+brg9dnL4LJn7kautYQWOkJNbhSf2UOXXmLQdMho3G6Ihs7dUZ06PI0RF/nqu3MjZgpkidxgXvsqNwbzRh5AJRMGdOTEgSageApGOGVd7wF9b67MbN/ErQlM5E6CwaHKbJq/ByEpZXcxfHDAIRxVdpcFM/KGu71zsyHPJ1ZA+ymv+iYOlNu4c5/KS4YPSK4q3h/TynY7bNF6VDoq1CmSjZ2U800J6CSzcYEv0qvTvh7QHc9v0pgYcRHsMTqu3Moeb2pZ0XYaaUcQPUG99RcygOwfVMU6e/U1CI8vGnKWwxFOH2WM0Fr3oLIPZO3UVDsKBvsRLvn+CJ9S9tmjcHGQ+1R8esP4n2bv/L15afaL3jd0bPxdyM2aGujctIYhHwcRi0RgLY179ahW3Vhlj4dOYKF2wGBuxtVBYc4l3j+hoM5RWBcmo+pInmOasxRtt6m9PZzgIGzj2h9ujnXIGckWYe8x3bo6tY5K/8UJwNpjIwWsyLBVC9fz4eCTTjicYPNHHM785pNB6+3VTn9xOpXda7kd92hyHgu6/PRUnJx+hw12ZanWCdISzoU+r+Jn5kd1Y54xkHxpBWuGLAP5CtX+EFIKD8UmcNXt1ooI3Ui+m7j1IPjt+mHwv5EwCvWjpOqShJB53Z7X6on6rv5H1RKmqTkIVTciMrINUpqWsCeJIM34bkzOMw/qibOGu44Q3t9lz0mOqn6PVYEbYNSw== X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(6666004)(86362001)(70586007)(55016003)(70206006)(8676002)(40460700003)(16526019)(36756003)(508600001)(4326008)(426003)(336012)(81166007)(36860700001)(7696005)(316002)(8936002)(2616005)(107886003)(1076003)(356005)(82310400004)(83380400001)(47076005)(2906002)(186003)(6286002)(54906003)(6916009)(5660300002)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2022 08:11:35.9755 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13e74159-d918-4d5c-0ac1-08d9fa91f07e 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.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT025.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3405 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