From owner-freebsd-net@FreeBSD.ORG Mon Oct 6 11:31:20 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88732B59; Mon, 6 Oct 2014 11:31:20 +0000 (UTC) Received: from nbfkord-smmo04.seg.att.com (nbfkord-smmo04.seg.att.com [209.65.160.86]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25951B7F; Mon, 6 Oct 2014 11:31:19 +0000 (UTC) Received: from unknown [12.187.104.25] (EHLO webmail.solarflare.com) by nbfkord-smmo04.seg.att.com(mxl_mta-7.2.2-0) with ESMTP id 88d72345.2b221ac7d940.1390574.00-2472.3550500.nbfkord-smmo04.seg.att.com (envelope-from ); Mon, 06 Oct 2014 11:31:20 +0000 (UTC) X-MXL-Hash: 54327d88159f6782-1f601796ccc619fa39a348cc8d8c0ee2fef6268f Received: from unknown [12.187.104.25] (EHLO webmail.solarflare.com) by nbfkord-smmo04.seg.att.com(mxl_mta-7.2.2-0) over TLS secured channel with ESMTP id 08d72345.0.1390568.00-2324.3550477.nbfkord-smmo04.seg.att.com (envelope-from ); Mon, 06 Oct 2014 11:31:18 +0000 (UTC) X-MXL-Hash: 54327d86511cbff2-652b70ef941a2838a1bcad4471d8d09d273d52e9 Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex02.SolarFlarecom.com (10.20.40.31) with Microsoft SMTP Server (TLS) id 14.3.158.1; Mon, 6 Oct 2014 04:30:33 -0700 Received: from [192.168.38.17] (84.52.89.52) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.847.32; Mon, 6 Oct 2014 04:30:50 -0700 Message-ID: <54327D5D.6010904@solarflare.com> Date: Mon, 6 Oct 2014 15:30:37 +0400 From: Andrew Rybchenko User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: John Baldwin , Subject: Re: Choice of private ioctl approach References: <54295246.6010502@solarflare.com> <201409301131.31309.jhb@freebsd.org> In-Reply-To: <201409301131.31309.jhb@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [84.52.89.52] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ocex03.SolarFlarecom.com (10.20.40.36) X-TM-AS-Product-Ver: SMEX-10.0.0.1412-7.000.1014-20998.005 X-TM-AS-Result: No--14.978200-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-AnalysisOut: [v=2.0 cv=CYa/EsXl c=1 sm=1 a=MkjXnYnS3dyNWGSWLXxFFQ==:17 a] X-AnalysisOut: [=Ozv50jBIw7UA:10 a=4oxowH2qkH0A:10 a=RB3BGLmKESwA:10 a=BLc] X-AnalysisOut: [eEmwcHowA:10 a=8nJEP1OIZ-IA:10 a=zRKbQ67AAAAA:8 a=P3e8OJEo] X-AnalysisOut: [HGnXFEymnLsA:9 a=wPNLvfGTeEIA:10] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2014051901)] X-MAIL-FROM: X-SOURCE-IP: [12.187.104.25] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Oct 2014 11:31:20 -0000 Hello John, On 09/30/2014 07:31 PM, John Baldwin wrote: > On Monday, September 29, 2014 8:36:22 am Andrew Rybchenko wrote: >> Hello, >> >> we need to add private ioctl to the driver sfxge(4) to make FW update, >> do internal diagnostics commands etc. >> We see at least two approaches in other drivers: >> 1. SIOCGPRIVATE_0/ SIOCGPRIVATE_1 on net device >> 2. dedicated char device with its own ioctl's >> >> Is there any recommendations on which way is preferred? > I would be inclined towards 2). It is more flexible if you need to add m= ore > custom ioctls in the future. Thanks a lot for your reply. It looks like there are no any strong opinions on the topic. The problem with 2) is that it adds one more entity and we'd like to avoid it. We need more than one request semantically, so we'll have multiplexing by internal opcode inside SIOCGPRIVATE_0. I think it is flexible enough. Best regards, Andrew. The information contained in this message is confidential and is intended f= or the addressee(s) only. If you have received this message in error, pleas= e notify the sender immediately and delete the message. Unless you are an a= ddressee (or authorized to receive for an addressee), you may not use, copy= or disclose to anyone this message or any information contained in this me= ssage. The unauthorized use, disclosure, copying or alteration of this mess= age is strictly prohibited.