1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2016-2017 Intel Corporation
8 #include <rte_hash_crc.h>
13 * Shared port info, including statistics information for display by server.
14 * Structure will be put in a memzone.
15 * - All port id values share one cache line as this data will be read-only
17 * - All rx statistic values share cache lines, as this data is written only
18 * by the server process. (rare reads by stats display)
19 * - The tx statistics have values for all ports per cache line, but the stats
20 * themselves are written by the nodes, so we have a distinct set, on different
21 * cache lines for each node to use.
24 uint64_t rx[RTE_MAX_ETHPORTS];
25 } __rte_cache_aligned;
28 uint64_t tx[RTE_MAX_ETHPORTS];
29 uint64_t tx_drop[RTE_MAX_ETHPORTS];
30 } __rte_cache_aligned;
35 } __rte_cache_aligned;
41 uint16_t id[RTE_MAX_ETHPORTS];
42 struct rx_stats rx_stats;
43 struct tx_stats tx_stats[MAX_NODES];
44 struct filter_stats filter_stats[MAX_NODES];
47 /* define common names for structures shared between server and node */
48 #define MP_NODE_RXQ_NAME "MProc_Node_%u_RX"
49 #define PKTMBUF_POOL_NAME "MProc_pktmbuf_pool"
50 #define MZ_SHARED_INFO "MProc_shared_info"
53 * Given the rx queue name template above, get the queue name
55 static inline const char *
56 get_rx_queue_name(unsigned int id)
59 * Buffer for return value. Size calculated by %u being replaced
60 * by maximum 3 digits (plus an extra byte for safety)
62 static char buffer[sizeof(MP_NODE_RXQ_NAME) + 2];
64 snprintf(buffer, sizeof(buffer), MP_NODE_RXQ_NAME, id);
68 #define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1