From patchwork Wed Jun 24 01:01:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 217228 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFAA5C433DF for ; Wed, 24 Jun 2020 01:02:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A76AB214DB for ; Wed, 24 Jun 2020 01:02:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388326AbgFXBCg (ORCPT ); Tue, 23 Jun 2020 21:02:36 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:57424 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388161AbgFXBCT (ORCPT ); Tue, 23 Jun 2020 21:02:19 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1jntnq-001woJ-KA; Wed, 24 Jun 2020 03:02:14 +0200 From: Andrew Lunn To: Michal Kubecek Cc: netdev , Chris Healy , Andrew Lunn Subject: [PATCH ethtool v1 0/6] ethtool(1) cable test support Date: Wed, 24 Jun 2020 03:01:49 +0200 Message-Id: <20200624010155.464334-1-andrew@lunn.ch> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add the user space side of the ethtool cable test. The TDR output is most useful when fed to some other tool which can visualize the data. So add JSON support, by borrowing code from iproute2. Andrew Lunn (6): Add cable test support Add cable test TDR support json_writer: Import the iproute2 helper code for JSON output Add --json command line argument parsing ethtool.8.in: Document the cable test commands ethtool.8.in: Add --json option Makefile.am | 5 +- ethtool.8.in | 53 ++++ ethtool.c | 46 +++- internal.h | 4 + json_writer.c | 389 +++++++++++++++++++++++++++ json_writer.h | 76 ++++++ netlink/cable_test.c | 624 +++++++++++++++++++++++++++++++++++++++++++ netlink/extapi.h | 4 + netlink/monitor.c | 8 + netlink/netlink.h | 5 +- netlink/parser.c | 41 +++ netlink/parser.h | 4 + 12 files changed, 1245 insertions(+), 14 deletions(-) create mode 100644 json_writer.c create mode 100644 json_writer.h create mode 100644 netlink/cable_test.c