unsigned digest_length;
unsigned block_size;
- uint16_t cipher_dataunit_len;
+ uint32_t cipher_dataunit_len;
struct l2fwd_iv cipher_iv;
struct l2fwd_iv auth_iv;
static struct rte_eth_conf port_conf = {
.rxmode = {
- .mq_mode = ETH_MQ_RX_NONE,
- .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+ .mq_mode = RTE_ETH_MQ_RX_NONE,
.split_hdr_size = 0,
},
.txmode = {
- .mq_mode = ETH_MQ_TX_NONE,
+ .mq_mode = RTE_ETH_MQ_TX_NONE,
},
};
struct l2fwd_crypto_statistics crypto_statistics[RTE_CRYPTO_MAX_DEVS];
/* A tsc-based timer responsible for triggering statistics printout */
-#define TIMER_MILLISECOND 2000000ULL /* around 1ms at 2 Ghz */
+#define TIMER_MILLISECOND (rte_get_tsc_hz() / 1000)
#define MAX_TIMER_PERIOD 86400UL /* 1 day max */
-
-/* default period is 10 seconds */
-static int64_t timer_period = 10 * TIMER_MILLISECOND * 1000;
+#define DEFAULT_TIMER_PERIOD 10UL
/* Print out statistics on packets dropped */
static void
}
/* if timer is enabled */
- if (timer_period > 0) {
+ if (options->refresh_period > 0) {
/* advance the timer */
timer_tsc += diff_tsc;
/* if timer has reached its timeout */
if (unlikely(timer_tsc >=
- (uint64_t)timer_period)) {
+ options->refresh_period)) {
/* do this only on main core */
- if (lcore_id == rte_get_main_lcore()
- && options->refresh_period) {
+ if (lcore_id == rte_get_main_lcore()) {
print_stats();
timer_tsc = 0;
}
else if (strcmp(lgopts[option_index].name, "cipher_dataunit_len") == 0) {
retval = parse_size(&val, optarg);
- if (retval == 0 && val >= 0 && val <= UINT16_MAX) {
+ if (retval == 0 && val >= 0) {
options->cipher_xform.cipher.dataunit_len =
- (uint16_t)val;
+ (uint32_t)val;
return 0;
} else
return -1;
{
options->portmask = 0xffffffff;
options->nb_ports_per_lcore = 1;
- options->refresh_period = 10000;
+ options->refresh_period = DEFAULT_TIMER_PERIOD *
+ TIMER_MILLISECOND * 1000;
options->single_lcore = 0;
options->sessionless = 0;
continue;
}
/* clear all_ports_up flag if any link down */
- if (link.link_status == ETH_LINK_DOWN) {
+ if (link.link_status == RTE_ETH_LINK_DOWN) {
all_ports_up = 0;
break;
}
RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_4096_BYTES))
ret = -1;
break;
+ case 1048576:
+ if (!(cap->sym.cipher.dataunit_set &
+ RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_1_MEGABYTES))
+ ret = -1;
+ break;
default:
ret = -1;
}
return retval;
}
- if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+ if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
- DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+ RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
retval = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
if (retval < 0) {
printf("Cannot configure device: err=%d, port=%u\n",
last_portid = portid;
}
- l2fwd_enabled_port_mask |= (1 << portid);
+ l2fwd_enabled_port_mask |= (1ULL << portid);
enabled_portcount++;
}