git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
config: cleanup duplicated comments
[dpdk.git]
/
examples
/
ip_reassembly
/
main.c
diff --git
a/examples/ip_reassembly/main.c
b/examples/ip_reassembly/main.c
index
7311b29
..
3bb6afd
100644
(file)
--- a/
examples/ip_reassembly/main.c
+++ b/
examples/ip_reassembly/main.c
@@
-942,19
+942,19
@@
setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, uint32_t queue)
}
/*
}
/*
- * At any given moment up to <max_flow_num * (MAX_FRAG_NUM
- 1
)>
+ * At any given moment up to <max_flow_num * (MAX_FRAG_NUM)>
* mbufs could be stored int the fragment table.
* Plus, each TX queue can hold up to <max_flow_num> packets.
*/
* mbufs could be stored int the fragment table.
* Plus, each TX queue can hold up to <max_flow_num> packets.
*/
- nb_mbuf =
2 *
RTE_MAX(max_flow_num, 2UL * MAX_PKT_BURST) * MAX_FRAG_NUM;
+ nb_mbuf = RTE_MAX(max_flow_num, 2UL * MAX_PKT_BURST) * MAX_FRAG_NUM;
nb_mbuf *= (port_conf.rxmode.max_rx_pkt_len + BUF_SIZE - 1) / BUF_SIZE;
nb_mbuf *= (port_conf.rxmode.max_rx_pkt_len + BUF_SIZE - 1) / BUF_SIZE;
- nb_mbuf += RTE_TEST_RX_DESC_DEFAULT + RTE_TEST_TX_DESC_DEFAULT;
nb_mbuf *= 2; /* ipv4 and ipv6 */
nb_mbuf *= 2; /* ipv4 and ipv6 */
+ nb_mbuf += RTE_TEST_RX_DESC_DEFAULT + RTE_TEST_TX_DESC_DEFAULT;
nb_mbuf = RTE_MAX(nb_mbuf, (uint32_t)NB_MBUF);
nb_mbuf = RTE_MAX(nb_mbuf, (uint32_t)NB_MBUF);
-
rte_
snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue);
+ snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue);
if ((rxq->pool = rte_mempool_create(buf, nb_mbuf, MBUF_SIZE, 0,
sizeof(struct rte_pktmbuf_pool_private),
if ((rxq->pool = rte_mempool_create(buf, nb_mbuf, MBUF_SIZE, 0,
sizeof(struct rte_pktmbuf_pool_private),
@@
-990,7
+990,7
@@
init_mem(void)
if (socket_lpm[socket] == NULL) {
RTE_LOG(INFO, IP_RSMBL, "Creating LPM table on socket %i\n", socket);
if (socket_lpm[socket] == NULL) {
RTE_LOG(INFO, IP_RSMBL, "Creating LPM table on socket %i\n", socket);
-
rte_
snprintf(buf, sizeof(buf), "IP_RSMBL_LPM_%i", socket);
+ snprintf(buf, sizeof(buf), "IP_RSMBL_LPM_%i", socket);
lpm = rte_lpm_create(buf, socket, LPM_MAX_RULES, 0);
if (lpm == NULL) {
lpm = rte_lpm_create(buf, socket, LPM_MAX_RULES, 0);
if (lpm == NULL) {
@@
-1002,7
+1002,7
@@
init_mem(void)
if (socket_lpm6[socket] == NULL) {
RTE_LOG(INFO, IP_RSMBL, "Creating LPM6 table on socket %i\n", socket);
if (socket_lpm6[socket] == NULL) {
RTE_LOG(INFO, IP_RSMBL, "Creating LPM6 table on socket %i\n", socket);
-
rte_
snprintf(buf, sizeof(buf), "IP_RSMBL_LPM_%i", socket);
+ snprintf(buf, sizeof(buf), "IP_RSMBL_LPM_%i", socket);
lpm6 = rte_lpm6_create("IP_RSMBL_LPM6", socket, &lpm6_config);
if (lpm6 == NULL) {
lpm6 = rte_lpm6_create("IP_RSMBL_LPM6", socket, &lpm6_config);
if (lpm6 == NULL) {
@@
-1093,6
+1093,10
@@
MAIN(int argc, char **argv)
if (init_mem() < 0)
rte_panic("Cannot initialize memory structures!\n");
if (init_mem() < 0)
rte_panic("Cannot initialize memory structures!\n");
+ /* check if portmask has non-existent ports */
+ if (enabled_port_mask & ~(RTE_LEN2MASK(nb_ports, unsigned)))
+ rte_exit(EXIT_FAILURE, "Non-existent ports in portmask!\n");
+
/* initialize all ports */
for (portid = 0; portid < nb_ports; portid++) {
/* skip ports that are not enabled */
/* initialize all ports */
for (portid = 0; portid < nb_ports; portid++) {
/* skip ports that are not enabled */
@@
-1114,7
+1118,7
@@
MAIN(int argc, char **argv)
qconf = &lcore_queue_conf[rx_lcore_id];
}
qconf = &lcore_queue_conf[rx_lcore_id];
}
- socket = rte_
eth_dev
_socket_id(portid);
+ socket = rte_
lcore_to
_socket_id(portid);
if (socket == SOCKET_ID_ANY)
socket = 0;
if (socket == SOCKET_ID_ANY)
socket = 0;