Page MenuHomeFreeBSD

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

Authored by afedorov on May 6 2020, 3:00 PM.

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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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.