Commit 8b013930 authored by Leonardo Lai's avatar Leonardo Lai

minor fixes

parent 23161034
......@@ -190,7 +190,6 @@ static int init_shared_memzone(void)
memset(mz->addr, 0, sizeof(*exch_zone_desc));
exch_zone_desc = mz->addr;
// TODO any field to set to a specific value?
return 0;
}
......@@ -247,9 +246,7 @@ int udpdk_init(int argc, char *argv[])
// Start the secondary process
poller_pid = fork();
if (poller_pid != 0) {
// application
if (poller_pid != 0) { // parent -> application
// Initialize EAL (returns how many arguments it consumed)
retval = rte_eal_init(argc, argv);
if (retval < 0) {
......@@ -303,9 +300,7 @@ int udpdk_init(int argc, char *argv[])
RTE_LOG(ERR, INIT, "Cannot initialize exchange slots\n");
return -1;
}
// TODO initialize shared structures
} else {
// child -> packet poller
} else { // child -> packet poller
// TODO the arguments should come from a config rather than being hardcoded
int poller_argc = 6;
char *poller_argv[6] = {
......
......@@ -344,7 +344,7 @@ void poller_body(void)
// Transmit packets to DPDK port 0 (queue 0)
for (i = 0; i < NUM_SOCKETS_MAX; i++) {
if (exch_zone_desc->slots[i].used) {
tx_sendable = rte_ring_dequeue_burst(exch_slots[i].tx_q, (void **)txbuf, PKT_READ_SIZE, NULL);
tx_sendable = rte_ring_dequeue_burst(exch_slots[i].tx_q, (void **)txbuf, PKT_WRITE_SIZE, NULL);
if (likely(tx_sendable > 0)) {
tx_count = rte_eth_tx_burst(PORT_TX, QUEUE_TX, txbuf, tx_sendable); // TODO should call a send function that accoubts for fragmentation
if (unlikely(tx_count < tx_sendable)) {
......@@ -360,7 +360,6 @@ void poller_body(void)
rx_count = rte_eth_rx_burst(PORT_RX, QUEUE_RX, rxbuf, PKT_READ_SIZE);
if (likely(rx_count > 0)) {
printf("poller rxcount: %d\n", rx_count); // TODO debug
// Prefetch some packets (to reduce cache misses later)
for (j = 0; j < PREFETCH_OFFSET && j < rx_count; j++) {
rte_prefetch0(rte_pktmbuf_mtod(rxbuf[j], void *));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment