From patchwork Wed Jun 25 10:27:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changliang Wu X-Patchwork-Id: 2102468 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=smartx-com.20230601.gappssmtp.com header.i=@smartx-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=cw0vGCE4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (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 4bRygQ4trmz1ymW for ; Wed, 25 Jun 2025 20:27:30 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 6345C41716; Wed, 25 Jun 2025 10:27:41 +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 kaPF-LTvG7J1; Wed, 25 Jun 2025 10:27:40 +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 smtp2.osuosl.org 86D6940057 Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=smartx-com.20230601.gappssmtp.com header.i=@smartx-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=cw0vGCE4 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 86D6940057; Wed, 25 Jun 2025 10:27:40 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 39656C02A6; Wed, 25 Jun 2025 10:27:40 +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 E04E9C02A5 for ; Wed, 25 Jun 2025 10:27:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id C78E040224 for ; Wed, 25 Jun 2025 10:27:38 +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 ymxsdff6GUxm for ; Wed, 25 Jun 2025 10:27:37 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::634; helo=mail-pl1-x634.google.com; envelope-from=changliang.wu@smartx.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 9777440057 Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=smartx.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 9777440057 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by smtp2.osuosl.org (Postfix) with ESMTPS id 9777440057 for ; Wed, 25 Jun 2025 10:27:36 +0000 (UTC) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-235e1d710d8so20520565ad.1 for ; Wed, 25 Jun 2025 03:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1750847255; x=1751452055; darn=openvswitch.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=y15dNhiw91sBzOLuJ94GXCZF4TcxhQh0I2tYZMPuDmM=; b=cw0vGCE48PmNeo6NXELeAiMvA83KNzyRfGhtZxbz8AOojx2jUmW3FthvUIEFY2qWI/ MB8az+Y+tlGPRC4VHEhU9rs0bqpapnX8lV93j8+rfQipMpH7W73QLQlx4TLZHNr7P9eL 6+G/bjEWeSladU+3pBYBsRmq34eMIc5Y+l8qu/es5x1hvGBUH3PZnM0d6kta4DoKewly 3FfULM160SrmJAzZfVhHl0yoFwmV+72s8ztOFuttw8jg/jKc3E1yCAK0sihsqjpgLBqo e6ZZ6+/3UB/pecrpoX+Mg3mjnwbxGvS/F+nKpWpzlXLnAWO2qDa29zEYVZl0kz1Pr372 1GQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750847255; x=1751452055; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=y15dNhiw91sBzOLuJ94GXCZF4TcxhQh0I2tYZMPuDmM=; b=a3v/CFCE+iaWsG6AxcW9M3QwI7MTe704eN0I+N1PcZJVBhoDNnEtWOVYM+YmRAgJKs 88MKCYEe2NUQ7YFmiUZmA0sj+D8u/nGPHrEpp0XuvZXmWON0xjGqXJovXx7K7Tl9Kv4+ RZVg7Q0fAfVWyRHWd7l7RF9Rb5squ379Wh89NQyn6ncJ07mRjwUfh7BaLg0+xpYjjSlG TSYBS38rW330l9tOlqrBeDMLvJa6pO0d/Kh2NdpmbM+uLOk7IqJ9O1zo9ayiqITuPdwV Xp8MPPuqUXMogAcXe3g2+F9RFFNHWzEWkYUeeuHItfDvnJ2sb3CgmwTiUWExV/+d3elT Pp1Q== X-Forwarded-Encrypted: i=1; AJvYcCUhuFFVhUGuJ1/dRo/BUaKVOSGMP83yil3t0ksUO2cCl/zA7GhYD8EgB/u6aeY3A0eUP6c=@openvswitch.org X-Gm-Message-State: AOJu0YzKoi1w+zU+57LQ4wVYSLK5opRhunGGD+Wx8Q30aWHyZylLA371 Knqxu0jVFQC9USbbhRuP+6JjlenmwLy1pO++WRhFRJzDwyDXIuOnkWP1SHCNI6AHjAJ+BlwihvM rdKxZjz61TA== X-Gm-Gg: ASbGncu3kNyWQp0mQDFPqIP9gCiyXwN55pOnJDvOBPKQo69AaY0XeQYTrTdljmDlIYX sxJXlI+Hr49q3kmWMDB+RHTBhTFr9+NzdAu/D2eWMV1ayhyLyz5NmnvdqZ9lutjTSFNFGemO0Mn jsvhtjvle4HQcpsCvCJWrBmo91rQgO3Gz4AlY0M6uhkjl+Pb1zIUoRPzIkVqGYiIw/f3Dr2adwL hhdJY+KmR5po8pPsmmP0RKs5K1IEq5f8Q6XvBoRzxiBnU8xnKa6Ixvgei6ttBbHyC9ysehI+qZc iylmGqGCt+lE7xMwPuwB4QP/a8ihjJrpeaFzHkUNk+VG1CHEmi6XMWGruYH10Z9bmNV8DAD8X3/ gpZLviaCZXkQL3LZMIVxDPYymkZApO05Gl0R8m34ypvvNc0sX X-Google-Smtp-Source: AGHT+IEkQzICH4cJvtF7AcBZTzmf5j2NTKNxwU13XsSS6uxivQMAGXCxcbwbe/bGePqY8mJRvV6XYg== X-Received: by 2002:a17:902:ef4f:b0:234:a139:1208 with SMTP id d9443c01a7336-23823fcd6cbmr51966165ad.16.1750847255247; Wed, 25 Jun 2025 03:27:35 -0700 (PDT) Received: from localhost.localdomain ([154.64.226.185]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-237d83f1e1fsm133350635ad.83.2025.06.25.03.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jun 2025 03:27:34 -0700 (PDT) From: Changliang Wu To: aconole@redhat.com, echaudro@redhat.com, i.maximets@ovn.org, dev@openvswitch.org Date: Wed, 25 Jun 2025 18:27:07 +0800 Message-ID: <20250625102710.822034-1-changliang.wu@smartx.com> X-Mailer: git-send-email 2.43.5 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH 0/3] lldp: Add ovs-appctl lldp/neighbor command. 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: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" New appctl 'lldp/neighbor' displays lldp neighbor information. Support json output with --format json --pretty Supoort dot1 and dot3 tlv Example outputs would be: $ ovs-appctl lldp/neighbor ------------------------------------------------------------------------------- LLDP neighbor: ------------------------------------------------------------------------------- Interface: ens13np0 Chassis: Chassis ID: 38:a9:1c:18:a1:0a SysName: 7F-jieru-chuan SysDescr: H3C Comware Platform Software MgmtIP: 192.168.67.234 MgmtIface: 635 Capability: Bridge, on Capability: Router, on Port: PortID: GigabitEthernet1/0/15 PortDescr: GigabitEthernet1/0/15 Interface TTL: 121 MFS: 10240 PMD autoneg: supported: yes, enabled: yes Adv: 10Base-T, HD: yes, FD: yes Adv: 100Base-TX, HD: yes, FD: yes Adv: 1000Base-T, HD: no, FD: yes MAU oper type: 30 MDI Power: supported: yes, enabled: no, pair control: no Device type: PSE VLAN: 1, pvid: yes, VLAN 0001 ------------------------------------------------------------------------------- $ ovs-appctl --format json --pretty lldp/neighbor { "lldp": { "interface": [ { "ens13np0": { "chassis": { "7F-jieru-chuan": { "capability": [ { "enabled": true, "type": "Bridge"}, { "enabled": true, "type": "Router"}], "descr": "H3C Comware Platform Software", "id": { "type": "mac", "value": "38:a9:1c:18:a1:0a"}, "mgmt-iface": [ 635], "mgmt-ip": [ "192.168.67.234"]}}, "port": { "auto-negotiation": { "advertised": [ { "fd": true, "hd": true, "type": "10Base-T"}, { "fd": true, "hd": true, "type": "100Base-TX"}, { "fd": true, "hd": false, "type": "1000Base-T"}], "current": 30, "enabled": true, "supported": true}, "desc": "GigabitEthernet1/0/15 Interface", "id": { "type": "ifname", "value": "GigabitEthernet1/0/15"}, "mfs": 10240, "power": { "device-type": "PSE", "enabled": false, "paircontrol": false, "supported": true}, "ttl": 121}, "ppid": { "enabled": false, "supported": false}, "vlan": { "pvid": true, "value": "VLAN 0001", "vlan-id": 1}}}]}} Changliang Wu (3): lldp: Add ovs-appctl lldp/neighbor command. lldp: Decode dot1 dot3 tlv and display in lldp/neighbor. tests: lldp: Add testcases for lldp/neighbor. NEWS | 2 + lib/lldp/lldp-const.h | 41 ++- lib/lldp/lldp.c | 76 ++++- lib/lldp/lldpd-structs.h | 24 ++ lib/ovs-lldp.c | 630 +++++++++++++++++++++++++++++++++++++ tests/automake.mk | 1 + tests/ovs-lldp.at | 335 ++++++++++++++++++++ tests/testsuite.at | 1 + vswitchd/ovs-vswitchd.8.in | 4 + 9 files changed, 1096 insertions(+), 18 deletions(-) create mode 100644 tests/ovs-lldp.at