Page MenuHomeFreeBSD

netmap: pkt-gen: several updates from upstream
ClosedPublic

Authored by vmaffione on Oct 25 2018, 10:31 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 11 2024, 9:50 PM
Unknown Object (File)
Dec 31 2023, 4:03 AM
Unknown Object (File)
Dec 31 2023, 4:03 AM
Unknown Object (File)
Dec 31 2023, 4:03 AM
Unknown Object (File)
Dec 31 2023, 3:59 AM
Unknown Object (File)
Dec 20 2023, 12:01 AM
Unknown Object (File)
Dec 12 2023, 1:26 AM
Unknown Object (File)
Nov 16 2023, 9:57 AM
Subscribers

Details

Summary

Various improvements to the netmap pkt-gen program:

  • indentation fixes
  • support for IPV6
  • fixes to checksum computation
  • support for NS_MOREFRAG
  • rate limiting in ping mode
Test Plan

Tested locally with many types of interfaces.
Tested by the community for months.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bcr added a subscriber: bcr.

OK from manpages (don't forget to bump the .Dd, even for such a small content change).

This revision is now accepted and ready to land.Oct 25 2018, 10:57 AM
0mp requested changes to this revision.Oct 25 2018, 1:06 PM
0mp added a subscriber: 0mp.

Please correct me if I'm wrong but you seem to add some functionalities to this software (potentially even some new flags) without documenting those changes in the manual page. Is that right?

This revision now requires changes to proceed.Oct 25 2018, 1:06 PM

@0mp corrected me that there is no .Dd needed. There was no change in the syntax in the man page itself, just whitespace fixes. In those cases, you can leave the .Dd as it is.

You are right, I'm updating the man page. This will take a while :)

Addressed reviewer's comments.
pkt-gen man page and usage() cleaned up to reflect the real options.
Some old/unused/obsolete options have been removed.

0mp requested changes to this revision.Oct 31 2018, 2:58 PM

Also, igor and mandoc -Tlint still report some errors.

pkt-gen.8
59 ↗(On Diff #49615)

tx is not an argument name. It is a fixed string that the user may provide to the utility to change its behavior. Therefor it is a command modifier and it should use Cm instead of Ar.

The same applies to rx, ping, ... below.

150 ↗(On Diff #49615)

.Ar len

202 ↗(On Diff #49615)

You probably want something like this:

.It Fl C Ar tx_slots Ns Oo Cm \&, Ns Ar rx_slots Ns Oo Cm \&, Ns Ar tx_rings Ns Oo Cm \&, Ns Ar rx_rings Oc Oc Oc

I may fix formatting in a different commit, as there are some similar issues in the synopsis section, if you prefer.

221 ↗(On Diff #49615)

I am not sure if I understand this sentence.

235 ↗(On Diff #49615)

I'd use Dq here (or even Dq Li) instead of Ar.

244 ↗(On Diff #49615)

It would be better to put this example in a code block:

.Bd
pkg-gen -i cxl0 -f rx
.Ed

The same applies to the other example.

This revision now requires changes to proceed.Oct 31 2018, 2:58 PM
vmaffione marked 6 inline comments as done.

Thanks for the suggestions.
I did not implement two of the suggested changes, see inline.
igor and mandoc -Tlint report zero errors

Flushing unsubmitted comments

pkt-gen.8
221 ↗(On Diff #49615)

I noticed there is an offset between your comments should be displayed and where I actually see them. I'm afraid I don't understand which sentence you don't understand.

244 ↗(On Diff #49615)

If I try something like that I get a mandoc -Tlint error:

Bd: skipping display without arguments

0mp requested changes to this revision.Oct 31 2018, 3:59 PM

Good job so far. There are couple of issues left:

  1. igor produces the following errors on my machine (FreeBSD 13.0-CURRENT r339443 GENERIC amd64, igor-1.595):
pkt-gen.8:33:.Sh DESCRIPTION used here:but .Nm has not been defined
pkt-gen.8:33:.Sh DESCRIPTION used here:but .Nd has not been defined
pkt-gen.8:33:.Sh DESCRIPTION used here:but .Sh SYNOPSIS has not been defined
  1. mandoc -Tlint produces the following errors:
mandoc: ./pkt-gen.8:10:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:8:2: WARNING: bad NAME section content: Bl
mandoc: ./pkt-gen.8:7:2: WARNING: NAME section without Nm before Nd
mandoc: ./pkt-gen.8:7:2: WARNING: NAME section without description
mandoc: ./pkt-gen.8:34:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:44:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:57:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:69:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:105:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:132:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:141:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:158:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:222:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:230:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:245:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:253:2: ERROR: missing manual name, using "": Nm
mandoc: ./pkt-gen.8:257:6: STYLE: referenced manual not found: Xr bridge 8
  1. I like to render manpage as HTML to see if everything is fine. You may like the idea as well ;)
mandoc -Thtml > /tmp/a.html ./pkg-gen.8
firefox /tmp/a.html
pkt-gen.8
221 ↗(On Diff #49615)

I'm referring to:

.Nm
.Xr netmap 4
or
.Xr bpf 4
but which is most often used with
.Xr netmap 4 .
235 ↗(On Diff #49615)

I think you skipped this one.

244 ↗(On Diff #49615)

Oh right, I have not provided you with the full syntax:

.Bd -literal -offset indent
...

should do the job.

This revision now requires changes to proceed.Oct 31 2018, 3:59 PM
vmaffione marked 4 inline comments as done.
  1. Is a good idea, thanks.

For 1 and 2 I'm sorry , but I only have freefall.freebsd.org and some VMs where I do not see those errors.
Also, it looks like most of those error messages do not make sense...

pkt-gen.8
221 ↗(On Diff #49615)

Yes, I also do not really understand that. pkt-gen transmits/receives to/from netmap ports. The tx/rx functions are also able to work on TAP or PCAP interfaces.

I think @gnn wrote this sentence ? Maybe he can shed some light on what he meant exactly?

235 ↗(On Diff #49615)

I replaced .Ar with .Dq. Maybe we are talking about different lines? I mean line

.Dq tx_slots,rx_slots,tx_rings,rx_rings .

Is there anything I can do to progress on this?

This revision is now accepted and ready to land.Nov 6 2018, 12:48 PM

Remove dependency on commit r340279.

This revision now requires review to proceed.Nov 9 2018, 8:51 AM

LGTM this can be committed with Approved by: gnn (mentor)

This revision is now accepted and ready to land.Nov 10 2018, 7:57 AM
This revision was automatically updated to reflect the committed changes.