Skip to content

Commit ecd42d8

Browse files
shemmingertmonjalo
authored andcommitted
bpf: use bulk free on filtered packets
When rte_pktmbuf_free_bulk is faster because it does single mempool operation rather than per-packet. Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Konstantin Ananyev <[email protected]> Reviewed-by: Marat Khalili <[email protected]>
1 parent 0247b16 commit ecd42d8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/bpf/bpf_pkt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ apply_filter(struct rte_mbuf *mb[], const uint64_t rc[], uint32_t num,
177177

178178
if (drop != 0) {
179179
/* free filtered out mbufs */
180-
for (i = 0; i != k; i++)
181-
rte_pktmbuf_free(dr[i]);
180+
rte_pktmbuf_free_bulk(dr, k);
182181
} else {
183182
/* copy filtered out mbufs beyond good ones */
184183
for (i = 0; i != k; i++)

0 commit comments

Comments
 (0)