From patchwork Sun Nov 30 15:49:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 2170267 X-Patchwork-Delegate: i.maximets@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=hVJigmdj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4dKBM24XW1z1xtx for ; Mon, 1 Dec 2025 02:50:22 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 06AB082277; Sun, 30 Nov 2025 15:50:21 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 7FO85SVYA0UO; Sun, 30 Nov 2025 15:50:19 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org B2C7B812AF Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=hVJigmdj Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id B2C7B812AF; Sun, 30 Nov 2025 15:50:19 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9A38EC063E; Sun, 30 Nov 2025 15:50:19 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2814FC0642 for ; Sun, 30 Nov 2025 15:50:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id AA24940A7A for ; Sun, 30 Nov 2025 15:50:10 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id cHecfM3DdIsp for ; Sun, 30 Nov 2025 15:50:10 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:111:f403:c10d::1; helo=sn4pr2101cu001.outbound.protection.outlook.com; envelope-from=elibr@nvidia.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org D50EF40A5F Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D50EF40A5F Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=hVJigmdj Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazlp170120001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c10d::1]) by smtp4.osuosl.org (Postfix) with ESMTPS id D50EF40A5F for ; Sun, 30 Nov 2025 15:50:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yN2xFoVAXv790vRWErHtAPBhPNOknVQdcEx+Br76xo3RT3Ada/YcGIwkKKpIcDv9JxxCZAqHvTJyy3ed2wXBavmPPtD0/6W6pRqIh//aOhj0OgCfNDsWH9KYp+8yS95V64R1FqpD44JoKdy6lyVtkZrgFA7iTT6a/NzQnUhSIBWGytNqZb/6zarSwoKk/DDTk7vIaeC6/BJRCeyXZC9tZ0qNBMIoarFYruzk301ZDr7jjTFe/Xn+p8j/+W/5C1z5vpWbGG0tuD8zn5S8q5F0ciCXI+c9VAjPFbfHN9VLTCFjPqNXLBVpBCJxNKy54eMY3z8/0ilWY9zhEfFTLJqIZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1Pa0sw872Cn0mQGdClnh1EQNSS3gOF/2uXXoHFtkRcw=; b=Nf+KFppVxhuCBdzhvNDLr64AOtWQZ1mz5k/OznGU+Q2YZmwgPePqHVJThENEqyH/0QXIKZ5tcxTPZr84YIYRDfYzzvhNdCZNcQMNaA0M4o1xwTKCcK1oHTNAcVeWW+MRGVcLRh/gCJsj+zSnJK431Dx4fu5wakXzaZxQDsGrPjAULieOHWkk8g6H/Hj+bnCUGml7TyM9JelcxH4MkxUQLLuOqi10qKMDCaVGIygqI8bEdd6Jegkp3suVF9024k1bcHIeXpplPOHnJhSmYzmWxPDStpvWZhz/lK2WcGmf4ygrb1+/GUG+l+/jTfjo/KDFALp5VEASXhwmD8XC/ds42A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=openvswitch.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1Pa0sw872Cn0mQGdClnh1EQNSS3gOF/2uXXoHFtkRcw=; b=hVJigmdjFdC8+3ItEr2MQTDBJQCb8wH1+QUU3L0N5gZSDb95qoAlCR4Vs2/4juVPim87oI37Hu4UZd3SPizwiLFH+lD3mkhfDlx59r+Y9wgCDDVh8RohRKAE3y0rnKGlOO9nJbHiiGGhcilagkTJC7Z11P+KQtZJJ4LNQnmrWTBYMH+D//v6faoZL74WtetvXY0/FCmR4bdcTHeZN7KGRXHRhMzKXo9EUuaplv56YTKrZ/G9AVsLezGkYtsyMtnr983x+mGfdIYH4AdcqmOYibUqkWKU08KZJXNmqGZeLOXb7HcMEYgiRRy5QmqhM4Wu6S8knsibp0CerTWa/5FFdA== Received: from BN9P221CA0019.NAMP221.PROD.OUTLOOK.COM (2603:10b6:408:10a::34) by SA1PR12MB8094.namprd12.prod.outlook.com (2603:10b6:806:336::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9366.17; Sun, 30 Nov 2025 15:50:05 +0000 Received: from BN2PEPF00004FBA.namprd04.prod.outlook.com (2603:10b6:408:10a:cafe::4f) by BN9P221CA0019.outlook.office365.com (2603:10b6:408:10a::34) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9366.17 via Frontend Transport; Sun, 30 Nov 2025 15:50:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN2PEPF00004FBA.mail.protection.outlook.com (10.167.243.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.8 via Frontend Transport; Sun, 30 Nov 2025 15:50:03 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 30 Nov 2025 07:49:47 -0800 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 30 Nov 2025 07:49:45 -0800 To: Date: Sun, 30 Nov 2025 17:49:19 +0200 Message-ID: <20251130154922.785311-2-elibr@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251130154922.785311-1-elibr@nvidia.com> References: <20251130154922.785311-1-elibr@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF00004FBA:EE_|SA1PR12MB8094:EE_ X-MS-Office365-Filtering-Correlation-Id: 5df97a10-df1a-4a2c-5d3b-08de30282066 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: EYEyf3XKMg48INQmmUstAkw5eF6GNL23Gj9pkN8B7PZ/2Q4bbTAk1jPtzGSXTjfZCrcwhTIzUPBD39zWkXUdNbg9IPQG2yuYQyuTobWGVtd5kqaqNuVvlvU6SJhtUzrGAANnebc3gtgqivXO/P+p0G0/t8hUVA3G/pFFtv8F0MbZB4nCUVOIBW76Umz+OneDtO8Gnw29Ixbw+h3xwK2UjYvyFaXx/3tY0Ws1B+YDmw3OwZRhMnmsTkPEZoVvtTIgO0FN8nFVmgKp0XE2NW1Ejs2H228pnM4aH2IbXgtVAdEW6tZnUTrTli0OOnjJHxT9BTFQDghnnzs9O8V7s+syN2MOEMHJaRzD8qOtR6CXyz2uzmvmZbROQGNPlDB5uAtFZa+4LXYwHIWuIJJhgwbiYFCPArM61ZPtpHc5M7ZVn1Ukt8LZMKeUgPY0uZgQkqKQIk3HIYobixo6Hb66Y2VKlxvIaNmaKQrLelcKATeFdB6Jm9Xq8ZqwJ4Pj4eJqopFsouUl/Je8IDfQ1wKT1mvx90puynEKACLkMFedi2lGtVRhZlJgreY2c2kzBOLC6pZtHdEGcCghaVJfRcmmaVAcl0CQmJdSLyU48D8yzhYjKnGLSt3wyibiwTh9EnntDB69qZLbRxucck2sswrjG6yc08lZOY0uEcJfaCKx1drG/xa0PZK8tc0T8PzrzJWzZHfLqn2SoCCblpBrcpCfSEbvgwH3HLiTD2HdfEEUbepwLWl+9eNu4zJd2/kC4QZRWGadEPUH7wjwFqI6p2KHpscDimAivAoRfjfb+O+58iTeaqAi3pjFSSffrb1PlHhWuLI0H1c0pljDdDaLICAgIvgyTLwqU1wfw159iwWz5yd63w5/Z4eOw+WlxFsaxpBbK6F4oRhgrbfjjjR1Y6VzbEDtyXSt9Na+Z5jPMkV3ZHgjh4O9E9bCYDGWK133541c/jkL6yroQRX7Z239PpT76vZdOz3isRdVCBsJnrUwKsR7qsZ3MTxGwgzrApUnhS9gE+FAed3tHb7xTjCjOUcFmNY8S7U9P8cctVYTWqTsz4WH+qk7EwElNlFgtqLiJyjC02MzDkeXfRY5apMX6N0zcj8+a5uZ/Tj+fHFR5L3PqhnDX/FgbDvuYY3EOmjClJcd9n60mj5cS9HoyQVVsr+Gkw1/5ZhTfOnZvxhqtPE+HvxHyVgbwjHw6Mf7HsCyU4tZmvhqTVRXLOFBb6lPJXKqtluf/petBCgY8c8NLMkVR1WOk6HKpicnqsfkzBICBtooU0mMhtfzRc/qCD7mjrwF/FZPWSxDZYLvarVgEDSClEsT2QLusK8achRc5Q8Nu5CCnYW6c5R930jO6hgIx1YZLarNfBXLeIJn3Na622UXZSu4+Uthuf8+k7BRuSv51ATwsY2vmWpqGmVCmOmZHchF48GJLfrivBfVPedvJGnhY7jPcfsUvBc6S5KNM+5PdIsEkOXbOw6f9F2gJa9T05YX06SOCVpCbZB+XQBd1tz+5OveuCB/JTIPj+oPbdWdP/vcuByBK9grVZLVnDYO/JRtK4HKZu4o1Hr69YkVayu6X1Tnaz4= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2025 15:50:03.1570 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5df97a10-df1a-4a2c-5d3b-08de30282066 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF00004FBA.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8094 Subject: [ovs-dev] [PATCH v1 1/4] vswitch.ovsschema: Add libraries to Open_vSwitch. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Eli Britstein via dev From: Eli Britstein Reply-To: Eli Britstein Cc: Eli Britstein , Ilya Maximets , David Marchand , Maor Dickman Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Add a table Library that has the following columns: 1. 'name' - the name of the library. 2. 'initialized' - true if this library is initialized. 3. 'config' - set of configurations for this library. 4. 'status' - string of the library initialization process. 'libraries' column is added to Open_vSwitch that has the added libraries. Signed-off-by: Eli Britstein --- vswitchd/bridge.c | 2 ++ vswitchd/vswitch.ovsschema | 27 ++++++++++++++++++++++++--- vswitchd/vswitch.xml | 19 +++++++++++++++++++ 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 475eefefa..4294caf8a 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -451,6 +451,8 @@ bridge_init(const char *remote) ovsdb_idl_omit(idl, &ovsrec_open_vswitch_col_system_version); ovsdb_idl_omit_alert(idl, &ovsrec_open_vswitch_col_dpdk_version); ovsdb_idl_omit_alert(idl, &ovsrec_open_vswitch_col_dpdk_initialized); + ovsdb_idl_omit_alert(idl, &ovsrec_library_col_initialized); + ovsdb_idl_omit_alert(idl, &ovsrec_library_col_status); ovsdb_idl_omit_alert(idl, &ovsrec_bridge_col_datapath_id); ovsdb_idl_omit_alert(idl, &ovsrec_bridge_col_datapath_version); diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema index c658291c7..34d8b4f16 100644 --- a/vswitchd/vswitch.ovsschema +++ b/vswitchd/vswitch.ovsschema @@ -1,6 +1,6 @@ {"name": "Open_vSwitch", - "version": "8.8.0", - "cksum": "2823623553 27869", + "version": "8.9.0", + "cksum": "3288044162 28435", "tables": { "Open_vSwitch": { "columns": { @@ -57,9 +57,30 @@ "type": "boolean"}, "dpdk_version": { "type": {"key": {"type": "string"}, - "min": 0, "max": 1}}}, + "min": 0, "max": 1}}, + "libraries": { + "type": {"key": {"type": "uuid", + "refTable": "Library"}, + "min": 0, "max": "unlimited"}}}, "isRoot": true, "maxRows": 1}, + "Library": { + "columns": { + "name": { + "type": "string" + }, + "initialized": { + "type": "boolean" + }, + "config": { + "type": {"key": "string", "value": "string", + "min": 0, "max": "unlimited"} + }, + "status": { + "type": "string" + } + } + }, "Bridge": { "columns": { "name": { diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 3dcf74402..f1cc3adb2 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -63,6 +63,10 @@ Set of bridges managed by the daemon. + + Set of libraries managed by the daemon. + + SSL/TLS used globally by the daemon. @@ -6172,6 +6176,21 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \ + + + Library name. + + + True if the library is successfully initialized. + + + Library configuration. + + + Status about the library initialization. + +
+

