From nobody Sun Apr 02 01:09:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PpwtG0KdXz43fqV; Sun, 2 Apr 2023 01:09:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PpwtF6V7fz3HdK; Sun, 2 Apr 2023 01:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680397797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OofaQqqKJz9JCxY4TH6TTHaepeWd/uwn8cqVDss/GJA=; b=tQVOyVLv5+zs9+Jf3iTwnUQb7PyNDWbGPXfdPn6JTCvriVDYL8vUEW8leuZy7gczQGtVEP OB4c2e1RXPpOKOQ9dqgVkKNTV5inZAJhWDAsIJ5l1mqQ0I/PIbkycXd8ZsiIG7v49GiLoW ZTunWz/lF4ekZtqqM8M7v+9vp7j5SLSHtkPAPE2nT6/5pdhdo6lxbSRy00+4kkNQW9sA+N VVuhig5+Qy5knjFFWs+TytSaNDNsYnxf5kgaXzOhE6n+4gaNvwqBIru7YEE9yBhzOG86NB uutXzrVAlm41kKpxTcZSUOq7zV4XPiZekVDcjyc4JnrSSSZZZNBwtMVTw4P2OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680397797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OofaQqqKJz9JCxY4TH6TTHaepeWd/uwn8cqVDss/GJA=; b=q1oiv/DmpKiO9yMRdbqWNimKWgmiNVX1QKHjWaSga7JsYOaJMjofydbv1EIQDtdUYMOIKZ nLy7S+BpxBGTJbY+oJNav17q4f2pi4JQa5mzCx4shK7M6+oqTIPxgbD27xAYUSDVe1rPrb fUI4w/suPuPxIwJz2K8538env3E8ciSvpH1/ponsI1ZSDLWKcX79eTOVkeI2VPkdewpj5L nuYtPjU0lJaAEwWIGfNvNF2S3rKsRKMwgar/kMV3GMvompnCRVOPk/HLws5Ej1WIEcWU7T SI1sxZCXJQ+52fOjVLhqjeU542CTRUrKdknc5tlb0lHf4/wZYoCl8tOCwNy7wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680397797; a=rsa-sha256; cv=none; b=sfeHICYRMmj7bfYOZhatTNGaLjarrWkyR/oFgZMw5vqoJd7UWfRX2dMTCzsHnOpV0y/Wjf vn+WClfMy0I0mLaPYUBZmE9kYOylew1DPF3CgP+0+j5esp749RvONx17SvPQgzfRib7gAG xMI1TGwijXxUQoHKKi4kGmXk1NhJaD8HZAL1/uno5kTAy2ZcVm1Df9Mv5F5NGmEJEJKf0t JPbJrBP5h+VlHA1ybxmGEAaQsJuCKTJCVMRohjBRjbaMJadWx7LHAMpUc7YlYSp+qcEPFS Sknuv5/UFbVeu5pegQyjbf6OW9NjvcTr98cQBBRGBUe15Fp+LyuIAieD16cpMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PpwtF58KgzxRv; Sun, 2 Apr 2023 01:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33219vZM054589; Sun, 2 Apr 2023 01:09:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33219vCx054588; Sun, 2 Apr 2023 01:09:57 GMT (envelope-from git) Date: Sun, 2 Apr 2023 01:09:57 GMT Message-Id: <202304020109.33219vCx054588@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 4913a24e7910 - main - cxgbetool(8): Add support for tracing loopback traffic for a port. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4913a24e7910edf5a3f52536b780d1b1d4bb73a4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=4913a24e7910edf5a3f52536b780d1b1d4bb73a4 commit 4913a24e7910edf5a3f52536b780d1b1d4bb73a4 Author: Navdeep Parhar AuthorDate: 2023-04-02 00:43:20 +0000 Commit: Navdeep Parhar CommitDate: 2023-04-02 00:50:57 +0000 cxgbetool(8): Add support for tracing loopback traffic for a port. Use lo to tap the loopback for port . MFC after: 1 week Sponsored by: Chelsio Communications --- usr.sbin/cxgbetool/cxgbetool.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/usr.sbin/cxgbetool/cxgbetool.c b/usr.sbin/cxgbetool/cxgbetool.c index 43707df0b47a..149eacb54924 100644 --- a/usr.sbin/cxgbetool/cxgbetool.c +++ b/usr.sbin/cxgbetool/cxgbetool.c @@ -124,7 +124,7 @@ usage(FILE *fp) "\tsched-queue bind NIC queues to TX Scheduling class\n" "\tstdio interactive mode\n" "\ttcb read TCB\n" - "\ttracer tx|rx set and enable a tracer\n" + "\ttracer tx|rx|lo set and enable a tracer\n" "\ttracer disable|enable disable or enable a tracer\n" "\ttracer list list all tracers\n" ); @@ -2478,17 +2478,24 @@ set_tracer(uint8_t idx, int argc, const char *argv[]) t.valid = 1; if (argc != 1) { - warnx("must specify tx or rx."); + warnx("must specify one of tx/rx/lo"); return (EINVAL); } len = strlen(argv[0]); if (len != 3) { - warnx("argument must be 3 characters (tx or rx)"); + warnx("argument must be 3 characters (tx/rx/lo). eg. tx0"); return (EINVAL); } - if (strncmp(argv[0], "tx", 2) == 0) { + if (strncmp(argv[0], "lo", 2) == 0) { + port = argv[0][2] - '0'; + if (port < 0 || port > 3) { + warnx("'%c' in %s is invalid", argv[0][2], argv[0]); + return (EINVAL); + } + port += 8; + } else if (strncmp(argv[0], "tx", 2) == 0) { port = argv[0][2] - '0'; if (port < 0 || port > 3) { warnx("'%c' in %s is invalid", argv[0][2], argv[0]);