From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3431460921582027958==" MIME-Version: 1.0 From: Paolo Abeni To: mptcp at lists.01.org Subject: [MPTCP] Re: sock diag uAPI and MPTCP Date: Mon, 22 Jun 2020 12:18:52 +0200 Message-ID: <07e0f81138421beee347c362dce61f78dd8bf00c.camel@redhat.com> In-Reply-To: 20200620.174408.1728600398443363480.davem@davemloft.net X-Status: X-Keywords: X-UID: 4761 --===============3431460921582027958== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Sat, 2020-06-20 at 17:44 -0700, David Miller wrote: > From: Paolo Abeni > Date: Fri, 19 Jun 2020 12:54:40 +0200 > = > > IPPROTO_MPTCP value (0x106) can't be represented using the current sock > > diag uAPI, as the 'sdiag_protocol' field is 8 bits wide. > > = > > To implement diag support for MPTCP socket, we will likely need a > > 'inet_diag_req_v3' with a wider 'sdiag_protocol' > > field. inet_diag_handler_cmd() could detect the version of > > the inet_diag_req_v* provided by user-space checking nlmsg_len() and > > convert _v2 reqs to _v3. > > = > > This change will be a bit invasive, as all in kernel diag users will > > then operate only on 'inet_diag_req_v3' (many functions' signature > > change required), but the code-related changes will be encapsulated > > by inet_diag_handler_cmd(). > = > Another way to extend the size of a field is to add an attribute which > supercedes the header structure field when present. > = > We did this when we needed to make the fib rule table ID number larger, > see FRA_TABLE. > = > You'd only need to specify this when using protocol values larger than > 8 bits in size. Thank you very much for the directions! This looks like a better, more encapsulated solution. I'll try to give it a shot. Thanks! Paolo --===============3431460921582027958==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85579C433E0 for ; Mon, 22 Jun 2020 10:19:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A5BD20675 for ; Mon, 22 Jun 2020 10:19:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="g/mgi4fv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727047AbgFVKTB (ORCPT ); Mon, 22 Jun 2020 06:19:01 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:35660 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726853AbgFVKTB (ORCPT ); Mon, 22 Jun 2020 06:19:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592821139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hhx2/dKVX3sYoJHRc0UNtjJeMWtsunceOpFQydeky9g=; b=g/mgi4fvYjI6CEJCq/65btmwKrJXsL3hQF9Zpi/aRu8N71SHE2ozPitmB2/fkc4MFpJxTN WvIMofzwPqpWLfj1yVuw9H6X+HR6su0IvWE+PgMvT52C6eLRUZrpSKCTgGimfi2VsSe/LK PFVZSKcAeExSV+O8dzIlxJYKVBD4Hqk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-221-yxXM4gCnN6qrPx4XoFPRTA-1; Mon, 22 Jun 2020 06:18:55 -0400 X-MC-Unique: yxXM4gCnN6qrPx4XoFPRTA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D1C4718A8221; Mon, 22 Jun 2020 10:18:54 +0000 (UTC) Received: from ovpn-113-146.ams2.redhat.com (ovpn-113-146.ams2.redhat.com [10.36.113.146]) by smtp.corp.redhat.com (Postfix) with ESMTP id 982167166E; Mon, 22 Jun 2020 10:18:53 +0000 (UTC) Message-ID: <07e0f81138421beee347c362dce61f78dd8bf00c.camel@redhat.com> Subject: Re: sock diag uAPI and MPTCP From: Paolo Abeni To: David Miller Cc: eric.dumazet@gmail.com, netdev@vger.kernel.org, mptcp@lists.01.org Date: Mon, 22 Jun 2020 12:18:52 +0200 In-Reply-To: <20200620.174408.1728600398443363480.davem@davemloft.net> References: <20200620.174408.1728600398443363480.davem@davemloft.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.3 (3.36.3-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, 2020-06-20 at 17:44 -0700, David Miller wrote: > From: Paolo Abeni > Date: Fri, 19 Jun 2020 12:54:40 +0200 > > > IPPROTO_MPTCP value (0x106) can't be represented using the current sock > > diag uAPI, as the 'sdiag_protocol' field is 8 bits wide. > > > > To implement diag support for MPTCP socket, we will likely need a > > 'inet_diag_req_v3' with a wider 'sdiag_protocol' > > field. inet_diag_handler_cmd() could detect the version of > > the inet_diag_req_v* provided by user-space checking nlmsg_len() and > > convert _v2 reqs to _v3. > > > > This change will be a bit invasive, as all in kernel diag users will > > then operate only on 'inet_diag_req_v3' (many functions' signature > > change required), but the code-related changes will be encapsulated > > by inet_diag_handler_cmd(). > > Another way to extend the size of a field is to add an attribute which > supercedes the header structure field when present. > > We did this when we needed to make the fib rule table ID number larger, > see FRA_TABLE. > > You'd only need to specify this when using protocol values larger than > 8 bits in size. Thank you very much for the directions! This looks like a better, more encapsulated solution. I'll try to give it a shot. Thanks! Paolo