From patchwork Tue Sep 5 13:53:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davide Caratti X-Patchwork-Id: 13374480 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 25CFED521 for ; Tue, 5 Sep 2023 13:54:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693922082; 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; bh=UCsqY1cFd3bpNkIV3wmsKCt2TYQUD2F5Vw7p0M6Z/WY=; b=dtGK2Uu0zR5MlQexb80bf2ors1wYbUo5YY9ClVcnAyiZ4lkkx2A5Cx+x2o/gaxzdtzSYse wbqO5281xwyIMdB4t3QizujLgdW5v5W9m+woWI1VPWw1KCqZj5BQPwvUq+fyahCiVFsbKv QFCqSEeWCLV2CnpMBddia5Em70uWhw8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-435-M_ZRaxKxNVSu9L_7ko5g_Q-1; Tue, 05 Sep 2023 09:54:39 -0400 X-MC-Unique: M_ZRaxKxNVSu9L_7ko5g_Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 01DD0928C83; Tue, 5 Sep 2023 13:54:39 +0000 (UTC) Received: from dcaratti.users.ipa.redhat.com (unknown [10.32.181.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E04C4043CCD; Tue, 5 Sep 2023 13:54:38 +0000 (UTC) From: Davide Caratti To: mptcp@lists.linux.dev Cc: pabeni@redhat.com, Matthieu Baerts Subject: [PATCH mptcp-next v3 0/6] mptcp: convert netlink code to use YAML spec Date: Tue, 5 Sep 2023 15:53:05 +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.1 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}] 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 ++++++++++++++++++++ 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 +- 10 files changed, 814 insertions(+), 273 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