From patchwork Tue Dec 3 09:27:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Stancek X-Patchwork-Id: 13892019 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 E73E81DFD83 for ; Tue, 3 Dec 2024 09:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733218046; cv=none; b=Bu25OX/259P1FqikWf9/G/XPTEoooXUfMrnJSmSH8mPieIg5G5XZou5th0c0eJpBwJ0wXtFfZbQapWlnUrFi3OICJRjihsXBwuiI6Y27GQ58qU/TUb59fP9DcaGAHoKQr2Pyt9oXj+TCOSV+EPWZ/k3OKl+dR5J6QwoqiLGtepw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733218046; c=relaxed/simple; bh=39SHD+VjfNUd7C3Ji7Di7q+42sRYS1L14vIFwRE0JO8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=UWyE0Cjzjb95F9xK1VkDzn/J4JWk4rRcmcoZV1L693I1Rk/3ovfW0Iz8L3goQi5lvkOE8lQeYrNQpjk6+wuRByVj4h6z4Kad+UXnCMFHbU3x2ms+ePb5rUPFF8arFtA/aUNuKGkKizNbLJZIF2OfLJ3Gyborh7WU7pbB/dNlats= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=dw+I8Mrs; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dw+I8Mrs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733218044; 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=IJrry1UVSeQzVul0wdv32bJIy87aa7w5dz7DAhlFvV4=; b=dw+I8MrsSLLQ79c9MKyNc3a2shrHK3unsMauIXTDfWZ804yggs7STR7GS1LCxN8Q29X2Cg Bisau+EGMgTK80MpDwKRZn02hF1hzdBRvPL/o5ukhwo1I55Y8KxCtA6dPt2A9mSujFykP7 /LFZvOOh5DanseG50w/VlU0fIYadFxU= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-437-XP3M99xYMtih2sajAbQf1g-1; Tue, 03 Dec 2024 04:27:22 -0500 X-MC-Unique: XP3M99xYMtih2sajAbQf1g-1 X-Mimecast-MFC-AGG-ID: XP3M99xYMtih2sajAbQf1g Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EB5861944B38; Tue, 3 Dec 2024 09:27:20 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.45.224.51]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4C8411956052; Tue, 3 Dec 2024 09:27:15 +0000 (UTC) From: Jan Stancek To: donald.hunter@gmail.com, kuba@kernel.org Cc: pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jstancek@redhat.com Subject: [PATCH 1/5] tools: ynl: move python code to separate sub-directory Date: Tue, 3 Dec 2024 10:27:00 +0100 Message-ID: <20b2bdfe94fed5b9694e22c79c79858502f5e014.1733216767.git.jstancek@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Move python code to a separate directory so it can be packaged as a python module. Signed-off-by: Jan Stancek --- tools/net/ynl/Makefile | 1 + tools/net/ynl/generated/Makefile | 2 +- tools/net/ynl/lib/.gitignore | 1 - tools/net/ynl/lib/Makefile | 1 - tools/net/ynl/pyynl/__init__.py | 0 tools/net/ynl/{ => pyynl}/cli.py | 0 tools/net/ynl/{ => pyynl}/ethtool.py | 0 tools/net/ynl/pyynl/lib/.gitignore | 1 + tools/net/ynl/{ => pyynl}/lib/__init__.py | 0 tools/net/ynl/{ => pyynl}/lib/nlspec.py | 0 tools/net/ynl/{ => pyynl}/lib/ynl.py | 0 tools/net/ynl/{ => pyynl}/ynl-gen-c.py | 0 tools/net/ynl/{ => pyynl}/ynl-gen-rst.py | 0 tools/net/ynl/ynl-regen.sh | 2 +- 14 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 tools/net/ynl/pyynl/__init__.py rename tools/net/ynl/{ => pyynl}/cli.py (100%) rename tools/net/ynl/{ => pyynl}/ethtool.py (100%) create mode 100644 tools/net/ynl/pyynl/lib/.gitignore rename tools/net/ynl/{ => pyynl}/lib/__init__.py (100%) rename tools/net/ynl/{ => pyynl}/lib/nlspec.py (100%) rename tools/net/ynl/{ => pyynl}/lib/ynl.py (100%) rename tools/net/ynl/{ => pyynl}/ynl-gen-c.py (100%) rename tools/net/ynl/{ => pyynl}/ynl-gen-rst.py (100%) diff --git a/tools/net/ynl/Makefile b/tools/net/ynl/Makefile index d1cdf2a8f826..617b405d9ef8 100644 --- a/tools/net/ynl/Makefile +++ b/tools/net/ynl/Makefile @@ -21,5 +21,6 @@ clean distclean: fi \ done rm -f libynl.a + rm -rf pyynl/lib/__pycache__ .PHONY: all clean distclean $(SUBDIRS) diff --git a/tools/net/ynl/generated/Makefile b/tools/net/ynl/generated/Makefile index 7db5240de58a..36519ea2792a 100644 --- a/tools/net/ynl/generated/Makefile +++ b/tools/net/ynl/generated/Makefile @@ -12,7 +12,7 @@ include ../Makefile.deps YNL_GEN_ARG_ethtool:=--user-header linux/ethtool_netlink.h \ --exclude-op stats-get -TOOL:=../ynl-gen-c.py +TOOL:=../pyynl/ynl-gen-c.py GENS_PATHS=$(shell grep -nrI --files-without-match \ 'protocol: netlink' \ diff --git a/tools/net/ynl/lib/.gitignore b/tools/net/ynl/lib/.gitignore index 296c4035dbf2..a4383358ec72 100644 --- a/tools/net/ynl/lib/.gitignore +++ b/tools/net/ynl/lib/.gitignore @@ -1,2 +1 @@ -__pycache__/ *.d diff --git a/tools/net/ynl/lib/Makefile b/tools/net/ynl/lib/Makefile index 94c49cca3dca..4b2b98704ff9 100644 --- a/tools/net/ynl/lib/Makefile +++ b/tools/net/ynl/lib/Makefile @@ -19,7 +19,6 @@ ynl.a: $(OBJS) clean: rm -f *.o *.d *~ - rm -rf __pycache__ distclean: clean rm -f *.a diff --git a/tools/net/ynl/pyynl/__init__.py b/tools/net/ynl/pyynl/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tools/net/ynl/cli.py b/tools/net/ynl/pyynl/cli.py similarity index 100% rename from tools/net/ynl/cli.py rename to tools/net/ynl/pyynl/cli.py diff --git a/tools/net/ynl/ethtool.py b/tools/net/ynl/pyynl/ethtool.py similarity index 100% rename from tools/net/ynl/ethtool.py rename to tools/net/ynl/pyynl/ethtool.py diff --git a/tools/net/ynl/pyynl/lib/.gitignore b/tools/net/ynl/pyynl/lib/.gitignore new file mode 100644 index 000000000000..c18dd8d83cee --- /dev/null +++ b/tools/net/ynl/pyynl/lib/.gitignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/tools/net/ynl/lib/__init__.py b/tools/net/ynl/pyynl/lib/__init__.py similarity index 100% rename from tools/net/ynl/lib/__init__.py rename to tools/net/ynl/pyynl/lib/__init__.py diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/pyynl/lib/nlspec.py similarity index 100% rename from tools/net/ynl/lib/nlspec.py rename to tools/net/ynl/pyynl/lib/nlspec.py diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py similarity index 100% rename from tools/net/ynl/lib/ynl.py rename to tools/net/ynl/pyynl/lib/ynl.py diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/pyynl/ynl-gen-c.py similarity index 100% rename from tools/net/ynl/ynl-gen-c.py rename to tools/net/ynl/pyynl/ynl-gen-c.py diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/pyynl/ynl-gen-rst.py similarity index 100% rename from tools/net/ynl/ynl-gen-rst.py rename to tools/net/ynl/pyynl/ynl-gen-rst.py diff --git a/tools/net/ynl/ynl-regen.sh b/tools/net/ynl/ynl-regen.sh index a37304dcc88e..3212dab1cc6e 100755 --- a/tools/net/ynl/ynl-regen.sh +++ b/tools/net/ynl/ynl-regen.sh @@ -1,7 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -TOOL=$(dirname $(realpath $0))/ynl-gen-c.py +TOOL=$(dirname $(realpath $0))/pyynl/ynl-gen-c.py force= search= From patchwork Tue Dec 3 09:27:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Stancek X-Patchwork-Id: 13892020 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 ED79C1DFE0D for ; Tue, 3 Dec 2024 09:27:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733218051; cv=none; b=t1iC5nNBxqL2JsNwTaH0H1/F8lcR6nS5arHVbvlmNXsMcIWhm8dsijR+HxdJ2jjIf0IWSZ6qhd7n8wOfV0V4PpBMdtA0EHjcBqzE1upILZqp6pBhdNlq7xy1SDD6IpOlPBhAIVEZRCTiZeqS+WvC9gXX8iVpN7fogRY2T3sUgVk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733218051; c=relaxed/simple; bh=WBYA0qsg8BBcxyRwDzyxnfN8T65ufKtAFdlewzdEWb4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=L7WUKEox04SaZmAWw3sm4/IgizNBzBAFSWDykduBbN2g0sXc3VtbKk1LDaSdUCMQrIIfh9OjNEME267oB58Cz9qaLpPSm9/hktALn3hB2ZkUoWtWZ2f9BbUHq6qqBZk2mYz0IxRG/V+czt+NN9q5JFWjuftNx4U7vm2iAm4zSyg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=gy+bFev7; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gy+bFev7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733218048; 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=1p3ps2XMMc8k3RPA96MAQqh9azEdDuQn6tnN7ml4mUc=; b=gy+bFev7MSMFXSLnGqwHBgCvG7IfsfvhYSjEh44IQG7u8VQVkh0nBeIbfmX9Lb9GQHBmTz 2C9RqpURTYfAK9vx/OpCWuMSYp7W37bCHkOX0VyFE6XPHrBBn/JELdS/WMtY8vST/0cFb2 iZ/pQeOfCJ0T/EJvFM4cyoI6hsXNQQg= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-454-vmZ2vor3OnOc9XkV77THrg-1; Tue, 03 Dec 2024 04:27:25 -0500 X-MC-Unique: vmZ2vor3OnOc9XkV77THrg-1 X-Mimecast-MFC-AGG-ID: vmZ2vor3OnOc9XkV77THrg Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7FAF01955EA7; Tue, 3 Dec 2024 09:27:24 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.45.224.51]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 712B71956052; Tue, 3 Dec 2024 09:27:21 +0000 (UTC) From: Jan Stancek To: donald.hunter@gmail.com, kuba@kernel.org Cc: pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jstancek@redhat.com Subject: [PATCH 2/5] tools: ynl: rename ynl-gen-[c|rst] to ynl_gen_[c|rst] Date: Tue, 3 Dec 2024 10:27:01 +0100 Message-ID: <399b6bfbe90b4b8ce10e38ce8c7cf1f52ecac627.1733216767.git.jstancek@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Don't use dashes as these prevent easy imports for entrypoints. Signed-off-by: Jan Stancek --- tools/net/ynl/generated/Makefile | 2 +- tools/net/ynl/pyynl/{ynl-gen-c.py => ynl_gen_c.py} | 0 tools/net/ynl/pyynl/{ynl-gen-rst.py => ynl_gen_rst.py} | 0 tools/net/ynl/ynl-regen.sh | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename tools/net/ynl/pyynl/{ynl-gen-c.py => ynl_gen_c.py} (100%) rename tools/net/ynl/pyynl/{ynl-gen-rst.py => ynl_gen_rst.py} (100%) diff --git a/tools/net/ynl/generated/Makefile b/tools/net/ynl/generated/Makefile index 36519ea2792a..00af721b1571 100644 --- a/tools/net/ynl/generated/Makefile +++ b/tools/net/ynl/generated/Makefile @@ -12,7 +12,7 @@ include ../Makefile.deps YNL_GEN_ARG_ethtool:=--user-header linux/ethtool_netlink.h \ --exclude-op stats-get -TOOL:=../pyynl/ynl-gen-c.py +TOOL:=../pyynl/ynl_gen_c.py GENS_PATHS=$(shell grep -nrI --files-without-match \ 'protocol: netlink' \ diff --git a/tools/net/ynl/pyynl/ynl-gen-c.py b/tools/net/ynl/pyynl/ynl_gen_c.py similarity index 100% rename from tools/net/ynl/pyynl/ynl-gen-c.py rename to tools/net/ynl/pyynl/ynl_gen_c.py diff --git a/tools/net/ynl/pyynl/ynl-gen-rst.py b/tools/net/ynl/pyynl/ynl_gen_rst.py similarity index 100% rename from tools/net/ynl/pyynl/ynl-gen-rst.py rename to tools/net/ynl/pyynl/ynl_gen_rst.py diff --git a/tools/net/ynl/ynl-regen.sh b/tools/net/ynl/ynl-regen.sh index 3212dab1cc6e..81b4ecd89100 100755 --- a/tools/net/ynl/ynl-regen.sh +++ b/tools/net/ynl/ynl-regen.sh @@ -1,7 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -TOOL=$(dirname $(realpath $0))/pyynl/ynl-gen-c.py +TOOL=$(dirname $(realpath $0))/pyynl/ynl_gen_c.py force= search= From patchwork Tue Dec 3 09:27:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Stancek X-Patchwork-Id: 13892021 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 322011DF72C for ; Tue, 3 Dec 2024 09:27:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733218055; cv=none; b=D3NDPOuAwAmPzbZ+k7BRC5qAkopp2H1J0+1oTAliLxkhdtf12+pRyuKib7llFfh8uq8IO+3XZYDX0Xqkz1owI+7/yT6woAHmVP7/3bEcL3/iMHP9cI/CXvDMHV1m4CbLv2w0uyb1FIk4D7zvFgPJFSaCjivYHOYviFrl9jphcBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733218055; c=relaxed/simple; bh=q1aC8FipRxk5/ELsDousM9EAhvQgS6rDXwqI8l+rB/0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=KPnT2X14QpR3URtfTby5Vo7Zx8JAfhXLnSwfFZMNdz0a7eM7rpoto0Uud26WTEbwacAAvlizGzvM9S2s+R4K2VpeirpD4J4Y2ztm2+/8wHZCUJhewMfMetvZpCKupx3OU0IZStidZWVT73XhLLUBFMKu5HRSzYy9KjoJ0aQm2TE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=EivmwcoZ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EivmwcoZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733218053; 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=UAWrhRTAmjG9tfueAyBFJRTAuQHFdszPKgmlhu4/3z8=; b=EivmwcoZ4sqqnfUMw3WEnSK2wX4LMoR+HZHbNrVwyAsO33zD5e5VOcITvkdIF/HegKnFFB FAub6wkwDy/6nMBkryJdNwBOm0boXND0tU5jnHL/0043RmZtW2B3tCprU3qEWQoyQmcxWS z8AS1Kw2k38nNsxT2SXnB718jyBwih8= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-292-oDIRuECFPhGJt_5VzMyp-A-1; Tue, 03 Dec 2024 04:27:29 -0500 X-MC-Unique: oDIRuECFPhGJt_5VzMyp-A-1 X-Mimecast-MFC-AGG-ID: oDIRuECFPhGJt_5VzMyp-A Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F388F19560B3; Tue, 3 Dec 2024 09:27:27 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.45.224.51]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 00C901956052; Tue, 3 Dec 2024 09:27:24 +0000 (UTC) From: Jan Stancek To: donald.hunter@gmail.com, kuba@kernel.org Cc: pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jstancek@redhat.com Subject: [PATCH 3/5] tools: ynl: add initial pyproject.toml for packaging Date: Tue, 3 Dec 2024 10:27:02 +0100 Message-ID: <3b652cc0da01ed6e9e721a32355566b3b14ebb5a.1733216767.git.jstancek@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 And define entrypoints for cli tools. Signed-off-by: Jan Stancek --- tools/net/ynl/pyproject.toml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tools/net/ynl/pyproject.toml diff --git a/tools/net/ynl/pyproject.toml b/tools/net/ynl/pyproject.toml new file mode 100644 index 000000000000..677ea8f4c185 --- /dev/null +++ b/tools/net/ynl/pyproject.toml @@ -0,0 +1,26 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "pyynl" +authors = [ + {name = "Donald Hunter", email = "donald.hunter@gmail.com"}, + {name = "Jakub Kicinski", email = "kuba@kernel.org"}, +] +description = "yaml netlink (ynl)" +version = "0.0.1" +requires-python = ">=3.9" +dependencies = [ + "pyyaml==6.*", + "jsonschema==4.*" +] + +[tool.setuptools.packages.find] +include = ["pyynl", "pyynl.lib"] + +[project.scripts] +ynl = "pyynl.cli:main" +ynl-ethtool = "pyynl.ethtool:main" +ynl-gen-c = "pyynl.ynl_gen_c:main" +ynl-gen-rst = "pyynl.ynl_gen_rst:main" From patchwork Tue Dec 3 09:27:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Stancek X-Patchwork-Id: 13892022 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 0E5071E0B6F for ; Tue, 3 Dec 2024 09:27:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733218058; cv=none; b=T+QAHC1qHcAESBiMBwLc0uWXpTtNfILppJ4wNA3Th2sXrBAT/+KW597FfafaVdbO0i3+xmgcFAVS6h9WFGKrxxt7ROcEkkm7bwJUsKtXxgKgWlFU97Ez/ChRi7K65YkfBIWgy/zL2HYP+NtzF43Sf8UZbEnw+11uyaUmzkd+HIE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733218058; c=relaxed/simple; bh=bQAv1UxQssB3tMoCrEaPaH8YhrV81zDOO65SEhBhWbg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=eKnoo1z+gp0ZE7MJEU33Zr7/THIx9BLtdiymEB8Ed39cq9S+OvmpOfSa5qE9ZBey6T+8SVQQdR72FbG+xU6h+zU/R1ViXvlMbzv0grLgN2zhFGXcQerWleauT4waZSA/eZltcDH4+cLDpEUAqAZ3R+etxL8rd/Mx/e1+GUU2Y0g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=XpnEbj3O; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XpnEbj3O" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733218056; 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=1CKW1cKzOvQu3PHZh9xUbsjiPM1Bs37pILAwq3THS0w=; b=XpnEbj3Oh55Fsf7PcI7bHtsEJaVv/dWVwoigDbw6lH0ZdOD7b6UbsonJnTYASN7Pl8RxeI byl8t6BmE9nlGuGwChpWfDBZyBxQKreM0bgXLqMsQsSbw+ZBQQ7Paj71wia86xRmxUw3eD Xbojy30o+JF3icK9C0+v0ch1KvuV660= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-400-tEqySOjNO7eq6scrrNViFQ-1; Tue, 03 Dec 2024 04:27:32 -0500 X-MC-Unique: tEqySOjNO7eq6scrrNViFQ-1 X-Mimecast-MFC-AGG-ID: tEqySOjNO7eq6scrrNViFQ Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5EBE81955F3C; Tue, 3 Dec 2024 09:27:31 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.45.224.51]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7AEAD1956052; Tue, 3 Dec 2024 09:27:28 +0000 (UTC) From: Jan Stancek To: donald.hunter@gmail.com, kuba@kernel.org Cc: pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jstancek@redhat.com Subject: [PATCH 4/5] tools: ynl: add install target for specs and docs Date: Tue, 3 Dec 2024 10:27:03 +0100 Message-ID: In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Generate docs using ynl_gen_rst and add install target for both specs and generates rst files. Signed-off-by: Jan Stancek --- tools/net/ynl/generated/.gitignore | 1 + tools/net/ynl/generated/Makefile | 34 +++++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/tools/net/ynl/generated/.gitignore b/tools/net/ynl/generated/.gitignore index ade488626d26..859a6fb446e1 100644 --- a/tools/net/ynl/generated/.gitignore +++ b/tools/net/ynl/generated/.gitignore @@ -1,2 +1,3 @@ *-user.c *-user.h +*.rst diff --git a/tools/net/ynl/generated/Makefile b/tools/net/ynl/generated/Makefile index 00af721b1571..d28509ac0573 100644 --- a/tools/net/ynl/generated/Makefile +++ b/tools/net/ynl/generated/Makefile @@ -7,12 +7,18 @@ ifeq ("$(DEBUG)","1") CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan endif +INSTALL ?= install +prefix ?= /usr +datarootdir ?= $(prefix)/share +docdir ?= $(datarootdir)/doc + include ../Makefile.deps YNL_GEN_ARG_ethtool:=--user-header linux/ethtool_netlink.h \ --exclude-op stats-get TOOL:=../pyynl/ynl_gen_c.py +TOOL_RST:=../pyynl/ynl_gen_rst.py GENS_PATHS=$(shell grep -nrI --files-without-match \ 'protocol: netlink' \ @@ -22,7 +28,11 @@ SRCS=$(patsubst %,%-user.c,${GENS}) HDRS=$(patsubst %,%-user.h,${GENS}) OBJS=$(patsubst %,%-user.o,${GENS}) -all: protos.a $(HDRS) $(SRCS) $(KHDRS) $(KSRCS) $(UAPI) +SPECS_PATHS=$(wildcard ../../../../Documentation/netlink/specs/*.yaml) +SPECS=$(patsubst ../../../../Documentation/netlink/specs/%.yaml,%,${SPECS_PATHS}) +RSTS=$(patsubst %,%.rst,${SPECS}) + +all: protos.a $(HDRS) $(SRCS) $(KHDRS) $(KSRCS) $(UAPI) $(RSTS) protos.a: $(OBJS) @echo -e "\tAR $@" @@ -40,8 +50,12 @@ protos.a: $(OBJS) @echo -e "\tCC $@" @$(COMPILE.c) $(CFLAGS_$*) -o $@ $< +%.rst: ../../../../Documentation/netlink/specs/%.yaml $(TOOL2) + @echo -e "\tGEN_RST $@" + @$(TOOL_RST) -o $@ -i $< + clean: - rm -f *.o + rm -f *.o *.rst distclean: clean rm -f *.c *.h *.a @@ -49,5 +63,19 @@ distclean: clean regen: @../ynl-regen.sh -.PHONY: all clean distclean regen +install-rsts: + @echo -e "\tINSTALL generated docs" + @$(INSTALL) -d $(DESTDIR)$(docdir)/ynl + @$(INSTALL) -m 0644 $(RSTS) $(DESTDIR)$(docdir)/ynl/ + +install-specs: + @echo -e "\tINSTALL specs" + @$(INSTALL) -d $(DESTDIR)$(datarootdir)/ynl + @$(INSTALL) -m 0644 ../../../../Documentation/netlink/*.yaml $(DESTDIR)$(datarootdir)/ynl/ + @$(INSTALL) -d $(DESTDIR)$(datarootdir)/ynl/specs + @$(INSTALL) -m 0644 ../../../../Documentation/netlink/specs/*.yaml $(DESTDIR)$(datarootdir)/ynl/specs/ + +install: install-rsts install-specs + +.PHONY: all clean distclean regen install .DEFAULT_GOAL: all From patchwork Tue Dec 3 09:27:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Stancek X-Patchwork-Id: 13892023 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 4B6151E0DBE for ; Tue, 3 Dec 2024 09:27:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733218064; cv=none; b=Mhb5sUeOyHDlR65yO9KzA/1YTNnE3tOTyT1cHfCbvUJ+vv+VlFnKubRKSItZszkG+IYozSygWGu9MVWpG5wXPCJUs+FddOCg8vwJIDkbrkzH6LsYdpUJUunU0tAV2GmrfUhQ5hbLNyhW9H4YdZgAtk5myME0X1JnwXXWxLf+T9A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733218064; c=relaxed/simple; bh=LtoeILdsYxQuEuNm5Sq9+1S03A8uKng5c7MwWdMzhJ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-type; b=r8dtwIEAUM4fpMDCMa3ji9Ftcsmtv3Zj2UrWQ949N54dDL9Qae8jTyH46wNKDeTJ0tmPkrOq7TD4iI5VW1lp79xc73MSjNapyxaY85Ek/6nMw2MJaJxM19Srw4tZJRolusWk7FmTr0uvlvsQuStpNImofj5lLVopabrnLhFhPX8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=L8XOWWap; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="L8XOWWap" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733218062; 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=OcfOiDWwi48053cjduhTjVXfsTwP0dn8jUXizpYq9Dc=; b=L8XOWWapO/tBPdECzHQ2Wku+6qPMBzg39dQFX9+cuGk5r08Dgn5cDfHAvWKkOFj0Zx0cQz um01MjXZ6xWsI1zJ1Hx+p7chfdyDvspxZMd0UDHMwFY2BJJ7eiU+merjEVOMAuY9E6ppbX txdE0Nrl3JWmu7ywiX2S1H0NyitM5ww= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-398-hnN35gWDPA6MpsCjWM_Cbg-1; Tue, 03 Dec 2024 04:27:36 -0500 X-MC-Unique: hnN35gWDPA6MpsCjWM_Cbg-1 X-Mimecast-MFC-AGG-ID: hnN35gWDPA6MpsCjWM_Cbg Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D1AD01945CB2; Tue, 3 Dec 2024 09:27:34 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.45.224.51]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DC9E81956052; Tue, 3 Dec 2024 09:27:31 +0000 (UTC) From: Jan Stancek To: donald.hunter@gmail.com, kuba@kernel.org Cc: pabeni@redhat.com, davem@davemloft.net, edumazet@google.com, horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jstancek@redhat.com Subject: [PATCH 5/5] tools: ynl: add main install target Date: Tue, 3 Dec 2024 10:27:04 +0100 Message-ID: In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 This will install C library, specs, rsts and pyynl. The initial structure is: $ mkdir /tmp/myroot $ make DESTDIR=/tmp/myroot install /usr /usr/lib64 /usr/lib64/libynl.a /usr/lib/python3.XX/site-packages/pyynl/* /usr/lib/python3.XX/site-packages/pyynl-0.0.1.dist-info/* /usr/bin /usr/bin/ynl /usr/bin/ynl-ethtool /usr/bin/ynl-gen-c /usr/bin/ynl-gen-rst /usr/share /usr/share/doc /usr/share/doc/ynl /usr/share/doc/ynl/*.rst /usr/share/ynl /usr/share/ynl/genetlink-c.yaml /usr/share/ynl/genetlink-legacy.yaml /usr/share/ynl/genetlink.yaml /usr/share/ynl/netlink-raw.yaml /usr/share/ynl/specs /usr/share/ynl/specs/devlink.yaml /usr/share/ynl/specs/dpll.yaml /usr/share/ynl/specs/ethtool.yaml /usr/share/ynl/specs/fou.yaml /usr/share/ynl/specs/handshake.yaml /usr/share/ynl/specs/mptcp_pm.yaml /usr/share/ynl/specs/netdev.yaml /usr/share/ynl/specs/net_shaper.yaml /usr/share/ynl/specs/nfsd.yaml /usr/share/ynl/specs/nftables.yaml /usr/share/ynl/specs/nlctrl.yaml /usr/share/ynl/specs/ovs_datapath.yaml /usr/share/ynl/specs/ovs_flow.yaml /usr/share/ynl/specs/ovs_vport.yaml /usr/share/ynl/specs/rt_addr.yaml /usr/share/ynl/specs/rt_link.yaml /usr/share/ynl/specs/rt_neigh.yaml /usr/share/ynl/specs/rt_route.yaml /usr/share/ynl/specs/rt_rule.yaml /usr/share/ynl/specs/tcp_metrics.yaml /usr/share/ynl/specs/tc.yaml /usr/share/ynl/specs/team.yaml Signed-off-by: Jan Stancek --- tools/net/ynl/Makefile | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tools/net/ynl/Makefile b/tools/net/ynl/Makefile index 617b405d9ef8..e18a7f68cf5c 100644 --- a/tools/net/ynl/Makefile +++ b/tools/net/ynl/Makefile @@ -1,5 +1,16 @@ # SPDX-License-Identifier: GPL-2.0 +include ../../scripts/Makefile.arch + +INSTALL ?= install +prefix ?= /usr +ifeq ($(LP64), 1) + libdir_relative = lib64 +else + libdir_relative = lib +endif +libdir ?= $(prefix)/$(libdir_relative) + SUBDIRS = lib generated samples all: $(SUBDIRS) libynl.a @@ -22,5 +33,15 @@ clean distclean: done rm -f libynl.a rm -rf pyynl/lib/__pycache__ + rm -rf pyynl.egg-info + rm -rf build + +install: libynl.a + @echo -e "\tINSTALL libynl.a" + @$(INSTALL) -d $(DESTDIR)$(libdir) + @$(INSTALL) -m 0644 libynl.a $(DESTDIR)$(libdir)/libynl.a + @echo -e "\tINSTALL pyynl" + @pip install --prefix=$(DESTDIR)$(prefix) . + @make -C generated install -.PHONY: all clean distclean $(SUBDIRS) +.PHONY: all clean distclean install $(SUBDIRS)