From nobody Thu Jan 11 05:34:27 2024 X-Original-To: dev-commits-src-all@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 4T9YJN2mG0z56VXj; Thu, 11 Jan 2024 05:34:28 +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 4T9YJN13wVz47ws; Thu, 11 Jan 2024 05:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951268; 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=OcdhsvNIsYS+oEc2yD5oQHxuuCcOCXe/oj6oh8PkKkk=; b=CTFcK85eh9QbieOqZ2GVlbPjQNfhuCz2+rZ1Lqu7W1r/Y5rIvyUPIU5cISp/vQZbl+rHJK a9JZ2nhQ1keJFEL7lnvCrcAistF2jXDp040hli1pJqubYUn/8FSpTsdzf02CYKsCvDwZVf xfV1xcOvx44/WCB1nBNLQpMQeFCHCr2AK3+NsNAC+hXDQuPBQcP6R2k2F5WSzs2iO3+elR auNcrZrxg+qZf3t2jpM4oEwGmazIqEs0ygroHAjKh1yYhMAc8NvR+9VSybDh2vq5mmAfht dPwJYDZ3/BluxR/xzQocZv9Axw5Qvcv7VP34XjddrQ0F0MuvTzcP5DDGLJa/zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951268; 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=OcdhsvNIsYS+oEc2yD5oQHxuuCcOCXe/oj6oh8PkKkk=; b=JWd07UJmJSTZX8V3O6SM1Qy2qwNPieq+Djzp2L4cUsD5QxLgXe+/N8+2uasGV3GzrJeVNX 7wbW5PM6mcUEWoM/P1YN7dVNg9rETRbmASeGint23lveNVekK9SzC19ZQYD+tkr5EKskAt T/v4IWPutnvnk99ns31qrJURSxA1dy3Hv5als4QoszTzbMYRnLWXHjJUcyVJm29cscA0S1 iXKI729MzEL3P4oewBU8e8ar3MXJjxnxuA3eVCjsjHlbmCUey4DsHiDn7HDkoQMfHw6A2+ 29qxWb8S4VwuoDxj0nMjsGJ0ycI7KoU3znW14G49WyI0rwZ0ncD2zsUZx9z3wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951268; a=rsa-sha256; cv=none; b=lhRJiBZEdZZe7yY3mcpq3jAbFmA4Nc4gUjkT5NxZ+U30czByGXwCE5rNPwPBVRCSAIsQhq 6pVvA7zC3fsYz5F1iV8axKFhNbgt5Q51T2b8YOCyo3iIMNsutFigxkQLntdnrXDRAFg2cC P6GRdFDvqvuLJcU1fDHwKe5HkzpWlvFI8VM2fOkMn76omVWum7UNue43+PUkJ0pIO3GNhA 7I1QfAi7vdnL9k064O8WRGbkj9/UlArM19BPWNOU7+1u2+4NpCqblDD0iWPnxJCHClLKPu +EmwWLzIPxNpNXqHGPWmRybwtmF/iLEMNePyFJKPsYCqac715xlfALVRxAGrog== 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 4T9YJM73qKz15S7; Thu, 11 Jan 2024 05:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5YRLa009834; Thu, 11 Jan 2024 05:34:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5YRuq009829; Thu, 11 Jan 2024 05:34:27 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:34:27 GMT Message-Id: <202401110534.40B5YRuq009829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: f0eedbcd8039 - stable/13 - cxgbetool(8): Add support for tracing loopback traffic for a port. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f0eedbcd80395190ff120b37beb59097827a1892 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f0eedbcd80395190ff120b37beb59097827a1892 commit f0eedbcd80395190ff120b37beb59097827a1892 Author: Navdeep Parhar AuthorDate: 2023-04-02 00:43:20 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:06:58 +0000 cxgbetool(8): Add support for tracing loopback traffic for a port. Use lo to tap the loopback for port . Sponsored by: Chelsio Communications (cherry picked from commit 4913a24e7910edf5a3f52536b780d1b1d4bb73a4) --- 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 6f9031240515..c02bc7fdc054 100644 --- a/usr.sbin/cxgbetool/cxgbetool.c +++ b/usr.sbin/cxgbetool/cxgbetool.c @@ -122,7 +122,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" ); @@ -2476,17 +2476,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]);