reorder ops in sk_start to avoid possibly rolling back ifq_deq.
authordlg <dlg@openbsd.org>
Thu, 1 Jun 2017 23:22:14 +0000 (23:22 +0000)
committerdlg <dlg@openbsd.org>
Thu, 1 Jun 2017 23:22:14 +0000 (23:22 +0000)
commit54e34ddfb56fb015e759306da07b071d74b82f5b
treeda99217c41a6b67db9b9555790e72a1f29fa3d40
parenta79cb044b6e71bc5058d4f279f2c10c1039f2303
reorder ops in sk_start to avoid possibly rolling back ifq_deq.

instead of checking for space after beggining to deq a packet, check
for space before committing to handling a packet. this means we
can use ifq_dequeue instead of ifq_deq_begin/commit/rollback.

this is a port of src/sys/dev/pci/if_sk.c r1.187, but tweaked to
account for msk using twice the tx ring descriptors thanks to its
annoying support for 64bit addresses.

tested on an od1000
ok jmatthew@ sthen@
sys/dev/pci/if_msk.c