Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp382574rdb; Thu, 30 Nov 2023 07:18:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5650w+1TiBnxij2Pra6Y+bYdy3tGlRDOat57hOzsCtgsKAgQg7ncMlyXIrXIRQrzmLLSP X-Received: by 2002:a05:6a20:160b:b0:18c:3ec:5ad5 with SMTP id l11-20020a056a20160b00b0018c03ec5ad5mr24792946pzj.57.1701357519647; Thu, 30 Nov 2023 07:18:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701357519; cv=none; d=google.com; s=arc-20160816; b=NNHLN+0xK8O/Xt4fGDNIE75T53UdOR75khXeBlDrWQdd2NhWHYg3Kx4RGcnHXQA+m7 7Xa1CGbBaSvcQBlbIEFX+3foPPo304LglPZe98Xc6/WWHt/G3MuuxjeXw3fdEbD7C7e/ meOlaOM3aOr1S+BYZBqAVpUV4uP/Qn0NmeGNbVFJIwbXz4ir+DRr7K82G87Xsa8tFNYR WxwKrsyXOI0nNcjchJbu3Ihv6lI8Y5ui9p4HXlXvriUX6xigh+doP74mxKgwe+GRG0+y 4ZZf6SAa95KPExRd3W6MxN/afAp3r4DfuWGPdHoXzTtQk3sLum3xQO2vYAhwqOrJz/oz MjIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=irFprwF1F6INkBRexvSgLTgXOEWPdW1OaUyRusuINZA=; fh=h6sm7JNH/Nw3t9Ebm0vuHd9Da8PzpcdirOtt4R6tyfI=; b=A9qtFi5oQ6Uuzz184SlJvuEKppISVLQMgwDVcdwpRH2oCt3nJOglXh9ltOSMmXUMjL bWM37WAOhRInFFkf7lSxp142plCenGRD35IPuUY3SzrIHs92qbhCL3T3aq5giw2kksk3 h/+RZ/WakjC/bunlooS6YR40fXvbimzheBemMyz27LcWYNWzVZx2MPr/ajz/feWkYasZ tQ+zTfodrS3wVZuR5vjtl24Y5DPKXwS4Rh4pVkGNZG4ZnAiHtm+yYYfkjtPWYNQ8Zcsc hzCQwf7p0w6jq94+MfHZ5YqkiXlyA81kuxsLeVpF+u7uhZwuNwUugPf9k55P7/2Cze3s pRrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GJXFB4Cb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id k5-20020aa788c5000000b006cbed8953e9si1472802pff.90.2023.11.30.07.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:18:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GJXFB4Cb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 24D608031D7D; Thu, 30 Nov 2023 07:18:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346131AbjK3PSP (ORCPT + 99 others); Thu, 30 Nov 2023 10:18:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232062AbjK3PSO (ORCPT ); Thu, 30 Nov 2023 10:18:14 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A0A410D5; Thu, 30 Nov 2023 07:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701357500; x=1732893500; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=10fw+r5XbxUYA5SnJKr/duWs+Vhz0TMSzhkjID0W420=; b=GJXFB4CbgvGFTlp8q1gPOhKjKxDUWPhtI1eIM7Hs6MLWiZ/3vPloI5Bm s5e1gY0nzHcyoLQR0oyhaYXZLzG9lQ875FyIRl+hw84duB9hSxGzULvvT n2QMtPO8NEZJaRIxautD330A0Gt66S3ugv3iH4kCkEMgwb6xE683ieGhY Vb8MC6UX6vTKANq15azrQ9G/HLdCPhWVyYQVDR4uaZfWQqlhVUghb7TOo PU9siSzGH0FeIjP3bAp+m3Jr7dJ3SVo8j/uh5/atgMsG/dfnsjnHYYj3V FwYgKrhOdb6yUkgYaedbn0RdWYrYSHy9I+cGCP04CLKyUFKwX+gozrpX3 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="383734059" X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="383734059" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 07:18:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,239,1695711600"; d="scan'208";a="17434854" Received: from rafaelfl-mobl.amr.corp.intel.com ([10.212.26.103]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 07:18:19 -0800 Message-ID: <29ea34917cbfabf2b98b4957b7770683f5994873.camel@linux.intel.com> Subject: Re: [PATCH v10 14/14] dmaengine: idxd: Add support for device/wq defaults From: Tom Zanussi To: "Yu, Fenghua" , "herbert@gondor.apana.org.au" , "davem@davemloft.net" , "vkoul@kernel.org" Cc: "Jiang, Dave" , "Luck, Tony" , "Feghali, Wajdi K" , "Guilford, James" , "Sridhar, Kanchana P" , "Gopal, Vinodh" , "Cabiddu, Giovanni" , "pavel@ucw.cz" , "linux-kernel@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "dmaengine@vger.kernel.org" Date: Thu, 30 Nov 2023 09:18:17 -0600 In-Reply-To: References: <20231127202704.1263376-1-tom.zanussi@linux.intel.com> <20231127202704.1263376-15-tom.zanussi@linux.intel.com> <00aa3b9f-d81e-3dc2-3fb0-bb79e16564d3@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 30 Nov 2023 07:18:37 -0800 (PST) Hi Fenghua, On Thu, 2023-11-30 at 00:31 +0000, Yu, Fenghua wrote: > Hi, Tom, >=20 > > From: Tom Zanussi > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* set name to "iaa_cryp= to" */ > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0memset(wq->name, 0, WQ_N= AME_SIZE + 1); > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0strscpy(wq->name, "iaa_c= rypto", WQ_NAME_SIZE + 1); > > >=20 > > > Is strcpy(wq->name, "iaa_crypto") simpler than memset() and > > > strscpy()? > >=20 > > That's what I originally had, but checkpatch complained about it, > > suggesting > > strscpy, so I changed it to make checkpatch happy. >=20 > Why is size WQ_NAME_SIZE+1 instead of WQ_NAME_SIZE? Will > WQ_NAME_SIZE+1 cause mem corruption because wq->name is defined as a > string with WQ_NAME_SIZE? No, wq->name actually is: char name[WQ_NAME_SIZE + 1]; This code is doing the same thing as elsewhere in the idxd driver except instead of sprintf() it uses strscpy(). > >=20 > > >=20 > > > > + > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* set driver_name to "c= rypto" */ > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0memset(wq->driver_name, = 0, DRIVER_NAME_SIZE + 1); > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0strscpy(wq->driver_name,= "crypto", DRIVER_NAME_SIZE + > > > > 1); > > >=20 > > > Is strcpy(wq->driver_name, "crypto") simpler? > >=20 > > Same here. >=20 > Ditto. >=20 Same. Tom > Thanks. >=20 > -Fenghua