Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1764514rdb; Sat, 3 Feb 2024 23:52:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFAD/9ymOhwEole4kJ1d+LnsjKX2V/NePQyVx1eH29Yc2DzlTiWpHfgbYgzS1DcuFPhTNVs X-Received: by 2002:a05:6e02:491:b0:363:ad01:f052 with SMTP id b17-20020a056e02049100b00363ad01f052mr8080754ils.24.1707033122852; Sat, 03 Feb 2024 23:52:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707033122; cv=pass; d=google.com; s=arc-20160816; b=x2bplLJzAiFAV59KCO5Fa3t+MUzw2SWFBHa9FSwlhg8saFgbf0UFPj4+PuePJi2UWH ys4fW0lHLTklbcre0hgRA+vVW5HDsT5RjDtlv2/D2HdH2QpDzv/3mgqsT2iSVFvIx3kq +qFMpxQVJFHOleAdyzvv2Wo//0oBbTSBW/AJg8wv1lE3JsCIEZN2weS6AVZaJ3y0ps6g UhRhQ4BBQSYMAZSrW7AOypOaRWfR8u+9rNZTaKYtK9+RSjAHwQML+/4poG2J8RKIuZlB b9226cckszscE6/zAekRyX0CHAkDQO9w4q2U+2qmHI+S9+nZeGbt8f/DmcJ5zrQwAV3O D2Xg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=A14BCls41fwfyoOZpPImx9gM6CsoQWADM/eYvGfz9Sg=; fh=HsuaWVGo6nGY1rsrZlGCdrwbm7EGBS8PJSOLNa8JtPg=; b=rYybpSqsyf3P2VmGWVH3XAHXujMgpL1GwGbDVIpxUnFcOIudaRfPueu1C24AqWOoU2 PNWlTrO7un8PXJewFsBFyC38vh8BO+XuaoiXMptpgrH406qI47sYilfn6MUWb9eo0HQU Jvh2/pu2R0u1k8rKuhA43TYkHWMhimiFFRhzCAYFpxX0daPQ8U9SCcl3RduolfDpKUZA XWk/JKV553ihPgP5tjQeNYnbQb1cmSsL851CNf4BYWrFKLm3jzF1zxjRGl1UBUmQtZ3U Q8ktvb0WlWD0tRpDtJQT/RCUFtBQl8GYxEjTF3R9npKKDOgrWwSFCggKUN9wmI66Ld9J tVbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HnTtvqz+; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-crypto+bounces-1827-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1827-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=1; AJvYcCUBFdLdWn+THsmK5tUlRULEQrTSggzXqri1IOVwLSBkSqDPqB+xOtOnxZv7m6h5qimnIuuSn4/RA4HOyEXLljTQ10Sa45XOzuPzT+Rhcg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k135-20020a633d8d000000b005cf17ab8a61si2487308pga.272.2024.02.03.23.52.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 23:52:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-1827-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HnTtvqz+; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-crypto+bounces-1827-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1827-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E876FB21761 for ; Sun, 4 Feb 2024 07:51:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03DBD14ABC; Sun, 4 Feb 2024 07:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="HnTtvqz+" X-Original-To: linux-crypto@vger.kernel.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C567214A94; Sun, 4 Feb 2024 07:50:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707033003; cv=none; b=lo0uQ8UJKw/+VIziT4Bn2b+hY7ajqHICe2SjhNNof7IFhEhC66EeaUCSvfuCWN3tBlNGKv/OWweFf2KDFMSoZ0TTkpEmSFrdnUVC3LrqruREAJTu9xOOCAfNOaDpKzN5oVARNecOD+9e4ltogLZYVF/LRI87UH61GEPPrZc2poI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707033003; c=relaxed/simple; bh=8rYxczI/5Lo4DDBMNGT7Xezq3tFx3qZcjoXISzbgu8o=; h=From:To:CC:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=EujY80wRTVHeBzWphuk8yr2PiR4FrHGB5lqcy3ww5m8srZ1q7YH++mNxx7S3mPpMFSYtpIau/BabK22fOqDQU1VYl5QeyGlz9N1/hvtWmQDVK05gv0IfAjbOUczNgCIkoVC2lU/ofNFfXanSuIiW0PhkOWIU5db1nHZO1JQn8XM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=HnTtvqz+; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 4147nZVA040695; Sun, 4 Feb 2024 01:49:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707032975; bh=A14BCls41fwfyoOZpPImx9gM6CsoQWADM/eYvGfz9Sg=; h=From:To:CC:Subject:In-Reply-To:References:Date; b=HnTtvqz+bj/maXJMRIFvmTvcnjEgG7IUIaeB9KK+Ei6OlNfkUkTvlpuVwxmar3cBM cGw8kVsdvDZXnSa2+/VkLNOML3E9cVn+EVg5R03mdJE5hQPyi4mWwMq+TzbQ939VJ8 qpbx+8sA3WQ/9M2bYTOMCuSQ0vJWroZWlusiR2qM= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 4147nZ5A053108 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 4 Feb 2024 01:49:35 -0600 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Sun, 4 Feb 2024 01:49:35 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Sun, 4 Feb 2024 01:49:35 -0600 Received: from localhost (kamlesh.dhcp.ti.com [172.24.227.123]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 4147nY0O050380; Sun, 4 Feb 2024 01:49:35 -0600 From: Kamlesh Gurudasani To: Xin Zeng , , , , , , CC: , , , Siming Wan , Xin Zeng Subject: Re: [EXTERNAL] [PATCH 07/10] crypto: qat - add bank save and restore flows In-Reply-To: <20240201153337.4033490-8-xin.zeng@intel.com> References: <20240201153337.4033490-1-xin.zeng@intel.com> <20240201153337.4033490-8-xin.zeng@intel.com> Date: Sun, 4 Feb 2024 13:19:34 +0530 Message-ID: <87o7cwzn1t.fsf@kamlesh.i-did-not-set--mail-host-address--so-tickle-me> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Xin Zeng writes: > This message was sent from outside of Texas Instruments. > Do not click links or open attachments unless you recognize the source of this email and know the content is safe. > > From: Siming Wan > > Add logic to save, restore, quiesce and drain a ring bank for QAT GEN4 > devices. > This allows to save and restore the state of a Virtual Function (VF) and > will be used to implement VM live migration. > > Signed-off-by: Siming Wan > Reviewed-by: Giovanni Cabiddu > Reviewed-by: Xin Zeng > Signed-off-by: Xin Zeng ... > +#define CHECK_STAT(op, expect_val, name, args...) \ > +({ \ > + u32 __expect_val = (expect_val); \ > + u32 actual_val = op(args); \ > + if (__expect_val != actual_val) \ > + pr_err("QAT: Fail to restore %s register. Expected 0x%x, but actual is 0x%x\n", \ > + name, __expect_val, actual_val); \ > + (__expect_val == actual_val) ? 0 : -EINVAL; \ I was wondering if this can be done like following, saves repeat comparison. (__expect_val == actual_val) ? 0 : (pr_err("QAT: Fail to restore %s \ register. Expected 0x%x, \ but actual is 0x%x\n", \ name, __expect_val, \ actual_val), -EINVAL); \ Regards, Kamlesh > +}) ...