Configuration for a datapath within . From patchwork Sun Nov 30 15:49:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 2170266 X-Patchwork-Delegate: i.maximets@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=Vr6aWmu4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4dKBM04k3Gz1xtx for ; Mon, 1 Dec 2025 02:50:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id BE23240A9D; Sun, 30 Nov 2025 15:50:18 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 1_NwJNurcNLO; Sun, 30 Nov 2025 15:50:17 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org BC90E40A8E Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=Vr6aWmu4 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id BC90E40A8E; Sun, 30 Nov 2025 15:50:17 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9B617C063E; Sun, 30 Nov 2025 15:50:17 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 25DA7C063D for ; Sun, 30 Nov 2025 15:50:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id E60CD60750 for ; Sun, 30 Nov 2025 15:50:03 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Mm2OfZHCpiQt for ; Sun, 30 Nov 2025 15:50:03 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:111:f403:c105::7; helo=ch4pr04cu002.outbound.protection.outlook.com; envelope-from=elibr@nvidia.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 1D2F06075B Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 1D2F06075B Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=Vr6aWmu4 Received: from CH4PR04CU002.outbound.protection.outlook.com (mail-northcentralusazlp170130007.outbound.protection.outlook.com [IPv6:2a01:111:f403:c105::7]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1D2F06075B for ; Sun, 30 Nov 2025 15:50:02 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nDXC00nMul5mU8YTban1ucuxsQe+Aau2nY9yZaKF4fAq67KHyq94TKFbU+65tUbPoesVNeq8tKGwhI2yzeMsGS7daFDNK/Mh7ILIKCUsQlEFPSNHe4m3Hom+TD6M+pn9SyoM+hehrLuwHWeXssiic3mc4veVOhE/hWFMOFgzTzX4g+m+mwbNIQ/YWAgRKYC5XScgCvq8EI2qZAOEUWxHwS8tlcTEJRLET0prNgbgG1+qHm+UYsH3rPn37RpBm5v2T59VqiLEF83OqeGskOiaHZV6FPcor4li2I2DEPIOIjYYGwGcoEbt5U3JHpEmVphGGQVdpsJJFQNW7bMbSUToqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O8cJJr3uzqHBh6wJo9BzT8ANTtaptehv6I32q9ISv0Y=; b=Aydssf0g001FnCUOU3PEc8RQPszHvGr5uCHfqngAXxPSAkXzQw8IFfmQexXGSsnV0hUs2VhIIR9vlJqfMZMxHKHkwIF9+TkMcZq29uIH4lzePI3s1qvW4kK8IgbsnELE/Avc9mt76kF4j08yYzLM4pFeB1ssTZie2q6FvlIrPBbZo5hAGIDKfSmiEJTjfL2OM1gAycZeut6eNDl1dayQs0yidciVRsgJbHPOluQBQIYP95MskbPyM84LfzjJA2YyV+DK5pFoO2K7oCSVd+3e9LNtG5h3akgonRI3eknbmfpELABtSWax3jIUYV7Pvd4wl8ebyHtNABZ+6Gu+JNN4Kg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=openvswitch.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O8cJJr3uzqHBh6wJo9BzT8ANTtaptehv6I32q9ISv0Y=; b=Vr6aWmu4+WDjiY3N4UMGbiGKVF0bjbA1Z/XRL/cpaN9QHVhiu2ZVTgHoYSMKg8MYEpGvwSv6ICTVbJyrnLbX2s8VkR0mMDPznaCY05uJvmncnhZzyvXPMV3oHNRRO3+z8/Msy8TwJTv6IDTjhgoByFzYcCqNTlvGX8mqqwbPJoy2ZIn14p01OTpS427TyaabiV6y6BXKeOBMJmJ6PuDbgOmhu8yIyzWQSo76WUjefXZtfcQOJNc0pcdRKEwUTM7AUoZaXM4YsKpq36KnhE9fa0mHCPz59cQ5OC384o/VXfOTh6T9AcS6RZFKiagTJR2IpVjfMqTbPebONtvUA1eGYw== Received: from CH0P223CA0005.NAMP223.PROD.OUTLOOK.COM (2603:10b6:610:116::16) by BY5PR12MB4164.namprd12.prod.outlook.com (2603:10b6:a03:207::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9366.17; Sun, 30 Nov 2025 15:49:57 +0000 Received: from CH1PEPF0000AD7D.namprd04.prod.outlook.com (2603:10b6:610:116:cafe::fd) by CH0P223CA0005.outlook.office365.com (2603:10b6:610:116::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9366.17 via Frontend Transport; Sun, 30 Nov 2025 15:49:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CH1PEPF0000AD7D.mail.protection.outlook.com (10.167.244.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.8 via Frontend Transport; Sun, 30 Nov 2025 15:49:57 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 30 Nov 2025 07:49:50 -0800 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 30 Nov 2025 07:49:47 -0800 To: Date: Sun, 30 Nov 2025 17:49:20 +0200 Message-ID: <20251130154922.785311-3-elibr@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251130154922.785311-1-elibr@nvidia.com> References: <20251130154922.785311-1-elibr@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD7D:EE_|BY5PR12MB4164:EE_ X-MS-Office365-Filtering-Correlation-Id: a2d72843-8b0c-4c70-d443-08de30281cd1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: +egPz+kXIX6yuvw8PuOmn9Boad5bW9JKCGEMzETajs+3x7vld5hjEuRGg1QnQVZ9bsZD7ZH+1FzzgZkIrSxj4BXaXfik957ZSmm03xCkKyHllomJ91Kq6K8B/PYt+sbxl2Nkbea+icuBDaLb+1A//pT4t/3AACwMk7Bu3SqoK0Itg+FZiedzqZDyVJucnPmYiCGcvfAHWhWXPewSP8q1MxYcr8gJBCfcF+SQcORGR2EIAQ526cNnUDT0o6gPyr5neXGI1T/lwQQCgJe/8cUUaBFrCBAyBayypBayMYJt24DmHLI47RVAo0a1b1MCfSrx4DJEbTaGy4HzZVApS7o5TZFmKGZoBHqgDnVYjKP80YsS8tAR/G/PVojnhaRxj+cU/p+JOBujqHLD3+iV656oXsQMxGtxxRjt/uOnkyS0OV4MuGhJk/7HWt7H66opFYvlB6WP8MrqwHN9WFbVoyB2FNJlCS9/2GCmT5CEuQ2QkdN7c58Iq2mwUUafZ/MxdO6/7W16pSKe0XxmZwznviPYmjtmB/FN9tvHHgVrWvTSOYqMx6XqggY51y7teKGPs66jopKzzah7BCvcMWL2VS4mYj1nO+IZCwDpTfPATt8XcEtHyqjPplD4SvVuWRKJ82Xp01orG7mU05hV1YpNO360HPQihdXIOHaWYyo2zsvnOVNL5nPamj+RgAuNeSzSis+8DxCSvboEWVdxfguG0TVN2O5aEINMqtqCtDiGVkh5bC6R9Do2AHgOy7mHfrM/G9CBjV/q2RRJ7Epkb/VCtLCCsGzudlESek9ZSq/CbvRfvWVuFdf6yFpy0GLelB6dawkGL3PYtCEKF4BNfJvU0TSGrdSvjLWxnOoLWJKtG8bO26ZQ9vMIyMeo8TW+VkJhfPXmOcEtCINWliAlobhDB48/FZ0NTVxAfnceVo0NOoxJTCWyH5h5pKCdAmi8d+hI/V1GAwTTfUtTjIdPE1fCSTNAmuma4OdLsTpVptXHmLj3PYKH+FMqfBucL1xCbQ2H/hes4MzWAQKERsppDdRyT9IRYZopGUkM/ntnNC8NKD0Ebyxq3hS5ZGLXvCEduo50uFrBvo+CK/+xTFLQ5fciWYaJhJDD9r/rzu2SZBJg8bcmlf6UKpAaon+XkH2PDsWehGEjuxKDATO4Pl2dU3lhtv6gA7McINaJVe0BgYvlN6siK9YonsHR6AaoFDnTFNO3RXAQJJjewAf5tEu0G3cQuAs4EezUb1BZJdh5kacpsY5nJWCrfVIUOO0154NUEssLZt+GU5F/gz3jzkigx61I8WXEg8xhqYP+ldhO50jsMeyDkuI10tcNmN5gmv6te9Q/cax0KtxXumUSw6k6qwCAYUDadYJdSASgxnJdOg5TY3mCyU7MJG+/gPKz8NOCsCX8kFs5TXxDqC+L4td+U17Nn0vGkPzc2XKTBu4kYyD78h+1zENYQY/BiAu1QEFU9ur8P1aVqy2Uu5aGPyou/PJO8/0NhBp5l3u/cq1La9wEPyZxU82eWP0UirjX40bMdHyzQ6DDHq0DheJdY7usyHngAOKGgAM68Bh3bWq+URX1Csyb9nQ= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2025 15:49:57.2392 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a2d72843-8b0c-4c70-d443-08de30281cd1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000AD7D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4164 Subject: [ovs-dev] [PATCH v1 2/4] ovs-vsctl: Add add/del-library commands. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Eli Britstein via dev From: Eli Britstein Reply-To: Eli Britstein Cc: Eli Britstein , Ilya Maximets , David Marchand , Maor Dickman Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Add add/del-library commands. To add a library, with optional configuration 'x' and 'y': ovs-vsctl add-library x=1 y=2 To remove a library: ovs-vsctl del-library To see the available libraries: ovs-vsctl list library Signed-off-by: Eli Britstein --- utilities/ovs-vsctl.c | 89 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index d90db934b..8cc75c7be 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -783,6 +783,9 @@ pre_get_info(struct ctl_context *ctx) ovsdb_idl_add_column(ctx->idl, &ovsrec_interface_col_ofport); ovsdb_idl_add_column(ctx->idl, &ovsrec_interface_col_error); + + ovsdb_idl_add_column(ctx->idl, &ovsrec_open_vswitch_col_libraries); + ovsdb_idl_add_column(ctx->idl, &ovsrec_library_col_name); } static void @@ -1885,6 +1888,86 @@ cmd_br_get_external_id(struct ctl_context *ctx) } } +static void +cmd_add_library(struct ctl_context *ctx) +{ + struct vsctl_context *vsctl_ctx = vsctl_context_cast(ctx); + struct smap config = SMAP_INITIALIZER(&config); + struct ovsrec_library **lib_list; + const char *name = ctx->argv[1]; + struct ovsrec_library *lib; + size_t n_libs; + + for (int i = 2; i < ctx->argc; i++) { + const char *arg = ctx->argv[i]; + char *key, *val; + + key = xstrdup(arg); + val = strchr(key, '='); + + if (val) { + *val = '\0'; + val++; + smap_add(&config, key, val); + } + free(key); + } + + lib = ovsrec_library_insert(ctx->txn); + + ovsrec_library_set_name(lib, name); + ovsrec_library_set_config(lib, &config); + smap_destroy(&config); + + n_libs = vsctl_ctx->ovs->n_libraries; + lib_list = xmalloc(sizeof *lib_list * (n_libs + 1)); + memcpy(lib_list, vsctl_ctx->ovs->libraries, sizeof *lib_list * n_libs); + lib_list[n_libs] = lib; + ovsrec_open_vswitch_set_libraries(vsctl_ctx->ovs, lib_list, n_libs + 1); + free(lib_list); +} + +static void +cmd_del_library(struct ctl_context *ctx) +{ + bool must_exist = !shash_find(&ctx->options, "--if-exists"); + struct vsctl_context *vsctl_ctx = vsctl_context_cast(ctx); + struct ovsrec_library **orig_lib_list, **new_lib_list; + const char *name = ctx->argv[1]; + struct ovsrec_library *lib; + size_t lib_list_idx; + size_t n_libs; + + n_libs = vsctl_ctx->ovs->n_libraries; + orig_lib_list = vsctl_ctx->ovs->libraries; + new_lib_list = xmalloc(sizeof *new_lib_list * (n_libs - 1)); + lib = NULL; + lib_list_idx = 0; + + for (size_t i = 0; i < n_libs; i++) { + if (strcmp(orig_lib_list[i]->name, name)) { + new_lib_list[lib_list_idx++] = orig_lib_list[i]; + continue; + } + + lib = orig_lib_list[i]; + } + + if (!lib) { + free(new_lib_list); + if (must_exist) { + ctl_fatal("no library named %s", name); + } + return; + } + + ovsrec_open_vswitch_set_libraries(vsctl_ctx->ovs, new_lib_list, + n_libs - 1); + free(new_lib_list); + + ovsrec_library_delete(lib); +} + static void cmd_list_ports(struct ctl_context *ctx) { @@ -3248,6 +3331,12 @@ static const struct ctl_command_syntax vsctl_commands[] = { {"br-get-external-id", 1, 2, "BRIDGE [KEY]", pre_cmd_br_get_external_id, cmd_br_get_external_id, NULL, "", RO}, + /* Library commands. */ + {"add-library", 1, INT_MAX, "LIBRARY [options:KEY=VALUE]...", pre_get_info, + cmd_add_library, NULL, "", RW}, + {"del-library", 1, 1, "LIBRARY", pre_get_info, cmd_del_library, + NULL, "--if-exists", RW}, + /* Port commands. */ {"list-ports", 1, 1, "BRIDGE", pre_get_info, cmd_list_ports, NULL, "", RO}, From patchwork Sun Nov 30 15:49:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 2170265 X-Patchwork-Delegate: i.maximets@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=S3unOKSX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4dKBLw4Wwgz1xtx for ; Mon, 1 Dec 2025 02:50:16 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 089D581132; Sun, 30 Nov 2025 15:50:15 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id EAfLdM3K4Mny; Sun, 30 Nov 2025 15:50:14 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D3D3981098 Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=S3unOKSX Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id D3D3981098; Sun, 30 Nov 2025 15:50:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B985CC063F; Sun, 30 Nov 2025 15:50:13 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 060DDC063D for ; Sun, 30 Nov 2025 15:50:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 17FC94041B for ; Sun, 30 Nov 2025 15:50:07 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id zTXNegV2ddxd for ; Sun, 30 Nov 2025 15:50:06 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:111:f403:c005::5; helo=co1pr03cu002.outbound.protection.outlook.com; envelope-from=elibr@nvidia.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 3983140419 Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3983140419 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=S3unOKSX Received: from CO1PR03CU002.outbound.protection.outlook.com (mail-westus2azlp170100005.outbound.protection.outlook.com [IPv6:2a01:111:f403:c005::5]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3983140419 for ; Sun, 30 Nov 2025 15:50:06 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=h3uBaAUAZr8kHG6dH24jGTnTLDahqOQQJ/jYXmPYd6YXPqns79INiTnCllDxl72Hy/8DH/LV5O5/BX0n8J222RBiErMCeM82FOa8UYV+jmniWnlKYxTosdsQZawiDpDIpJakjPMvSyQIp38uOFtGhd5c4yypg5nHg5Rp6tFEbRuiWwFVprYFV56/4S182cpkNoTBpZ2GBr/39onP2IwUiwRKo8a+szMv1zp43U7S/Nk5ajdEsCSbgYfdxOpFKyiZO5FsvRSGQqOdhZcvQNZhHwodxFGRJtu0opD70FckgexdDGVzMUBX5qTXMFz6/pFfW4SJfWImHsZ2sLtG5IIPXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/oSzvLdGDCMmcJrJ1RouX15AkK5vZg5E0rQPFgIQR54=; b=MvVoucFK5grZb/1uY47pan5LqwPY+z6hmW5wptT71D6TC6ReM3oPByYX0WcrbGKFTM6LDh7LGltH4SmmQeDTRQf1+J06DI+/bOBNbeiBEmaaZWAyfEbw+4/OOcPuY6sD9gSEfyIPjVqE2iu01Q6uqeBwLUSh+cXTZsoCP9s0mNifOT4eXnjPCtApWAf9o8+BuV4JYHednYr7JjGuI5O2emmY5e3oCVFQz7GgZM/AykzBeBG6Rt9v1wUueU8fhyWulFbN4INHBmUunxK6wrmsWTmaq6xVVCcBa6dhu4hC/S7s/jYmg/bDPsydVd7zuxGodkDZPruym2qxcDs6EDdi3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=openvswitch.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/oSzvLdGDCMmcJrJ1RouX15AkK5vZg5E0rQPFgIQR54=; b=S3unOKSXOn8HiaAdQNaIwKvJRwHct4RAWYWZ6JzDFVoQko0iVU8telhrKxUi+fDqqnPnar4PWI6NRgqYfMsyWFJ8n7fHJj8F4loScA+e4puhfGNJlbf0r5AhQI1Ka3GmQ7GRvlILtkQqcA3qSDXuUJRsAWNPH0/As8LxhmNC3gV09IQ4sU/xrey65TNZuBAb5wE5CpUtguNQtDLVquH6eM+blcigBkmV9AHEdmC44VAoyFr0OQvW+wTEBL/Ip10ZmjwzdUtyEPVx3kCu+tTtAqXpW4iayI4dDBtd2L/qGd5kzKGt6q0ELgDccFt37V3Bzp2ro03vzy0AUUxDxTn/rA== Received: from CH0P223CA0027.NAMP223.PROD.OUTLOOK.COM (2603:10b6:610:116::17) by SN7PR12MB7347.namprd12.prod.outlook.com (2603:10b6:806:29a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9366.17; Sun, 30 Nov 2025 15:49:59 +0000 Received: from CH1PEPF0000AD7D.namprd04.prod.outlook.com (2603:10b6:610:116:cafe::be) by CH0P223CA0027.outlook.office365.com (2603:10b6:610:116::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9366.17 via Frontend Transport; Sun, 30 Nov 2025 15:49:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CH1PEPF0000AD7D.mail.protection.outlook.com (10.167.244.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.8 via Frontend Transport; Sun, 30 Nov 2025 15:49:59 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 30 Nov 2025 07:49:52 -0800 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 30 Nov 2025 07:49:50 -0800 To: Date: Sun, 30 Nov 2025 17:49:21 +0200 Message-ID: <20251130154922.785311-4-elibr@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251130154922.785311-1-elibr@nvidia.com> References: <20251130154922.785311-1-elibr@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD7D:EE_|SN7PR12MB7347:EE_ X-MS-Office365-Filtering-Correlation-Id: ef6aceaa-64f1-416e-b7d8-08de30281dec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: ql8/4nv80NfZpKbC4XUkC0v8kUKeJ43Zvz+mVkJPtFv8WoYHrAZspC7sGfk5C/nCZcFIFiTlpp5BSYDmGgeozkwT71saMB4Z55l9zhygveqJ+WlUDw62U89PblMSyTuaiW66EYfrusBg39RxGetYY7Z6zhxDow39Bm2gsf10ujROE+pNfOhMHCOZpz+bKfrX5qvugoisGuOzz1phBt67w4J8R0+QUQR/txm6Sa/p2bxnYOTjgP2ZMeE8dg7faUBQFLaj17En7UXCy4KGSddEDDvahzf2X4nXbDxyISDXaqWcGy2WcELqNAHkPyV/NHaq9kRKY/9Y/qP4OvnBcW5ctpcxzcqW8izOLDdUeFOgq16QtgR6pKtlvxvDkZtfaO1KsZQ0vsQXanWj82lgAqF0xutmef7Unq9HyY2DeR7YzUSL0uoj7vS/sm0waao6rHzeqfvv0+c4cmqyKI5gSL5VzNjnpse3FeSQYjksrgrZTVV6G266HqCMmrCSOK76AABpIYLUMtXNESExWlixvXOkXrKvfTIObyp99H1D5IlLf1TKLjo7j/LPFtMKKcPyDmY3FoFURd99djXuUor7GLYOAtq0Yi0H2V1fwTU22xTFulPuaL4rzCDl4D1NbKY0sO/UD40GyvCsG3aXeC3bcsvTmb99t1AfxkIlFiaWgmEKmZj7kFVbLs9q/B2ItY98uAdHc8WzA4gP3GOPBnQLCuLzBluRdgP137K3fXqHoac3xOtKh/MBMtnlwH5Vtp7S1ErwGfIMyD9Kej0e9ScuG/uvSpJRLPXvd1Awb9aegV3+SWgiUi6LxLGVxwmlcy6nHD1GCqqVe/eazeSYRAiGnP7Mg3C/FFkjujV1Ib/pAtckVoXiQI3C5F4QZKeC8eUxruq51luoIek2qg+V2E66eQdFI2I2mSmzZIgj/u+Bf6cggR1THZ7areGn8iNvCZnGfi0SxPgf83N2xdNmaXjsU88lokjxQhf2XDtk8aOC3DIGRL9GxVUs814262SO6eKlmWinlxwvrWmNhw7lce33xVCQgH5BdNyioBhikQTJ8NzldXl8rM95ZKhYkUp9UWz7Fnn6Pg4Xt1Jclgm1vWPa0iK/qjB1XUpyOS2uvjxPNjozafCbspNt55wwKIZw8I8TuX9OKkuzKf6V+pOeDY3BOmpXRHmf0waPDtF8NsQPKThvhJhpf3iUAH7d8/ESg+IYOqmjy9fkTQSFGP5nIBswgyEcPrkx/IXiFZJusMhHhmZBsBEYw4t6chhbxW4WX6izUO13TYgZW4sB1/1wW44oD0IxJoe1bqUp/Bie4RCoWN9ztf+hgjXVyZixk0+UyKSSMYRuLhDL46i+hiGoZvV1gTOyhKB2XIMtk9pAumRVwUtbvOvhCL7ThrbnBVLkkLbFPI95VGr666MK76DeGscLJyMhlLdcIK8LLeMxoF+bG65tzKNCgu7ikVRVx0LkEMbmKLyTwXEfRo9sBnS3UaTcPW55jBc9obERGeJ9ruWtfoWeZgCtP0zVRvoQrP3sXxyMYfVsUqngO8Rr3SIVqBpT/R/CN9s+gCHUlvWAKbQOsHAF4KI= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2025 15:49:59.0579 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef6aceaa-64f1-416e-b7d8-08de30281dec X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000AD7D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7347 Subject: [ovs-dev] [PATCH v1 3/4] lib: Introduce library module. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Eli Britstein via dev From: Eli Britstein Reply-To: Eli Britstein Cc: Eli Britstein , Ilya Maximets , David Marchand , Maor Dickman Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Introduce a new module - "library". This module manages the set of libraries available to OVS, currently only dpdk. Instead of dedicated "dpdk_init" and "dpdk_status" commands from the bridge module, have a generic method that can also be extended for it. The legacy "dpdk-init=true" method is preserved for backward compatibility. To see the available libraries to add: ovs-appctl library/list Signed-off-by: Eli Britstein --- lib/automake.mk | 3 + lib/library-provider.h | 25 ++++++++ lib/library.c | 123 ++++++++++++++++++++++++++++++++++++++++ lib/library.h | 18 ++++++ vswitchd/bridge.c | 18 ++++++ vswitchd/ovs-vswitchd.c | 2 + 6 files changed, 189 insertions(+) create mode 100644 lib/library-provider.h create mode 100644 lib/library.c create mode 100644 lib/library.h diff --git a/lib/automake.mk b/lib/automake.mk index 78d6e6516..6c9362f77 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -188,6 +188,9 @@ lib_libopenvswitch_la_SOURCES = \ lib/learn.h \ lib/learning-switch.c \ lib/learning-switch.h \ + lib/library.c \ + lib/library.h \ + lib/library-provider.h \ lib/lockfile.c \ lib/lockfile.h \ lib/mac-learning.c \ diff --git a/lib/library-provider.h b/lib/library-provider.h new file mode 100644 index 000000000..930421e38 --- /dev/null +++ b/lib/library-provider.h @@ -0,0 +1,25 @@ + +#ifndef LIBRARY_PROVIDER_H +#define LIBRARY_PROVIDER_H 1 + +struct ovsrec_library; +struct smap; + +struct library_class { + const char *name; + +/* ## ------------------- ## */ +/* ## Top-Level Functions ## */ +/* ## ------------------- ## */ + + /* Called when the library provider is registered, typically at program + * startup. Returning an error from this function will prevent any network + * device in this class from being opened. + * + * This function may be set to null if a network device class needs no + * initialization at registration time. */ + void (*init)(const struct smap *cfg); + void (*status)(const struct ovsrec_library *lib); +}; + +#endif /* LIBRARY_PROVIDER_H */ diff --git a/lib/library.c b/lib/library.c new file mode 100644 index 000000000..ad6657bbb --- /dev/null +++ b/lib/library.c @@ -0,0 +1,123 @@ +/* NVIDIA */ + +#include + +#include + +#include "cmap.h" +#include "hash.h" +#include "library.h" +#include "library-provider.h" +#include "openvswitch/dynamic-string.h" +#include "openvswitch/vlog.h" +#include "ovs-thread.h" +#include "unixctl.h" +#include "util.h" +#include "vswitch-idl.h" + +VLOG_DEFINE_THIS_MODULE(library); + +struct library_registered_class { + struct cmap_node cmap_node; /* In 'library_classes', by class->name. */ + const struct library_class *class; +}; + +static struct ovs_mutex library_class_mutex = OVS_MUTEX_INITIALIZER; + +/* Contains 'struct library_registered_class'es. */ +static struct cmap library_classes = CMAP_INITIALIZER; + +static struct library_registered_class * +library_lookup_class(const char *name) +{ + struct library_registered_class *rc; + + CMAP_FOR_EACH_WITH_HASH (rc, cmap_node, hash_string(name, 0), + &library_classes) { + if (!strcmp(name, rc->class->name)) { + return rc; + } + } + return NULL; +} + +/* Initializes and registers a new library provider. */ +OVS_UNUSED +static int +library_register_one(const struct library_class *new_class) + OVS_EXCLUDED(library_class_mutex) +{ + int error = 0; + + ovs_mutex_lock(&library_class_mutex); + if (library_lookup_class(new_class->name)) { + VLOG_WARN("attempted to register duplicate library provider: %s", + new_class->name); + error = EEXIST; + } else { + struct library_registered_class *rc; + + rc = xmalloc(sizeof *rc); + rc->class = new_class; + cmap_insert(&library_classes, &rc->cmap_node, + hash_string(new_class->name, 0)); + } + ovs_mutex_unlock(&library_class_mutex); + + return error; +} + +static void +library_list(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, + void *aux OVS_UNUSED) +{ + struct ds reply = DS_EMPTY_INITIALIZER; + struct library_registered_class *rc; + + CMAP_FOR_EACH (rc, cmap_node, &library_classes) { + ds_put_format(&reply, "- %s\n", rc->class->name); + } + unixctl_command_reply(conn, ds_cstr(&reply)); + ds_destroy(&reply); +} + +void +library_register(void) +{ + unixctl_command_register("library/list", "", + 0, 0, library_list, + NULL); +} + +void +library_init(const char *name, const struct smap *cfg) +{ + struct library_registered_class *rc; + + rc = library_lookup_class(name); + if (!rc) { + VLOG_WARN_ONCE("Unkown library '%s'", name); + return; + } + + if (!rc->class->init) { + return; + } + + rc->class->init(cfg); +} + +void +library_status(const struct ovsrec_library *lib_cfg) +{ + struct library_registered_class *rc; + + rc = library_lookup_class(lib_cfg->name); + if (!rc) { + VLOG_WARN_ONCE("Unkown library '%s'", lib_cfg->name); + return; + } + + rc->class->status(lib_cfg); +} diff --git a/lib/library.h b/lib/library.h new file mode 100644 index 000000000..b1f804cb5 --- /dev/null +++ b/lib/library.h @@ -0,0 +1,18 @@ +/* NVIDIA */ + +#ifndef LIBRARY_H +#define LIBRARY_H 1 + +struct ovsrec_library; +struct smap; + +void +library_register(void); + +void +library_init(const char *name, const struct smap *cfg); + +void +library_status(const struct ovsrec_library *lib_cfg); + +#endif /* LIBRARY_H */ diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 4294caf8a..9df3f4115 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -35,6 +35,7 @@ #include "if-notifier.h" #include "jsonrpc.h" #include "lacp.h" +#include "library.h" #include "mac-learning.h" #include "mcast-snooping.h" #include "netdev.h" @@ -263,6 +264,7 @@ static uint64_t last_ifaces_changed; #define BRIDGE_CONTROLLER_PACKET_QUEUE_MIN_SIZE 1 #define BRIDGE_CONTROLLER_PACKET_QUEUE_MAX_SIZE 512 +static void libraries_config(const struct ovsrec_open_vswitch *); static void add_del_bridges(const struct ovsrec_open_vswitch *); static void bridge_run__(void); static void bridge_create(const struct ovsrec_bridge *); @@ -896,6 +898,8 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg) smap_get_bool(&ovs_cfg->other_config, "explicit-sampled-drops", OFPROTO_EXPLICIT_SAMPLED_DROPS_DEFAULT)); + libraries_config(ovs_cfg); + /* Destroy "struct bridge"s, "struct port"s, and "struct iface"s according * to 'ovs_cfg', with only very minimal configuration otherwise. * @@ -2154,6 +2158,20 @@ add_del_bridges(const struct ovsrec_open_vswitch *cfg) shash_destroy(&new_br); } +static void +libraries_config(const struct ovsrec_open_vswitch *cfg) +{ + size_t i; + + /* Collect new libraries' names. */ + for (i = 0; i < cfg->n_libraries; i++) { + const struct ovsrec_library *lib_cfg = cfg->libraries[i]; + + library_init(lib_cfg->name, &lib_cfg->config); + library_status(lib_cfg); + } +} + /* Configures 'netdev' based on the "options" column in 'iface_cfg'. * Returns 0 if successful, otherwise a positive errno value. */ static int diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c index 6d90c73b8..f9fa3d554 100644 --- a/vswitchd/ovs-vswitchd.c +++ b/vswitchd/ovs-vswitchd.c @@ -33,6 +33,7 @@ #include "dpif.h" #include "dummy.h" #include "fatal-signal.h" +#include "lib/library.h" #include "memory.h" #include "netdev.h" #include "openflow/openflow.h" @@ -120,6 +121,7 @@ main(int argc, char *argv[]) unixctl_command_register("exit", "[--cleanup]", 0, 1, ovs_vswitchd_exit, NULL); + library_register(); bridge_init(remote); free(remote); From patchwork Sun Nov 30 15:49:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 2170268 X-Patchwork-Delegate: i.maximets@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=JPYEdC8d; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4dKBM54K9Rz1xtx for ; Mon, 1 Dec 2025 02:50:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0C12980DCE; Sun, 30 Nov 2025 15:50:22 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id uhkuIlvXl927; Sun, 30 Nov 2025 15:50:21 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org C5D9A81100 Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=JPYEdC8d Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id C5D9A81100; Sun, 30 Nov 2025 15:50:20 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 93958C0640; Sun, 30 Nov 2025 15:50:20 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0C74EC063D for ; Sun, 30 Nov 2025 15:50:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 92EC040A5F for ; Sun, 30 Nov 2025 15:50:11 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 4qJH3UAhTRP0 for ; Sun, 30 Nov 2025 15:50:10 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:111:f403:c10d::1; helo=sn4pr2101cu001.outbound.protection.outlook.com; envelope-from=elibr@nvidia.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 17C5540A73 Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 17C5540A73 Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=JPYEdC8d Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazlp170120001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c10d::1]) by smtp4.osuosl.org (Postfix) with ESMTPS id 17C5540A73 for ; Sun, 30 Nov 2025 15:50:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xsURhb6VemX+teOKpJpiWphXcYPUv6Moop+e2qyS1hjFcaqd8bBU1yA7g5WfDq76YZV6hJSnU+3r6RnE/OerH9by9oav3jHZBy17JK+wlTDlQTaeODrwIcrirGrlEHZqQx+Ibi6VhNoFfns4qJLGs2XTZpgLKUvDl+FdKaGnR/7Hkv8rjcduxBua2o7IgQM0WDYoUmFF+ggCb3kGX5+n6JxD8ov9E8V8fQJ2fufVYsKnuWrQo4x9xXAXwzFSPJqneo44WzZ9ZCOfqCXzAJ73TRGpqg7+izu51bXZOvWxnLYFtM0gQH7DibVp0hCBxXVIzyW4rPbkppf20zbasz1yDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cK0uSbuW9XkT8vCjrwroGpdBXfhSsEIqaX1hXniEgnQ=; b=rLd/kYvTtBTrFF93P/UTvVcCKS0iMNQq5/5VmhE/63RDRJzPtimWdssL8glcY/G8XioCV1riBkD3CA48WFY27BTM1lD1mYCXT4QYmBaWOL3EvnBzZp0JWlpYAglbmOED91fUihegH6X2GWjczMQMXfiNiEA2tSZo/RufF62Wf9ZIKV8VSWqTXAiH6NO8Bq1EFfCKDyoa/WKbSvLYKV1jJE1WJuv65y6ZIciNSXkidEgkTABz/D6KwB4XUs1wQzuUhv0HT/EhioLBd3igGyV+0TFoSyEAywpfLbjIKQvsozhsYfshamzcuJ3Vn1pYdHA3B1e+7J5iYT+Xf3bZ2SU2VQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=openvswitch.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cK0uSbuW9XkT8vCjrwroGpdBXfhSsEIqaX1hXniEgnQ=; b=JPYEdC8dW1qPK4BIUH5wOxAvBoLuFdVPLvijzkutyOiZViCyeUbitNr7bXEgxdA19+Z+P2FAStpQ7MCX4WJx6zWn1pZf0eYyRfvXP/Lbg6vcmrfvsndTxpkci6ept2o90rJcTRjfbA0dylCxm315had9629qP0uXWCN351vr8jg8M4Z4kOfHsQuebZ7ina51wWfkart6Dibxx6Ii8+pfyTHeagND7WukxpoqsQ/VUecD6U+TM+AVY2z6PMDgAM+dA34dHdZrypCDAupVw7Bif/lFiZcM5QEBwG864IONkYZ9C2v4MtNz1duPEESebeK4A36yAi1fIq6HeISoc/YzGg== Received: from CH3P221CA0019.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1e7::18) by LV2PR12MB5896.namprd12.prod.outlook.com (2603:10b6:408:172::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9366.17; Sun, 30 Nov 2025 15:50:04 +0000 Received: from CH1PEPF0000AD7C.namprd04.prod.outlook.com (2603:10b6:610:1e7:cafe::dc) by CH3P221CA0019.outlook.office365.com (2603:10b6:610:1e7::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9366.17 via Frontend Transport; Sun, 30 Nov 2025 15:50:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CH1PEPF0000AD7C.mail.protection.outlook.com (10.167.244.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.8 via Frontend Transport; Sun, 30 Nov 2025 15:50:04 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 30 Nov 2025 07:49:55 -0800 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Sun, 30 Nov 2025 07:49:52 -0800 To: Date: Sun, 30 Nov 2025 17:49:22 +0200 Message-ID: <20251130154922.785311-5-elibr@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251130154922.785311-1-elibr@nvidia.com> References: <20251130154922.785311-1-elibr@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD7C:EE_|LV2PR12MB5896:EE_ X-MS-Office365-Filtering-Correlation-Id: c324f1d2-6787-49e7-13c3-08de30282121 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: Y6S6CWP3qOMcwJNTDZUmE8qCOMjBzYiRMqjhyt7Ap+7jlEqM4nUWZOBj5Xab+PHWaA3VAsmgfv+3zIdL/3b5LJJUUezmSJ3Kqu9QNhCCMXBrHi2DA4L7vRPiD0+J64j3WIg6dl1Pr7efNfhlUlN+LWo0OZ3wI1arCkYurruSp1Vyal4ucZJosAnQRV4IUjx/1r4m0GEh9GNwDD2Rf8mPvmiDpcC+NTXV51aQXSmgzkHyMRem8ih6QchhZhk6tB8Aq0lJp4/uplPOrOtmLwMSRJl3+tZMGh3piaSjVxJgAxxr/hLrpFphIlhrmFBTV7E9V1u9AJZyUUv6RqQNUHN3iIHxQQLuPsbCfrMGX3Ff85GiiXMwyMF3xeK2XNgtZYzfTvz18TscxI7vUVVtQ8TccgwsRKNETuKzu1y+H17Y7GTvp2APbCrUMA2QaklEkE6FTYM6KbA1WSFAXFDFFWnObpQuMp3OXNXIGnqJW5l4NGMVxn+/rhSzV7rYVrJ91vO9JdptxpYc1OmtiFkYFLDA0uRiZaTkEXkYQFtCoD3Jg/71glQWwTvNwGTwJdhbVyuk/ezuRwt1elFY08beti+gK9qi0hiOVlIRzV54jDCH0tJ4Odn/ER37n+hiquBBVnBQ/wxbFQLn33d7GLxgA1bQnUVKW5HQzMJ56oCHneipzO21JWBzutQl3FnotrKGXbhMAiqRkojs0c8PDL33KD/bS1Lq6BIJuVayjrh+c0dhIm0RlKD9xTIpZh3ydAFDiA8hcKRtd1qG0QHWWng7HqPsoMx+d6HbfIAp20V4EWSQhYbOfs6lu/E3NfiBS+PePgo8T8epxlG5MyoyKDYxMJ0HKDyIRH5ujIypFNhZzpmy3FSxGwT2pRL/zk5bLLfPWNAj8dHuPMVghHwOr00iysQ+H+gsTQ9zHJZ8zAHwymu5OMr71e//0gYKKab8wcKA3E3uSkD3vQBJUA4WSgyyrulbZ+UCtCHSIAsqw+Uu05eTd24gs1/mug+yexmIt9OeNrodTkyb7ZYSV8b/Tvlh4jFzURV/etfSui91FSTo47qIlaL3PAQe1tIaLFplkKFvFt/5MmgYRvjJ1L3AxE60w3ixyD4hjr63OLRpR0jJ3XnmLwa2hqpzZwviMPIygLKF8JxcMDpQFUeNiAti3qrXt5JPr4K3hbbGjMBkiolxblNxOH6eg0lUP8APv6P5tWMcO3BHpJ408OIEpKKzr6Zj/yU0t6nD5Ynqc0e7g4m1rCU5BCLxmeUbdhsBiZ51Lv9PNcAswfVoC5ghtl8htR6th/6QUi6KZXT2LpuS2C8w7vl+6a6+l/ohhqj5ULNLKniLpCh4r1K/p4JMr18Lqh28sumd0E1g463kgxXbG3ZsAwiNttxvctntmxrlM3exrIPOSS7xf1qSSG6on8KqzY9UKzOLQA9935pLUtZCNNu216b8M77AqTI/hv8bmnLLEYUoHOs+XnG3ujzJDjdYBPtHLUnAzwcGiDaiHmyCm2MJCQwSZqg6/XKctphRXSyRBxHGOJVMK6Cm30fb6Mo/ctLzpZ/YwQRtWe3+2aiRJWN7cgFI6/4= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2025 15:50:04.4231 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c324f1d2-6787-49e7-13c3-08de30282121 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000AD7C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5896 Subject: [ovs-dev] [PATCH v1 4/4] dpdk: Implement library_class_dpdk. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Eli Britstein via dev From: Eli Britstein Reply-To: Eli Britstein Cc: Eli Britstein , Ilya Maximets , David Marchand , Maor Dickman Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Implement library_class_dpdk with init/status methods implemented. Signed-off-by: Eli Britstein --- lib/dpdk.c | 26 ++++++++++++++++++++++++++ lib/dpdk.h | 2 ++ lib/library.c | 5 +++++ 3 files changed, 33 insertions(+) diff --git a/lib/dpdk.c b/lib/dpdk.c index 077bdfc09..712feb44d 100644 --- a/lib/dpdk.c +++ b/lib/dpdk.c @@ -30,6 +30,7 @@ #include "dirs.h" #include "fatal-signal.h" +#include "library-provider.h" #include "netdev-dpdk.h" #include "netdev-offload-provider.h" #include "openvswitch/dynamic-string.h" @@ -600,3 +601,28 @@ dpdk_status(const struct ovsrec_open_vswitch *cfg) ovsrec_open_vswitch_set_dpdk_version(cfg, rte_version()); } } + +static void +dpdk_library_init(const struct smap *ovs_other_config) +{ + smap_replace(CONST_CAST(struct smap *, ovs_other_config), "dpdk-init", + "true"); + dpdk_init(ovs_other_config); +} + +static void +dpdk_library_status(const struct ovsrec_library *lib) +{ + if (!lib) { + return; + } + + ovsrec_library_set_initialized(lib, dpdk_available()); + ovsrec_library_set_status(lib, rte_version()); +} + +const struct library_class library_class_dpdk = { + .name = "dpdk", + .init = dpdk_library_init, + .status = dpdk_library_status, +}; diff --git a/lib/dpdk.h b/lib/dpdk.h index 1b790e682..1d2ed45be 100644 --- a/lib/dpdk.h +++ b/lib/dpdk.h @@ -42,4 +42,6 @@ bool dpdk_available(void); void print_dpdk_version(void); void dpdk_status(const struct ovsrec_open_vswitch *); +extern const struct library_class library_class_dpdk; + #endif /* dpdk.h */ diff --git a/lib/library.c b/lib/library.c index ad6657bbb..3c2d7eebc 100644 --- a/lib/library.c +++ b/lib/library.c @@ -5,6 +5,7 @@ #include #include "cmap.h" +#include "dpdk.h" #include "hash.h" #include "library.h" #include "library-provider.h" @@ -88,6 +89,10 @@ library_register(void) unixctl_command_register("library/list", "", 0, 0, library_list, NULL); + +#ifdef DPDK_NETDEV + library_register_one(&library_class_dpdk); +#endif } void