Page MenuHomeFreeBSD

xen-netfront: fix initialization
ClosedPublic

Authored by royger on May 31 2016, 12:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 23 2024, 3:37 PM
Unknown Object (File)
Sep 22 2024, 3:37 PM
Unknown Object (File)
Sep 17 2024, 5:03 AM
Unknown Object (File)
Sep 12 2024, 6:54 AM
Unknown Object (File)
Sep 12 2024, 6:53 AM
Unknown Object (File)
Sep 12 2024, 6:53 AM
Unknown Object (File)
Sep 12 2024, 6:53 AM
Unknown Object (File)
Sep 12 2024, 6:48 AM
Subscribers

Details

Summary

A couple of mostly cosmetic fixes for the final initialization of netfront:

  • Switch to "connected" state before starting to kick the rings.
  • Correctly use "rxq" in the initialization loop (previously rxq was not updated in the loop, and netfront would kick np->rxq[N] several times).
  • Kick the TX task in case there are packets pending for send.

Sponsored by: Citrix Systems R&D

Diff Detail

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

Event Timeline

royger retitled this revision from to xen-netfront: fix initialization.
royger updated this object.
royger edited the test plan for this revision. (Show Details)
royger added a reviewer: liuw_liuw.name.
sys/dev/xen/netfront/netfront.c
1973 ↗(On Diff #17147)

It's better to leave this in the state changing function.

Just move this before calling xn_connect will do, right?

sys/dev/xen/netfront/netfront.c
1973 ↗(On Diff #17147)

Thanks for the review!

I'm not sure that's correct. If the call to xenbus_set_state is done before calling xn_connect, netfront would be switching to state 4 before writing the ring information on xenstore (grant-ref, evtchn) and the features. I'm quite sure netback would choke if it sees state 4 but no shared-ring information on xenstore.

I could split out the last part of xn_connect into something like xn_kick_rings, and then call xenbus_set_state in the middle:

xn_connect(...)
xenbus_set_state(...)
xn_kick_rings(...)

Does that look better?

sys/dev/xen/netfront/netfront.c
1973 ↗(On Diff #17147)

Yes, that's better.

But, maybe we could just remove the taskqueue_enqueue and leave that to the interrupt handler? Because that's more or less what Linux netfront does -- it allocates resources, kick the backend, no kicking itself is done.

Sorry our freebsd vm is not yet back online so I can't easily navigate the freebsd code.

Split xn_kick_rings from xn_connect and leave the set_state call at the same
place. Also remove the taskqueue kick.

This revision is now accepted and ready to land.Jun 6 2016, 11:07 AM
This revision was automatically updated to reflect the committed changes.