summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ring.c5
-rw-r--r--ring.h2
-rw-r--r--ring_rx.c2
3 files changed, 4 insertions, 5 deletions
diff --git a/ring.c b/ring.c
index dc58a07..2a0a6b5 100644
--- a/ring.c
+++ b/ring.c
@@ -45,10 +45,9 @@ void mmap_ring_generic(int sock, struct ring *ring)
panic("Cannot mmap {TX,RX}_RING!\n");
}
-void alloc_ring_frames_generic(struct ring *ring, int num, size_t size)
+void alloc_ring_frames_generic(struct ring *ring, size_t num, size_t size)
{
- int i;
- size_t len = num * sizeof(*ring->frames);
+ size_t i, len = num * sizeof(*ring->frames);
ring->frames = xmalloc_aligned(len, CO_CACHE_LINE_SIZE);
fmemset(ring->frames, 0, len);
diff --git a/ring.h b/ring.h
index 0ac72bb..6517a80 100644
--- a/ring.h
+++ b/ring.h
@@ -200,7 +200,7 @@ static inline int get_sockopt_tpacket(int sock)
extern void setup_ring_layout_generic(int sock, struct ring *ring, size_t size,
bool jumbo_support);
extern void mmap_ring_generic(int sock, struct ring *ring);
-extern void alloc_ring_frames_generic(struct ring *ring, int num, size_t size);
+extern void alloc_ring_frames_generic(struct ring *ring, size_t num, size_t size);
extern void bind_ring_generic(int sock, struct ring *ring, int ifindex, bool tx_only);
#endif /* RING_H */
diff --git a/ring_rx.c b/ring_rx.c
index 1df7eb3..8ddc44b 100644
--- a/ring_rx.c
+++ b/ring_rx.c
@@ -91,7 +91,7 @@ static inline void setup_rx_ring_layout_v3(struct ring *ring __maybe_unused)
{
}
-static inline int rx_ring_get_num(struct ring *ring, bool v3 __maybe_unused)
+static inline size_t rx_ring_get_num(struct ring *ring, bool v3 __maybe_unused)
{
return ring->layout.tp_frame_nr;
}