From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 75749A04B7; Tue, 13 Oct 2020 16:10:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9DB3E1DC6A; Tue, 13 Oct 2020 16:10:29 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 43CC61BA9A for ; Tue, 13 Oct 2020 16:10:26 +0200 (CEST) IronPort-SDR: N+va7V48AepqgN72yJuR/WouYfUaZMYkOtUJK7FuKXppz2Rthtu2Lrw9xXHTVXwrBX//rgB632 fEXQRUqOuDZw== X-IronPort-AV: E=McAfee;i="6000,8403,9772"; a="165124967" X-IronPort-AV: E=Sophos;i="5.77,371,1596524400"; d="scan'208";a="165124967" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2020 07:10:25 -0700 IronPort-SDR: 98Y5kbjW2OcjI8CwJttn48PRV5jf34rk6XbBZ8yQGrvipqc08ihlXZDTdrDX3C655CJsSUpJUn X12z/I7bRlKw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,371,1596524400"; d="scan'208";a="346198157" Received: from silpixa00400308.ir.intel.com ([10.237.214.143]) by orsmga008.jf.intel.com with ESMTP; 13 Oct 2020 07:10:23 -0700 From: Adam Dybkowski To: dev@dpdk.org, akhil.goyal@nxp.com Cc: fiona.trahe@intel.com, Adam Dybkowski Date: Tue, 13 Oct 2020 15:10:15 +0100 Message-Id: <20201013141015.31232-2-adamx.dybkowski@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201013141015.31232-1-adamx.dybkowski@intel.com> References: <20201012104352.19236-1-adamx.dybkowski@intel.com> <20201013141015.31232-1-adamx.dybkowski@intel.com> Subject: [dpdk-dev] [PATCH v5 1/1] doc: document vfio-pci usage with QAT PMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" This patch marks the old igb-uio driver as unsecure when used with the QAT PMD and updates all examples to recommend using vfio-pci instead. It also mentions security issues with the QAT CPM and provides information about the new vfio-pci parameter 'disable_denylist' available in Linux kernels 5.9 and later. Signed-off-by: Adam Dybkowski Acked-by: Anatoly Burakov --- doc/guides/cryptodevs/qat.rst | 64 +++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst index 7c5629319..dbbdec1c7 100644 --- a/doc/guides/cryptodevs/qat.rst +++ b/doc/guides/cryptodevs/qat.rst @@ -462,7 +462,7 @@ Check that the VFs are available for use. For example ``lspci -d:37c9`` should list 48 VF devices available for a ``C62x`` device. To complete the installation follow the instructions in -`Binding the available VFs to the DPDK UIO driver`_. +`Binding the available VFs to the vfio-pci driver`_. .. Note:: @@ -534,7 +534,8 @@ Confirm the presence of 48 VF devices - 16 per PF:: lspci -d:37c9 -To complete the installation - follow instructions in `Binding the available VFs to the DPDK UIO driver`_. +To complete the installation - follow instructions in +`Binding the available VFs to the vfio-pci driver`_. .. Note:: @@ -584,10 +585,21 @@ To complete the installation - follow instructions in `Binding the available VFs sudo yum install kernel-devel-`uname -r` -Binding the available VFs to the DPDK UIO driver +Binding the available VFs to the vfio-pci driver ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Unbind the VFs from the stock driver so they can be bound to the uio driver. +Note: + +* Please note that due to security issues, the usage of older DPDK igb-uio + driver is not recommended. This document shows how to use the more secure + vfio-pci driver. +* If QAT fails to bind to vfio-pci on Linux kernel 5.9+, please see the + QATE-39220 and QATE-7495 issues in + `01.org doc `_ + which details the constraint about trusted guests and add `disable_denylist=1` + to the vfio-pci params to use QAT. See also `this patch description `_. + +Unbind the VFs from the stock driver so they can be bound to the vfio-pci driver. For an Intel(R) QuickAssist Technology DH895xCC device ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -595,10 +607,10 @@ For an Intel(R) QuickAssist Technology DH895xCC device The unbind command below assumes ``BDFs`` of ``03:01.00-03:04.07``, if your VFs are different adjust the unbind command below:: + cd to the top-level DPDK directory for device in $(seq 1 4); do \ for fn in $(seq 0 7); do \ - echo -n 0000:03:0${device}.${fn} > \ - /sys/bus/pci/devices/0000\:03\:0${device}.${fn}/driver/unbind; \ + usertools/dpdk-devbind.py -u 0000:03:0${device}.${fn}; \ done; \ done @@ -609,16 +621,12 @@ The unbind command below assumes ``BDFs`` of ``1a:01.00-1a:02.07``, ``3d:01.00-3d:02.07`` and ``3f:01.00-3f:02.07``, if your VFs are different adjust the unbind command below:: + cd to the top-level DPDK directory for device in $(seq 1 2); do \ for fn in $(seq 0 7); do \ - echo -n 0000:1a:0${device}.${fn} > \ - /sys/bus/pci/devices/0000\:1a\:0${device}.${fn}/driver/unbind; \ - - echo -n 0000:3d:0${device}.${fn} > \ - /sys/bus/pci/devices/0000\:3d\:0${device}.${fn}/driver/unbind; \ - - echo -n 0000:3f:0${device}.${fn} > \ - /sys/bus/pci/devices/0000\:3f\:0${device}.${fn}/driver/unbind; \ + usertools/dpdk-devbind.py -u 0000:1a:0${device}.${fn}; \ + usertools/dpdk-devbind.py -u 0000:3d:0${device}.${fn}; \ + usertools/dpdk-devbind.py -u 0000:3f:0${device}.${fn}; \ done; \ done @@ -628,31 +636,29 @@ For Intel(R) QuickAssist Technology C3xxx or 200xx or D15xx device The unbind command below assumes ``BDFs`` of ``01:01.00-01:02.07``, if your VFs are different adjust the unbind command below:: + cd to the top-level DPDK directory for device in $(seq 1 2); do \ for fn in $(seq 0 7); do \ - echo -n 0000:01:0${device}.${fn} > \ - /sys/bus/pci/devices/0000\:01\:0${device}.${fn}/driver/unbind; \ + usertools/dpdk-devbind.py -u 0000:01:0${device}.${fn}; \ done; \ done -Bind to the DPDK uio driver +Bind to the vfio-pci driver ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Install the DPDK igb_uio driver, bind the VF PCI Device id to it and use lspci -to confirm the VF devices are now in use by igb_uio kernel driver, +Load the vfio-pci driver, bind the VF PCI Device id to it using the +``dpdk-devbind.py`` script then use the ``--status`` option +to confirm the VF devices are now in use by vfio-pci kernel driver, e.g. for the C62x device:: - modprobe uio - insmod igb_uio.ko - echo "8086 37c9" > /sys/bus/pci/drivers/igb_uio/new_id - lspci -vvd:37c9 - - -Another way to bind the VFs to the DPDK UIO driver is by using the -``dpdk-devbind.py`` script:: - cd to the top-level DPDK directory - ./usertools/dpdk-devbind.py -b igb_uio 0000:03:01.1 + modprobe vfio-pci + usertools/dpdk-devbind.py -b vfio-pci 0000:03:01.1 + usertools/dpdk-devbind.py --status + +Use ``modprobe vfio-pci disable_denylist=1`` from kernel 5.9 onwards. +See note in the section `Binding the available VFs to the vfio-pci driver`_ +above. Testing ~~~~~~~ -- 2.25.1