1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
11 * Shared port info, including statistics information for display by server.
12 * Structure will be put in a memzone.
13 * - All port id values share one cache line as this data will be read-only
15 * - All rx statistic values share cache lines, as this data is written only
16 * by the server process. (rare reads by stats display)
17 * - The tx statistics have values for all ports per cache line, but the stats
18 * themselves are written by the clients, so we have a distinct set, on different
19 * cache lines for each client to use.
22 uint64_t rx[RTE_MAX_ETHPORTS];
23 } __rte_cache_aligned;
26 uint64_t tx[RTE_MAX_ETHPORTS];
27 uint64_t tx_drop[RTE_MAX_ETHPORTS];
28 } __rte_cache_aligned;
32 uint16_t id[RTE_MAX_ETHPORTS];
33 volatile struct rx_stats rx_stats;
34 volatile struct tx_stats tx_stats[MAX_CLIENTS];
37 /* define common names for structures shared between server and client */
38 #define MP_CLIENT_RXQ_NAME "MProc_Client_%u_RX"
39 #define PKTMBUF_POOL_NAME "MProc_pktmbuf_pool"
40 #define MZ_PORT_INFO "MProc_port_info"
43 * Given the rx queue name template above, get the queue name
45 static inline const char *
46 get_rx_queue_name(uint8_t id)
48 /* buffer for return value. Size calculated by %u being replaced
49 * by maximum 3 digits (plus an extra byte for safety) */
50 static char buffer[sizeof(MP_CLIENT_RXQ_NAME) + 2];
52 snprintf(buffer, sizeof(buffer), MP_CLIENT_RXQ_NAME, id);
56 #define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1