From patchwork Wed Sep 20 09:24:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davide Caratti X-Patchwork-Id: 13392396 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CC3D11728 for ; Wed, 20 Sep 2023 09:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695201903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bQ4dKklZXkhQ6zzQox9SgOXtm5ZA73yrK18cKMrMAic=; b=T4CEYC9e1QMYOX/xRaeCBiLYV1tpjXCqocHaqrRtXFKYot5N575KZrCnyncCYujjw8m2sP Snod0oBHxCo74ANxt8BUZ2bUp2wTRhy7K8WGWbLy3WrNLoyD5v/TWxXsLZYcyv4xu9rJTC OfYEU/P9Wrv0nxFDJXP2e6WbbIN98lU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-414-HuvnWpgsOwq0KV0l2ribtw-1; Wed, 20 Sep 2023 05:25:01 -0400 X-MC-Unique: HuvnWpgsOwq0KV0l2ribtw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 304C91C09A4E for ; Wed, 20 Sep 2023 09:24:46 +0000 (UTC) Received: from dcaratti.users.ipa.redhat.com (unknown [10.45.226.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CCF040C6EC1 for ; Wed, 20 Sep 2023 09:25:01 +0000 (UTC) From: Davide Caratti To: mptcp@lists.linux.dev Subject: [PATCH mptcp-next v4 0/6] mptcp: convert netlink code to use YAML spec Date: Wed, 20 Sep 2023 11:24:43 +0200 Message-ID: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com this series converts most of the MPTCP netlink interface (plus uAPI bits) to use sources generated by a YAML spec file. Patch 2/6 and 6/6 have been individually verified with kselftests. POC: $ sudo ./tools/net/ynl/cli.py --spec \ > Documentation/netlink/specs/mptcp.yaml --do add_addr \ > --json '{"addr": {"addr4": 16909061, "family": 2, "flags": 4, "id": 10, "port": 0}}' $ ip -j mptcp endpoint show id 10 [{"address":"1.2.3.5","id":10,"backup":true}] v4: - removed unwanted whitespaces, update MAINTAINERS (Matthieu Baerts) v3: - add missing 'static' keyword (MPTCP CI) - fix element ordering for 'attr' attributes in patch 2, mptcp spec and generated C code (Paolo Abeni) - removed extra newline, deuglified subjects in patch 2 and 4 v2: - mptcp.yaml: only put values around enum "holes" (Paolo Abeni) - _doit and _dumpit renames are done in a dedicate patch (Paolo Abeni) - removed useless nla_policy passed through parse_entry() (Paolo Abeni) - renamed mptcp_pm_address_nl_policy in patch 2 (Paolo Abeni) - (hopefully) more comprehensible commit messages (Paolo Abeni) Davide Caratti (6): tools: ynl: add uns-admin-perm to genetlink legacy net: mptcp: convert netlink from small_ops to ops Documentation: netlink: add a YAML spec for mptcp uapi: mptcp: use header file generated from YAML spec net: mptcp: rename netlink handlers to mptcp_pm_nl__{doit,dumpit} net: mptcp: use policy generated by YAML spec Documentation/netlink/genetlink-legacy.yaml | 2 +- Documentation/netlink/specs/mptcp.yaml | 394 ++++++++++++++++++++ MAINTAINERS | 3 +- include/uapi/linux/mptcp.h | 174 +-------- include/uapi/linux/mptcp_pm.h | 149 ++++++++ net/mptcp/Makefile | 3 +- net/mptcp/mptcp_pm_gen.c | 179 +++++++++ net/mptcp/mptcp_pm_gen.h | 58 +++ net/mptcp/pm_netlink.c | 114 +----- net/mptcp/pm_userspace.c | 8 +- net/mptcp/protocol.h | 6 +- 11 files changed, 816 insertions(+), 274 deletions(-) create mode 100644 Documentation/netlink/specs/mptcp.yaml create mode 100644 include/uapi/linux/mptcp_pm.h create mode 100644 net/mptcp/mptcp_pm_gen.c create mode 100644 net/mptcp/mptcp_pm_gen.h