Return-Path: Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id BD786C0032 for ; Wed, 23 Aug 2023 03:22:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9E45581801 for ; Wed, 23 Aug 2023 03:22:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9E45581801 Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=h971toYZ X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -4.391 X-Spam-Level: X-Spam-Status: No, score=-4.391 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UPPERCASE_50_75=0.008] autolearn=ham autolearn_force=no Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r8jFU-dDdJ0g for ; Wed, 23 Aug 2023 03:22:45 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by smtp1.osuosl.org (Postfix) with ESMTPS id B7EB0817FF for ; Wed, 23 Aug 2023 03:22:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org B7EB0817FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692760965; x=1724296965; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=S/EuwZngOEkqdud35T7la1+49ErbDYtNogadjNN25sQ=; b=h971toYZvqLu+TkCBQQkJohTpVdSx/lxqMDfcocrM83hmgK3wELcjSBu aHdsBQ/a9WVwiGd6mDuL3dHwsl5pH6UNB9ur7UA45BIUkjtAyXayIbIgC DCoY1s9mU2v+4BSgEm/1YtsS+g94YlJyJ5g1YghbX75ux4RPw3h8JdweS 3y7/9WlmxEfAxr593SKcfTBIfnKRIXCZKiNgFNsvUKUy1yhZbyEYY6CxO MNU9BChhdPvVviqRBEuuEi17/qOYLcbYys/vRL3cEHuJLHBDAyRPiDQ7u jvbAhDMnd1N9mQVNgr5ElNMQQBMSkXe58OoQrVGQL1GTijj9Vy7P3a/Yb g==; X-IronPort-AV: E=McAfee;i="6600,9927,10810"; a="405049565" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="405049565" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2023 20:22:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10810"; a="910347245" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="910347245" Received: from rex-z390-aorus-pro.sh.intel.com ([10.239.161.21]) by orsmga005.jf.intel.com with ESMTP; 22 Aug 2023 20:22:38 -0700 From: Rex Zhang To: fenghua.yu@intel.com, ramesh.thomas@intel.com, dave.jiang@intel.com, rex.zhang@intel.com, tony.zhu@intel.com, accel-config@lists.linuxfoundation.org Date: Wed, 23 Aug 2023 11:22:32 +0800 Message-Id: <20230823032232.39894-1-rex.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 23 Aug 2023 15:20:12 +0000 Subject: [Accel-config] [PATCH v1 1/2] accel-config/test: Add op mask to check if an op is available X-BeenThere: accel-config@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: accel-config List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Aug 2023 03:22:46 -0000 Several operations were removed in IAA2.0 specification. In idxd-config, keep the related code about removed operations, define op mask for comparing against the /sys/bus/dsa/devices/iax1/op_cap to check if an operation is available or not. Whether to do the operation or not depends on the checking result. This commit is for defining the operation masks. Signed-off-by: Rex Zhang --- test/iaa_user_test_runner.sh | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test/iaa_user_test_runner.sh b/test/iaa_user_test_runner.sh index c8f2686..2887fad 100755 --- a/test/iaa_user_test_runner.sh +++ b/test/iaa_user_test_runner.sh @@ -14,6 +14,53 @@ VENDOR_ID=`lspci -n -s ${DBDF} | awk -F ' ' '{print $NF}' | awk -F ':' '{print $ DEVICE_ID=`lspci -n -s ${DBDF} | awk -F ' ' '{print $NF}' | awk -F ':' '{print $2}'` VFIO_BINDED=0 +IAA_OPCODE_NOOP=0x0 +IAA_OPCODE_TRANSL_FETCH=0xa +IAA_OPCODE_DECRYPT=0x40 +IAA_OPCODE_ENCRYPT=0x41 +IAA_OPCODE_DECOMPRESS=0x42 +IAA_OPCODE_COMPRESS=0x43 +IAA_OPCODE_CRC64=0x44 +IAA_OPCODE_ZDECOMPRESS32=0x48 +IAA_OPCODE_ZDECOMPRESS16=0x49 +IAA_OPCODE_ZDECOMPRESS8=0x4a +IAA_OPCODE_ZCOMPRESS32=0x4c +IAA_OPCODE_ZCOMPRESS16=0x4d +IAA_OPCODE_ZCOMPRESS8=0x4e +IAA_OPCODE_SCAN=0x50 +IAA_OPCODE_SET_MEMBERSHIP=0x51 +IAA_OPCODE_EXTRACT=0x52 +IAA_OPCODE_SELECT=0x53 +IAA_OPCODE_RLE_BURST=0x54 +IAA_OPCODE_FIND_UNIQUE=0x55 +IAA_OPCODE_EXPAND=0x56 + +IAA_OPCODE_MASK_NOOP=$((1 << IAA_OPCODE_NOOP)) +IAA_OPCODE_MASK_TRANSL_FETCH=$((1 << IAA_OPCODE_TRANSL_FETCH)) +IAA_OPCODE_MASK_DECRYPT=$((1 << IAA_OPCODE_DECRYPT)) +IAA_OPCODE_MASK_ENCRYPT=$((1 << IAA_OPCODE_ENCRYPT)) +IAA_OPCODE_MASK_DECOMPRESS=$((1 << IAA_OPCODE_DECOMPRESS)) +IAA_OPCODE_MASK_COMPRESS=$((1 << IAA_OPCODE_COMPRESS)) +IAA_OPCODE_MASK_CRC64=$((1 << IAA_OPCODE_CRC64)) +IAA_OPCODE_MASK_ZDECOMPRESS32=$((1 << IAA_OPCODE_ZDECOMPRESS32)) +IAA_OPCODE_MASK_ZDECOMPRESS16=$((1 << IAA_OPCODE_ZDECOMPRESS16)) +IAA_OPCODE_MASK_ZDECOMPRESS8=$((1 << IAA_OPCODE_ZDECOMPRESS8)) +IAA_OPCODE_MASK_ZCOMPRESS32=$((1 << IAA_OPCODE_ZCOMPRESS32)) +IAA_OPCODE_MASK_ZCOMPRESS16=$((1 << IAA_OPCODE_ZCOMPRESS16)) +IAA_OPCODE_MASK_ZCOMPRESS8=$((1 << IAA_OPCODE_ZCOMPRESS8)) +IAA_OPCODE_MASK_SCAN=$((1 << IAA_OPCODE_SCAN)) +IAA_OPCODE_MASK_SET_MEMBERSHIP=$((1 << IAA_OPCODE_SET_MEMBERSHIP)) +IAA_OPCODE_MASK_EXTRACT=$((1 << IAA_OPCODE_EXTRACT)) +IAA_OPCODE_MASK_SELECT=$((1 << IAA_OPCODE_SELECT)) +IAA_OPCODE_MASK_RLE_BURST=$((1 << IAA_OPCODE_RLE_BURST)) +IAA_OPCODE_MASK_FIND_UNIQUE=$((1 << IAA_OPCODE_FIND_UNIQUE)) +IAA_OPCODE_MASK_EXPAND=$((1 << IAA_OPCODE_EXPAND)) + +OP_CAP0=`cat /sys/bus/dsa/devices/iax1/op_cap | awk -F ',' '{print $NF}'` +OP_CAP0="0x$OP_CAP0" +OP_CAP2=`cat /sys/bus/dsa/devices/iax1/op_cap | awk -F ',' '{print $(NF - 2)}'` +OP_CAP2="0x$OP_CAP2" + trap err_exit ERR [ ! -f "$IAATEST" ] && echo "fail: $LINENO" && exit 1 -- 2.25.1