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 4F008A00C3; Sun, 27 Feb 2022 16:46:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1280D4068A; Sun, 27 Feb 2022 16:46:38 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) by mails.dpdk.org (Postfix) with ESMTP id 2AF0940683 for ; Sun, 27 Feb 2022 16:46:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pd6UcUOW8hxETHvtZKoDmBNVhhMrTRC6W2lxHwYsntduplFLydsVB3enPvEqD0pkVFGT90bqC8bfhUT5BTO8zc4G+PRhz665irTg8bfCR7FTbOHUSDMFEJdmEqWzhfuUfrw+6ewFAOyIj54D2Z2ySv1owBX+WFGd+XWejAlElnlhvyk+Iz7pKESSJCg11Yg+/GA7lXhLB6vRQWVq7oI3UrjFkeLsoCevafDvNWxUb/XX+DedIMCCCBVCi+WHEt5UGytlSePa9tKs29pSOki6mtTzIW8Cw/kWjoA8Z68q9vKyncir27TcYkYtqkWES5GkJKpdnldvq7+ZJVmlDARjRQ== 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=fpQUR3oBD5h8NMRKTvTQPCyknfWpcsPTtbBiwTEWKA8=; b=LRpnb3m3wX2T499wZsPewXDSklyresdBzFX5L5zp65CZiyYUAEp9xmvFCzVxWosevi/3qyObkBXPvkYNpq2ueBsI40nh1D+hS02k/mdaFNRuuUHpwu2D3d53KR7NAdQm1Uxdh9IPE577bwRKQynFPc3OvhIVjHzvh7LhgnpH+i3gu7yi5ndJwt+75hQT0AYvAV7Q9jirXFJoKtAELPP/7orlI8ct7DSWRZNu6TV+qIkDldBGeEOpqJxrqFH4t6acxJfUtUjdQjDmYLD2+MVL7MhuYN6fFs8HC/2H9ijx/9lzUkV2WQLyI7JZuREm8GUldKrBo71r4fJvVLm15ZSAGA== 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=fpQUR3oBD5h8NMRKTvTQPCyknfWpcsPTtbBiwTEWKA8=; b=MFgZDv/LPBvFcfPdAtSsiMkfPqENhmbrBj7f7AYB1oSOFrPx98YQbRQoI435ksKU6jm1cPQ1fzbG7+LMuCTKJ5DqhPBBGyJ7cSe+8F9xjf7tydBUb9AqfHvYmheaT+a9hQdR90Eq8GW4ZPaqnzgrWEnc2SzNhlkvuffWk1UOSczUzdYQH5PWa8miidhDydy0FQA/Qv1MywPKL0Fy1ijwBaHqouYZHfJ9lHBo9ECTp4Zx1empuqtupxBcD9B8rpc98gOgV3AXh/nMLKVRCd7FpkCt3566igC6++MWK4uSKle4G9K94i3Ww5IuOKYWJtucPRg0BrZtSwmWK3ZBfJ9QQw== Received: from MWHPR04CA0058.namprd04.prod.outlook.com (2603:10b6:300:6c::20) by DM6PR12MB4250.namprd12.prod.outlook.com (2603:10b6:5:21a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.25; Sun, 27 Feb 2022 15:46:35 +0000 Received: from CO1NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:300:6c:cafe::36) by MWHPR04CA0058.outlook.office365.com (2603:10b6:300:6c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22 via Frontend Transport; Sun, 27 Feb 2022 15:46:35 +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 CO1NAM11FT066.mail.protection.outlook.com (10.13.175.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5017.22 via Frontend Transport; Sun, 27 Feb 2022 15:46:34 +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; Sun, 27 Feb 2022 15:46:34 +0000 Received: from nvidia.com (10.126.230.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; Sun, 27 Feb 2022 07:46:32 -0800 From: Asaf Penso To: CC: , , , Subject: [PATCH 1/1] doc: add steps to configure VF interface as trusted Date: Sun, 27 Feb 2022 17:46:17 +0200 Message-ID: <20220227154617.2946292-1-asafp@nvidia.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.230.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: a951ac72-c751-4aed-4636-08d9fa085567 X-MS-TrafficTypeDiagnostic: DM6PR12MB4250: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: WJU9/EHHZWLozqiPWWOOwi64DSmEtNM9U0qYSgXYCBjo3Z9Yev68T63pagpRZ9Be83nJSPWe1OIKsIVEMm6gVRuNDj1gWoCJblcbP+wMWSlS+RZz+KSplMqIYIkwkBOf7d/T9S3G5gTJ8FDGv+MgjvKhMyPVC+6L/EEttdoTp0pyLwuNtbIAKQh2wpHq6Qk9Gko7OPvehkVVx5cCawZUfTieoZbpEEvDOu3YO+920O1JAIEhcbCJUO+agvDMcNOPEMsTtcYWhsoyzG3qsa5YQmeP1LA/rp43eM0uJ4V/vQhLdEOjZDFa6/tn2+KSuBZmCoCWvTDXrxflvrnbHzRIBZVhc9S/XC2MH6qRY6FdRmerx7m37vV1AaMo9i3D8GXcWkJ4LdHeW/+Lp+u/paiEuHGfiVEaMNfSEDCtbRt5Zpi7oiZyL1lCp8rvMifEHuH9J0vSODf8vepEVls1em1OuEGKUn1fHEb4WaxjXduBDD/W2LKdseO7pAItLMyMJ+O1WK8d5JU9e3D5VuUdQX5Zs+yNt9IE2weFPRRmkjrjAzsFB+8wIvXUHh7MtjKtWf9vNfAsVmuYStc5hnBakPxpHoXiUCyeVPLVXbPfMnAMoHuzGw6TWZKB8aTadYoOFM1HigzyQjE4Gu7HCg+BYUQTgGFFzgGYb2vqvQ2UO9NvX7WsVBUP9mxRG6j0pcEAgEz7skDRF7GKgLZwEOR8ENDRj3yIKO5Qi9ZCub0BnrQsjkd6U5wvJhSGnWACuG2ol3fzFV5s8pawcFvsu/yRea3B3A== 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)(40470700004)(46966006)(2616005)(36860700001)(107886003)(81166007)(1076003)(6666004)(7696005)(6286002)(316002)(6916009)(70206006)(8676002)(70586007)(55016003)(54906003)(83380400001)(508600001)(186003)(336012)(4326008)(36756003)(356005)(47076005)(82310400004)(86362001)(5660300002)(16526019)(8936002)(40460700003)(426003)(26005)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2022 15:46:34.7899 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a951ac72-c751-4aed-4636-08d9fa085567 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: CO1NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4250 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 --- 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 0a92145796..6d08ae53cb 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -1614,3 +1614,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 \ No newline at end of file -- 2.18.2