MCPcopy Create free account
hub / github.com/F-Stack/f-stack / update_flow_mask

Function update_flow_mask

dpdk/lib/acl/acl_run_avx512.c:39–64  ·  view source on GitHub ↗

* Update flow and result masks based on the number of unprocessed flows. */

Source from the content-addressed store, hash-verified

37 * Update flow and result masks based on the number of unprocessed flows.
38 */
39static inline uint32_t
40update_flow_mask(const struct acl_flow_avx512 *flow, uint32_t *fmsk,
41 uint32_t *rmsk)
42{
43 uint32_t i, j, k, m, n;
44
45 fmsk[0] ^= rmsk[0];
46 m = rmsk[0];
47
48 k = rte_popcount32(m);
49 n = flow->total_packets - flow->num_packets;
50
51 if (n < k) {
52 /* reduce mask */
53 for (i = k - n; i != 0; i--) {
54 j = sizeof(m) * CHAR_BIT - 1 - rte_clz32(m);
55 m ^= 1 << j;
56 }
57 } else
58 n = k;
59
60 rmsk[0] = m;
61 fmsk[0] |= rmsk[0];
62
63 return n;
64}
65
66/*
67 * Resolve matches for multiple categories (LE 8, use 128b instructions/regs)

Callers 1

_F_(match_process)Function · 0.85

Calls 2

rte_popcount32Function · 0.85
rte_clz32Function · 0.85

Tested by

no test coverage detected