summaryrefslogtreecommitdiff
path: root/ring_rx.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-11-06 10:48:55 +0100
committerTobias Klauser <tklauser@distanz.ch>2015-11-06 10:48:55 +0100
commite9889f58e2e116d10f6b683a267423086b6cf00f (patch)
treea2376e79ece4e38ce75c2a6d4d40bcef2480eeeb /ring_rx.c
parentc1c3bc8c146b9f395790164a9b4aabebc9f5ab25 (diff)
ring: Move common ring block_r/frame_nr shrinking to generic function
Merge shrinking code duplicated for RX/TX rings into an own generic function. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'ring_rx.c')
-rw-r--r--ring_rx.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ring_rx.c b/ring_rx.c
index 8ddc44b..9c63dbd 100644
--- a/ring_rx.c
+++ b/ring_rx.c
@@ -165,10 +165,7 @@ retry:
layout_size);
if (errno == ENOMEM && ring->layout.tp_block_nr > 1) {
- ring->layout.tp_block_nr >>= 1;
- ring->layout.tp_frame_nr = ring->layout.tp_block_size /
- ring->layout.tp_frame_size *
- ring->layout.tp_block_nr;
+ shrink_ring_layout_generic(ring);
goto retry;
}
if (ret < 0)