Page MenuHomeFreeBSD

[bhyve] Pass a complete string of parameters to network backends
ClosedPublic

Authored by afedorov on May 6 2020, 3:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 6:33 AM
Unknown Object (File)
Fri, Nov 29, 2:18 AM
Unknown Object (File)
Thu, Nov 28, 12:46 PM
Unknown Object (File)
Thu, Nov 28, 6:56 AM
Unknown Object (File)
Nov 9 2024, 7:21 AM
Unknown Object (File)
Oct 5 2024, 6:44 AM
Unknown Object (File)
Oct 3 2024, 7:52 PM
Unknown Object (File)
Oct 1 2024, 7:11 PM
Subscribers

Details

Summary

These changes are needed to integrate the Netgraph backend. See discussion: https://reviews.freebsd.org/D24620

I also think passing all the arguments to the backend can be useful in the future.

Test Plan

Test various combinations with mac and mtu options:

  • -s X:Y,virtio-net,tap,mtu=X,mac=XXXXXX
  • -s X:Y,virtio-net,valeN:M,mtu=X,mac=XXXXXX
  • -s X:Y,e1000,tap,mtu=X,mac=XXXXXX
  • -s X:Y,e1000,valeN:M,mtu=X,mac=XXXXXX

And without options:

  • -s X:Y,virtio-net,tap
  • -s X:Y,virtio-net
  • -s X:Y,e1000,tap
  • -s X:Y,e1000

Diff Detail

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

Event Timeline

vmaffione added inline comments.
usr.sbin/bhyve/net_backends.c
759 ↗(On Diff #71460)

Please return -1. The caller will check errno if needed.
I know below (EINVAL) is returned, but I see that as a leftover that should be removed.

usr.sbin/bhyve/pci_e82545.c
2284 ↗(On Diff #71460)

optscopy may be a better name?

This revision is now accepted and ready to land.May 6 2020, 7:00 PM
This revision now requires review to proceed.May 7 2020, 11:05 AM
  • Fix the indicated issues.

@vmaffione , if you have no objection, can I commit these changes?

Have you tested the case with no arguments, e.g.:

-s X:Y,virtio-net,tap1

?
After that, please go ahead and commit.
Thanks.

This revision is now accepted and ready to land.May 7 2020, 8:17 PM
afedorov edited the test plan for this revision. (Show Details)
  • Free optscopy early.
  • While I'm here, fix a memory leak in e1000 frontend.
This revision now requires review to proceed.May 8 2020, 4:59 PM
This revision was not accepted when it landed; it landed in state Needs Review.May 8 2020, 5:15 PM
This revision was automatically updated to reflect the committed changes.