From owner-dev-commits-src-all@freebsd.org Sun Jan 17 21:18:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03C274D87E1; Sun, 17 Jan 2021 21:18:37 +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 4DJnpN6h67z4XZ5; Sun, 17 Jan 2021 21:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 D825B606; Sun, 17 Jan 2021 21:18:36 +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 10HLIam5098985; Sun, 17 Jan 2021 21:18:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10HLIaIV098984; Sun, 17 Jan 2021 21:18:36 GMT (envelope-from git) Date: Sun, 17 Jan 2021 21:18:36 GMT Message-Id: <202101172118.10HLIaIV098984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 75e7ef74dfc1 - main - netgraph/ng_source: Allow ng_source to inject into any netgraph network MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75e7ef74dfc12e01b1ef4706110d238639e04543 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 21:18:37 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=75e7ef74dfc12e01b1ef4706110d238639e04543 commit 75e7ef74dfc12e01b1ef4706110d238639e04543 Author: Lutz Donnerhacke AuthorDate: 2021-01-17 20:35:28 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-01-17 21:17:01 +0000 netgraph/ng_source: Allow ng_source to inject into any netgraph network PR: 240530 Reviewed by: kp Approved by: kp (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D21968 --- share/man/man4/ng_source.4 | 11 +++++++++-- sys/netgraph/ng_source.c | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/share/man/man4/ng_source.4 b/share/man/man4/ng_source.4 index 5205bc41e15d..87b235bda2c8 100644 --- a/share/man/man4/ng_source.4 +++ b/share/man/man4/ng_source.4 @@ -32,7 +32,7 @@ .\" Author: Dave Chapeskie .\" $FreeBSD$ .\" -.Dd March 1, 2007 +.Dd January 18, 2021 .Dt NG_SOURCE 4 .Os .Sh NAME @@ -91,7 +91,14 @@ should be turned off on .Xr ng_ether 4 node manually. .Pp -Once interface is configured, upon receipt of a +If the node is connected to a netgraph network, which does not +terminate in a real +.Xr ng_ether 4 +interface, limit the packet injection rate explicitly with the +.Va NGM_SOURCE_SETPPS +control message. +.Pp +Upon receipt of a .Dv NGM_SOURCE_START control message the node starts sending the previously queued packets out the diff --git a/sys/netgraph/ng_source.c b/sys/netgraph/ng_source.c index da8f42381ac3..401548da65d0 100644 --- a/sys/netgraph/ng_source.c +++ b/sys/netgraph/ng_source.c @@ -683,8 +683,8 @@ ng_source_clr_data (sc_p sc) static int ng_source_start(sc_p sc, uint64_t packets) { - if (sc->output_ifp == NULL) { - printf("ng_source: start without iface configured\n"); + if (sc->output_ifp == NULL && sc->stats.maxPps == 0) { + printf("ng_source: start without iface or pps configured\n"); return (ENXIO); }