Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3848067iob; Tue, 17 May 2022 08:23:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBel70Blls0BsiAdglg8Ym7twfVJC0NA6hG4Lk7K58B77ZZhv8WadAQhIrA4uXzqScIidM X-Received: by 2002:a62:31c1:0:b0:50a:4909:2691 with SMTP id x184-20020a6231c1000000b0050a49092691mr23000338pfx.64.1652801011614; Tue, 17 May 2022 08:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652801011; cv=none; d=google.com; s=arc-20160816; b=SQX/HVPUv9a9a7lwwzd7vq/Ar0Tu05cHAO8UmBbWjn/YoF/RhDVdy+zzgc0f/M3gjF UgDESh1TIeTvdmPF3p3zUjWVl8gW0ytCnwEt/J1626ThfUDg/EmkFMBTA209LR1L7tPv QZdg9RYLBjOOvE9QrdozBaSI0Twfo1j1zjVEzC4hTSJXs0qjG8WScfc9Uat+NXkA0/kr t7fOSTvTeSWu+Ls/iwSRvigzQqb2Rg9cQydmSclvUGkENV2y3N1o2TUoQSnUHNX3n1fi BYPY1jknXY5Qqi0SYOfy95kx0hVV4paU0CZP/kRVZB/VKa5yhbjbn9Afm4QR9LjEgy4R NNaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=3hzncAqqT1+mTJKG40ukqbqCuShSYmPXT2JoA/jHVw0=; b=nqsGXIVjgQzGLDLKOS5xxEi/t2HgBwe6tr1/1hyYi6+wm1BaVwt2InbS1RkxaM5bpI 4R/fHI8gbPZoxjRR8JwUrrBXzQhSuzpzHpGrB+y3vZFijupFOM8moQ70TNM6hIeOVtz+ emfXy2Kx7yV/s7pf3mlcCXk+L1weZUYAYRT+WoslfG46Ldx79UiyN71L+3sstyq1uHAz GdywDLc1yH/KA4ecvu30Jz+JdRX5g+kaGxF1jOIGfkQjw3a30JxAghykngfKABoI8F7V Ve9D9i0/QoiviD5chR+8npnX+mHA3Zk8beOvc9B/VML1pKQPgMoIEk20Hb8MILgKDgkP GSqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VbxcJ+zm; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12-20020a17090a348c00b001df4fd7a036si3367184pjb.83.2022.05.17.08.23.05; Tue, 17 May 2022 08:23:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VbxcJ+zm; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240607AbiEQOKK (ORCPT + 99 others); Tue, 17 May 2022 10:10:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235614AbiEQOKJ (ORCPT ); Tue, 17 May 2022 10:10:09 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0D933E0D0 for ; Tue, 17 May 2022 07:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652796607; x=1684332607; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=eDOCKtvZ8AcbbQ0xhBSfJSuE/pNW67dcl4fnM+aiVm0=; b=VbxcJ+zmBxbBeTGDwju18Vpa92y1ohIAhpLo4TwJq9fJDRc/sNA9bvQ/ suVE2OJGramONxDLFwtw6pikRvMpaWV7OcH4hLdflsWXixVZuQXUUPdFN i3Z30v1Lnggc7EqxV4+4HlEExI290JPSIPlP2OLZrikufaos4ieOxJ0pi NVHQ2GSs0VvxIxBsoS8SaaRYIiETqHTbwCi2ADhwMte7T+Oe402ZCYAQm UTD0Oi1WPQ1J/uiTzZN2FQ+EPzQAqqxxMlskZ+FQ2Zt8hI+wDYc9sfUpA 36cZuVBJHi4RBsla4BDINBF+SiZDtPNyBtx5r2oLPPMWdm+rPq4BuoIlQ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10349"; a="268777748" X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="268777748" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 07:10:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,233,1647327600"; d="scan'208";a="816916394" Received: from silpixa00400314.ir.intel.com (HELO silpixa00400314.ger.corp.intel.com) ([10.237.222.76]) by fmsmga006.fm.intel.com with ESMTP; 17 May 2022 07:10:06 -0700 From: Giovanni Cabiddu To: herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com, vdronov@redhat.com, Giovanni Cabiddu Subject: [PATCH 0/4] crypto: qat - enable configuration for 4xxx Date: Tue, 17 May 2022 15:09:58 +0100 Message-Id: <20220517141002.32385-1-giovanni.cabiddu@intel.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Organization: Intel Research and Development Ireland Ltd - Co. Reg. #308263 - Collinstown Industrial Park, Leixlip, County Kildare - Ireland Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org qat_4xxx devices can be configured to allow either crypto or compression operations. By default, devices are configured statically according to following rule: - odd numbered devices assigned to compression services - even numbered devices assigned to crypto services This set exposes two attributes in sysfs that allow to report and change the state and the configuration of a QAT 4xxx device. The first, /sys/bus/pci/devices//qat/state, allows to bring a device down in order to change the configuration, and bring it up again. The second, /sys/bus/pci/devices//qat/cfg_services, allows to inspect the current configuration of a device (i.e. crypto or compression) and change it. Giovanni Cabiddu (4): crypto: qat - expose device state through sysfs for 4xxx crypto: qat - change behaviour of adf_cfg_add_key_value_param() crypto: qat - relocate and rename adf_sriov_prepare_restart() crypto: qat - expose device config through sysfs for 4xxx Documentation/ABI/testing/sysfs-driver-qat | 58 ++++++ .../crypto/qat/qat_4xxx/adf_4xxx_hw_data.c | 1 + .../crypto/qat/qat_4xxx/adf_4xxx_hw_data.h | 1 + drivers/crypto/qat/qat_4xxx/adf_drv.c | 6 +- drivers/crypto/qat/qat_common/Makefile | 1 + .../crypto/qat/qat_common/adf_accel_devices.h | 1 + drivers/crypto/qat/qat_common/adf_cfg.c | 41 +++- .../crypto/qat/qat_common/adf_common_drv.h | 3 + drivers/crypto/qat/qat_common/adf_init.c | 26 +++ drivers/crypto/qat/qat_common/adf_sriov.c | 28 +-- drivers/crypto/qat/qat_common/adf_sysfs.c | 191 ++++++++++++++++++ 11 files changed, 328 insertions(+), 29 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-driver-qat create mode 100644 drivers/crypto/qat/qat_common/adf_sysfs.c -- 2.36.1