From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 49BADA0507; Thu, 31 Mar 2022 17:47:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D54A5410F3; Thu, 31 Mar 2022 17:47:18 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 1944C4014F for ; Thu, 31 Mar 2022 17:47:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648741637; x=1680277637; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=y2Y+8jZvUJ3hz35/Q76cQxErFZaRNOk57Wfum02BftU=; b=biv9hDRMPpm7oxPnxz+R7yMaPh2kXayNyMtjqqabuojt9p3Bx7veGseY M+2Nt8zDra8iKWWYOwxB4n6BjtY7DVTSuEpRgZr0h1H6NVBpK8rzIAqQd U1oNZxN6nr9djVjm9ch/rRelLyxQWHQCBFRCfE39lKSEQMjICkM5ARNPj L7CE2cs0Y+vKZf9gofPQt4E9MNG6c7ZRQAWPm1Ugt/ycNeRK8ZFgE1xIG bG+LiPsQBL04Iv0sBBRdFiuG3i7cZCEErMLHkAimu0bT8TIeD4jpxdtHz D99ZRD1qITD2pFy2aJ3wuMzxWQufzeJxFMUmIDtBkHAdrEb3DCYtyPNZO g==; X-IronPort-AV: E=McAfee;i="6200,9189,10302"; a="240466854" X-IronPort-AV: E=Sophos;i="5.90,225,1643702400"; d="scan'208";a="240466854" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2022 08:47:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,225,1643702400"; d="scan'208";a="654847496" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga004.jf.intel.com with ESMTP; 31 Mar 2022 08:47:15 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 31 Mar 2022 08:47:15 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Thu, 31 Mar 2022 08:47:15 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.170) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 31 Mar 2022 08:47:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aeS6yV/DfrbNnyktezrLXqBb+YnCr4LM5KkcdK+sGVXvv/5/bZeajRYnvYlaVo3/2nt6ooVC61/gbJUK5hj0WOoLJkLCOVq0GbVvPx7whZj2ZaXs9a7nX0zYVc2evHeNI6zN6jGfWKiW1JaMnFHoY20aC68o8NIIrqm2apLEgsz6tj0kPTFK6wkzv1+2YvNZ3+11xPRuqPhi7E9bL4a324kvzVjCMBKM4AiLb3NFNWtiBvlXpfdSDva3yXcSdzwYt9XdK4AMc/TkY4L8vfl9z39mkP/NKajf9y3hPaYk/NwPKy6jNTHPdxqmQxKf9BE1RA3A9G6aIiRg2/C52x2TfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0oY0Bk9YetLaI/hxyoAAW1YDUKKmaTPTfEZSDEZDJkE=; b=CQU9vywojHdfzvwkx7qtKy3/eddw5h5QLDdJtU0SATdclyBphs8zZMdX2pZtsso+JpMI+U9kTgf9Icm5ie9aV0zfyAGEL0f8Yr+Twiz/3docuGn7ScfHUFGeHBDEf9bCNzc8URYSVZqQbvSZF8KLicuD30ig5Wt6OG1nhesEns+DfPnWb9yRn11LzVPGdYu2Tsy3zt8a0N+pDnUGwXb3PAB37zvPsoOhYoAwHRtkWeITL5Plg4todzmgZkGRE+L08ZrzB/XhW+9Zl4xvnq+06u8UuuVqjlxAIuPrK3pl5+dseMmiXjY3SC8iUJbKJ0HrmSaykagGeiqfmdLbdEN4Ag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by CY4PR1101MB2134.namprd11.prod.outlook.com (2603:10b6:910:19::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.21; Thu, 31 Mar 2022 15:47:10 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::e188:d844:25ed:e390]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::e188:d844:25ed:e390%4]) with mapi id 15.20.5102.021; Thu, 31 Mar 2022 15:47:10 +0000 Message-ID: <3c9246a0-dcd1-7615-3024-2dd1d596ff5a@intel.com> Date: Thu, 31 Mar 2022 16:47:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] dma/idxd: add generic option for queue config To: Bruce Richardson CC: References: <20220330150700.435875-1-kevin.laatz@intel.com> From: Kevin Laatz In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DU2PR04CA0228.eurprd04.prod.outlook.com (2603:10a6:10:2b1::23) To MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7f09043-f82d-4055-5f10-08da132db7ba X-MS-TrafficTypeDiagnostic: CY4PR1101MB2134:EE_ X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oDIiVJn8XTugNYu6Qb0E83sGh9kD/tMtmy6zFbf4SvyTElYbCfGIaIkyV1qCqIV8PLT8gmMMjpgkPLa1b4bIrll9c/6oJXcPt5t95oHYNCLtYSOJ1T/AcZydT7qKAtVvtSsAwdF7/75WHjZcurzlXQLJhLcRZ3CGyvdHREjsVMwLJimJ1ZZoASloB6UKPflwZ6hF3QMqiWXm7q7Q9giM7FvA2FxrM0YSkuJKLOqw6zu+UJbu6t/m5yWR79enRJCAxBgyMdzC2L7FkVTGGnzWgXuz5EaHw4W1QV60+8/IRP9aU+bFaInVRDno26d86pQTySxKj6za2scWqXdXEvnzpuAuIBDzZMBY+GOkQRPyMvF1uw1jv8igrgwNDMhz9eyk1g8Vf9W1y9G6jgjGeYzspRo/FSCrWzhKhhyJ1SBNzB8JTIr5wfkrssZ5jSOQ+Kxy4Euzi463btchSC7BY/UfLDmk8EWq/1zuCFfbNhC71dvkbbAY2s49YvJWtKeJFMfjDvhmM96Qshxy2UWomV6NdjEqBGZn1x555j+mMxifgxmbCOaDqzf20ws4wl7g1qkKP2R+UNmv7MM2eaqeIDxryfXC+DkY2zZbMdCru5Ske1OwYYsVA8WJFody16aJ30cTJAXjcJ1ZL9NTni21G/pyKFcrjWlZOy579Ez3qR2qR4u+5dyUDCdC8ot9TR8BTg/xMNZp4c6fdeeulGBcfr+PwGMvM/4B01tgkS+mSLBJ/as4mpYVzzxNkFcrNSIu7p/RfLaRKJM6vzvh55J26h4WCg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR11MB5872.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(82960400001)(6636002)(37006003)(5660300002)(44832011)(31686004)(316002)(38100700002)(36756003)(6486002)(66476007)(83380400001)(186003)(508600001)(6862004)(4326008)(31696002)(66946007)(66556008)(86362001)(8936002)(2616005)(8676002)(26005)(6506007)(53546011)(6666004)(2906002)(6512007)(41533002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RWgwQ2YrbmhiYmN3RktkaGRaN0VWc3JPb1orYzZZdU40TTdJbGMrS1VVL3lG?= =?utf-8?B?cnAyRC93SnYrczlQdmxSSWFhL2xlTHpPMXpoM1NqRUZLTGNxbGN0c1JKZUdu?= =?utf-8?B?Wk0yRzhjdEFXWW5kRGFBbVdaVG5tRUt4TE0xUGloREZNT2FISnpEWWpXWmt3?= =?utf-8?B?eENZV3J6cTMwNnl2ZDZWV0xRZHhYOG9zYTlmWXpLN01xVjlVV0E3MzRuUkhy?= =?utf-8?B?WXZWWWx1MXFheUNpdEdoWSs0Nmtuc1ErRVRSc0RpZFpsL3BmbXNmSUp4VHNW?= =?utf-8?B?cmVtcUhuUXlMb3dTbGFSRDNBMHY2ZTV2L1kxamNsWDBtcG96WVdsVXNTajBr?= =?utf-8?B?Y0p6R1VMbWtoSGdJS29abGRsaHl3cDFCaHdGaGpRQVdNbmtleVk0WE9kalZ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EdwdG8rRXcxaVpsU29teG9vMkYyN2QvaHB6?= =?utf-8?B?OXUzZnZsTWpwemFmbTlSMkRjdHVJbFlqd3AwOU5qQUxjY0tIUDMweXUwanRX?= =?utf-8?B?QnBGMHhnWXRHY3ZFWHRMMTJqM3QxcFNYaVMzYlI2M2M1VXB2TU5VTDRQeGFZ?= =?utf-8?Q?1RY5OfKr8QnkUuMI=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: b7f09043-f82d-4055-5f10-08da132db7ba X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2022 15:47:10.5590 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BtDV7U6MchfXWNLbQo9MibAHy6uIDJwlo9uAo6gn7btYm3koabYXDcaJApiDMn68MOisUl+t02I5kcOChmCORQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1101MB2134 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 31/03/2022 15:57, Bruce Richardson wrote: > On Wed, Mar 30, 2022 at 04:07:00PM +0100, Kevin Laatz wrote: >> The device config script currently uses some defaults to configure >> devices in a generic way. >> >> With the addition of this option, users have more control over how >> queues are configured. >> >> Signed-off-by: Kevin Laatz >> --- >> drivers/dma/idxd/dpdk_idxd_cfg.py | 29 ++++++++++++++++++++++++++--- >> 1 file changed, 26 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/dma/idxd/dpdk_idxd_cfg.py b/drivers/dma/idxd/dpdk_idxd_cfg.py >> index 3f5d5ee752..9ac724e7a8 100755 >> --- a/drivers/dma/idxd/dpdk_idxd_cfg.py >> +++ b/drivers/dma/idxd/dpdk_idxd_cfg.py >> @@ -62,9 +62,25 @@ def get_dsa_id(pci): >> return int(dir[3:]) >> sys.exit(f"Could not get device ID for device {pci}") >> >> - >> -def configure_dsa(dsa_id, queues, prefix): >> +def parse_wq_opts(dsa_id, q, wq_opts): >> + "Parse the additional user-specified queue configuration" >> + wq_dir = SysfsDir(f'/sys/bus/dsa/devices/dsa{dsa_id}/wq{dsa_id}.{q}') >> + for wq_opt in wq_opts: >> + try: >> + opt, val = wq_opt.split("=") >> + except ValueError: >> + sys.exit("Invalid format, use format 'option=value'") >> + if not os.path.exists(os.path.join(wq_dir.path, f'{opt}')): >> + sys.exit(f"Invalid sysfs node '{opt}', path does not exist") >> + wq_dir.write_values({opt: val}) >> + >> + >> +def configure_dsa(dsa_id, args): >> "Configure the DSA instance with appropriate number of queues" >> + queues = args.q >> + prefix = args.prefix >> + wq_opts = args.wq_option >> + >> dsa_dir = SysfsDir(f"/sys/bus/dsa/devices/dsa{dsa_id}") >> >> max_groups = dsa_dir.read_int("max_groups") >> @@ -92,6 +108,11 @@ def configure_dsa(dsa_id, queues, prefix): >> "max_batch_size": 1024, >> "size": int(max_work_queues_size / nb_queues)}) >> >> + # parse additional user-spcified queue configuration >> + if wq_opts: >> + for q in range(nb_queues): >> + parse_wq_opts(dsa_id, q, wq_opts) >> + > I think this may be better to have the parse function only parse the > options and split them. If that is done before the actual queue > configuration function is called, then the additional options could be > passed in there, and merged with the existing config settings. This avoids > duplicating things and doing two sets of configs. Thanks for the suggestion, Bruce. I'll look into it and send a v2. /Kevin