Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1149352imm; Fri, 29 Jun 2018 12:16:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd/mVIOi6bKjW7pVcWbk1WiXYYrCihkYfD4Xp7mAYvKiDWhl0Ne1fF1ui6ENL8Yh3F+gjMn X-Received: by 2002:a62:fd0b:: with SMTP id p11-v6mr15761603pfh.52.1530299781693; Fri, 29 Jun 2018 12:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530299781; cv=none; d=google.com; s=arc-20160816; b=rYwW7m9ymtvKVS/0y6Vp5jSPDXFdsBhhGvBjF4BebiKGQtnlPKSiNIfHVeIqp2CvDi OQhJ9auscXwnFKx16xGNtoWpcDlMiQbECP0gWNffZ0Nh3wOdZrxB+NHYd7r4ukJPu4WS l+0tO0g7tYtJKB7+d7kzlFUQINtHsKgA1RfCbDUWQpK/J6qhLdHXL0BI0kstzS61Gg8Q eSy/frIZLZO0Yn+1woy2PNTy78O5EDULESy+Qt4p0mj0Oih5vKCDJj/QJqxRYpetL9Pm IivxQX6Elly4W8taGqMfwY5jbwP1dnKPczqjzAPicrOcQTgOm4q3zb1HBoTeoMo/1tuO 8gdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:organization:from:cc :references:to:subject:arc-authentication-results; bh=21wPbeuVyKLpEWLS4FvU3zfaOBEq5+3osr83EFRNzUs=; b=jZpIoj6JTR4Idu71IPdjCknHh3RG7bU1RB3COSx6jTBaQp+OssCuYMDlq+uJh+a0Em Kw0R/VWFbK89p9mYEvuEiHtgCQxCGu6qzwy9V2zEeKS5lePRSZHgA3SezdKKjBrd1Nii O403LS2FaX04HQeX3J1RcKJ0maQ2DMAEIRYfDkyKl0Jivy2w+yWEQ3xr6hGfd++5Qf9o umGupWWP1QOlHK1eGWkZJZqYcLs8GwVZ0LqRIt7HCGOi2mHd6y6FGYU4P2BcHs4mzyBk BD3Hp2jltjVGa45CnVw+dJbyN+lvcCdmlJzU9/EQdEhqbVPE0Cj9e9jrLR5ozu4EA6Bs swGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t22-v6si9431212plo.263.2018.06.29.12.16.06; Fri, 29 Jun 2018 12:16:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936522AbeF2TBJ (ORCPT + 99 others); Fri, 29 Jun 2018 15:01:09 -0400 Received: from mail2.candelatech.com ([208.74.158.173]:33460 "EHLO mail2.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932377AbeF2TBH (ORCPT ); Fri, 29 Jun 2018 15:01:07 -0400 Received: from [192.168.100.149] (firewall.candelatech.com [50.251.239.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail2.candelatech.com (Postfix) with ESMTPSA id 78D4440A626; Fri, 29 Jun 2018 12:01:04 -0700 (PDT) Subject: Re: [PATCH] cfg80211: use IDA to allocate wiphy indeces To: Brian Norris , Johannes Berg References: <20180621012945.185705-1-briannorris@chromium.org> <1530258140.3481.4.camel@sipsolutions.net> <20180629184847.GA251207@ban.mtv.corp.google.com> Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org From: Ben Greear Organization: Candela Technologies Message-ID: <278cfd54-204b-2ff7-a8d2-575a01151667@candelatech.com> Date: Fri, 29 Jun 2018 12:01:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20180629184847.GA251207@ban.mtv.corp.google.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/29/2018 11:48 AM, Brian Norris wrote: > Hi Johannes, > > On Fri, Jun 29, 2018 at 09:42:20AM +0200, Johannes Berg wrote: >> On Wed, 2018-06-20 at 18:29 -0700, Brian Norris wrote: >>> It's annoying to see the phy index increase arbitrarily, just because a >>> device got removed and re-probed (e.g., during a device reset, or due to >>> probe testing). We can use the in-kernel index allocator for this, >>> instead of just an increasing counter. >> >> I can understand that it's somewhat annoying to people, but it was >> actually done on purpose to avoid userspace talking to the wrong device. > > Hmm, interesting. I'm not dead-set on this patch, so if there are good > reasons to reject it, I won't fret. > >> Imagine you have some userspace process running that has remembered the >> wiphy index to use it to talk to nl80211, and now underneath the device >> goes away and reappears. This process should understand that situation, >> and handle it accordingly, rather than being blind to the reset. > > How is this different from the wlan (netdev) device naming? We allow > 'wlan0' to leave and return under the same name. Isn't the right answer > that user space should be listening for udev and/or netlink events? > > Brian > For what it is worth, we use udev to rename the phyX to wiphyZ devices based on their MAC address, and that seems to work OK. I can't think of any reason why user-space would need the phy index number to increase as modules are loaded/unloaded though. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com