Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ioat/ioat.c
Show First 20 Lines • Show All 792 Lines • ▼ Show 20 Lines | for (i = 0; i < current_size; i++) { | ||||
ring[new_idx]->id = new_idx; | ring[new_idx]->id = new_idx; | ||||
} | } | ||||
/* add new descriptors to the ring */ | /* add new descriptors to the ring */ | ||||
for (i = current_size; i < new_size; i++) { | for (i = current_size; i < new_size; i++) { | ||||
new_idx = (ioat->tail + i) & (new_size - 1); | new_idx = (ioat->tail + i) & (new_size - 1); | ||||
ring[new_idx] = ioat_alloc_ring_entry(ioat); | ring[new_idx] = ioat_alloc_ring_entry(ioat); | ||||
if (!ring[new_idx]) { | if (ring[new_idx] == NULL) { | ||||
while (i--) { | while (i--) { | ||||
new_idx2 = (ioat->tail + i) & | new_idx2 = (ioat->tail + i) & | ||||
(new_size - 1); | (new_size - 1); | ||||
ioat_free_ring_entry(ioat, | ioat_free_ring_entry(ioat, | ||||
ring[new_idx2]); | ring[new_idx2]); | ||||
} | } | ||||
free(ring, M_IOAT); | free(ring, M_IOAT); | ||||
▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines |