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 4492445E17; Tue, 3 Dec 2024 09:55:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E3FF240264; Tue, 3 Dec 2024 09:55:45 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by mails.dpdk.org (Postfix) with ESMTP id 7546240261 for ; Tue, 3 Dec 2024 09:55:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1733216143; x=1764752143; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=amlJMTrsCH9/XZsBvOrBQ49+aPrdSKNaXO1ZS1RFCbA=; b=HphJxgeXhgdfFWvvwRXzxl40zH3ak5xMqq008/HdmzdpN6c5I6i3AZKm 0n1aciSljStEVyioRwwsmitEmq9cF2cv5la2zN/InKs8Gqog+10lE1miO NEyoj5ML+t49zaqRxjc5dbsOGWuz8gdCImR/QJmT0tVnQWDnTHVWPlhKh DnbgSnY4dzq788jiGx7CHDsvEZXNQ9Jai9nqyPMjOhPB8n3f/gVF+1rHx nTfxqLYfrPzGhirQr+L6RYEuruKm0GyqIQEKHMKNR3P8pkGQiRBncFnvx IY8fwzRIgp2UprpDoSZTG7OM6kyx+PyNK/sgBAFqFfYSfp1HpsK23MrUy A==; X-CSE-ConnectionGUID: 3I1Z5Rl9ThG6X3Z+ZfsnJA== X-CSE-MsgGUID: OqRrfYt3R3u06n/GrxHC0w== X-IronPort-AV: E=McAfee;i="6700,10204,11274"; a="32774224" X-IronPort-AV: E=Sophos;i="6.12,204,1728975600"; d="scan'208";a="32774224" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2024 00:55:42 -0800 X-CSE-ConnectionGUID: gBjvIRvMSOeOTczyA+xN9g== X-CSE-MsgGUID: klvp6CU1QQGyeHCFnYsE7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,204,1728975600"; d="scan'208";a="93826738" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 03 Dec 2024 00:55:42 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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.2507.39; Tue, 3 Dec 2024 00:55:41 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 3 Dec 2024 00:55:41 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.174) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 3 Dec 2024 00:55:41 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Zy4FnCIzuBkVyM0EI3cWCubvrXH9kIUBl4y5Ouo4wSM/YYh+ZI4Y5d1UNpM8HNWmIbdRWeigX4bVyOREXCV3jPDHPjNaj6bWUBc1woP0bAXxymyNzgsV55+x3XZT3OWzQePqg2mAwyDZRX8Y42Goj0xkIghZhdtnlAh5qFNlLgkC41j5hZyIdap6TMPZcLbdhgo8DrgkJbNIK+ThUITo0mzFRKyIenQKZXY/PBL0MNdiCUDY8+fgKY4Kq0g+KZRReHWWJSHSNfjJKVaj5p9icQue5/9R9Usga9VMF3TJEE9ybdTO98Zj96pVlJvkt2Wwzm1tcPs2QBBDQf+V5WnO+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=S5Ks2AIv6GE/VZdXtzvi/fIpZOexDyAwAuy3ti7VW+8=; b=g1OxXgyvR0oj5oMr+XuLAbbKEFLicxLpfBe5D5pEBg+l59Vqsb973Fjb/SYHOX3QHo6jGREjRZT5AP9jC88xXg0+c5x8RlYUUNGXNtGoBE/cYf4ijp3RRuXnaeBFAqVCgSRFl0So3FAmJ1X0L3MqG7dYdkF9vZcElsfx4wIrXUkOaFPrluzq+GnajDQky/ZFfDUlGUkAb4Z/fsQQp+q2NvxQm00F0l2LDZzRXg5Xu3bimUzJC0jmEClYTbw2P8/DUWB+4FYKwpAgVgEreg6rCx97I0NTpeFHo2549GOG8EoN5KVB+qfKSdEBeBKVxUm4cHlu6IzhJltKjr75qcsqwQ== 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 DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) by CH3PR11MB8362.namprd11.prod.outlook.com (2603:10b6:610:175::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.18; Tue, 3 Dec 2024 08:55:34 +0000 Received: from DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::21e4:2d98:c498:2d7a]) by DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::21e4:2d98:c498:2d7a%3]) with mapi id 15.20.8207.017; Tue, 3 Dec 2024 08:55:34 +0000 Message-ID: <6ca32de7-dcf8-4135-8e14-454947a025f8@intel.com> Date: Tue, 3 Dec 2024 09:55:30 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/1] usertools/devbind: update coding style To: Stephen Hemminger CC: , Robin Jarry References: <3fb9cafaad635d583e20a02610c7c2c9cb7e2771.1733151400.git.anatoly.burakov@intel.com> <20241202090137.4a02a9f6@hermes.local> Content-Language: en-US From: "Burakov, Anatoly" In-Reply-To: <20241202090137.4a02a9f6@hermes.local> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DU2P250CA0003.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:231::8) To DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB6502:EE_|CH3PR11MB8362:EE_ X-MS-Office365-Filtering-Correlation-Id: 69d77e38-537c-4ca3-efb2-08dd13783fea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YjhCT3hhK3RnUWdPT1lNR1ZDbUxvOGoyZ3pUVytGUUR4MUs4NUtKeGJ5Y1dB?= =?utf-8?B?MDJyek9VOFFpQStmNzFjcGd6NkZvWCtIb2dmQU1BUDFTNkk1RXRQZkZralBp?= =?utf-8?B?M1prRWRQN0JuN245V2lOS093ZnlzNm9iUkphWmI1RXBWcVh3bzRRRUptbzJY?= =?utf-8?B?Y2x0SkZNTE52MS9XeVJ4S1hKRGxrQXpyUzlzc2VZUFlkRGFGTjZEVjJqR3M1?= =?utf-8?B?c2I2QmE3OFFKQWhNRWttOWVQK3VvWC9QV0pCaklvbC9yRUZYNUU5dEhkNDFm?= =?utf-8?B?RnhvWHFwdlFaYW5tNVQ5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NeFNqbXRGT1lEd1ZZY1BLejFIcDVBMVN5L1EvbDN2?= =?utf-8?B?Mlk4VExsSWtDMkdOcUluOVZpZzhIOGRWbHFLcHAxUnE3dkdlc0FZeC9tZi9J?= =?utf-8?B?c2w1UkQ1aHB6R0tMb1NaODlOSXd6YzZtNWVmM28wcFd4SXFKMlZFYXJ5Rng4?= =?utf-8?B?cXQ2ZmlTb3NpTTN5UVJaVmwwK1Q2b3ZoTTUxU2tCNk1HV2pPdzROUnJUMDIw?= =?utf-8?B?THVTRUp1aDRCaVpqRUFwUVZNdVdCRnRwM25DWkxsK21iazduUXYzSlFnbmJT?= =?utf-8?B?NzRsbEtES1R3N0R6ajBmK05uVWFLejE1RGpWRWxaYWkyVkplMmNRTTZpYm9W?= =?utf-8?B?VlRZY09BRUJ0Y1luaVB6NUpFV1dPaEZQaU5KTXhwdzEweUxYQ1NZL1NaNlBv?= =?utf-8?B?WktkL21HbEdpUUhXSGplU2FLOW02NStjMmo0dlV5R1Flc2gxN3NxamlNY1N4?= =?utf-8?B?SXhZbjFJeHcxM2drNnNnTm9VU0RwVkhmREZxeFdIQlk3MXNsc1NzYkh1WDVD?= =?utf-8?B?ZFJoSlg0azc3VmREbTZtc2ZMV2NvaW9rYVpxVnV3NU4rbi92YTRmUnRWaFl5?= =?utf-8?B?TDhLbTMxU1pZWFN5Rnp6Zz09?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB6502.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VG9UUUU1ejg1SlZRNzNucmRCcDU2aStjSkx1dW4vM2NvM29yUlZya2F3S2oy?= =?utf-8?B?dndGVi8xSzIrWmhuMmtNMzM3b3NoY3EvbzZQZWw4dC9DOU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?B?cUFMN3RrdVQ0c3RQNi9OajBnNTBsT3drRDkrV0QwWWQyMVJlMzlUQ05ENmUz?= =?utf-8?B?aU43bStORTJndnBtOVRVcGVRZjd0Mks3WVhpNmtyOHVZbE5rOE1Fbkc0R21x?= =?utf-8?B?UHFjSTF6aHdHZGRYdVpBN3RDa29aNG1FeTdIblVybUdJMlNQNlZkQkpCTFIx?= =?utf-8?B?aUxMeUk3bjI3TFh1VWtPbWRLWFNKelRQNlhFR28xMzFWMWQ2QVQ3aGZoaEc0?= =?utf-8?B?bHMzVC9GUDZWYjF3Ykhkano1bGVMY2IzaXFsd2tVQ3JORXYrTzJ2VWlLVkdv?= =?utf-8?B?N2c9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 69d77e38-537c-4ca3-efb2-08dd13783fea X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB6502.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2024 08:55:34.7767 (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: YhFyeObbkbNu8MILt8agQXvNjcbSEm8oasXhLcl4pKQ+HGqW0eixMvG2GNTeeGCOavHfEldSA54bJrDI+/knWkLxulg9Kfdn8jD4680pBUc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB8362 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 12/2/2024 6:01 PM, Stephen Hemminger wrote: > On Mon, 2 Dec 2024 15:09:34 +0000 > Anatoly Burakov wrote: > >> + # For kernels < 3.15 when binding devices to a generic driver (i.e. one that doesn't have a PCI >> + # ID table) using new_id, some devices that are not bound to any other driver could be bound >> + # even if no one has asked them to. hence, we check the list of drivers again, and see if some >> + # of the previously-unbound devices were erroneously bound. >> + if not devbind.use_driver_override: > > Why is tool still supporting out of date and no longer supported kernel? The aim was 100% compatibility with the old script, but I agree these parts can be taken out as this kernel is no longer supported. This will definitely make the binding code simpler. > > > >> + choices=[ >> + "baseband", >> + "compress", >> + "crypto", >> + "dma", >> + "event", >> + "mempool", >> + "misc", >> + "net", >> + "regex", >> + "ml", >> + "all", >> + ], > > Would prefer that all the types are in table/list and the help just > references that list. The next time a type is added, only one place > needs to change. It's a bit difficult to have *everything* as one list, as there are multiple places where we use this: 1) initial declarations at the top of the file (which I treat as "ground truth" for what sort of devices devbind aims to recognize) 2) categorization rules (which are inside Devbind class) 3) command line arguments 4) printouts I suppose I can merge 3 and 4, but I don't see a neat way to specify 1) and 2) in a way that we can reuse elsewhere. I'll think on this though, thanks for the suggestion. > > Also, I would not trust the output format of ip route not to change. > If the utility has to parse output of ip command, use json (-j) instead. > > This whole section of code is quite fragile: > >> if devices_type == network_devices: >> # check what is the interface if any for an ssh connection if >> # any to this host, so we can mark it later. >> ssh_if = [] >> route = subprocess.check_output(["ip", "-o", "route"]) >> # filter out all lines for 169.254 routes >> route = "\n".join(filter(lambda ln: not ln.startswith("169.254"), >> route.decode().splitlines())) >> rt_info = route.split() >> for i in range(len(rt_info) - 1): >> if rt_info[i] == "dev": >> ssh_if.append(rt_info[i + 1]) The quoted code is from old devbind code, but I agree that relying on -o output is not ideal, and using -j will be better. I'll fix it in v2. Thanks for your feedback! -- Thanks, Anatoly