Page MenuHomeFreeBSD

valectl(8) patch to use the new netmap API
Needs ReviewPublic

Authored by hrs on Aug 23 2020, 9:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 23, 12:48 PM
Unknown Object (File)
Wed, Oct 23, 12:47 PM
Unknown Object (File)
Wed, Oct 23, 12:29 PM
Unknown Object (File)
Oct 6 2024, 8:30 AM
Unknown Object (File)
Oct 3 2024, 6:19 AM
Unknown Object (File)
Oct 3 2024, 1:25 AM
Unknown Object (File)
Sep 19 2024, 12:46 PM
Unknown Object (File)
Sep 19 2024, 12:46 PM

Details

Summary

Update to use new netmap API. Changes include:

  • Use err(3) function family to report errors.
  • Print no or fewer message when an operation is completed successfully.
  • Fix usage() to make it consistent with the valectl(8) manual page and the actual implementation.
  • Minor wording changes and markup fixes in the valectl(8) manual page.

No functional change except for command-line messages from the valectl(8) utility.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33112
Build 30480: arc lint + arc unit

Event Timeline

hrs requested review of this revision.Aug 23 2020, 9:00 AM

Thanks a lot @hrs !
However, there is still a pending change in the upstream netmap repository:

https://github.com/luigirizzo/netmap/blob/master/apps/vale-ctl/vale-ctl.c

that also makes use of the new "libnetmap" library.
This needs to be checked in first, and unfortunately it will cause most of your changes to valectl.c to conflict. I'm sorry for that.

Btw, we need to check in libnetmap first. The idea is to use it as a static library to be included in the application binary.
I guess the best choice would be to put the lib into lib/libnemtap in the src tree? Do you have any better suggestions? Any guidelines or example on how to configure the build system to link valectl to libnetmap?

This revision now requires changes to proceed.Aug 23 2020, 5:25 PM

Thanks a lot @hrs !
However, there is still a pending change in the upstream netmap repository:

https://github.com/luigirizzo/netmap/blob/master/apps/vale-ctl/vale-ctl.c

Ah, I did not notice it. Thanks for the pointer. So importing it sounds much better.

that also makes use of the new "libnetmap" library.
This needs to be checked in first, and unfortunately it will cause most of your changes to valectl.c to conflict. I'm sorry for that.

No problem at all.

Btw, we need to check in libnetmap first. The idea is to use it as a static library to be included in the application binary.
I guess the best choice would be to put the lib into lib/libnemtap in the src tree? Do you have any better suggestions? Any guidelines or example on how to configure the build system to link valectl to libnetmap?

Yes, lib/libnetmap is the best location. I think lib/libcrypt and usr.bin/enigma are simple enough to learn the build infrastructure involving a library and a binary depending on it. Names in LIBADD must be registered to share/mk/src.libnames.mk.

If valectl and libnetmap are developed in the netmap repository, we might want to import them to the vendor branch like libpcap. You can see how it works by looking into lib/libpcap and contrib/libpcap.

Thanks for the pointers.
In any case, once I manage to align from upstream, we can still keep at least the manpage changes.

Now that libnetmap has been merged and valectl updated, we can apply part of this change (documentation, usage, error checking).

Not relevant anymore.

This revision now requires review to proceed.Jan 23 2023, 9:33 PM
pauamma_gundo.com added inline comments.
usr.sbin/valectl/valectl.8
27

Bump on commit

135

While touching this file: should this read "The forms with one or two numbers ..."?