Bug 240530 - netgraph/ng_source: Allow ng_source to inject into any netgraph network
Summary: netgraph/ng_source: Allow ng_source to inject into any netgraph network
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.0-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-net (Nobody)
URL:
Keywords: feature, needs-qa
Depends on:
Blocks:
 
Reported: 2019-09-12 10:26 UTC by Lutz Donnerhacke
Modified: 2021-02-16 08:28 UTC (History)
1 user (show)

See Also:
koobs: mfc-stable12?
koobs: mfc-stable11?


Attachments
patch to ng_source in 12-STABLE train (585 bytes, patch)
2019-09-12 10:26 UTC, Lutz Donnerhacke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lutz Donnerhacke freebsd_committer freebsd_triage 2019-09-12 10:26:14 UTC
Created attachment 207415 [details]
patch to ng_source in 12-STABLE train

ng_source is a module for debugging and performance measurement within netgraph.

The current implementation is designed to emit packets to an physical ethernet interface and tries to maximize the hardware throughput. There is already code to limit the packet rate injected (maxpps) further.

The whole code is able to inject any netgraph messages into any netgraph network, despite the dependency to a physical interface prohibits this at the moment.

This patch allows to use the ng_source module to be used in arbitary netgraph network. In order to limit the rate of packets injected, the maxpps part needs to be enforced if there is no assigned ethernet interface available.

I personally use this patch to profile somewhat complex netgraph networks, which terminate in i.e. in eiface nodes.
Comment 1 Lutz Donnerhacke freebsd_committer freebsd_triage 2019-10-10 13:14:08 UTC
Comment on attachment 207415 [details]
patch to ng_source in 12-STABLE train

Replaced by https://reviews.freebsd.org/D21968
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-01-17 21:18:58 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=75e7ef74dfc12e01b1ef4706110d238639e04543

commit 75e7ef74dfc12e01b1ef4706110d238639e04543
Author:     Lutz Donnerhacke <donner@FreeBSD.org>
AuthorDate: 2021-01-17 20:35:28 +0000
Commit:     Lutz Donnerhacke <donner@FreeBSD.org>
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(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-02-16 08:28:23 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=591e21210e35b7b0ed0a8c39404e15a1225976bf

commit 591e21210e35b7b0ed0a8c39404e15a1225976bf
Author:     Lutz Donnerhacke <donner@FreeBSD.org>
AuthorDate: 2021-01-17 20:35:28 +0000
Commit:     Lutz Donnerhacke <donner@FreeBSD.org>
CommitDate: 2021-02-16 08:25:59 +0000

    netgraph/ng_source: Allow ng_source to inject into any netgraph network

    PR:             240530
    Reviewed by:    kp
    Differential Revision: https://reviews.freebsd.org/D21968

    (cherry picked from commit 75e7ef74dfc12e01b1ef4706110d238639e04543)

 share/man/man4/ng_source.4 | 11 +++++++++--
 sys/netgraph/ng_source.c   |  4 ++--
 2 files changed, 11 insertions(+), 4 deletions(-)