Page MenuHomeFreeBSD

Fix PR222744 - netmap errors with iflib em driver
ClosedPublic

Authored by shurd on Oct 23 2017, 4:47 PM.

Details

Summary

Fix error when refilling netmap buffers that resulted in the first
buffer of the successive passes through ifl_bus_addrs[] leaving the
first value unset (tmp_pidx started at 1, not zero after the first time
through the loop).

Leave the one unused buffer required by some NICs visible in the netmap
ring rather than hidden. There will always be a buffer in use by the
kernel now when an iflib driver is used via netmap.

Always get the netmap slot index via netmap_idx_n2k() to account for
nkr_hwofs in a consistent way.

Split shared functionality into new functions.
iru_init(): shared by _iflib_fl_refill() and netmap_fl_refill()
netmap_fl_refill(): shared by iflib_netmap_rxsync() and
iflib_netmap_rxq_init()

Test Plan

Have reporter test, test with netmap packet generator

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

shurd created this revision.Oct 23 2017, 4:47 PM

Added this diff and built a new kernel last night and let the netmap application "lb" run all night, with tcpdump reading from two netmap pipes and everything appeared to run just fine. I have not been able to cause a panic with the e1000 network interface. There is some issue with the lb app that was not working correctly (it was not load balancing flows), so I will be running just tcpdump with "-i netmap:em0" overnight to verify a clean packet capture.

This revision is now accepted and ready to land.Oct 30 2017, 8:18 PM
This revision was automatically updated to reflect the committed changes.