/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * version: DPDK.L.1.2.3-3
*/
#include <stdio.h>
#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */
#define MAX_PKT_BURST 32
-#define BURST_TX_DRAIN 200000ULL /* around 100us at 2 Ghz */
-
-#define SOCKET0 0
+#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */
#define TX_QUEUE_FLUSH_MASK 0xFFFFFFFF
#define TSC_COUNT_LIMIT 1000
.rx_adv_conf = {
.rss_conf = {
.rss_key = NULL,
- .rss_hf = ETH_RSS_IPV4,
+ .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6,
},
},
.txmode = {
+ .mq_mode = ETH_MQ_TX_NONE,
},
};
static inline uint8_t
get_output_port(uint8_t input_port)
{
- return (uint8_t)(input_port ^ 1);
+ RTE_BUILD_BUG_ON((RTE_MAX_ETHPORTS & 1) != 0);
+ /* Simple scheme to map consecutive ports. */
+ return (uint8_t)(input_port ^ 1);
}
/* main processing loop */
{
uint32_t lcoreid;
struct lcore_conf *qconf;
+ const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US;
lcoreid = rte_lcore_id();
qconf = &lcore_conf[lcoreid];
tsc = rte_rdtsc();
diff_tsc = tsc - qconf->tsc;
- if (unlikely(diff_tsc > BURST_TX_DRAIN)) {
+ if (unlikely(diff_tsc > drain_tsc)) {
nic_tx_flush_queues(qconf);
crypto_flush_tx_queue(lcoreid);
qconf->tsc = tsc;
print_usage(const char *prgname)
{
printf ("%s [EAL options] -- -p PORTMASK [--no-promisc]"
- " [--config (port,queue,lcore)[,(port,queue,lcore]]\n"
+ " [--config '(port,queue,lcore)[,(port,queue,lcore)]'\n"
" -p PORTMASK: hexadecimal bitmask of ports to configure\n"
" --no-promisc: disable promiscuous mode (default is ON)\n"
- " --config (port,queue,lcore): rx queues configuration\n",
+ " --config '(port,queue,lcore)': rx queues configuration\n",
prgname);
}
fflush(stdout);
ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
- socketid, &rx_conf, pktmbuf_pool[socketid]);
+ socketid, &rx_conf, pktmbuf_pool[socketid]);
if (ret < 0)
rte_panic("rte_eth_rx_queue_setup: err=%d,"
"port=%d\n", ret, portid);