From patchwork Fri Sep 1 18:10:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davide Caratti X-Patchwork-Id: 13372834 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 C42F3BA2D for ; Fri, 1 Sep 2023 18:10:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693591840; 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=hiHVZn9TzgrrP6XoIa/4d6trKXOSgUiOw30Wwf4AyOY=; b=Le2bpnwFPmxWuS7xEpYJ1k6XTcTlqiXkx6+Usoj11HyaybhHv0Y8rD4/+NltzODpgme9Jt CM4BsXQRMtqWRvfNeYWRTc21tv/ew9YTUkGASY1Xlqe2vnYaWfxkVQ2BhpzAw0WZ59SXKh SlLomIulUI1Etkc0rTxQ6C5GX/IU7Xo= 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-56-HM341J2rMBiOpOJFET9bUg-1; Fri, 01 Sep 2023 14:10:39 -0400 X-MC-Unique: HM341J2rMBiOpOJFET9bUg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DA1E01817905; Fri, 1 Sep 2023 18:10:38 +0000 (UTC) Received: from dcaratti.users.ipa.redhat.com (unknown [10.45.225.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12189D47819; Fri, 1 Sep 2023 18:10:37 +0000 (UTC) From: Davide Caratti To: mptcp@lists.linux.dev Cc: pabeni@redhat.com, Matthieu Baerts Subject: [PATCH mptcp-next v2 0/6] convert MPTCP to use YAML spec Date: Fri, 1 Sep 2023 20:10:29 +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.8 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}] 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 mptcp: convert netlink from small_ops to ops Documentation: netlink: add a YAML spec for mptcp mptcp: uapi: 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