Commit 494b9dae authored by Joanne Hugé's avatar Joanne Hugé

WIP: segfault

parent f255cff5
......@@ -416,10 +416,6 @@ static void log_exit(const char * section, const char * msg, ...) {
#define TX_POOL_SIZE 16
#ifdef DPDK
#include "dpdk.c"
static void send_packets(int port) {
}
/* DPDK */
#else
......@@ -695,13 +691,8 @@ static void *send_thread(void *p) {
int pkt_size;
pkt[i] = rte_pktmbuf_alloc(tx_mbuf_pool);
eth_hdr = rte_pktmbuf_mtod(pkt[i], struct rte_ether_hdr*);
if(port) {
eth_hdr->d_addr = s_addr;
eth_hdr->s_addr = d_addr;
} else {
eth_hdr->d_addr = d_addr;
eth_hdr->s_addr = s_addr;
}
eth_hdr->d_addr = d_addr;
eth_hdr->s_addr = s_addr;
eth_hdr->ether_type = htons(0xaefe);
memcpy(rte_pktmbuf_mtod_offset(pkt[i], uint8_t *, sizeof(struct rte_ether_hdr)), RBUF_READ0(tx_rbuf, uint8_t), 8 + s->tx_n_channel * 60);
rbuf_update_read_index(&tx_rbuf);
......@@ -711,7 +702,7 @@ static void *send_thread(void *p) {
}
while(nb_tx < TX_POOL_SIZE) {
int64_t x = TX_POOL_SIZE - nb_tx;
nb_tx += rte_eth_tx_burst(port, 0, pkt + nb_tx, x > BURST_SIZE ? BURST_SIZE : x);
nb_tx += rte_eth_tx_burst(0, 0, pkt + nb_tx, x > BURST_SIZE ? BURST_SIZE : x);
}
/* Free any unsent packets. */
......
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