From patchwork Mon Aug 7 20:37:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Zanussi X-Patchwork-Id: 132384 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1706821vqr; Mon, 7 Aug 2023 13:59:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcxrXTAaIZwCkpybHwjuvc2mL6+DpU+BBqrpwJaFgYt6ODiAaYoGASrla3nX62RRUlc4ye X-Received: by 2002:a05:6808:1289:b0:3a7:6698:7493 with SMTP id a9-20020a056808128900b003a766987493mr15719232oiw.23.1691441972422; Mon, 07 Aug 2023 13:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691441972; cv=none; d=google.com; s=arc-20160816; b=nF9hU9BYc8vmMec+2KNw1EsKS9f0uLR27GWiw0/N9mzxWGXHyr9VuJ7312S1VNj9Qw 2rxnn6qMsYiY+jbgMJx+hvDwGIlcGkV94HZ+9zE3tsK6uLIdGaPbl8+5G2V+OB8we1y7 QQptQLL0Urfbb+BtkuAzzLT+wU7C3V/BKUoKew5rEyja0NjaVoyKel1h120WD9NraJEy VM4C/yzuila1t3ExDvJVUgpEJ9re6mO6nt/GFgdQTl2j4ylFHTiYJd9t3ukCEREJ5GLD 7hpOTD8fqbE9iwBegadQK/hIuOHGC4FmaAsB2YNVc4rdq8PL6hPUj//RzR94XWb/oXOE JN6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QgH3GSfpMwLN6xqwZWKho2x7OprR4Q/pArUZ09h1kls=; fh=KKYX96Dyn269sAN9Nbt8IfOk86mWVdLVST7Tbph7224=; b=s1UElxJg/kmUc1CdIbgL7xaX5s5N70PBGpx0zatXdKvb0DsXloM0J5m0HK/GMot9fB aR3fZGlTLH3S+U9CNdUJAyUXOgb+iGky9kqilBWBhi9froLFmPB3MLpGf8NNd1r15Vug T539odiazi8t9TY5JE8ZNRCB6feeI9ZLKz1aOF6MnXwE06JfMVPje5SScfJaKoXbUhQn D2+6kv9A97FcgxDG/uGxblEnB6NiQdVqPhL23rK+Bt3UtzJ+QfmnEmfwdB1VW6nroxtZ gGVnymE6UM5Spe5iCL87rf8rv50J9dzPCBui2v/0gPOuaHeVB7WP7Xea3mTnOlFkXJ26 j7gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fy3Udp6I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q136-20020a632a8e000000b0055c8d14df3bsi6099967pgq.501.2023.08.07.13.59.16; Mon, 07 Aug 2023 13:59:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=fy3Udp6I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S231516AbjHGUi0 (ORCPT + 99 others); Mon, 7 Aug 2023 16:38:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbjHGUiJ (ORCPT ); Mon, 7 Aug 2023 16:38:09 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92BCFE62; Mon, 7 Aug 2023 13:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691440688; x=1722976688; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XDP/Lzh/PA2NjJl2oSljk0y1i7dKPRi9KQWpDqSxAlk=; b=fy3Udp6IXulHTuFsDYNX6kXJkYtNpZgGpVR1C89q/HQh5KBj+jsXaDib 40JQMYsI9jKam7VwAeOMJ7uA7FuXT3fjnqqx4v0/NOhjBpb9M8jDU9DBe kVnTy8z9jJ3R2aD7DiCrOp3P2iXtza23oxLh/ycIQ4zMrUSy0yElOEsSt CCWQzobZdKiEuyoLc+pVJxpsYzSEvrhmvba59SIptrsxGjfRJn1KhBpbv oTd3vEQKx2dD0HW+Qnh5+v80LAIivvrKibA7bwk28v1+Q68YaKyF9wtsm lm6kCP/NNwCiFT2r+AuBY9joX8jLnHk3iRZLzrQe7PEx/c0GnwF0cvdB9 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="374319685" X-IronPort-AV: E=Sophos;i="6.01,263,1684825200"; d="scan'208";a="374319685" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2023 13:37:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="766123350" X-IronPort-AV: E=Sophos;i="6.01,263,1684825200"; d="scan'208";a="766123350" Received: from eeroesle-mobl.amr.corp.intel.com (HELO tzanussi-mobl1.intel.com) ([10.212.81.193]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2023 13:37:46 -0700 From: Tom Zanussi To: herbert@gondor.apana.org.au, davem@davemloft.net, fenghua.yu@intel.com, vkoul@kernel.org Cc: dave.jiang@intel.com, tony.luck@intel.com, wajdi.k.feghali@intel.com, james.guilford@intel.com, kanchana.p.sridhar@intel.com, vinodh.gopal@intel.com, giovanni.cabiddu@intel.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, dmaengine@vger.kernel.org Subject: [PATCH v9 06/14] dmaengine: idxd: Add wq private data accessors Date: Mon, 7 Aug 2023 15:37:18 -0500 Message-Id: <20230807203726.1682123-7-tom.zanussi@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230807203726.1682123-1-tom.zanussi@linux.intel.com> References: <20230807203726.1682123-1-tom.zanussi@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773605457552684622 X-GMAIL-MSGID: 1773605457552684622 Add the accessors idxd_wq_set_private() and idxd_wq_get_private() allowing users to set and retrieve a private void * associated with an idxd_wq. The private data is stored in the idxd_dev.conf_dev associated with each idxd_wq. Signed-off-by: Tom Zanussi Reviewed-by: Fenghua Yu Acked-by: Vinod Koul --- drivers/dma/idxd/idxd.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h index f58df2cd9cf5..0c7974383c71 100644 --- a/drivers/dma/idxd/idxd.h +++ b/drivers/dma/idxd/idxd.h @@ -609,6 +609,16 @@ static inline int idxd_wq_refcount(struct idxd_wq *wq) return wq->client_count; }; +static inline void idxd_wq_set_private(struct idxd_wq *wq, void *private) +{ + dev_set_drvdata(wq_confdev(wq), private); +} + +static inline void *idxd_wq_get_private(struct idxd_wq *wq) +{ + return dev_get_drvdata(wq_confdev(wq)); +} + /* * Intel IAA does not support batch processing. * The max batch size of device, max batch size of wq and