Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755448AbbLQABx (ORCPT ); Wed, 16 Dec 2015 19:01:53 -0500 Received: from seldsegrel01.sonyericsson.com ([37.139.156.29]:12360 "EHLO SELDSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751370AbbLQABv (ORCPT ); Wed, 16 Dec 2015 19:01:51 -0500 Date: Wed, 16 Dec 2015 16:01:41 -0800 From: Courtney Cavin To: David Miller CC: "Andersson, Bj?rn" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "netdev@vger.kernel.org" , "srinivas.kandagatla@linaro.org" , "linux-arm-msm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] net: add Qualcomm IPC router Message-ID: <20151217000141.GG28026@sonymobile.com> References: <1449866519-14551-1-git-send-email-bjorn.andersson@sonymobile.com> <20151215.160114.1178824607335349574.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20151215.160114.1178824607335349574.davem@davemloft.net> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1683 Lines: 42 On Tue, Dec 15, 2015 at 10:01:14PM +0100, David Miller wrote: > From: Bjorn Andersson > Date: Fri, 11 Dec 2015 12:41:59 -0800 > > > +static unsigned int qrtr_local_nid = 1; > > +module_param_named(node_id, qrtr_local_nid, uint, S_IRUGO); > > +MODULE_PARM_DESC(idVendor, "Local Node Identifier"); > > Module parameters suck. > > Allow the user to choose this dynamically. You have roughtly two choices. > > 1) Subvert the 'protocol' field passed to ->create() and use that, it is > being ignored otherwise. > > 2) Put it into the socket address for bind(). So each socket can have its own node id? That doesn't seem right. The way these node ids are assigned is by a system designer (in this case Qualcomm). The ARM, Linux CPU is always node 1, the audio DSP is always node 5, etc. Anyone with the knowhow could reassign these numbers, but there's no reason to have them be dynamic during runtime. Additionally, allowing dynamic assignment would require code to prevent id duplication for known remote nodes, as well as to deal with cases in which remote node discovery happens after local sockets have acquired that node's id. Maybe the first socket created needs CAP_NET_ADMIN, and uses the 'protocol' field to set the node id? Ugh. Gross. We could hardcode the value in kconfig, but that seems like a worse solution than a module parameter. I'm open to further suggestions. -Courtney -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/