DPDK: upgrade to DPDK 19.11.6(LTS).

This commit is contained in:
fengbojiang 2021-01-28 17:08:59 +00:00
parent 8d0052bc9a
commit 0c6bd47016
841 changed files with 19024 additions and 8324 deletions

View File

@ -46,7 +46,7 @@ M: Jerin Jacob <jerinj@marvell.com>
T: git://dpdk.org/next/dpdk-next-net-mrvl
Next-net-mlx Tree
M: Raslan Darawsheh <rasland@mellanox.com>
M: Raslan Darawsheh <rasland@nvidia.com>
T: git://dpdk.org/next/dpdk-next-net-mlx
Next-virtio Tree
@ -128,8 +128,11 @@ F: meson.build
F: lib/librte_eal/freebsd/BSDmakefile.meson
F: meson_options.txt
F: config/rte_config.h
F: buildtools/call-sphinx-build.py
F: buildtools/gen-pmdinfo-cfile.sh
F: buildtools/map_to_def.py
F: buildtools/list-dir-globs.py
F: buildtools/pkg-config/
F: buildtools/symlink-drivers-solibs.sh
Public CI
@ -370,7 +373,7 @@ F: devtools/test-null.sh
F: doc/guides/prog_guide/switch_representation.rst
Flow API
M: Ori Kam <orika@mellanox.com>
M: Ori Kam <orika@nvidia.com>
T: git://dpdk.org/next/dpdk-next-net
F: app/test-pmd/cmdline_flow.c
F: doc/guides/prog_guide/rte_flow.rst
@ -456,8 +459,8 @@ F: lib/librte_eventdev/*crypto_adapter*
F: app/test/test_event_crypto_adapter.c
F: doc/guides/prog_guide/event_crypto_adapter.rst
Raw device API - EXPERIMENTAL
M: Shreyansh Jain <shreyansh.jain@nxp.com>
Raw device API
M: Nipun Gupta <nipun.gupta@nxp.com>
M: Hemant Agrawal <hemant.agrawal@nxp.com>
F: lib/librte_rawdev/
F: drivers/raw/skeleton/
@ -728,17 +731,17 @@ F: doc/guides/nics/features/octeontx2*.ini
F: doc/guides/nics/octeontx2.rst
Mellanox mlx4
M: Matan Azrad <matan@mellanox.com>
M: Shahaf Shuler <shahafs@mellanox.com>
M: Matan Azrad <matan@nvidia.com>
M: Shahaf Shuler <shahafs@nvidia.com>
T: git://dpdk.org/next/dpdk-next-net-mlx
F: drivers/net/mlx4/
F: doc/guides/nics/mlx4.rst
F: doc/guides/nics/features/mlx4.ini
Mellanox mlx5
M: Matan Azrad <matan@mellanox.com>
M: Shahaf Shuler <shahafs@mellanox.com>
M: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
M: Matan Azrad <matan@nvidia.com>
M: Shahaf Shuler <shahafs@nvidia.com>
M: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
T: git://dpdk.org/next/dpdk-next-net-mlx
F: drivers/net/mlx5/
F: buildtools/options-ibverbs-static.sh
@ -746,7 +749,7 @@ F: doc/guides/nics/mlx5.rst
F: doc/guides/nics/features/mlx5.ini
Microsoft vdev_netvsc - EXPERIMENTAL
M: Matan Azrad <matan@mellanox.com>
M: Matan Azrad <matan@nvidia.com>
F: drivers/net/vdev_netvsc/
F: doc/guides/nics/vdev_netvsc.rst
F: doc/guides/nics/features/vdev_netvsc.ini
@ -1491,7 +1494,7 @@ M: Marko Kovacevic <marko.kovacevic@intel.com>
F: examples/fips_validation/
F: doc/guides/sample_app_ug/fips_validation.rst
M: Ori Kam <orika@mellanox.com>
M: Ori Kam <orika@nvidia.com>
F: examples/flow_filtering/
F: doc/guides/sample_app_ug/flow_filtering.rst

View File

@ -1 +1 @@
19.11.2
19.11.6

View File

@ -151,7 +151,7 @@ static uint8_t multiple_core_capture;
static void
pdump_usage(const char *prgname)
{
printf("usage: %s [EAL options]"
printf("usage: %s [EAL options] --"
" --["CMD_LINE_OPT_MULTI"]\n"
" --"CMD_LINE_OPT_PDUMP" "
"'(port=<port id> | device_id=<pci id or vdev name>),"

View File

@ -12,7 +12,7 @@
#include <rte_lcore.h>
#include <rte_ip.h>
#define PRINT_USAGE_START "%s [EAL options]\n"
#define PRINT_USAGE_START "%s [EAL options] --\n"
#define RTE_LOGTYPE_TESTACL RTE_LOGTYPE_USER1

View File

@ -1 +1 @@
test_vectors/turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_high_snr.data
test_vectors/ldpc_enc_v2342.data

View File

@ -582,7 +582,8 @@ main(int argc, char **argv)
goto err;
}
if (!opts.silent)
if (!opts.silent && opts.test != CPERF_TEST_TYPE_THROUGHPUT &&
opts.test != CPERF_TEST_TYPE_LATENCY)
show_test_vector(t_vec);
total_nb_qps = nb_cryptodevs * opts.nb_qps;

View File

@ -13,3 +13,6 @@ sources = files('cperf_ops.c',
'cperf_test_verify.c',
'main.c')
deps += ['cryptodev', 'security']
if dpdk_conf.has('RTE_LIBRTE_PMD_CRYPTO_SCHEDULER')
deps += 'pmd_crypto_scheduler'
endif

View File

@ -197,6 +197,10 @@ evt_parse_nb_timer_adptrs(struct evt_options *opt, const char *arg)
int ret;
ret = parser_read_uint8(&(opt->nb_timer_adptrs), arg);
if (opt->nb_timer_adptrs <= 0) {
evt_err("Number of timer adapters cannot be <= 0");
return -EINVAL;
}
return ret;
}

View File

@ -495,6 +495,8 @@ pipeline_atq_capability_check(struct evt_options *opt)
evt_nr_active_lcores(opt->wlcores),
dev_info.max_event_ports);
}
if (!evt_has_all_types_queue(opt->dev_id))
return false;
return true;
}

View File

@ -385,12 +385,16 @@ pipeline_event_tx_adapter_setup(struct evt_options *opt,
if (!(cap & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT)) {
uint32_t service_id = -1U;
rte_event_eth_tx_adapter_service_id_get(consm,
&service_id);
ret = rte_event_eth_tx_adapter_service_id_get(consm,
&service_id);
if (ret != -ESRCH && ret != 0) {
evt_err("Failed to get Tx adptr service ID");
return ret;
}
ret = evt_service_setup(service_id);
if (ret) {
evt_err("Failed to setup service core"
" for Tx adapter\n");
" for Tx adapter");
return ret;
}
}

View File

@ -42,8 +42,6 @@
#include "main.h"
struct app_params app;
static const char usage[] = "\n";
void

View File

@ -55,7 +55,7 @@ static const struct rte_bpf_xsym bpf_xsym[] = {
struct cmd_bpf_ld_result {
cmdline_fixed_string_t bpf;
cmdline_fixed_string_t dir;
uint8_t port;
uint16_t port;
uint16_t queue;
cmdline_fixed_string_t op;
cmdline_fixed_string_t flags;
@ -153,7 +153,7 @@ cmdline_parse_inst_t cmd_operate_bpf_ld_parse = {
struct cmd_bpf_unld_result {
cmdline_fixed_string_t bpf;
cmdline_fixed_string_t dir;
uint8_t port;
uint16_t port;
uint16_t queue;
};

View File

@ -94,7 +94,7 @@ static void cmd_help_brief_parsed(__attribute__((unused)) void *parsed_result,
" help ports : Configuring ports.\n"
" help registers : Reading and setting port registers.\n"
" help filters : Filters configuration help.\n"
" help traffic_management : Traffic Management commmands.\n"
" help traffic_management : Traffic Management commands.\n"
" help devices : Device related cmds.\n"
" help all : All of the above sections.\n\n"
);
@ -614,7 +614,7 @@ static void cmd_help_long_parsed(void *parsed_result,
"set bonding mode IEEE802.3AD aggregator policy (port_id) (agg_name)"
" Set Aggregation mode for IEEE802.3AD (mode 4)"
"set bonding xmit_balance_policy (port_id) (l2|l23|l34)\n"
"set bonding balance_xmit_policy (port_id) (l2|l23|l34)\n"
" Set the transmit balance policy for bonded device running in balance mode.\n\n"
"set bonding mon_period (port_id) (value)\n"
@ -1913,18 +1913,13 @@ cmd_config_rx_tx_parsed(void *parsed_result,
nb_txq = res->value;
}
else if (!strcmp(res->name, "rxd")) {
if (res->value <= 0 || res->value > RTE_TEST_RX_DESC_MAX) {
printf("rxd %d invalid - must be > 0 && <= %d\n",
res->value, RTE_TEST_RX_DESC_MAX);
if (check_nb_rxd(res->value) != 0)
return;
}
nb_rxd = res->value;
} else if (!strcmp(res->name, "txd")) {
if (res->value <= 0 || res->value > RTE_TEST_TX_DESC_MAX) {
printf("txd %d invalid - must be > 0 && <= %d\n",
res->value, RTE_TEST_TX_DESC_MAX);
if (check_nb_txd(res->value) != 0)
return;
}
nb_txd = res->value;
} else {
printf("Unknown parameter\n");
@ -4173,6 +4168,9 @@ cmd_tx_vlan_set_parsed(void *parsed_result,
{
struct cmd_tx_vlan_set_result *res = parsed_result;
if (port_id_is_invalid(res->port_id, ENABLED_WARN))
return;
if (!port_is_stopped(res->port_id)) {
printf("Please stop port %d first\n", res->port_id);
return;
@ -4227,6 +4225,9 @@ cmd_tx_vlan_set_qinq_parsed(void *parsed_result,
{
struct cmd_tx_vlan_set_qinq_result *res = parsed_result;
if (port_id_is_invalid(res->port_id, ENABLED_WARN))
return;
if (!port_is_stopped(res->port_id)) {
printf("Please stop port %d first\n", res->port_id);
return;
@ -4340,6 +4341,9 @@ cmd_tx_vlan_reset_parsed(void *parsed_result,
{
struct cmd_tx_vlan_reset_result *res = parsed_result;
if (port_id_is_invalid(res->port_id, ENABLED_WARN))
return;
if (!port_is_stopped(res->port_id)) {
printf("Please stop port %d first\n", res->port_id);
return;
@ -5122,7 +5126,7 @@ cmd_gso_size_parsed(void *parsed_result,
if (test_done == 0) {
printf("Before setting GSO segsz, please first"
" stop fowarding\n");
" stop forwarding\n");
return;
}
@ -16805,8 +16809,10 @@ cmd_ddp_get_list_parsed(
#ifdef RTE_LIBRTE_I40E_PMD
size = PROFILE_INFO_SIZE * MAX_PROFILE_NUM + 4;
p_list = (struct rte_pmd_i40e_profile_list *)malloc(size);
if (!p_list)
if (!p_list) {
printf("%s: Failed to malloc buffer\n", __func__);
return;
}
if (ret == -ENOTSUP)
ret = rte_pmd_i40e_get_ddp_list(res->port_id,

View File

@ -1005,7 +1005,6 @@ static const enum index item_pppoes[] = {
};
static const enum index item_pppoe_proto_id[] = {
ITEM_PPPOE_PROTO_ID,
ITEM_NEXT,
ZERO,
};
@ -2544,11 +2543,14 @@ static const struct token token_list[] = {
session_id)),
},
[ITEM_PPPOE_PROTO_ID] = {
.name = "proto_id",
.name = "pppoe_proto_id",
.help = "match PPPoE session protocol identifier",
.priv = PRIV_ITEM(PPPOE_PROTO_ID,
sizeof(struct rte_flow_item_pppoe_proto_id)),
.next = NEXT(item_pppoe_proto_id),
.next = NEXT(item_pppoe_proto_id, NEXT_ENTRY(UNSIGNED),
item_param),
.args = ARGS(ARGS_ENTRY_HTON
(struct rte_flow_item_pppoe_proto_id, proto_id)),
.call = parse_vc,
},
[ITEM_HIGIG2] = {
@ -3898,30 +3900,15 @@ parse_vc_action_rss(struct context *ctx, const struct token *token,
.func = RTE_ETH_HASH_FUNCTION_DEFAULT,
.level = 0,
.types = rss_hf,
.key_len = sizeof(action_rss_data->key),
.key_len = 0,
.queue_num = RTE_MIN(nb_rxq, ACTION_RSS_QUEUE_NUM),
.key = action_rss_data->key,
.key = NULL,
.queue = action_rss_data->queue,
},
.key = "testpmd's default RSS hash key, "
"override it for better balancing",
.queue = { 0 },
};
for (i = 0; i < action_rss_data->conf.queue_num; ++i)
action_rss_data->queue[i] = i;
if (!port_id_is_invalid(ctx->port, DISABLED_WARN) &&
ctx->port != (portid_t)RTE_PORT_ALL) {
struct rte_eth_dev_info info;
int ret2;
ret2 = rte_eth_dev_info_get(ctx->port, &info);
if (ret2 != 0)
return ret2;
action_rss_data->conf.key_len =
RTE_MIN(sizeof(action_rss_data->key),
info.hash_key_size);
}
action->conf = &action_rss_data->conf;
return ret;
}

View File

@ -1262,6 +1262,7 @@ static void cmd_set_port_meter_policer_action_parsed(void *parsed_result,
ret = rte_mtr_policer_actions_update(port_id, mtr_id,
action_mask, actions, &error);
if (ret != 0) {
free(actions);
print_err_msg(&error);
return;
}

View File

@ -53,6 +53,14 @@
#include "testpmd.h"
#ifdef CLOCK_MONOTONIC_RAW /* Defined in glibc bits/time.h */
#define CLOCK_TYPE_ID CLOCK_MONOTONIC_RAW
#else
#define CLOCK_TYPE_ID CLOCK_MONOTONIC
#endif
#define NS_PER_SEC 1E9
static char *flowtype_to_str(uint16_t flow_type);
static const struct {
@ -125,9 +133,10 @@ nic_stats_display(portid_t port_id)
static uint64_t prev_pkts_tx[RTE_MAX_ETHPORTS];
static uint64_t prev_bytes_rx[RTE_MAX_ETHPORTS];
static uint64_t prev_bytes_tx[RTE_MAX_ETHPORTS];
static uint64_t prev_cycles[RTE_MAX_ETHPORTS];
static uint64_t prev_ns[RTE_MAX_ETHPORTS];
struct timespec cur_time;
uint64_t diff_pkts_rx, diff_pkts_tx, diff_bytes_rx, diff_bytes_tx,
diff_cycles;
diff_ns;
uint64_t mpps_rx, mpps_tx, mbps_rx, mbps_tx;
struct rte_eth_stats stats;
struct rte_port *port = &ports[port_id];
@ -184,10 +193,17 @@ nic_stats_display(portid_t port_id)
}
}
diff_cycles = prev_cycles[port_id];
prev_cycles[port_id] = rte_rdtsc();
if (diff_cycles > 0)
diff_cycles = prev_cycles[port_id] - diff_cycles;
diff_ns = 0;
if (clock_gettime(CLOCK_TYPE_ID, &cur_time) == 0) {
uint64_t ns;
ns = cur_time.tv_sec * NS_PER_SEC;
ns += cur_time.tv_nsec;
if (prev_ns[port_id] != 0)
diff_ns = ns - prev_ns[port_id];
prev_ns[port_id] = ns;
}
diff_pkts_rx = (stats.ipackets > prev_pkts_rx[port_id]) ?
(stats.ipackets - prev_pkts_rx[port_id]) : 0;
@ -195,10 +211,10 @@ nic_stats_display(portid_t port_id)
(stats.opackets - prev_pkts_tx[port_id]) : 0;
prev_pkts_rx[port_id] = stats.ipackets;
prev_pkts_tx[port_id] = stats.opackets;
mpps_rx = diff_cycles > 0 ?
diff_pkts_rx * rte_get_tsc_hz() / diff_cycles : 0;
mpps_tx = diff_cycles > 0 ?
diff_pkts_tx * rte_get_tsc_hz() / diff_cycles : 0;
mpps_rx = diff_ns > 0 ?
(double)diff_pkts_rx / diff_ns * NS_PER_SEC : 0;
mpps_tx = diff_ns > 0 ?
(double)diff_pkts_tx / diff_ns * NS_PER_SEC : 0;
diff_bytes_rx = (stats.ibytes > prev_bytes_rx[port_id]) ?
(stats.ibytes - prev_bytes_rx[port_id]) : 0;
@ -206,10 +222,10 @@ nic_stats_display(portid_t port_id)
(stats.obytes - prev_bytes_tx[port_id]) : 0;
prev_bytes_rx[port_id] = stats.ibytes;
prev_bytes_tx[port_id] = stats.obytes;
mbps_rx = diff_cycles > 0 ?
diff_bytes_rx * rte_get_tsc_hz() / diff_cycles : 0;
mbps_tx = diff_cycles > 0 ?
diff_bytes_tx * rte_get_tsc_hz() / diff_cycles : 0;
mbps_rx = diff_ns > 0 ?
(double)diff_bytes_rx / diff_ns * NS_PER_SEC : 0;
mbps_tx = diff_ns > 0 ?
(double)diff_bytes_tx / diff_ns * NS_PER_SEC : 0;
printf("\n Throughput (since last show)\n");
printf(" Rx-pps: %12"PRIu64" Rx-bps: %12"PRIu64"\n Tx-pps: %12"
@ -223,11 +239,28 @@ nic_stats_display(portid_t port_id)
void
nic_stats_clear(portid_t port_id)
{
int ret;
if (port_id_is_invalid(port_id, ENABLED_WARN)) {
print_valid_ports();
return;
}
rte_eth_stats_reset(port_id);
ret = rte_eth_stats_reset(port_id);
if (ret != 0) {
printf("%s: Error: failed to reset stats (port %u): %s",
__func__, port_id, strerror(-ret));
return;
}
ret = rte_eth_stats_get(port_id, &ports[port_id].stats);
if (ret != 0) {
if (ret < 0)
ret = -ret;
printf("%s: Error: failed to get stats (port %u): %s",
__func__, port_id, strerror(ret));
return;
}
printf("\n NIC statistics for port %d cleared\n", port_id);
}
@ -303,10 +336,21 @@ nic_xstats_clear(portid_t port_id)
print_valid_ports();
return;
}
ret = rte_eth_xstats_reset(port_id);
if (ret != 0) {
printf("%s: Error: failed to reset xstats (port %u): %s",
__func__, port_id, strerror(-ret));
return;
}
ret = rte_eth_stats_get(port_id, &ports[port_id].stats);
if (ret != 0) {
if (ret < 0)
ret = -ret;
printf("%s: Error: failed to get stats (port %u): %s",
__func__, port_id, strerror(ret));
return;
}
}
@ -1234,8 +1278,9 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
return;
}
diag = rte_eth_dev_set_mtu(port_id, mtu);
if (diag == 0 &&
dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) {
if (diag)
printf("Set MTU failed. diag=%d\n", diag);
else if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) {
/*
* Ether overhead in driver is equal to the difference of
* max_rx_pktlen and max_mtu in rte_eth_dev_info when the
@ -1250,10 +1295,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
} else
rte_port->dev_conf.rxmode.offloads &=
~DEV_RX_OFFLOAD_JUMBO_FRAME;
return;
}
printf("Set MTU failed. diag=%d\n", diag);
}
/* Generic flow management functions. */
@ -1526,7 +1568,7 @@ port_flow_query(portid_t port_id, uint32_t rule,
/** List flow rules. */
void
port_flow_list(portid_t port_id, uint32_t n, const uint32_t group[n])
port_flow_list(portid_t port_id, uint32_t n, const uint32_t *group)
{
struct rte_port *port;
struct port_flow *pf;
@ -1643,22 +1685,102 @@ tx_queue_id_is_invalid(queueid_t txq_id)
}
static int
rx_desc_id_is_invalid(uint16_t rxdesc_id)
get_rx_ring_size(portid_t port_id, queueid_t rxq_id, uint16_t *ring_size)
{
if (rxdesc_id < nb_rxd)
struct rte_port *port = &ports[port_id];
struct rte_eth_rxq_info rx_qinfo;
int ret;
ret = rte_eth_rx_queue_info_get(port_id, rxq_id, &rx_qinfo);
if (ret == 0) {
*ring_size = rx_qinfo.nb_desc;
return ret;
}
if (ret != -ENOTSUP)
return ret;
/*
* If the rte_eth_rx_queue_info_get is not support for this PMD,
* ring_size stored in testpmd will be used for validity verification.
* When configure the rxq by rte_eth_rx_queue_setup with nb_rx_desc
* being 0, it will use a default value provided by PMDs to setup this
* rxq. If the default value is 0, it will use the
* RTE_ETH_DEV_FALLBACK_RX_RINGSIZE to setup this rxq.
*/
if (port->nb_rx_desc[rxq_id])
*ring_size = port->nb_rx_desc[rxq_id];
else if (port->dev_info.default_rxportconf.ring_size)
*ring_size = port->dev_info.default_rxportconf.ring_size;
else
*ring_size = RTE_ETH_DEV_FALLBACK_RX_RINGSIZE;
return 0;
}
static int
get_tx_ring_size(portid_t port_id, queueid_t txq_id, uint16_t *ring_size)
{
struct rte_port *port = &ports[port_id];
struct rte_eth_txq_info tx_qinfo;
int ret;
ret = rte_eth_tx_queue_info_get(port_id, txq_id, &tx_qinfo);
if (ret == 0) {
*ring_size = tx_qinfo.nb_desc;
return ret;
}
if (ret != -ENOTSUP)
return ret;
/*
* If the rte_eth_tx_queue_info_get is not support for this PMD,
* ring_size stored in testpmd will be used for validity verification.
* When configure the txq by rte_eth_tx_queue_setup with nb_tx_desc
* being 0, it will use a default value provided by PMDs to setup this
* txq. If the default value is 0, it will use the
* RTE_ETH_DEV_FALLBACK_TX_RINGSIZE to setup this txq.
*/
if (port->nb_tx_desc[txq_id])
*ring_size = port->nb_tx_desc[txq_id];
else if (port->dev_info.default_txportconf.ring_size)
*ring_size = port->dev_info.default_txportconf.ring_size;
else
*ring_size = RTE_ETH_DEV_FALLBACK_TX_RINGSIZE;
return 0;
}
static int
rx_desc_id_is_invalid(portid_t port_id, queueid_t rxq_id, uint16_t rxdesc_id)
{
uint16_t ring_size;
int ret;
ret = get_rx_ring_size(port_id, rxq_id, &ring_size);
if (ret)
return 1;
if (rxdesc_id < ring_size)
return 0;
printf("Invalid RX descriptor %d (must be < nb_rxd=%d)\n",
rxdesc_id, nb_rxd);
printf("Invalid RX descriptor %u (must be < ring_size=%u)\n",
rxdesc_id, ring_size);
return 1;
}
static int
tx_desc_id_is_invalid(uint16_t txdesc_id)
tx_desc_id_is_invalid(portid_t port_id, queueid_t txq_id, uint16_t txdesc_id)
{
if (txdesc_id < nb_txd)
uint16_t ring_size;
int ret;
ret = get_tx_ring_size(port_id, txq_id, &ring_size);
if (ret)
return 1;
if (txdesc_id < ring_size)
return 0;
printf("Invalid TX descriptor %d (must be < nb_txd=%d)\n",
txdesc_id, nb_txd);
printf("Invalid TX descriptor %u (must be < ring_size=%u)\n",
txdesc_id, ring_size);
return 1;
}
@ -1779,11 +1901,7 @@ rx_ring_desc_display(portid_t port_id, queueid_t rxq_id, uint16_t rxd_id)
{
const struct rte_memzone *rx_mz;
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
if (rx_queue_id_is_invalid(rxq_id))
return;
if (rx_desc_id_is_invalid(rxd_id))
if (rx_desc_id_is_invalid(port_id, rxq_id, rxd_id))
return;
rx_mz = ring_dma_zone_lookup("rx_ring", port_id, rxq_id);
if (rx_mz == NULL)
@ -1796,11 +1914,7 @@ tx_ring_desc_display(portid_t port_id, queueid_t txq_id, uint16_t txd_id)
{
const struct rte_memzone *tx_mz;
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
if (tx_queue_id_is_invalid(txq_id))
return;
if (tx_desc_id_is_invalid(txd_id))
if (tx_desc_id_is_invalid(port_id, txq_id, txd_id))
return;
tx_mz = ring_dma_zone_lookup("tx_ring", port_id, txq_id);
if (tx_mz == NULL)
@ -1841,10 +1955,17 @@ rxtx_config_display(void)
struct rte_eth_txconf *tx_conf = &ports[pid].tx_conf[0];
uint16_t *nb_rx_desc = &ports[pid].nb_rx_desc[0];
uint16_t *nb_tx_desc = &ports[pid].nb_tx_desc[0];
uint16_t nb_rx_desc_tmp;
uint16_t nb_tx_desc_tmp;
struct rte_eth_rxq_info rx_qinfo;
struct rte_eth_txq_info tx_qinfo;
uint16_t rx_free_thresh_tmp;
uint16_t tx_free_thresh_tmp;
uint16_t tx_rs_thresh_tmp;
uint16_t nb_rx_desc_tmp;
uint16_t nb_tx_desc_tmp;
uint64_t offloads_tmp;
uint8_t pthresh_tmp;
uint8_t hthresh_tmp;
uint8_t wthresh_tmp;
int32_t rc;
/* per port config */
@ -1858,41 +1979,64 @@ rxtx_config_display(void)
/* per rx queue config only for first queue to be less verbose */
for (qid = 0; qid < 1; qid++) {
rc = rte_eth_rx_queue_info_get(pid, qid, &rx_qinfo);
if (rc)
if (rc) {
nb_rx_desc_tmp = nb_rx_desc[qid];
else
rx_free_thresh_tmp =
rx_conf[qid].rx_free_thresh;
pthresh_tmp = rx_conf[qid].rx_thresh.pthresh;
hthresh_tmp = rx_conf[qid].rx_thresh.hthresh;
wthresh_tmp = rx_conf[qid].rx_thresh.wthresh;
offloads_tmp = rx_conf[qid].offloads;
} else {
nb_rx_desc_tmp = rx_qinfo.nb_desc;
rx_free_thresh_tmp =
rx_qinfo.conf.rx_free_thresh;
pthresh_tmp = rx_qinfo.conf.rx_thresh.pthresh;
hthresh_tmp = rx_qinfo.conf.rx_thresh.hthresh;
wthresh_tmp = rx_qinfo.conf.rx_thresh.wthresh;
offloads_tmp = rx_qinfo.conf.offloads;
}
printf(" RX queue: %d\n", qid);
printf(" RX desc=%d - RX free threshold=%d\n",
nb_rx_desc_tmp, rx_conf[qid].rx_free_thresh);
nb_rx_desc_tmp, rx_free_thresh_tmp);
printf(" RX threshold registers: pthresh=%d hthresh=%d "
" wthresh=%d\n",
rx_conf[qid].rx_thresh.pthresh,
rx_conf[qid].rx_thresh.hthresh,
rx_conf[qid].rx_thresh.wthresh);
printf(" RX Offloads=0x%"PRIx64"\n",
rx_conf[qid].offloads);
pthresh_tmp, hthresh_tmp, wthresh_tmp);
printf(" RX Offloads=0x%"PRIx64"\n", offloads_tmp);
}
/* per tx queue config only for first queue to be less verbose */
for (qid = 0; qid < 1; qid++) {
rc = rte_eth_tx_queue_info_get(pid, qid, &tx_qinfo);
if (rc)
if (rc) {
nb_tx_desc_tmp = nb_tx_desc[qid];
else
tx_free_thresh_tmp =
tx_conf[qid].tx_free_thresh;
pthresh_tmp = tx_conf[qid].tx_thresh.pthresh;
hthresh_tmp = tx_conf[qid].tx_thresh.hthresh;
wthresh_tmp = tx_conf[qid].tx_thresh.wthresh;
offloads_tmp = tx_conf[qid].offloads;
tx_rs_thresh_tmp = tx_conf[qid].tx_rs_thresh;
} else {
nb_tx_desc_tmp = tx_qinfo.nb_desc;
tx_free_thresh_tmp =
tx_qinfo.conf.tx_free_thresh;
pthresh_tmp = tx_qinfo.conf.tx_thresh.pthresh;
hthresh_tmp = tx_qinfo.conf.tx_thresh.hthresh;
wthresh_tmp = tx_qinfo.conf.tx_thresh.wthresh;
offloads_tmp = tx_qinfo.conf.offloads;
tx_rs_thresh_tmp = tx_qinfo.conf.tx_rs_thresh;
}
printf(" TX queue: %d\n", qid);
printf(" TX desc=%d - TX free threshold=%d\n",
nb_tx_desc_tmp, tx_conf[qid].tx_free_thresh);
nb_tx_desc_tmp, tx_free_thresh_tmp);
printf(" TX threshold registers: pthresh=%d hthresh=%d "
" wthresh=%d\n",
tx_conf[qid].tx_thresh.pthresh,
tx_conf[qid].tx_thresh.hthresh,
tx_conf[qid].tx_thresh.wthresh);
pthresh_tmp, hthresh_tmp, wthresh_tmp);
printf(" TX offloads=0x%"PRIx64" - TX RS bit threshold=%d\n",
tx_conf[qid].offloads, tx_conf->tx_rs_thresh);
offloads_tmp, tx_rs_thresh_tmp);
}
}
}
@ -2537,6 +2681,10 @@ set_fwd_lcores_mask(uint64_t lcoremask)
void
set_fwd_lcores_number(uint16_t nb_lc)
{
if (test_done == 0) {
printf("Please stop forwarding first\n");
return;
}
if (nb_lc > nb_cfg_lcores) {
printf("nb fwd cores %u > %u (max. number of configured "
"lcores) - ignored\n",
@ -2684,17 +2832,41 @@ show_tx_pkt_segments(void)
printf("Split packet: %s\n", split);
}
static bool
nb_segs_is_invalid(unsigned int nb_segs)
{
uint16_t ring_size;
uint16_t queue_id;
uint16_t port_id;
int ret;
RTE_ETH_FOREACH_DEV(port_id) {
for (queue_id = 0; queue_id < nb_txq; queue_id++) {
ret = get_tx_ring_size(port_id, queue_id, &ring_size);
if (ret)
return true;
if (ring_size < nb_segs) {
printf("nb segments per TX packets=%u >= "
"TX queue(%u) ring_size=%u - ignored\n",
nb_segs, queue_id, ring_size);
return true;
}
}
}
return false;
}
void
set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs)
{
uint16_t tx_pkt_len;
unsigned i;
if (nb_segs >= (unsigned) nb_txd) {
printf("nb segments per TX packets=%u >= nb_txd=%u - ignored\n",
nb_segs, (unsigned int) nb_txd);
if (nb_segs_is_invalid(nb_segs))
return;
}
/*
* Check that each segment length is greater or equal than
@ -3038,9 +3210,11 @@ vlan_extend_set(portid_t port_id, int on)
}
diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
if (diag < 0)
if (diag < 0) {
printf("rx_vlan_extend_set(port_pi=%d, on=%d) failed "
"diag=%d\n", port_id, on, diag);
return;
}
ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
}
@ -3065,9 +3239,11 @@ rx_vlan_strip_set(portid_t port_id, int on)
}
diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
if (diag < 0)
if (diag < 0) {
printf("rx_vlan_strip_set(port_pi=%d, on=%d) failed "
"diag=%d\n", port_id, on, diag);
return;
}
ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
}
@ -3106,9 +3282,11 @@ rx_vlan_filter_set(portid_t port_id, int on)
}
diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
if (diag < 0)
if (diag < 0) {
printf("rx_vlan_filter_set(port_pi=%d, on=%d) failed "
"diag=%d\n", port_id, on, diag);
return;
}
ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
}
@ -3133,9 +3311,11 @@ rx_vlan_qinq_strip_set(portid_t port_id, int on)
}
diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
if (diag < 0)
if (diag < 0) {
printf("%s(port_pi=%d, on=%d) failed "
"diag=%d\n", __func__, port_id, on, diag);
return;
}
ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
}
@ -3193,8 +3373,6 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id)
struct rte_eth_dev_info dev_info;
int ret;
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
if (vlan_id_is_invalid(vlan_id))
return;
@ -3225,8 +3403,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
struct rte_eth_dev_info dev_info;
int ret;
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
if (vlan_id_is_invalid(vlan_id))
return;
if (vlan_id_is_invalid(vlan_id_outer))
@ -3252,8 +3428,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
void
tx_vlan_reset(portid_t port_id)
{
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
ports[port_id].dev_conf.txmode.offloads &=
~(DEV_TX_OFFLOAD_VLAN_INSERT |
DEV_TX_OFFLOAD_QINQ_INSERT);

View File

@ -139,22 +139,23 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)
/*
* Parse an ethernet header to fill the ethertype, l2_len, l3_len and
* ipproto. This function is able to recognize IPv4/IPv6 with one optional vlan
* header. The l4_len argument is only set in case of TCP (useful for TSO).
* ipproto. This function is able to recognize IPv4/IPv6 with optional VLAN
* headers. The l4_len argument is only set in case of TCP (useful for TSO).
*/
static void
parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)
{
struct rte_ipv4_hdr *ipv4_hdr;
struct rte_ipv6_hdr *ipv6_hdr;
struct rte_vlan_hdr *vlan_hdr;
info->l2_len = sizeof(struct rte_ether_hdr);
info->ethertype = eth_hdr->ether_type;
if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
struct rte_vlan_hdr *vlan_hdr = (
struct rte_vlan_hdr *)(eth_hdr + 1);
while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN) ||
info->ethertype == _htons(RTE_ETHER_TYPE_QINQ)) {
vlan_hdr = (struct rte_vlan_hdr *)
((char *)eth_hdr + info->l2_len);
info->l2_len += sizeof(struct rte_vlan_hdr);
info->ethertype = vlan_hdr->eth_proto;
}

View File

@ -28,6 +28,18 @@ deps += ['ethdev', 'gro', 'gso', 'cmdline', 'metrics', 'meter', 'bus_pci']
if dpdk_conf.has('RTE_LIBRTE_PDUMP')
deps += 'pdump'
endif
if dpdk_conf.has('RTE_LIBRTE_BITRATESTATS')
deps += 'bitratestats'
endif
if dpdk_conf.has('RTE_LIBRTE_LATENCYSTATS')
deps += 'latencystats'
endif
if dpdk_conf.has('RTE_LIBRTE_PMD_CRYPTO_SCHEDULER')
deps += 'pmd_crypto_scheduler'
endif
if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
deps += 'pmd_bond'
endif
if dpdk_conf.has('RTE_LIBRTE_BNXT_PMD')
deps += 'pmd_bnxt'
endif

View File

@ -49,7 +49,7 @@
static void
usage(char* progname)
{
printf("usage: %s "
printf("usage: %s [EAL options] -- "
#ifdef RTE_LIBRTE_CMDLINE
"[--interactive|-i] "
"[--cmdline-file=FILENAME] "

View File

@ -1071,6 +1071,177 @@ check_nb_txq(queueid_t txq)
return 0;
}
/*
* Get the allowed maximum number of RXDs of every rx queue.
* *pid return the port id which has minimal value of
* max_rxd in all queues of all ports.
*/
static uint16_t
get_allowed_max_nb_rxd(portid_t *pid)
{
uint16_t allowed_max_rxd = UINT16_MAX;
portid_t pi;
struct rte_eth_dev_info dev_info;
RTE_ETH_FOREACH_DEV(pi) {
if (eth_dev_info_get_print_err(pi, &dev_info) != 0)
continue;
if (dev_info.rx_desc_lim.nb_max < allowed_max_rxd) {
allowed_max_rxd = dev_info.rx_desc_lim.nb_max;
*pid = pi;
}
}
return allowed_max_rxd;
}
/*
* Get the allowed minimal number of RXDs of every rx queue.
* *pid return the port id which has minimal value of
* min_rxd in all queues of all ports.
*/
static uint16_t
get_allowed_min_nb_rxd(portid_t *pid)
{
uint16_t allowed_min_rxd = 0;
portid_t pi;
struct rte_eth_dev_info dev_info;
RTE_ETH_FOREACH_DEV(pi) {
if (eth_dev_info_get_print_err(pi, &dev_info) != 0)
continue;
if (dev_info.rx_desc_lim.nb_min > allowed_min_rxd) {
allowed_min_rxd = dev_info.rx_desc_lim.nb_min;
*pid = pi;
}
}
return allowed_min_rxd;
}
/*
* Check input rxd is valid or not.
* If input rxd is not greater than any of maximum number
* of RXDs of every Rx queues and is not less than any of
* minimal number of RXDs of every Rx queues, it is valid.
* if valid, return 0, else return -1
*/
int
check_nb_rxd(queueid_t rxd)
{
uint16_t allowed_max_rxd;
uint16_t allowed_min_rxd;
portid_t pid = 0;
allowed_max_rxd = get_allowed_max_nb_rxd(&pid);
if (rxd > allowed_max_rxd) {
printf("Fail: input rxd (%u) can't be greater "
"than max_rxds (%u) of port %u\n",
rxd,
allowed_max_rxd,
pid);
return -1;
}
allowed_min_rxd = get_allowed_min_nb_rxd(&pid);
if (rxd < allowed_min_rxd) {
printf("Fail: input rxd (%u) can't be less "
"than min_rxds (%u) of port %u\n",
rxd,
allowed_min_rxd,
pid);
return -1;
}
return 0;
}
/*
* Get the allowed maximum number of TXDs of every rx queues.
* *pid return the port id which has minimal value of
* max_txd in every tx queue.
*/
static uint16_t
get_allowed_max_nb_txd(portid_t *pid)
{
uint16_t allowed_max_txd = UINT16_MAX;
portid_t pi;
struct rte_eth_dev_info dev_info;
RTE_ETH_FOREACH_DEV(pi) {
if (eth_dev_info_get_print_err(pi, &dev_info) != 0)
continue;
if (dev_info.tx_desc_lim.nb_max < allowed_max_txd) {
allowed_max_txd = dev_info.tx_desc_lim.nb_max;
*pid = pi;
}
}
return allowed_max_txd;
}
/*
* Get the allowed maximum number of TXDs of every tx queues.
* *pid return the port id which has minimal value of
* min_txd in every tx queue.
*/
static uint16_t
get_allowed_min_nb_txd(portid_t *pid)
{
uint16_t allowed_min_txd = 0;
portid_t pi;
struct rte_eth_dev_info dev_info;
RTE_ETH_FOREACH_DEV(pi) {
if (eth_dev_info_get_print_err(pi, &dev_info) != 0)
continue;
if (dev_info.tx_desc_lim.nb_min > allowed_min_txd) {
allowed_min_txd = dev_info.tx_desc_lim.nb_min;
*pid = pi;
}
}
return allowed_min_txd;
}
/*
* Check input txd is valid or not.
* If input txd is not greater than any of maximum number
* of TXDs of every Rx queues, it is valid.
* if valid, return 0, else return -1
*/
int
check_nb_txd(queueid_t txd)
{
uint16_t allowed_max_txd;
uint16_t allowed_min_txd;
portid_t pid = 0;
allowed_max_txd = get_allowed_max_nb_txd(&pid);
if (txd > allowed_max_txd) {
printf("Fail: input txd (%u) can't be greater "
"than max_txds (%u) of port %u\n",
txd,
allowed_max_txd,
pid);
return -1;
}
allowed_min_txd = get_allowed_min_nb_txd(&pid);
if (txd < allowed_min_txd) {
printf("Fail: input txd (%u) can't be less "
"than min_txds (%u) of port %u\n",
txd,
allowed_min_txd,
pid);
return -1;
}
return 0;
}
/*
* Get the allowed maximum number of hairpin queues.
* *pid return the port id which has minimal value of
@ -1430,9 +1601,9 @@ init_fwd_streams(void)
static void
pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)
{
unsigned int total_burst;
unsigned int nb_burst;
unsigned int burst_stats[3];
uint64_t total_burst;
uint64_t nb_burst;
uint64_t burst_stats[3];
uint16_t pktnb_stats[3];
uint16_t nb_pkt;
int burst_percent[3];
@ -1461,8 +1632,8 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)
}
if (total_burst == 0)
return;
burst_percent[0] = (burst_stats[0] * 100) / total_burst;
printf(" %s-bursts : %u [%d%% of %d pkts", rx_tx, total_burst,
burst_percent[0] = (double)burst_stats[0] / total_burst * 100;
printf(" %s-bursts : %"PRIu64" [%d%% of %d pkts", rx_tx, total_burst,
burst_percent[0], (int) pktnb_stats[0]);
if (burst_stats[0] == total_burst) {
printf("]\n");
@ -1473,7 +1644,7 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)
100 - burst_percent[0], pktnb_stats[1]);
return;
}
burst_percent[1] = (burst_stats[1] * 100) / total_burst;
burst_percent[1] = (double)burst_stats[1] / total_burst * 100;
burst_percent[2] = 100 - (burst_percent[0] + burst_percent[1]);
if ((burst_percent[1] == 0) || (burst_percent[2] == 0)) {
printf(" + %d%% of others]\n", 100 - burst_percent[0]);
@ -1698,11 +1869,22 @@ fwd_stats_display(void)
"%s\n",
acc_stats_border, acc_stats_border);
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
if (total_recv > 0)
printf("\n CPU cycles/packet=%u (total cycles="
"%"PRIu64" / total RX packets=%"PRIu64")\n",
(unsigned int)(fwd_cycles / total_recv),
fwd_cycles, total_recv);
#define CYC_PER_MHZ 1E6
if (total_recv > 0 || total_xmit > 0) {
uint64_t total_pkts = 0;
if (strcmp(cur_fwd_eng->fwd_mode_name, "txonly") == 0 ||
strcmp(cur_fwd_eng->fwd_mode_name, "flowgen") == 0)
total_pkts = total_xmit;
else
total_pkts = total_recv;
printf("\n CPU cycles/packet=%.2F (total cycles="
"%"PRIu64" / total %s packets=%"PRIu64") at %"PRIu64
" MHz Clock\n",
(double) fwd_cycles / total_pkts,
fwd_cycles, cur_fwd_eng->fwd_mode_name, total_pkts,
(uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ));
}
#endif
}
@ -2752,7 +2934,7 @@ check_all_ports_link_status(uint32_t port_mask)
"Port%d Link Up. speed %u Mbps- %s\n",
portid, link.link_speed,
(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
("full-duplex") : ("half-duplex\n"));
("full-duplex") : ("half-duplex"));
else
printf("Port %d Link Down\n", portid);
continue;
@ -3193,6 +3375,8 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf,
struct rte_eth_dcb_tx_conf *tx_conf =
&eth_conf->tx_adv_conf.dcb_tx_conf;
memset(&rss_conf, 0, sizeof(struct rte_eth_rss_conf));
rc = rte_eth_dev_rss_hash_conf_get(pid, &rss_conf);
if (rc != 0)
return rc;

View File

@ -859,6 +859,8 @@ queueid_t get_allowed_max_nb_rxq(portid_t *pid);
int check_nb_rxq(queueid_t rxq);
queueid_t get_allowed_max_nb_txq(portid_t *pid);
int check_nb_txq(queueid_t txq);
int check_nb_rxd(queueid_t rxd);
int check_nb_txd(queueid_t txd);
queueid_t get_allowed_max_nb_hairpinq(portid_t *pid);
int check_nb_hairpinq(queueid_t hairpinq);

View File

@ -147,6 +147,34 @@ setup_pkt_udp_ip_headers(struct rte_ipv4_hdr *ip_hdr,
ip_hdr->hdr_checksum = (uint16_t) ip_cksum;
}
static inline void
update_pkt_header(struct rte_mbuf *pkt, uint32_t total_pkt_len)
{
struct rte_ipv4_hdr *ip_hdr;
struct rte_udp_hdr *udp_hdr;
uint16_t pkt_data_len;
uint16_t pkt_len;
pkt_data_len = (uint16_t) (total_pkt_len - (
sizeof(struct rte_ether_hdr) +
sizeof(struct rte_ipv4_hdr) +
sizeof(struct rte_udp_hdr)));
/* updata udp pkt length */
udp_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_udp_hdr *,
sizeof(struct rte_ether_hdr) +
sizeof(struct rte_ipv4_hdr));
pkt_len = (uint16_t) (pkt_data_len + sizeof(struct rte_udp_hdr));
udp_hdr->dgram_len = RTE_CPU_TO_BE_16(pkt_len);
/* updata ip pkt length and csum */
ip_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv4_hdr *,
sizeof(struct rte_ether_hdr));
ip_hdr->hdr_checksum = 0;
pkt_len = (uint16_t) (pkt_len + sizeof(struct rte_ipv4_hdr));
ip_hdr->total_length = RTE_CPU_TO_BE_16(pkt_len);
ip_hdr->hdr_checksum = rte_ipv4_cksum(ip_hdr);
}
static inline bool
pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,
struct rte_ether_hdr *eth_hdr, const uint16_t vlan_tci,
@ -212,6 +240,10 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,
copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt,
sizeof(struct rte_ether_hdr) +
sizeof(struct rte_ipv4_hdr));
if (unlikely(tx_pkt_split == TX_PKT_SPLIT_RND) || txonly_multi_flow)
update_pkt_header(pkt, pkt_len);
/*
* Complete first mbuf of packet and append it to the
* burst of packets to be transmitted.

View File

@ -617,7 +617,7 @@ main(int argc, char **argv)
{
int ret;
struct rte_ipsec_sad *sad;
struct rte_ipsec_sad_conf conf;
struct rte_ipsec_sad_conf conf = {0};
unsigned int lcore_id;
ret = rte_eal_init(argc, argv);

View File

@ -122,7 +122,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_perf.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_functions.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_multiwriter.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_readwrite.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_readwrite_lf.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_readwrite_lf_perf.c
SRCS-$(CONFIG_RTE_LIBRTE_RIB) += test_rib.c
SRCS-$(CONFIG_RTE_LIBRTE_RIB) += test_rib6.c

View File

@ -670,8 +670,8 @@ non_parallel_test_list = [
"Report": None,
},
{
"Name": "Hash read-write lock-free concurrency autotest",
"Command": "hash_readwrite_lf_autotest",
"Name": "Hash read-write lock-free concurrency perf autotest",
"Command": "hash_readwrite_lf_perf_autotest",
"Func": default_autotest,
"Report": None,
},

View File

@ -56,7 +56,7 @@ test_sources = files('commands.c',
'test_hash_multiwriter.c',
'test_hash_readwrite.c',
'test_hash_perf.c',
'test_hash_readwrite_lf.c',
'test_hash_readwrite_lf_perf.c',
'test_interrupts.c',
'test_ipsec.c',
'test_ipsec_sad.c',
@ -154,88 +154,89 @@ test_deps = ['acl',
'timer'
]
fast_test_names = [
'acl_autotest',
'alarm_autotest',
'atomic_autotest',
'byteorder_autotest',
'cmdline_autotest',
'common_autotest',
'cpuflags_autotest',
'cycles_autotest',
'debug_autotest',
'eal_flags_c_opt_autotest',
'eal_flags_master_opt_autotest',
'eal_flags_n_opt_autotest',
'eal_flags_hpet_autotest',
'eal_flags_no_huge_autotest',
'eal_flags_w_opt_autotest',
'eal_flags_b_opt_autotest',
'eal_flags_vdev_opt_autotest',
'eal_flags_r_opt_autotest',
'eal_flags_mem_autotest',
'eal_flags_file_prefix_autotest',
'eal_flags_misc_autotest',
'eal_fs_autotest',
'errno_autotest',
'event_ring_autotest',
'fib_autotest',
'fib6_autotest',
'func_reentrancy_autotest',
'flow_classify_autotest',
'hash_autotest',
'interrupt_autotest',
'logs_autotest',
'lpm_autotest',
'lpm6_autotest',
'malloc_autotest',
'mbuf_autotest',
'mcslock_autotest',
'memcpy_autotest',
'memory_autotest',
'mempool_autotest',
'memzone_autotest',
'meter_autotest',
'multiprocess_autotest',
'per_lcore_autotest',
'prefetch_autotest',
'rcu_qsbr_autotest',
'red_autotest',
'rib_autotest',
'rib6_autotest',
'ring_autotest',
'rwlock_test1_autotest',
'rwlock_rda_autotest',
'rwlock_rds_wrm_autotest',
'rwlock_rde_wro_autotest',
'sched_autotest',
'spinlock_autotest',
'stack_autotest',
'stack_lf_autotest',
'string_autotest',
'table_autotest',
'tailq_autotest',
'timer_autotest',
'user_delay_us',
'version_autotest',
'crc_autotest',
'delay_us_sleep_autotest',
'distributor_autotest',
'eventdev_common_autotest',
'fbarray_autotest',
'hash_readwrite_autotest',
'hash_readwrite_lf_autotest',
'ipsec_autotest',
'kni_autotest',
'kvargs_autotest',
'member_autotest',
'metrics_autotest',
'power_cpufreq_autotest',
'power_autotest',
'power_kvm_vm_autotest',
'reorder_autotest',
'service_autotest',
'thash_autotest',
# Each test is marked with flag true/false
# to indicate whether it can run in no-huge mode.
fast_tests = [
['acl_autotest', true],
['alarm_autotest', false],
['atomic_autotest', false],
['byteorder_autotest', true],
['cmdline_autotest', true],
['common_autotest', true],
['cpuflags_autotest', true],
['cycles_autotest', true],
['debug_autotest', true],
['eal_flags_c_opt_autotest', false],
['eal_flags_master_opt_autotest', false],
['eal_flags_n_opt_autotest', false],
['eal_flags_hpet_autotest', false],
['eal_flags_no_huge_autotest', false],
['eal_flags_w_opt_autotest', false],
['eal_flags_b_opt_autotest', false],
['eal_flags_vdev_opt_autotest', false],
['eal_flags_r_opt_autotest', false],
['eal_flags_mem_autotest', false],
['eal_flags_file_prefix_autotest', false],
['eal_flags_misc_autotest', false],
['eal_fs_autotest', true],
['errno_autotest', true],
['event_ring_autotest', true],
['fib_autotest', true],
['fib6_autotest', true],
['func_reentrancy_autotest', false],
['flow_classify_autotest', false],
['hash_autotest', true],
['interrupt_autotest', true],
['logs_autotest', true],
['lpm_autotest', true],
['lpm6_autotest', true],
['malloc_autotest', false],
['mbuf_autotest', false],
['mcslock_autotest', false],
['memcpy_autotest', true],
['memory_autotest', false],
['mempool_autotest', false],
['memzone_autotest', false],
['meter_autotest', true],
['multiprocess_autotest', false],
['per_lcore_autotest', true],
['prefetch_autotest', true],
['rcu_qsbr_autotest', true],
['red_autotest', true],
['rib_autotest', true],
['rib6_autotest', true],
['ring_autotest', true],
['rwlock_test1_autotest', true],
['rwlock_rda_autotest', true],
['rwlock_rds_wrm_autotest', true],
['rwlock_rde_wro_autotest', true],
['sched_autotest', true],
['spinlock_autotest', true],
['stack_autotest', false],
['stack_lf_autotest', false],
['string_autotest', true],
['table_autotest', true],
['tailq_autotest', true],
['timer_autotest', false],
['user_delay_us', true],
['version_autotest', true],
['crc_autotest', true],
['delay_us_sleep_autotest', true],
['distributor_autotest', false],
['eventdev_common_autotest', true],
['fbarray_autotest', true],
['hash_readwrite_autotest', false],
['ipsec_autotest', true],
['kni_autotest', false],
['kvargs_autotest', true],
['member_autotest', true],
['metrics_autotest', true],
['power_cpufreq_autotest', false],
['power_autotest', true],
['power_kvm_vm_autotest', false],
['reorder_autotest', true],
['service_autotest', true],
['thash_autotest', true],
]
perf_test_names = [
@ -269,6 +270,7 @@ perf_test_names = [
'stack_perf_autotest',
'stack_lf_perf_autotest',
'rand_perf_autotest',
'hash_readwrite_lf_perf_autotest',
]
driver_test_names = [
@ -322,6 +324,10 @@ endif
# they are used via a driver-specific API.
if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
test_deps += 'pmd_bond'
if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
test_sources += 'test_link_bonding_mode4.c'
driver_test_names += 'link_bonding_mode4_autotest'
endif
endif
if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
test_deps += 'pmd_ring'
@ -330,16 +336,14 @@ if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
test_sources += 'test_event_eth_tx_adapter.c'
test_sources += 'test_bitratestats.c'
test_sources += 'test_latencystats.c'
test_sources += 'test_link_bonding_mode4.c'
test_sources += 'sample_packet_forward.c'
test_sources += 'test_pdump.c'
fast_test_names += 'ring_pmd_autotest'
fast_tests += [['ring_pmd_autotest', true]]
perf_test_names += 'ring_pmd_perf_autotest'
fast_test_names += 'event_eth_tx_adapter_autotest'
fast_test_names += 'bitratestats_autotest'
fast_test_names += 'latencystats_autotest'
driver_test_names += 'link_bonding_mode4_autotest'
fast_test_names += 'pdump_autotest'
fast_tests += [['event_eth_tx_adapter_autotest', false]]
fast_tests += [['bitratestats_autotest', true]]
fast_tests += [['latencystats_autotest', true]]
fast_tests += [['pdump_autotest', true]]
endif
if dpdk_conf.has('RTE_LIBRTE_POWER')
@ -360,6 +364,9 @@ endif
# specify -D_GNU_SOURCE unconditionally
cflags += '-D_GNU_SOURCE'
# Enable using internal APIs in unit tests
cflags += ['-DALLOW_INTERNAL_API']
test_dep_objs = []
if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV')
compress_test_dep = dependency('zlib', required: false)
@ -367,12 +374,13 @@ if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV')
test_dep_objs += compress_test_dep
test_sources += 'test_compressdev.c'
test_deps += 'compressdev'
fast_test_names += 'compressdev_autotest'
fast_tests += [['compressdev_autotest', false]]
endif
endif
if dpdk_conf.has('RTE_LIBRTE_PMD_CRYPTO_SCHEDULER')
driver_test_names += 'cryptodev_scheduler_autotest'
test_deps += 'pmd_crypto_scheduler'
endif
foreach d:test_deps
@ -383,7 +391,7 @@ test_dep_objs += cc.find_library('execinfo', required: false)
link_libs = []
if get_option('default_library') == 'static'
link_libs = dpdk_drivers
link_libs = dpdk_static_libraries + dpdk_drivers
endif
dpdk_test = executable('dpdk-test',
@ -391,9 +399,21 @@ dpdk_test = executable('dpdk-test',
link_whole: link_libs,
dependencies: test_dep_objs,
c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
install_rpath: driver_install_path,
install_rpath: join_paths(get_option('prefix'),
driver_install_path),
install: true)
has_hugepage = true
if is_linux
check_hugepage = run_command('cat',
'/proc/sys/vm/nr_hugepages')
if (check_hugepage.returncode() != 0 or
check_hugepage.stdout().strip() == '0')
has_hugepage = false
endif
endif
message('hugepage availability: @0@'.format(has_hugepage))
# some perf tests (eg: memcpy perf autotest)take very long
# to complete, so timeout to 10 minutes
timeout_seconds = 600
@ -402,37 +422,43 @@ timeout_seconds_fast = 10
get_coremask = find_program('get-coremask.sh')
num_cores_arg = '-l ' + run_command(get_coremask).stdout().strip()
test_args = [num_cores_arg]
default_test_args = [num_cores_arg]
foreach arg : fast_tests
test_args = default_test_args
run_test = true
if not has_hugepage
if arg[1]
test_args += ['--no-huge', '-m', '2048']
else
run_test = false
endif
endif
foreach arg : fast_test_names
if (get_option('default_library') == 'shared' and
arg == 'event_eth_tx_adapter_autotest')
arg[0] == 'event_eth_tx_adapter_autotest')
foreach drv:dpdk_drivers
test_args += ['-d', drv.full_path().split('.a')[0] + '.so']
endforeach
endif
if host_machine.system() == 'linux'
test(arg, dpdk_test,
env : ['DPDK_TEST=' + arg],
args : test_args +
['--file-prefix=@0@'.format(arg)],
timeout : timeout_seconds_fast,
is_parallel : false,
suite : 'fast-tests')
else
test(arg, dpdk_test,
env : ['DPDK_TEST=' + arg],
if is_linux
test_args += ['--file-prefix=@0@'.format(arg[0])]
endif
if run_test
test(arg[0], dpdk_test,
env : ['DPDK_TEST=' + arg[0]],
args : test_args,
timeout : timeout_seconds_fast,
is_parallel : false,
suite : 'fast-tests')
timeout : timeout_seconds_fast,
is_parallel : false,
suite : 'fast-tests')
endif
endforeach
foreach arg : perf_test_names
test(arg, dpdk_test,
env : ['DPDK_TEST=' + arg],
args : test_args,
args : default_test_args,
timeout : timeout_seconds,
is_parallel : false,
suite : 'perf-tests')
@ -441,7 +467,7 @@ endforeach
foreach arg : driver_test_names
test(arg, dpdk_test,
env : ['DPDK_TEST=' + arg],
args : test_args,
args : default_test_args,
timeout : timeout_seconds,
is_parallel : false,
suite : 'driver-tests')
@ -450,7 +476,7 @@ endforeach
foreach arg : dump_test_names
test(arg, dpdk_test,
env : ['DPDK_TEST=' + arg],
args : test_args,
args : default_test_args,
timeout : timeout_seconds,
is_parallel : false,
suite : 'debug-tests')

View File

@ -22,8 +22,6 @@
# define TEST_TRACE_FAILURE(_file, _line, _func)
#endif
#define RTE_TEST_TRACE_FAILURE TEST_TRACE_FAILURE
#include <rte_test.h>
#define TEST_ASSERT RTE_TEST_ASSERT

View File

@ -1394,16 +1394,18 @@ test_invalid_parameters(void)
} else
rte_acl_free(acx);
/* invalid NUMA node */
memcpy(&param, &acl_param, sizeof(param));
param.socket_id = RTE_MAX_NUMA_NODES + 1;
if (rte_eal_has_hugepages()) {
/* invalid NUMA node */
memcpy(&param, &acl_param, sizeof(param));
param.socket_id = RTE_MAX_NUMA_NODES + 1;
acx = rte_acl_create(&param);
if (acx != NULL) {
printf("Line %i: ACL context creation with invalid NUMA "
"should have failed!\n", __LINE__);
rte_acl_free(acx);
return -1;
acx = rte_acl_create(&param);
if (acx != NULL) {
printf("Line %i: ACL context creation with invalid "
"NUMA should have failed!\n", __LINE__);
rte_acl_free(acx);
return -1;
}
}
/* NULL name */

View File

@ -1797,13 +1797,6 @@ test_call1_check(uint64_t rc, const void *arg)
dummy_func1(arg, &v32, &v64);
v64 += v32;
if (v64 != rc) {
printf("%s@%d: invalid return value "
"expected=0x%" PRIx64 ", actual=0x%" PRIx64 "\n",
__func__, __LINE__, v64, rc);
return -1;
}
return 0;
return cmp_res(__func__, v64, rc, dv, dv, sizeof(*dv));
}
@ -1934,13 +1927,7 @@ test_call2_check(uint64_t rc, const void *arg)
dummy_func2(&a, &b);
v = a.u64 + a.u32 + b.u16 + b.u8;
if (v != rc) {
printf("%s@%d: invalid return value "
"expected=0x%" PRIx64 ", actual=0x%" PRIx64 "\n",
__func__, __LINE__, v, rc);
return -1;
}
return 0;
return cmp_res(__func__, v, rc, arg, arg, 0);
}
static const struct rte_bpf_xsym test_call2_xsym[] = {
@ -2429,7 +2416,6 @@ test_call5_check(uint64_t rc, const void *arg)
v = 0;
fail:
return cmp_res(__func__, v, rc, &v, &rc, sizeof(v));
}
@ -2458,6 +2444,7 @@ static const struct rte_bpf_xsym test_call5_xsym[] = {
},
};
/* all bpf test cases */
static const struct bpf_test tests[] = {
{
.name = "test_store1",
@ -2738,7 +2725,6 @@ run_test(const struct bpf_test *tst)
}
tst->prepare(tbuf);
rc = rte_bpf_exec(bpf, tbuf);
ret = tst->check_result(rc, tbuf);
if (ret != 0) {
@ -2746,17 +2732,20 @@ run_test(const struct bpf_test *tst)
__func__, __LINE__, tst->name, ret, strerror(ret));
}
/* repeat the same test with jit, when possible */
rte_bpf_get_jit(bpf, &jit);
if (jit.func == NULL)
return 0;
if (jit.func != NULL) {
tst->prepare(tbuf);
rc = jit.func(tbuf);
rv = tst->check_result(rc, tbuf);
ret |= rv;
if (rv != 0) {
printf("%s@%d: check_result(%s) failed, error: %d(%s);\n",
__func__, __LINE__, tst->name, rv, strerror(ret));
tst->prepare(tbuf);
rc = jit.func(tbuf);
rv = tst->check_result(rc, tbuf);
ret |= rv;
if (rv != 0) {
printf("%s@%d: check_result(%s) failed, "
"error: %d(%s);\n",
__func__, __LINE__, tst->name,
rv, strerror(ret));
}
}
rte_bpf_destroy(bpf);

View File

@ -643,7 +643,7 @@ test_device_configure_invalid_dev_id(void)
"Need at least %d devices for test", 1);
/* valid dev_id values */
dev_id = ts_params->valid_devs[ts_params->valid_dev_count - 1];
dev_id = ts_params->valid_devs[0];
/* Stop the device in case it's started so it can be configured */
rte_cryptodev_stop(dev_id);
@ -2701,13 +2701,15 @@ create_wireless_algo_cipher_auth_session(uint8_t dev_id,
/* Create Crypto session*/
ut_params->sess = rte_cryptodev_sym_session_create(
ts_params->session_mpool);
TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess,
&ut_params->cipher_xform,
ts_params->session_priv_mpool);
if (status == -ENOTSUP)
return status;
TEST_ASSERT_EQUAL(status, 0, "session init failed");
TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
return 0;
}
@ -2827,6 +2829,7 @@ create_wireless_algo_auth_cipher_session(uint8_t dev_id,
/* Create Crypto session*/
ut_params->sess = rte_cryptodev_sym_session_create(
ts_params->session_mpool);
TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
if (cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT) {
ut_params->auth_xform.next = NULL;
@ -2840,8 +2843,10 @@ create_wireless_algo_auth_cipher_session(uint8_t dev_id,
&ut_params->auth_xform,
ts_params->session_priv_mpool);
if (status == -ENOTSUP)
return status;
TEST_ASSERT_EQUAL(status, 0, "session init failed");
TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
return 0;
}
@ -2985,6 +2990,11 @@ create_wireless_algo_cipher_hash_operation(const uint8_t *auth_tag,
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
enum rte_crypto_cipher_algorithm cipher_algo =
ut_params->cipher_xform.cipher.algo;
enum rte_crypto_auth_algorithm auth_algo =
ut_params->auth_xform.auth.algo;
/* Generate Crypto op data structure */
ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
RTE_CRYPTO_OP_TYPE_SYMMETRIC);
@ -3005,8 +3015,22 @@ create_wireless_algo_cipher_hash_operation(const uint8_t *auth_tag,
TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
"no room to append auth tag");
ut_params->digest = sym_op->auth.digest.data;
sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, data_pad_len);
if (rte_pktmbuf_is_contiguous(ut_params->ibuf)) {
sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
ut_params->ibuf, data_pad_len);
} else {
struct rte_mbuf *m = ut_params->ibuf;
unsigned int offset = data_pad_len;
while (offset > m->data_len && m->next != NULL) {
offset -= m->data_len;
m = m->next;
}
sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset(
m, offset);
}
if (op == RTE_CRYPTO_AUTH_OP_GENERATE)
memset(sym_op->auth.digest.data, 0, auth_tag_len);
else
@ -3023,10 +3047,25 @@ create_wireless_algo_cipher_hash_operation(const uint8_t *auth_tag,
iv_ptr += cipher_iv_len;
rte_memcpy(iv_ptr, auth_iv, auth_iv_len);
sym_op->cipher.data.length = cipher_len;
sym_op->cipher.data.offset = cipher_offset;
sym_op->auth.data.length = auth_len;
sym_op->auth.data.offset = auth_offset;
if (cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 ||
cipher_algo == RTE_CRYPTO_CIPHER_KASUMI_F8 ||
cipher_algo == RTE_CRYPTO_CIPHER_ZUC_EEA3) {
sym_op->cipher.data.length = cipher_len;
sym_op->cipher.data.offset = cipher_offset;
} else {
sym_op->cipher.data.length = cipher_len >> 3;
sym_op->cipher.data.offset = cipher_offset >> 3;
}
if (auth_algo == RTE_CRYPTO_AUTH_SNOW3G_UIA2 ||
auth_algo == RTE_CRYPTO_AUTH_KASUMI_F9 ||
auth_algo == RTE_CRYPTO_AUTH_ZUC_EIA3) {
sym_op->auth.data.length = auth_len;
sym_op->auth.data.offset = auth_offset;
} else {
sym_op->auth.data.length = auth_len >> 3;
sym_op->auth.data.offset = auth_offset >> 3;
}
return 0;
}
@ -6595,8 +6634,9 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
unsigned int ciphertext_len;
struct rte_cryptodev_info dev_info;
struct rte_crypto_op *op;
/* Check if device supports particular algorithms */
/* Check if device supports particular algorithms separately */
if (test_mixed_check_if_unsupported(tdata))
return -ENOTSUP;
@ -6612,18 +6652,26 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
}
/* Create the session */
retval = create_wireless_algo_auth_cipher_session(
ts_params->valid_devs[0],
(verify ? RTE_CRYPTO_CIPHER_OP_DECRYPT
: RTE_CRYPTO_CIPHER_OP_ENCRYPT),
(verify ? RTE_CRYPTO_AUTH_OP_VERIFY
: RTE_CRYPTO_AUTH_OP_GENERATE),
tdata->auth_algo,
tdata->cipher_algo,
tdata->auth_key.data, tdata->auth_key.len,
tdata->auth_iv.len, tdata->digest_enc.len,
tdata->cipher_iv.len);
if (verify)
retval = create_wireless_algo_cipher_auth_session(
ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_DECRYPT,
RTE_CRYPTO_AUTH_OP_VERIFY,
tdata->auth_algo,
tdata->cipher_algo,
tdata->auth_key.data, tdata->auth_key.len,
tdata->auth_iv.len, tdata->digest_enc.len,
tdata->cipher_iv.len);
else
retval = create_wireless_algo_auth_cipher_session(
ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_ENCRYPT,
RTE_CRYPTO_AUTH_OP_GENERATE,
tdata->auth_algo,
tdata->cipher_algo,
tdata->auth_key.data, tdata->auth_key.len,
tdata->auth_iv.len, tdata->digest_enc.len,
tdata->cipher_iv.len);
if (retval < 0)
return retval;
@ -6666,7 +6714,7 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
tdata->cipher_iv.data, tdata->cipher_iv.len,
tdata->auth_iv.data, tdata->auth_iv.len,
(tdata->digest_enc.offset == 0 ?
(verify ? ciphertext_pad_len : plaintext_pad_len)
plaintext_pad_len
: tdata->digest_enc.offset),
tdata->validCipherLen.len_bits,
tdata->cipher.offset_bits,
@ -6677,9 +6725,19 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
if (retval < 0)
return retval;
ut_params->op = process_crypto_request(ts_params->valid_devs[0],
op = process_crypto_request(ts_params->valid_devs[0],
ut_params->op);
/* Check if the op failed because the device doesn't */
/* support this particular combination of algorithms */
if (op == NULL && ut_params->op->status ==
RTE_CRYPTO_OP_STATUS_INVALID_SESSION) {
printf("Device doesn't support this mixed combination. "
"Test Skipped.\n");
return -ENOTSUP;
}
ut_params->op = op;
TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf");
ut_params->obuf = (op_mode == IN_PLACE ?
@ -6694,12 +6752,10 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
(tdata->cipher.offset_bits >> 3);
debug_hexdump(stdout, "plaintext:", plaintext,
(tdata->plaintext.len_bits >> 3) -
tdata->digest_enc.len);
tdata->plaintext.len_bits >> 3);
debug_hexdump(stdout, "plaintext expected:",
tdata->plaintext.data,
(tdata->plaintext.len_bits >> 3) -
tdata->digest_enc.len);
tdata->plaintext.len_bits >> 3);
} else {
if (ut_params->obuf)
ciphertext = rte_pktmbuf_mtod(ut_params->obuf,
@ -6744,6 +6800,10 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
DIGEST_BYTE_LENGTH_SNOW3G_UIA2,
"Generated auth tag not as expected");
}
TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
"crypto op processing failed");
return 0;
}
@ -6767,6 +6827,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
uint8_t digest_buffer[10000];
struct rte_cryptodev_info dev_info;
struct rte_crypto_op *op;
/* Check if device supports particular algorithms */
if (test_mixed_check_if_unsupported(tdata))
@ -6795,18 +6856,26 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
}
/* Create the session */
retval = create_wireless_algo_auth_cipher_session(
ts_params->valid_devs[0],
(verify ? RTE_CRYPTO_CIPHER_OP_DECRYPT
: RTE_CRYPTO_CIPHER_OP_ENCRYPT),
(verify ? RTE_CRYPTO_AUTH_OP_VERIFY
: RTE_CRYPTO_AUTH_OP_GENERATE),
tdata->auth_algo,
tdata->cipher_algo,
tdata->auth_key.data, tdata->auth_key.len,
tdata->auth_iv.len, tdata->digest_enc.len,
tdata->cipher_iv.len);
if (verify)
retval = create_wireless_algo_cipher_auth_session(
ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_DECRYPT,
RTE_CRYPTO_AUTH_OP_VERIFY,
tdata->auth_algo,
tdata->cipher_algo,
tdata->auth_key.data, tdata->auth_key.len,
tdata->auth_iv.len, tdata->digest_enc.len,
tdata->cipher_iv.len);
else
retval = create_wireless_algo_auth_cipher_session(
ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_ENCRYPT,
RTE_CRYPTO_AUTH_OP_GENERATE,
tdata->auth_algo,
tdata->cipher_algo,
tdata->auth_key.data, tdata->auth_key.len,
tdata->auth_iv.len, tdata->digest_enc.len,
tdata->cipher_iv.len);
if (retval < 0)
return retval;
@ -6816,7 +6885,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
plaintext_pad_len = RTE_ALIGN_CEIL(plaintext_len, 16);
ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool,
plaintext_pad_len, 15, 0);
ciphertext_pad_len, 15, 0);
TEST_ASSERT_NOT_NULL(ut_params->ibuf,
"Failed to allocate input buffer in mempool");
@ -6850,7 +6919,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
tdata->cipher_iv.data, tdata->cipher_iv.len,
tdata->auth_iv.data, tdata->auth_iv.len,
(tdata->digest_enc.offset == 0 ?
(verify ? ciphertext_pad_len : plaintext_pad_len)
plaintext_pad_len
: tdata->digest_enc.offset),
tdata->validCipherLen.len_bits,
tdata->cipher.offset_bits,
@ -6861,9 +6930,20 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
if (retval < 0)
return retval;
ut_params->op = process_crypto_request(ts_params->valid_devs[0],
op = process_crypto_request(ts_params->valid_devs[0],
ut_params->op);
/* Check if the op failed because the device doesn't */
/* support this particular combination of algorithms */
if (op == NULL && ut_params->op->status ==
RTE_CRYPTO_OP_STATUS_INVALID_SESSION) {
printf("Device doesn't support this mixed combination. "
"Test Skipped.\n");
return -ENOTSUP;
}
ut_params->op = op;
TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf");
ut_params->obuf = (op_mode == IN_PLACE ?
@ -6936,6 +7016,10 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
tdata->digest_enc.len,
"Generated auth tag not as expected");
}
TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
"crypto op processing failed");
return 0;
}
@ -6997,6 +7081,176 @@ test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_oop_sgl(void)
&auth_aes_cmac_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 1);
}
/** MIXED AUTH + CIPHER */
static int
test_auth_zuc_cipher_snow_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_zuc_cipher_snow_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_zuc_cipher_snow_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_zuc_cipher_snow_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_auth_aes_cmac_cipher_snow_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_aes_cmac_cipher_snow_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_aes_cmac_cipher_snow_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_aes_cmac_cipher_snow_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_auth_zuc_cipher_aes_ctr_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_zuc_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_zuc_cipher_aes_ctr_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_zuc_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_auth_snow_cipher_aes_ctr_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_snow_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_snow_cipher_aes_ctr_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_snow_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_auth_snow_cipher_zuc_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_snow_cipher_zuc_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_snow_cipher_zuc_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_snow_cipher_zuc_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_auth_aes_cmac_cipher_zuc_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_aes_cmac_cipher_zuc_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_aes_cmac_cipher_zuc_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_aes_cmac_cipher_zuc_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_auth_null_cipher_snow_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_null_cipher_snow_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_null_cipher_snow_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_null_cipher_snow_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_auth_null_cipher_zuc_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_null_cipher_zuc_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_null_cipher_zuc_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_null_cipher_zuc_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_auth_snow_cipher_null_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_snow_cipher_null_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_snow_cipher_null_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_snow_cipher_null_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_auth_zuc_cipher_null_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_zuc_cipher_null_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_zuc_cipher_null_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_zuc_cipher_null_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_auth_null_cipher_aes_ctr_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_null_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_null_cipher_aes_ctr_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_null_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_auth_aes_cmac_cipher_null_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_aes_cmac_cipher_null_test_case_1, OUT_OF_PLACE, 0);
}
static int
test_verify_auth_aes_cmac_cipher_null_test_case_1(void)
{
return test_mixed_auth_cipher(
&auth_aes_cmac_cipher_null_test_case_1, OUT_OF_PLACE, 1);
}
static int
test_3DES_chain_qat_all(void)
{
@ -9158,8 +9412,10 @@ test_stats(void)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct rte_cryptodev_stats stats;
struct rte_cryptodev *dev;
cryptodev_stats_get_t temp_pfn;
if (rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats)
== -ENOTSUP)
return -ENOTSUP;
rte_cryptodev_stats_reset(ts_params->valid_devs[0]);
TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0] + 600,
@ -9167,18 +9423,9 @@ test_stats(void)
"rte_cryptodev_stats_get invalid dev failed");
TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0], 0) != 0),
"rte_cryptodev_stats_get invalid Param failed");
dev = &rte_cryptodevs[ts_params->valid_devs[0]];
temp_pfn = dev->dev_ops->stats_get;
dev->dev_ops->stats_get = (cryptodev_stats_get_t)0;
TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats)
== -ENOTSUP),
"rte_cryptodev_stats_get invalid Param failed");
dev->dev_ops->stats_get = temp_pfn;
/* Test expected values */
ut_setup();
test_AES_CBC_HMAC_SHA1_encrypt_digest();
ut_teardown();
TEST_ASSERT_SUCCESS(rte_cryptodev_stats_get(ts_params->valid_devs[0],
&stats),
"rte_cryptodev_stats_get failed");
@ -10469,7 +10716,7 @@ aes128cbc_hmac_sha1_test_vector = {
static const struct test_crypto_vector
aes128cbc_hmac_sha1_aad_test_vector = {
.crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC,
.cipher_offset = 12,
.cipher_offset = 8,
.cipher_len = 496,
.cipher_key = {
.data = {
@ -10505,9 +10752,9 @@ aes128cbc_hmac_sha1_aad_test_vector = {
},
.digest = {
.data = {
0x1F, 0x6A, 0xD2, 0x8B, 0x4B, 0xB3, 0xC0, 0x9E,
0x86, 0x9B, 0x3A, 0xF2, 0x00, 0x5B, 0x4F, 0x08,
0x62, 0x8D, 0x62, 0x65
0x6D, 0xF3, 0x50, 0x79, 0x7A, 0x2A, 0xAC, 0x7F,
0xA6, 0xF0, 0xC6, 0x38, 0x1F, 0xA4, 0xDD, 0x9B,
0x62, 0x0F, 0xFB, 0x10
},
.len = 20
}
@ -12296,6 +12543,68 @@ static struct unit_test_suite cryptodev_qat_testsuite = {
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_oop_sgl),
/** AUTH ZUC + CIPHER SNOW3G */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_zuc_cipher_snow_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_zuc_cipher_snow_test_case_1),
/** AUTH AES CMAC + CIPHER SNOW3G */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_aes_cmac_cipher_snow_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_aes_cmac_cipher_snow_test_case_1),
/** AUTH ZUC + CIPHER AES CTR */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_zuc_cipher_aes_ctr_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_zuc_cipher_aes_ctr_test_case_1),
/** AUTH SNOW3G + CIPHER AES CTR */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_snow_cipher_aes_ctr_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_snow_cipher_aes_ctr_test_case_1),
/** AUTH SNOW3G + CIPHER ZUC */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_snow_cipher_zuc_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_snow_cipher_zuc_test_case_1),
/** AUTH AES CMAC + CIPHER ZUC */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_aes_cmac_cipher_zuc_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_aes_cmac_cipher_zuc_test_case_1),
/** AUTH NULL + CIPHER SNOW3G */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_null_cipher_snow_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_null_cipher_snow_test_case_1),
/** AUTH NULL + CIPHER ZUC */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_null_cipher_zuc_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_null_cipher_zuc_test_case_1),
/** AUTH SNOW3G + CIPHER NULL */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_snow_cipher_null_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_snow_cipher_null_test_case_1),
/** AUTH ZUC + CIPHER NULL */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_zuc_cipher_null_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_zuc_cipher_null_test_case_1),
/** AUTH NULL + CIPHER AES CTR */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_null_cipher_aes_ctr_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_null_cipher_aes_ctr_test_case_1),
/** AUTH AES CMAC + CIPHER NULL */
TEST_CASE_ST(ut_setup, ut_teardown,
test_auth_aes_cmac_cipher_null_test_case_1),
TEST_CASE_ST(ut_setup, ut_teardown,
test_verify_auth_aes_cmac_cipher_null_test_case_1),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};

View File

@ -358,69 +358,69 @@ static const struct blockcipher_test_data null_test_data_chain_x1_multiple = {
static const uint8_t ciphertext512_aes128cbc_aad[] = {
0x57, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x6C,
0x6F, 0x75, 0x73, 0x79, 0x6D, 0x70, 0xB4, 0xAD,
0x09, 0x7C, 0xD7, 0x52, 0xD6, 0xF2, 0xBF, 0xD1,
0x9D, 0x79, 0xC6, 0xB6, 0x8F, 0x94, 0xEB, 0xD8,
0xBA, 0x5E, 0x01, 0x49, 0x7D, 0xB3, 0xC5, 0xFE,
0x18, 0xF4, 0xE3, 0x60, 0x8C, 0x84, 0x68, 0x13,
0x33, 0x06, 0x85, 0x60, 0xD3, 0xE7, 0x8A, 0xB5,
0x23, 0xA2, 0xDE, 0x52, 0x5C, 0xB6, 0x26, 0x37,
0xBB, 0x23, 0x8A, 0x38, 0x07, 0x85, 0xB6, 0x2E,
0xC3, 0x69, 0x57, 0x79, 0x6B, 0xE4, 0xD7, 0x86,
0x23, 0x72, 0x4C, 0x65, 0x49, 0x08, 0x1E, 0xF3,
0xCC, 0x71, 0x4C, 0x45, 0x97, 0x03, 0xBC, 0xA0,
0x9D, 0xF0, 0x4F, 0x5D, 0xEC, 0x40, 0x6C, 0xC6,
0x52, 0xC0, 0x9D, 0x1C, 0xDC, 0x8B, 0xC2, 0xFA,
0x35, 0xA7, 0x3A, 0x00, 0x04, 0x1C, 0xA6, 0x91,
0x5D, 0xEB, 0x07, 0xA1, 0xB9, 0x3E, 0xD1, 0xB6,
0xCA, 0x96, 0xEC, 0x71, 0xF7, 0x7D, 0xB6, 0x09,
0x3D, 0x19, 0x6E, 0x75, 0x03, 0xC3, 0x1A, 0x4E,
0x5B, 0x4D, 0xEA, 0xD9, 0x92, 0x96, 0x01, 0xFB,
0xA3, 0xC2, 0x6D, 0xC4, 0x17, 0x6B, 0xB4, 0x3B,
0x1E, 0x87, 0x54, 0x26, 0x95, 0x63, 0x07, 0x73,
0xB6, 0xBA, 0x52, 0xD7, 0xA7, 0xD0, 0x9C, 0x75,
0x8A, 0xCF, 0xC4, 0x3C, 0x4A, 0x55, 0x0E, 0x53,
0xEC, 0xE0, 0x31, 0x51, 0xB7, 0xB7, 0xD2, 0xB4,
0xF3, 0x2B, 0x70, 0x6D, 0x15, 0x9E, 0x57, 0x30,
0x72, 0xE5, 0xA4, 0x71, 0x5F, 0xA4, 0xE8, 0x7C,
0x46, 0x58, 0x36, 0x71, 0x91, 0x55, 0xAA, 0x99,
0x3B, 0x3F, 0xF6, 0xA2, 0x9D, 0x27, 0xBF, 0xC2,
0x62, 0x2C, 0x85, 0xB7, 0x51, 0xDD, 0xFD, 0x7B,
0x8B, 0xB5, 0xDD, 0x2A, 0x73, 0xF8, 0x93, 0x9A,
0x3F, 0xAD, 0x1D, 0xF0, 0x46, 0xD1, 0x76, 0x83,
0x71, 0x4E, 0xD3, 0x0D, 0x64, 0x8C, 0xC3, 0xE6,
0x03, 0xED, 0xE8, 0x53, 0x23, 0x1A, 0xC7, 0x86,
0xEB, 0x87, 0xD6, 0x78, 0xF9, 0xFB, 0x9C, 0x1D,
0xE7, 0x4E, 0xC0, 0x70, 0x27, 0x7A, 0x43, 0xE2,
0x5D, 0xA4, 0x10, 0x40, 0xBE, 0x61, 0x0D, 0x2B,
0x25, 0x08, 0x75, 0x91, 0xB5, 0x5A, 0x26, 0xC8,
0x32, 0xA7, 0xC6, 0x88, 0xBF, 0x75, 0x94, 0xCC,
0x58, 0xA4, 0xFE, 0x2F, 0xF7, 0x5C, 0xD2, 0x36,
0x66, 0x55, 0xF0, 0xEA, 0xF5, 0x64, 0x43, 0xE7,
0x6D, 0xE0, 0xED, 0xA1, 0x10, 0x0A, 0x84, 0x07,
0x11, 0x88, 0xFA, 0xA1, 0xD3, 0xA0, 0x00, 0x5D,
0xEB, 0xB5, 0x62, 0x01, 0x72, 0xC1, 0x9B, 0x39,
0x0B, 0xD3, 0xAF, 0x04, 0x19, 0x42, 0xEC, 0xFF,
0x4B, 0xB3, 0x5E, 0x87, 0x27, 0xE4, 0x26, 0x57,
0x76, 0xCD, 0x36, 0x31, 0x5B, 0x94, 0x74, 0xFF,
0x33, 0x91, 0xAA, 0xD1, 0x45, 0x34, 0xC2, 0x11,
0xF0, 0x35, 0x44, 0xC9, 0xD5, 0xA2, 0x5A, 0xC2,
0xE9, 0x9E, 0xCA, 0xE2, 0x6F, 0xD2, 0x40, 0xB4,
0x93, 0x42, 0x78, 0x20, 0x92, 0x88, 0xC7, 0x16,
0xCF, 0x15, 0x54, 0x7B, 0xE1, 0x46, 0x38, 0x69,
0xB8, 0xE4, 0xF1, 0x81, 0xF0, 0x08, 0x6F, 0x92,
0x6D, 0x1A, 0xD9, 0x93, 0xFA, 0xD7, 0x35, 0xFE,
0x7F, 0x59, 0x43, 0x1D, 0x3A, 0x3B, 0xFC, 0xD0,
0x14, 0x95, 0x1E, 0xB2, 0x04, 0x08, 0x4F, 0xC6,
0xEA, 0xE8, 0x22, 0xF3, 0xD7, 0x66, 0x93, 0xAA,
0xFD, 0xA0, 0xFE, 0x03, 0x96, 0x54, 0x78, 0x35,
0x18, 0xED, 0xB7, 0x2F, 0x40, 0xE3, 0x8E, 0x22,
0xC6, 0xDA, 0xB0, 0x8E, 0xA0, 0xA1, 0x62, 0x03,
0x63, 0x34, 0x11, 0xF5, 0x9E, 0xAA, 0x6B, 0xC4,
0x14, 0x75, 0x4C, 0xF4, 0xD8, 0xD9, 0xF1, 0x76,
0xE3, 0xD3, 0x55, 0xCE, 0x22, 0x7D, 0x4A, 0xB7,
0xBB, 0x7F, 0x4F, 0x09, 0x88, 0x70, 0x6E, 0x09,
0x84, 0x6B, 0x24, 0x19, 0x2C, 0x20, 0x73, 0x75
0x1D, 0x7C, 0x76, 0xED, 0xC2, 0x10, 0x3C, 0xB5,
0x14, 0x07, 0x3C, 0x33, 0x7B, 0xBE, 0x9E, 0xA9,
0x01, 0xC5, 0xAA, 0xA6, 0xB6, 0x7A, 0xE1, 0xDB,
0x39, 0xAA, 0xAA, 0xF4, 0xEE, 0xA7, 0x71, 0x71,
0x78, 0x0D, 0x5A, 0xD4, 0xF9, 0xCD, 0x75, 0xD1,
0x9C, 0x7F, 0xC8, 0x58, 0x46, 0x7A, 0xD1, 0x81,
0xEA, 0xCC, 0x08, 0xDC, 0x82, 0x73, 0x22, 0x08,
0x11, 0x73, 0x7C, 0xB1, 0x84, 0x6A, 0x8E, 0x67,
0x3F, 0x5D, 0xDB, 0x0E, 0xE2, 0xC2, 0xCB, 0x6D,
0x88, 0xEC, 0x3F, 0x50, 0x44, 0xD3, 0x47, 0x6E,
0xDD, 0x42, 0xDC, 0x2A, 0x5E, 0x5C, 0x50, 0x24,
0x57, 0x8A, 0xE7, 0xC5, 0x53, 0x6D, 0x89, 0x33,
0x21, 0x65, 0x82, 0xD6, 0xE9, 0xE7, 0x77, 0x10,
0xC2, 0x09, 0x91, 0xC1, 0x42, 0x62, 0x36, 0xF4,
0x43, 0x37, 0x95, 0xB3, 0x7E, 0x21, 0xC5, 0x3E,
0x65, 0xCB, 0xB6, 0xAA, 0xEC, 0xA5, 0xC6, 0x5C,
0x4D, 0xBE, 0x14, 0xF1, 0x98, 0xBF, 0x6C, 0x8A,
0x9E, 0x9F, 0xD4, 0xB4, 0xF2, 0x22, 0x96, 0x99,
0x37, 0x32, 0xB6, 0xC1, 0x04, 0x66, 0x52, 0x37,
0x5D, 0x5F, 0x58, 0x92, 0xC9, 0x97, 0xEA, 0x60,
0x60, 0x27, 0x57, 0xF9, 0x47, 0x4F, 0xBC, 0xDF,
0x05, 0xBD, 0x37, 0x87, 0xBB, 0x09, 0xA5, 0xBE,
0xC1, 0xFC, 0x32, 0x86, 0x6A, 0xB7, 0x8B, 0x1E,
0x6B, 0xCE, 0x8D, 0x81, 0x63, 0x4C, 0xF2, 0x7F,
0xD1, 0x45, 0x82, 0xE8, 0x0D, 0x1C, 0x4D, 0xA8,
0xBF, 0x2D, 0x2B, 0x52, 0xE5, 0xDB, 0xAB, 0xFD,
0x04, 0xA2, 0xA1, 0x1E, 0x21, 0x1D, 0x06, 0x9A,
0xC2, 0x7D, 0x99, 0xFC, 0xB4, 0x72, 0x89, 0x41,
0x55, 0x69, 0xFA, 0x1F, 0x78, 0x2F, 0x35, 0x59,
0xD7, 0x59, 0x6D, 0xA6, 0x45, 0xC9, 0x2B, 0x06,
0x6C, 0xEC, 0x83, 0x34, 0xA5, 0x08, 0xDB, 0x6F,
0xDE, 0x75, 0x21, 0x9B, 0xB0, 0xCB, 0x0A, 0xAE,
0x22, 0x99, 0x74, 0x1C, 0x9D, 0x37, 0x0E, 0xC6,
0x3A, 0x45, 0x49, 0xE5, 0xE3, 0x21, 0x11, 0xEA,
0x34, 0x25, 0xD5, 0x76, 0xB0, 0x30, 0x19, 0x87,
0x14, 0x3A, 0x10, 0x6F, 0x6D, 0xDD, 0xE9, 0x60,
0x6A, 0x00, 0x6A, 0x4C, 0x5B, 0x85, 0x3E, 0x1A,
0x41, 0xFA, 0xDE, 0x2D, 0x2F, 0x2E, 0x5B, 0x79,
0x09, 0x66, 0x65, 0xD0, 0xDB, 0x32, 0x05, 0xB5,
0xEA, 0xFB, 0x6A, 0xD5, 0x43, 0xF8, 0xBD, 0x98,
0x7B, 0x8E, 0x3B, 0x85, 0x89, 0x5D, 0xC5, 0x59,
0x54, 0x22, 0x75, 0xA8, 0x60, 0xDC, 0x0A, 0x37,
0x8C, 0xD8, 0x05, 0xEA, 0x62, 0x62, 0x71, 0x98,
0x0C, 0xCB, 0xCE, 0x0A, 0xD9, 0xE6, 0xE8, 0xA7,
0xB3, 0x2D, 0x89, 0xA7, 0x60, 0xF0, 0x42, 0xA7,
0x3D, 0x80, 0x44, 0xE7, 0xC1, 0xA6, 0x88, 0xB1,
0x4F, 0xC0, 0xB1, 0xAF, 0x40, 0xF3, 0x54, 0x72,
0x8F, 0xAF, 0x47, 0x96, 0x19, 0xEB, 0xA5, 0x5C,
0x00, 0x3B, 0x36, 0xC8, 0x3F, 0x1E, 0x63, 0x54,
0xF3, 0x3D, 0x85, 0x44, 0x9B, 0x9B, 0x20, 0xE3,
0x9D, 0xEF, 0x62, 0x21, 0xA1, 0x0B, 0x78, 0xF4,
0x2B, 0x89, 0x66, 0x5E, 0x97, 0xC6, 0xC4, 0x55,
0x35, 0x32, 0xD7, 0x44, 0x95, 0x9A, 0xE7, 0xF2,
0x57, 0x52, 0x5B, 0x92, 0x86, 0x8F, 0x8B, 0xCF,
0x41, 0x89, 0xF6, 0x2A, 0xD3, 0x42, 0x87, 0x43,
0x56, 0x1F, 0x0E, 0x49, 0xF1, 0x32, 0x6D, 0xA8,
0x62, 0xDF, 0x47, 0xBB, 0xB6, 0x53, 0xF8, 0x5C,
0x36, 0xDA, 0x34, 0x34, 0x2D, 0x2E, 0x1D, 0x33,
0xAF, 0x6A, 0x1E, 0xF1, 0xC9, 0x72, 0xB5, 0x3C,
0x64, 0x4C, 0x96, 0x12, 0x78, 0x67, 0x6A, 0xE5,
0x8B, 0x05, 0x80, 0xAE, 0x7D, 0xE5, 0x9B, 0x24,
0xDB, 0xFF, 0x1E, 0xB8, 0x36, 0x6D, 0x3D, 0x5D,
0x73, 0x65, 0x72, 0x73, 0x2C, 0x20, 0x73, 0x75
};
/* AES128-CTR-SHA1 test vector */

View File

@ -933,8 +933,9 @@ testsuite_setup(void)
}
/* setup asym session pool */
unsigned int session_size =
rte_cryptodev_asym_get_private_session_size(dev_id);
unsigned int session_size = RTE_MAX(
rte_cryptodev_asym_get_private_session_size(dev_id),
rte_cryptodev_asym_get_header_session_size());
/*
* Create mempool with TEST_NUM_SESSIONS * 2,
* to include the session headers

View File

@ -93,7 +93,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
uint64_t feat_flags = dev_info.feature_flags;
uint64_t oop_flag = RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT;
if (t->feature_mask && BLOCKCIPHER_TEST_FEATURE_OOP) {
if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_OOP) {
if (!(feat_flags & oop_flag)) {
printf("Device doesn't support out-of-place "
"scatter-gather in input mbuf. "

View File

@ -460,6 +460,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_data = &sha1_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_QAT |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
@ -473,6 +474,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_data = &sha1_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_QAT |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
@ -540,6 +542,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_data = &sha224_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_QAT |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
@ -553,6 +556,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_data = &sha224_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_QAT |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
@ -596,6 +600,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_data = &sha256_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_QAT |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
@ -609,6 +614,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_data = &sha256_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_QAT |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
@ -654,6 +660,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_data = &sha384_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_QAT |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
@ -667,6 +674,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_data = &sha384_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_QAT |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
@ -712,6 +720,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_data = &sha512_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_QAT |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)
@ -724,6 +733,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
.test_data = &sha512_test_vector,
.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
BLOCKCIPHER_TEST_TARGET_PMD_QAT |
BLOCKCIPHER_TEST_TARGET_PMD_CCP |
BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
#if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0)

File diff suppressed because it is too large Load Diff

View File

@ -79,8 +79,14 @@ REGISTER_TEST_COMMAND(cycles_autotest, test_cycles);
static int
test_delay_us_sleep(void)
{
int rv;
rte_delay_us_callback_register(rte_delay_us_sleep);
return check_wait_one_second();
rv = check_wait_one_second();
/* restore original delay function */
rte_delay_us_callback_register(rte_delay_us_block);
return rv;
}
REGISTER_TEST_COMMAND(delay_us_sleep_autotest, test_delay_us_sleep);

View File

@ -27,7 +27,9 @@ struct worker_params worker_params;
/* statics - all zero-initialized by default */
static volatile int quit; /**< general quit variable for all threads */
static volatile int zero_quit; /**< var for when we just want thr0 to quit*/
static volatile int zero_sleep; /**< thr0 has quit basic loop and is sleeping*/
static volatile unsigned worker_idx;
static volatile unsigned zero_idx;
struct worker_stats {
volatile unsigned handled_packets;
@ -42,7 +44,8 @@ total_packet_count(void)
{
unsigned i, count = 0;
for (i = 0; i < worker_idx; i++)
count += worker_stats[i].handled_packets;
count += __atomic_load_n(&worker_stats[i].handled_packets,
__ATOMIC_RELAXED);
return count;
}
@ -50,7 +53,10 @@ total_packet_count(void)
static inline void
clear_packet_count(void)
{
memset(&worker_stats, 0, sizeof(worker_stats));
unsigned int i;
for (i = 0; i < RTE_MAX_LCORE; i++)
__atomic_store_n(&worker_stats[i].handled_packets, 0,
__ATOMIC_RELAXED);
}
/* this is the basic worker function for sanity test
@ -62,23 +68,18 @@ handle_work(void *arg)
struct rte_mbuf *buf[8] __rte_cache_aligned;
struct worker_params *wp = arg;
struct rte_distributor *db = wp->dist;
unsigned int count = 0, num = 0;
unsigned int num;
unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);
int i;
for (i = 0; i < 8; i++)
buf[i] = NULL;
num = rte_distributor_get_pkt(db, id, buf, buf, num);
num = rte_distributor_get_pkt(db, id, buf, NULL, 0);
while (!quit) {
__atomic_fetch_add(&worker_stats[id].handled_packets, num,
__ATOMIC_RELAXED);
count += num;
num = rte_distributor_get_pkt(db, id,
buf, buf, num);
}
__atomic_fetch_add(&worker_stats[id].handled_packets, num,
__ATOMIC_RELAXED);
count += num;
rte_distributor_return_pkt(db, id, buf, num);
return 0;
}
@ -102,6 +103,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
struct rte_mbuf *returns[BURST*2];
unsigned int i, count;
unsigned int retries;
unsigned int processed;
printf("=== Basic distributor sanity tests ===\n");
clear_packet_count();
@ -115,7 +117,11 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
for (i = 0; i < BURST; i++)
bufs[i]->hash.usr = 0;
rte_distributor_process(db, bufs, BURST);
processed = 0;
while (processed < BURST)
processed += rte_distributor_process(db, &bufs[processed],
BURST - processed);
count = 0;
do {
@ -128,12 +134,14 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
printf("Line %d: Error, not all packets flushed. "
"Expected %u, got %u\n",
__LINE__, BURST, total_packet_count());
rte_mempool_put_bulk(p, (void *)bufs, BURST);
return -1;
}
for (i = 0; i < rte_lcore_count() - 1; i++)
printf("Worker %u handled %u packets\n", i,
worker_stats[i].handled_packets);
__atomic_load_n(&worker_stats[i].handled_packets,
__ATOMIC_RELAXED));
printf("Sanity test with all zero hashes done.\n");
/* pick two flows and check they go correctly */
@ -153,12 +161,15 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
printf("Line %d: Error, not all packets flushed. "
"Expected %u, got %u\n",
__LINE__, BURST, total_packet_count());
rte_mempool_put_bulk(p, (void *)bufs, BURST);
return -1;
}
for (i = 0; i < rte_lcore_count() - 1; i++)
printf("Worker %u handled %u packets\n", i,
worker_stats[i].handled_packets);
__atomic_load_n(
&worker_stats[i].handled_packets,
__ATOMIC_RELAXED));
printf("Sanity test with two hash values done\n");
}
@ -179,12 +190,14 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
printf("Line %d: Error, not all packets flushed. "
"Expected %u, got %u\n",
__LINE__, BURST, total_packet_count());
rte_mempool_put_bulk(p, (void *)bufs, BURST);
return -1;
}
for (i = 0; i < rte_lcore_count() - 1; i++)
printf("Worker %u handled %u packets\n", i,
worker_stats[i].handled_packets);
__atomic_load_n(&worker_stats[i].handled_packets,
__ATOMIC_RELAXED));
printf("Sanity test with non-zero hashes done\n");
rte_mempool_put_bulk(p, (void *)bufs, BURST);
@ -233,6 +246,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
if (num_returned != BIG_BATCH) {
printf("line %d: Missing packets, expected %d\n",
__LINE__, num_returned);
rte_mempool_put_bulk(p, (void *)many_bufs, BIG_BATCH);
return -1;
}
@ -247,6 +261,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
if (j == BIG_BATCH) {
printf("Error: could not find source packet #%u\n", i);
rte_mempool_put_bulk(p, (void *)many_bufs, BIG_BATCH);
return -1;
}
}
@ -270,24 +285,20 @@ handle_work_with_free_mbufs(void *arg)
struct rte_mbuf *buf[8] __rte_cache_aligned;
struct worker_params *wp = arg;
struct rte_distributor *d = wp->dist;
unsigned int count = 0;
unsigned int i;
unsigned int num = 0;
unsigned int num;
unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);
for (i = 0; i < 8; i++)
buf[i] = NULL;
num = rte_distributor_get_pkt(d, id, buf, buf, num);
num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
while (!quit) {
worker_stats[id].handled_packets += num;
count += num;
__atomic_fetch_add(&worker_stats[id].handled_packets, num,
__ATOMIC_RELAXED);
for (i = 0; i < num; i++)
rte_pktmbuf_free(buf[i]);
num = rte_distributor_get_pkt(d,
id, buf, buf, num);
num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
}
worker_stats[id].handled_packets += num;
count += num;
__atomic_fetch_add(&worker_stats[id].handled_packets, num,
__ATOMIC_RELAXED);
rte_distributor_return_pkt(d, id, buf, num);
return 0;
}
@ -303,6 +314,7 @@ sanity_test_with_mbuf_alloc(struct worker_params *wp, struct rte_mempool *p)
struct rte_distributor *d = wp->dist;
unsigned i;
struct rte_mbuf *bufs[BURST];
unsigned int processed;
printf("=== Sanity test with mbuf alloc/free (%s) ===\n", wp->name);
@ -313,10 +325,12 @@ sanity_test_with_mbuf_alloc(struct worker_params *wp, struct rte_mempool *p)
rte_distributor_process(d, NULL, 0);
for (j = 0; j < BURST; j++) {
bufs[j]->hash.usr = (i+j) << 1;
rte_mbuf_refcnt_set(bufs[j], 1);
}
rte_distributor_process(d, bufs, BURST);
processed = 0;
while (processed < BURST)
processed += rte_distributor_process(d,
&bufs[processed], BURST - processed);
}
rte_distributor_flush(d);
@ -337,55 +351,61 @@ sanity_test_with_mbuf_alloc(struct worker_params *wp, struct rte_mempool *p)
static int
handle_work_for_shutdown_test(void *arg)
{
struct rte_mbuf *pkt = NULL;
struct rte_mbuf *buf[8] __rte_cache_aligned;
struct worker_params *wp = arg;
struct rte_distributor *d = wp->dist;
unsigned int count = 0;
unsigned int num = 0;
unsigned int total = 0;
unsigned int i;
unsigned int returned = 0;
unsigned int num;
unsigned int zero_id = 0;
unsigned int zero_unset;
const unsigned int id = __atomic_fetch_add(&worker_idx, 1,
__ATOMIC_RELAXED);
num = rte_distributor_get_pkt(d, id, buf, buf, num);
num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
if (num > 0) {
zero_unset = RTE_MAX_LCORE;
__atomic_compare_exchange_n(&zero_idx, &zero_unset, id,
0, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE);
}
zero_id = __atomic_load_n(&zero_idx, __ATOMIC_ACQUIRE);
/* wait for quit single globally, or for worker zero, wait
* for zero_quit */
while (!quit && !(id == 0 && zero_quit)) {
worker_stats[id].handled_packets += num;
count += num;
for (i = 0; i < num; i++)
rte_pktmbuf_free(buf[i]);
num = rte_distributor_get_pkt(d,
id, buf, buf, num);
total += num;
}
worker_stats[id].handled_packets += num;
count += num;
returned = rte_distributor_return_pkt(d, id, buf, num);
while (!quit && !(id == zero_id && zero_quit)) {
__atomic_fetch_add(&worker_stats[id].handled_packets, num,
__ATOMIC_RELAXED);
num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
if (num > 0) {
zero_unset = RTE_MAX_LCORE;
__atomic_compare_exchange_n(&zero_idx, &zero_unset, id,
0, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE);
}
zero_id = __atomic_load_n(&zero_idx, __ATOMIC_ACQUIRE);
}
__atomic_fetch_add(&worker_stats[id].handled_packets, num,
__ATOMIC_RELAXED);
if (id == zero_id) {
rte_distributor_return_pkt(d, id, NULL, 0);
if (id == 0) {
/* for worker zero, allow it to restart to pick up last packet
* when all workers are shutting down.
*/
__atomic_store_n(&zero_sleep, 1, __ATOMIC_RELEASE);
while (zero_quit)
usleep(100);
__atomic_store_n(&zero_sleep, 0, __ATOMIC_RELEASE);
num = rte_distributor_get_pkt(d,
id, buf, buf, num);
num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
while (!quit) {
worker_stats[id].handled_packets += num;
count += num;
rte_pktmbuf_free(pkt);
num = rte_distributor_get_pkt(d, id, buf, buf, num);
__atomic_fetch_add(&worker_stats[id].handled_packets,
num, __ATOMIC_RELAXED);
num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
}
returned = rte_distributor_return_pkt(d,
id, buf, num);
printf("Num returned = %d\n", returned);
}
rte_distributor_return_pkt(d, id, buf, num);
return 0;
}
@ -401,7 +421,10 @@ sanity_test_with_worker_shutdown(struct worker_params *wp,
{
struct rte_distributor *d = wp->dist;
struct rte_mbuf *bufs[BURST];
unsigned i;
struct rte_mbuf *bufs2[BURST];
unsigned int i;
unsigned int failed = 0;
unsigned int processed = 0;
printf("=== Sanity test of worker shutdown ===\n");
@ -419,7 +442,10 @@ sanity_test_with_worker_shutdown(struct worker_params *wp,
for (i = 0; i < BURST; i++)
bufs[i]->hash.usr = 1;
rte_distributor_process(d, bufs, BURST);
processed = 0;
while (processed < BURST)
processed += rte_distributor_process(d, &bufs[processed],
BURST - processed);
rte_distributor_flush(d);
/* at this point, we will have processed some packets and have a full
@ -427,32 +453,45 @@ sanity_test_with_worker_shutdown(struct worker_params *wp,
*/
/* get more buffers to queue up, again setting them to the same flow */
if (rte_mempool_get_bulk(p, (void *)bufs, BURST) != 0) {
if (rte_mempool_get_bulk(p, (void *)bufs2, BURST) != 0) {
printf("line %d: Error getting mbufs from pool\n", __LINE__);
rte_mempool_put_bulk(p, (void *)bufs, BURST);
return -1;
}
for (i = 0; i < BURST; i++)
bufs[i]->hash.usr = 1;
bufs2[i]->hash.usr = 1;
/* get worker zero to quit */
zero_quit = 1;
rte_distributor_process(d, bufs, BURST);
rte_distributor_process(d, bufs2, BURST);
/* flush the distributor */
rte_distributor_flush(d);
rte_delay_us(10000);
while (!__atomic_load_n(&zero_sleep, __ATOMIC_ACQUIRE))
rte_distributor_flush(d);
zero_quit = 0;
while (__atomic_load_n(&zero_sleep, __ATOMIC_ACQUIRE))
rte_delay_us(100);
for (i = 0; i < rte_lcore_count() - 1; i++)
printf("Worker %u handled %u packets\n", i,
worker_stats[i].handled_packets);
__atomic_load_n(&worker_stats[i].handled_packets,
__ATOMIC_RELAXED));
if (total_packet_count() != BURST * 2) {
printf("Line %d: Error, not all packets flushed. "
"Expected %u, got %u\n",
__LINE__, BURST * 2, total_packet_count());
return -1;
failed = 1;
}
rte_mempool_put_bulk(p, (void *)bufs, BURST);
rte_mempool_put_bulk(p, (void *)bufs2, BURST);
if (failed)
return -1;
printf("Sanity test with worker shutdown passed\n\n");
return 0;
}
@ -466,7 +505,9 @@ test_flush_with_worker_shutdown(struct worker_params *wp,
{
struct rte_distributor *d = wp->dist;
struct rte_mbuf *bufs[BURST];
unsigned i;
unsigned int i;
unsigned int failed = 0;
unsigned int processed;
printf("=== Test flush fn with worker shutdown (%s) ===\n", wp->name);
@ -481,7 +522,10 @@ test_flush_with_worker_shutdown(struct worker_params *wp,
for (i = 0; i < BURST; i++)
bufs[i]->hash.usr = 0;
rte_distributor_process(d, bufs, BURST);
processed = 0;
while (processed < BURST)
processed += rte_distributor_process(d, &bufs[processed],
BURST - processed);
/* at this point, we will have processed some packets and have a full
* backlog for the other ones at worker 0.
*/
@ -492,20 +536,31 @@ test_flush_with_worker_shutdown(struct worker_params *wp,
/* flush the distributor */
rte_distributor_flush(d);
rte_delay_us(10000);
while (!__atomic_load_n(&zero_sleep, __ATOMIC_ACQUIRE))
rte_distributor_flush(d);
zero_quit = 0;
while (__atomic_load_n(&zero_sleep, __ATOMIC_ACQUIRE))
rte_delay_us(100);
for (i = 0; i < rte_lcore_count() - 1; i++)
printf("Worker %u handled %u packets\n", i,
worker_stats[i].handled_packets);
__atomic_load_n(&worker_stats[i].handled_packets,
__ATOMIC_RELAXED));
if (total_packet_count() != BURST) {
printf("Line %d: Error, not all packets flushed. "
"Expected %u, got %u\n",
__LINE__, BURST, total_packet_count());
return -1;
failed = 1;
}
rte_mempool_put_bulk(p, (void *)bufs, BURST);
if (failed)
return -1;
printf("Flush test with worker shutdown passed\n\n");
return 0;
}
@ -571,21 +626,34 @@ quit_workers(struct worker_params *wp, struct rte_mempool *p)
const unsigned num_workers = rte_lcore_count() - 1;
unsigned i;
struct rte_mbuf *bufs[RTE_MAX_LCORE];
rte_mempool_get_bulk(p, (void *)bufs, num_workers);
struct rte_mbuf *returns[RTE_MAX_LCORE];
if (rte_mempool_get_bulk(p, (void *)bufs, num_workers) != 0) {
printf("line %d: Error getting mbufs from pool\n", __LINE__);
return;
}
zero_quit = 0;
quit = 1;
for (i = 0; i < num_workers; i++)
for (i = 0; i < num_workers; i++) {
bufs[i]->hash.usr = i << 1;
rte_distributor_process(d, bufs, num_workers);
rte_mempool_put_bulk(p, (void *)bufs, num_workers);
rte_distributor_process(d, &bufs[i], 1);
}
rte_distributor_process(d, NULL, 0);
rte_distributor_flush(d);
rte_eal_mp_wait_lcore();
while (rte_distributor_returned_pkts(d, returns, RTE_MAX_LCORE))
;
rte_distributor_clear_returns(d);
rte_mempool_put_bulk(p, (void *)bufs, num_workers);
quit = 0;
worker_idx = 0;
zero_idx = RTE_MAX_LCORE;
zero_quit = 0;
zero_sleep = 0;
}
static int

View File

@ -171,7 +171,6 @@ test_op_forward_mode(uint8_t session_less)
struct rte_event ev;
uint32_t cap;
int ret;
uint8_t cipher_key[17];
memset(&m_data, 0, sizeof(m_data));
@ -183,14 +182,7 @@ test_op_forward_mode(uint8_t session_less)
/* Setup Cipher Parameters */
cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
cipher_xform.next = NULL;
cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
cipher_xform.cipher.key.data = cipher_key;
cipher_xform.cipher.key.length = 16;
cipher_xform.cipher.iv.offset = IV_OFFSET;
cipher_xform.cipher.iv.length = 16;
cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
op = rte_crypto_op_alloc(params.op_mpool,
RTE_CRYPTO_OP_TYPE_SYMMETRIC);
@ -209,8 +201,8 @@ test_op_forward_mode(uint8_t session_less)
&cipher_xform, params.session_priv_mpool);
TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
evdev, &cap);
ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
&cap);
TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@ -296,7 +288,7 @@ test_sessionless_with_op_forward_mode(void)
uint32_t cap;
int ret;
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@ -321,7 +313,7 @@ test_session_with_op_forward_mode(void)
uint32_t cap;
int ret;
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@ -378,7 +370,6 @@ test_op_new_mode(uint8_t session_less)
struct rte_mbuf *m;
uint32_t cap;
int ret;
uint8_t cipher_key[17];
memset(&m_data, 0, sizeof(m_data));
@ -390,14 +381,7 @@ test_op_new_mode(uint8_t session_less)
/* Setup Cipher Parameters */
cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
cipher_xform.next = NULL;
cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
cipher_xform.cipher.key.data = cipher_key;
cipher_xform.cipher.key.length = 16;
cipher_xform.cipher.iv.offset = IV_OFFSET;
cipher_xform.cipher.iv.length = 16;
cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
op = rte_crypto_op_alloc(params.op_mpool,
RTE_CRYPTO_OP_TYPE_SYMMETRIC);
@ -410,8 +394,8 @@ test_op_new_mode(uint8_t session_less)
params.session_mpool);
TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
evdev, &cap);
ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
&cap);
TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@ -460,7 +444,7 @@ test_sessionless_with_op_new_mode(void)
uint32_t cap;
int ret;
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@ -486,7 +470,7 @@ test_session_with_op_new_mode(void)
uint32_t cap;
int ret;
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@ -564,7 +548,9 @@ configure_cryptodev(void)
params.session_mpool = rte_cryptodev_sym_session_pool_create(
"CRYPTO_ADAPTER_SESSION_MP",
MAX_NB_SESSIONS, 0, 0, 0, SOCKET_ID_ANY);
MAX_NB_SESSIONS, 0, 0,
sizeof(union rte_event_crypto_metadata),
SOCKET_ID_ANY);
TEST_ASSERT_NOT_NULL(params.session_mpool,
"session mempool allocation failed\n");
@ -706,7 +692,7 @@ test_crypto_adapter_create(void)
/* Create adapter with default port creation callback */
ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
TEST_CDEV_ID,
evdev,
&conf, 0);
TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
@ -719,7 +705,7 @@ test_crypto_adapter_qp_add_del(void)
uint32_t cap;
int ret;
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {

View File

@ -45,7 +45,7 @@ static uint64_t eid = ~0ULL;
static uint32_t tid;
static inline int
port_init_common(uint8_t port, const struct rte_eth_conf *port_conf,
port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,
struct rte_mempool *mp)
{
const uint16_t rx_ring_size = RING_SIZE, tx_ring_size = RING_SIZE;
@ -104,7 +104,7 @@ port_init_common(uint8_t port, const struct rte_eth_conf *port_conf,
}
static inline int
port_init(uint8_t port, struct rte_mempool *mp)
port_init(uint16_t port, struct rte_mempool *mp)
{
struct rte_eth_conf conf = { 0 };
return port_init_common(port, &conf, mp);

View File

@ -35,7 +35,7 @@ struct route_rule {
uint8_t depth;
};
struct route_rule large_route_table[MAX_RULE_NUM];
static struct route_rule large_route_table[MAX_RULE_NUM];
static uint32_t num_route_entries;
#define NUM_ROUTE_ENTRIES num_route_entries

View File

@ -23,7 +23,7 @@
#define FLOW_CLASSIFY_MAX_RULE_NUM 100
#define MAX_PKT_BURST 32
#define NB_SOCKETS 1
#define NB_SOCKETS 4
#define MEMPOOL_CACHE_SIZE 256
#define MBUF_SIZE 512
#define NB_MBUF 512

View File

@ -1142,8 +1142,11 @@ fbk_hash_unit_test(void)
handle = rte_fbk_hash_create(&invalid_params_7);
RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed");
handle = rte_fbk_hash_create(&invalid_params_8);
RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed");
if (rte_eal_has_hugepages()) {
handle = rte_fbk_hash_create(&invalid_params_8);
RETURN_IF_ERROR_FBK(handle != NULL,
"fbk hash creation should have failed");
}
handle = rte_fbk_hash_create(&invalid_params_same_name_1);
RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation should have succeeded");

View File

@ -1241,7 +1241,7 @@ err:
}
static int
test_hash_readwrite_lf_main(void)
test_hash_readwrite_lf_perf_main(void)
{
/*
* Variables used to choose different tests.
@ -1254,7 +1254,7 @@ test_hash_readwrite_lf_main(void)
int ext_bkt = 0;
if (rte_lcore_count() < 2) {
printf("Not enough cores for hash_readwrite_lf_autotest, expecting at least 2\n");
printf("Not enough cores for hash_readwrite_lf_perf_autotest, expecting at least 2\n");
return TEST_SKIPPED;
}
@ -1431,4 +1431,5 @@ results:
return 0;
}
REGISTER_TEST_COMMAND(hash_readwrite_lf_autotest, test_hash_readwrite_lf_main);
REGISTER_TEST_COMMAND(hash_readwrite_lf_perf_autotest,
test_hash_readwrite_lf_perf_main);

View File

@ -1167,6 +1167,34 @@ test_ipsec_dump_buffers(struct ipsec_unitest_params *ut_params, int i)
}
}
static void
destroy_dummy_sec_session(struct ipsec_unitest_params *ut,
uint32_t j)
{
rte_security_session_destroy(&dummy_sec_ctx,
ut->ss[j].security.ses);
ut->ss[j].security.ctx = NULL;
}
static void
destroy_crypto_session(struct ipsec_unitest_params *ut,
uint8_t crypto_dev, uint32_t j)
{
rte_cryptodev_sym_session_clear(crypto_dev, ut->ss[j].crypto.ses);
rte_cryptodev_sym_session_free(ut->ss[j].crypto.ses);
memset(&ut->ss[j], 0, sizeof(ut->ss[j]));
}
static void
destroy_session(struct ipsec_unitest_params *ut,
uint8_t crypto_dev, uint32_t j)
{
if (ut->ss[j].type == RTE_SECURITY_ACTION_TYPE_NONE)
return destroy_crypto_session(ut, crypto_dev, j);
else
return destroy_dummy_sec_session(ut, j);
}
static void
destroy_sa(uint32_t j)
{
@ -1175,9 +1203,8 @@ destroy_sa(uint32_t j)
rte_ipsec_sa_fini(ut->ss[j].sa);
rte_free(ut->ss[j].sa);
rte_cryptodev_sym_session_clear(ts->valid_dev, ut->ss[j].crypto.ses);
rte_cryptodev_sym_session_free(ut->ss[j].crypto.ses);
memset(&ut->ss[j], 0, sizeof(ut->ss[j]));
destroy_session(ut, ts->valid_dev, j);
}
static int

View File

@ -142,7 +142,7 @@ static int test_valid_kvargs(void)
valid_keys = valid_keys_list;
kvlist = rte_kvargs_parse(args, valid_keys);
if (kvlist == NULL) {
printf("rte_kvargs_parse() error");
printf("rte_kvargs_parse() error\n");
goto fail;
}
if (strcmp(kvlist->pairs[0].value, "[0,1]") != 0) {
@ -157,6 +157,40 @@ static int test_valid_kvargs(void)
}
rte_kvargs_free(kvlist);
/* test using empty string (it is valid) */
args = "";
kvlist = rte_kvargs_parse(args, NULL);
if (kvlist == NULL) {
printf("rte_kvargs_parse() error\n");
goto fail;
}
if (rte_kvargs_count(kvlist, NULL) != 0) {
printf("invalid count value\n");
goto fail;
}
rte_kvargs_free(kvlist);
/* test using empty elements (it is valid) */
args = "foo=1,,check=value2,,";
kvlist = rte_kvargs_parse(args, NULL);
if (kvlist == NULL) {
printf("rte_kvargs_parse() error\n");
goto fail;
}
if (rte_kvargs_count(kvlist, NULL) != 2) {
printf("invalid count value\n");
goto fail;
}
if (rte_kvargs_count(kvlist, "foo") != 1) {
printf("invalid count value for 'foo'\n");
goto fail;
}
if (rte_kvargs_count(kvlist, "check") != 1) {
printf("invalid count value for 'check'\n");
goto fail;
}
rte_kvargs_free(kvlist);
return 0;
fail:
@ -179,11 +213,11 @@ static int test_invalid_kvargs(void)
const char *args_list[] = {
"wrong-key=x", /* key not in valid_keys_list */
"foo=1,foo=", /* empty value */
"foo=1,,foo=2", /* empty key/value */
"foo=1,foo", /* no value */
"foo=1,=2", /* no key */
"foo=[1,2", /* no closing bracket in value */
",=", /* also test with a smiley */
"foo=[", /* no value in list and no closing bracket */
NULL };
const char **args;
const char *valid_keys_list[] = { "foo", "check", NULL };
@ -197,8 +231,8 @@ static int test_invalid_kvargs(void)
rte_kvargs_free(kvlist);
goto fail;
}
return 0;
}
return 0;
fail:
printf("while processing <%s>", *args);

View File

@ -34,7 +34,7 @@ struct route_rule {
uint8_t depth;
};
struct route_rule large_route_table[MAX_RULE_NUM];
static struct route_rule large_route_table[MAX_RULE_NUM];
static uint32_t num_route_entries;
#define NUM_ROUTE_ENTRIES num_route_entries

View File

@ -746,6 +746,18 @@ test_malloc_bad_params(void)
if (bad_ptr != NULL)
goto err_return;
/* rte_malloc expected to return null with size will cause overflow */
align = RTE_CACHE_LINE_SIZE;
size = (size_t)-8;
bad_ptr = rte_malloc(type, size, align);
if (bad_ptr != NULL)
goto err_return;
bad_ptr = rte_realloc(NULL, size, align);
if (bad_ptr != NULL)
goto err_return;
return 0;
err_return:

View File

@ -1144,7 +1144,7 @@ test_refcnt_mbuf(void)
tref += refcnt_lcore[slave];
if (tref != refcnt_lcore[master])
rte_panic("refernced mbufs: %u, freed mbufs: %u\n",
rte_panic("referenced mbufs: %u, freed mbufs: %u\n",
tref, refcnt_lcore[master]);
rte_mempool_dump(stdout, refcnt_pool);
@ -2481,9 +2481,13 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool)
offset3 = rte_mbuf_dynfield_register_offset(&dynfield3,
offsetof(struct rte_mbuf, dynfield1[1]));
if (offset3 != offsetof(struct rte_mbuf, dynfield1[1]))
GOTO_FAIL("failed to register dynamic field 3, offset=%d: %s",
offset3, strerror(errno));
if (offset3 != offsetof(struct rte_mbuf, dynfield1[1])) {
if (rte_errno == EBUSY)
printf("mbuf test error skipped: dynfield is busy\n");
else
GOTO_FAIL("failed to register dynamic field 3, offset="
"%d: %s", offset3, strerror(errno));
}
printf("dynfield: offset=%d, offset2=%d, offset3=%d\n",
offset, offset2, offset3);
@ -2519,7 +2523,7 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool)
flag3 = rte_mbuf_dynflag_register_bitnum(&dynflag3,
rte_bsf64(PKT_LAST_FREE));
if (flag3 != rte_bsf64(PKT_LAST_FREE))
GOTO_FAIL("failed to register dynamic flag 3, flag2=%d: %s",
GOTO_FAIL("failed to register dynamic flag 3, flag3=%d: %s",
flag3, strerror(errno));
printf("dynflag: flag=%d, flag2=%d, flag3=%d\n", flag, flag2, flag3);

View File

@ -151,7 +151,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
"Port%d Link Up. Speed %u Mbps - %s\n",
portid, link.link_speed,
(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
("full-duplex") : ("half-duplex\n"));
("full-duplex") : ("half-duplex"));
if (link_mbps == 0)
link_mbps = link.link_speed;
} else

View File

@ -273,13 +273,13 @@ static int
test_rcu_qsbr_start(void)
{
uint64_t token;
int i;
unsigned int i;
printf("\nTest rte_rcu_qsbr_start()\n");
rte_rcu_qsbr_init(t[0], RTE_MAX_LCORE);
for (i = 0; i < 3; i++)
for (i = 0; i < num_cores; i++)
rte_rcu_qsbr_thread_register(t[0], enabled_core_ids[i]);
token = rte_rcu_qsbr_start(t[0]);
@ -293,14 +293,18 @@ test_rcu_qsbr_check_reader(void *arg)
{
struct rte_rcu_qsbr *temp;
uint8_t read_type = (uint8_t)((uintptr_t)arg);
unsigned int i;
temp = t[read_type];
/* Update quiescent state counter */
rte_rcu_qsbr_quiescent(temp, enabled_core_ids[0]);
rte_rcu_qsbr_quiescent(temp, enabled_core_ids[1]);
rte_rcu_qsbr_thread_unregister(temp, enabled_core_ids[2]);
rte_rcu_qsbr_quiescent(temp, enabled_core_ids[3]);
for (i = 0; i < num_cores; i++) {
if (i % 2 == 0)
rte_rcu_qsbr_quiescent(temp, enabled_core_ids[i]);
else
rte_rcu_qsbr_thread_unregister(temp,
enabled_core_ids[i]);
}
return 0;
}
@ -311,7 +315,8 @@ test_rcu_qsbr_check_reader(void *arg)
static int
test_rcu_qsbr_check(void)
{
int i, ret;
int ret;
unsigned int i;
uint64_t token;
printf("\nTest rte_rcu_qsbr_check()\n");
@ -329,7 +334,7 @@ test_rcu_qsbr_check(void)
ret = rte_rcu_qsbr_check(t[0], token, true);
TEST_RCU_QSBR_RETURN_IF_ERROR((ret == 0), "Blocking QSBR check");
for (i = 0; i < 3; i++)
for (i = 0; i < num_cores; i++)
rte_rcu_qsbr_thread_register(t[0], enabled_core_ids[i]);
ret = rte_rcu_qsbr_check(t[0], token, false);
@ -344,7 +349,7 @@ test_rcu_qsbr_check(void)
/* Threads are offline, hence this should pass */
TEST_RCU_QSBR_RETURN_IF_ERROR((ret == 0), "Non-blocking QSBR check");
for (i = 0; i < 3; i++)
for (i = 0; i < num_cores; i++)
rte_rcu_qsbr_thread_unregister(t[0], enabled_core_ids[i]);
ret = rte_rcu_qsbr_check(t[0], token, true);
@ -352,7 +357,7 @@ test_rcu_qsbr_check(void)
rte_rcu_qsbr_init(t[0], RTE_MAX_LCORE);
for (i = 0; i < 4; i++)
for (i = 0; i < num_cores; i++)
rte_rcu_qsbr_thread_register(t[0], enabled_core_ids[i]);
token = rte_rcu_qsbr_start(t[0]);
@ -591,7 +596,7 @@ test_rcu_qsbr_thread_offline(void)
static int
test_rcu_qsbr_dump(void)
{
int i;
unsigned int i;
printf("\nTest rte_rcu_qsbr_dump()\n");
@ -608,7 +613,7 @@ test_rcu_qsbr_dump(void)
rte_rcu_qsbr_thread_register(t[0], enabled_core_ids[0]);
for (i = 1; i < 3; i++)
for (i = 1; i < num_cores; i++)
rte_rcu_qsbr_thread_register(t[1], enabled_core_ids[i]);
rte_rcu_qsbr_dump(stdout, t[0]);
@ -758,7 +763,7 @@ test_rcu_qsbr_sw_sv_3qs(void)
{
uint64_t token[3];
uint32_t c;
int i;
int i, num_readers;
int32_t pos[3];
writer_done = 0;
@ -781,7 +786,11 @@ test_rcu_qsbr_sw_sv_3qs(void)
thread_info[0].ih = 0;
/* Reader threads are launched */
for (i = 0; i < 4; i++)
/* Keep the number of reader threads low to reduce
* the execution time.
*/
num_readers = num_cores < 4 ? num_cores : 4;
for (i = 0; i < num_readers; i++)
rte_eal_remote_launch(test_rcu_qsbr_reader, &thread_info[0],
enabled_core_ids[i]);
@ -814,7 +823,7 @@ test_rcu_qsbr_sw_sv_3qs(void)
/* Check the quiescent state status */
rte_rcu_qsbr_check(t[0], token[0], true);
for (i = 0; i < 4; i++) {
for (i = 0; i < num_readers; i++) {
c = hash_data[0][0][enabled_core_ids[i]];
if (c != COUNTER_VALUE && c != 0) {
printf("Reader lcore %d did not complete #0 = %d\n",
@ -832,7 +841,7 @@ test_rcu_qsbr_sw_sv_3qs(void)
/* Check the quiescent state status */
rte_rcu_qsbr_check(t[0], token[1], true);
for (i = 0; i < 4; i++) {
for (i = 0; i < num_readers; i++) {
c = hash_data[0][3][enabled_core_ids[i]];
if (c != COUNTER_VALUE && c != 0) {
printf("Reader lcore %d did not complete #3 = %d\n",
@ -850,7 +859,7 @@ test_rcu_qsbr_sw_sv_3qs(void)
/* Check the quiescent state status */
rte_rcu_qsbr_check(t[0], token[2], true);
for (i = 0; i < 4; i++) {
for (i = 0; i < num_readers; i++) {
c = hash_data[0][6][enabled_core_ids[i]];
if (c != COUNTER_VALUE && c != 0) {
printf("Reader lcore %d did not complete #6 = %d\n",
@ -869,7 +878,7 @@ test_rcu_qsbr_sw_sv_3qs(void)
writer_done = 1;
/* Wait and check return value from reader threads */
for (i = 0; i < 4; i++)
for (i = 0; i < num_readers; i++)
if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
goto error;
rte_hash_free(h[0]);
@ -899,6 +908,12 @@ test_rcu_qsbr_mw_mv_mqs(void)
unsigned int i, j;
unsigned int test_cores;
if (RTE_MAX_LCORE < 5 || num_cores < 4) {
printf("Not enough cores for %s, expecting at least 5\n",
__func__);
return TEST_SKIPPED;
}
writer_done = 0;
test_cores = num_cores / 4;
test_cores = test_cores * 4;
@ -984,11 +999,6 @@ test_rcu_qsbr_main(void)
{
uint16_t core_id;
if (rte_lcore_count() < 5) {
printf("Not enough cores for rcu_qsbr_autotest, expecting at least 5\n");
return TEST_SKIPPED;
}
num_cores = 0;
RTE_LCORE_FOREACH_SLAVE(core_id) {
enabled_core_ids[num_cores] = core_id;

View File

@ -696,7 +696,7 @@ test_ring_basic_ex(void)
printf("%u ring entries are now free\n", rte_ring_free_count(rp));
for (i = 0; i < RING_SIZE; i ++) {
for (i = 0; i < RING_SIZE - 1; i ++) {
rte_ring_enqueue(rp, obj[i]);
}
@ -705,7 +705,7 @@ test_ring_basic_ex(void)
goto fail_test;
}
for (i = 0; i < RING_SIZE; i ++) {
for (i = 0; i < RING_SIZE - 1; i ++) {
rte_ring_dequeue(rp, &obj[i]);
}

View File

@ -296,12 +296,13 @@ load_loop_fn(void *p)
static int
run_on_all_cores(struct rte_ring *r)
{
uint64_t total = 0;
uint64_t total;
struct thread_params param;
unsigned int i, c;
memset(&param, 0, sizeof(struct thread_params));
for (i = 0; i < RTE_DIM(bulk_sizes); i++) {
total = 0;
printf("\nBulk enq/dequeue count on size %u\n", bulk_sizes[i]);
param.size = bulk_sizes[i];
param.r = r;

View File

@ -114,6 +114,7 @@ unregister_all(void)
}
rte_service_lcore_reset_all();
rte_eal_mp_wait_lcore();
return TEST_SUCCESS;
}

View File

@ -190,11 +190,13 @@ check_pipeline_invalid_params(void)
goto fail;
}
p = rte_pipeline_create(&pipeline_params_3);
if (p != NULL) {
RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with invalid "
"socket\n", __func__);
goto fail;
if (rte_eal_has_hugepages()) {
p = rte_pipeline_create(&pipeline_params_3);
if (p != NULL) {
RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with "
"invalid socket\n", __func__);
goto fail;
}
}
/* Check pipeline consistency */

View File

@ -0,0 +1,31 @@
#! /usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2019 Intel Corporation
#
import sys
import os
from os.path import join
from subprocess import run, PIPE
from distutils.version import StrictVersion
(sphinx, src, dst) = sys.argv[1:] # assign parameters to variables
# for sphinx version >= 1.7 add parallelism using "-j auto"
ver = run([sphinx, '--version'], stdout=PIPE).stdout.decode().split()[-1]
sphinx_cmd = [sphinx]
if StrictVersion(ver) >= StrictVersion('1.7'):
sphinx_cmd += ['-j', 'auto']
# find all the files sphinx will process so we can write them as dependencies
srcfiles = []
for root, dirs, files in os.walk(src):
srcfiles.extend([join(root, f) for f in files])
# run sphinx, putting the html output in a "html" directory
process = run(sphinx_cmd + ['-b', 'html', src, join(dst, 'html')], check=True)
print(str(process.args) + ' Done OK')
# create a gcc format .d file giving all the dependencies of this doc build
with open(join(dst, '.html.d'), 'w') as d:
d.write('html: ' + ' '.join(srcfiles) + '\n')

View File

@ -12,10 +12,12 @@ ldflags_ibverbs_static = find_program('options-ibverbs-static.sh')
# set up map-to-def script using python, either built-in or external
python3 = import('python').find_installation(required: false)
if python3.found()
map_to_def_cmd = [python3, files('map_to_def.py')]
py3 = [python3]
else
map_to_def_cmd = ['meson', 'runpython', files('map_to_def.py')]
py3 = ['meson', 'runpython']
endif
map_to_def_cmd = py3 + files('map_to_def.py')
sphinx_wrapper = py3 + files('call-sphinx-build.py')
# stable ABI always starts with "DPDK_"
is_experimental_cmd = [find_program('grep', 'findstr'), '^DPDK_']

View File

@ -9,6 +9,13 @@
#
# PKG_CONFIG_PATH may be required to be set if libibverbs.pc is not installed.
pkg-config --libs-only-l --static libibverbs |
lib='libibverbs'
deps='pthread|nl'
pkg-config --libs --static $lib |
tr '[:space:]' '\n' |
sed -r '/^-l(pthread|nl)/! s,(^-l)(.*),\1:lib\2.a,'
sed -r "/^-l($deps)/! s,(^-l)(.*),\1:lib\2.a," | # explicit .a
sed -n '/^-[Ll]/p' | # extra link options may break with make
tac |
awk "/^-l:$lib.a/&&c++ {next} 1" | # drop first duplicates of main lib
tac

View File

@ -0,0 +1,55 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2020 Intel Corporation
pkg = import('pkgconfig')
pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args
if is_freebsd
pkg_extra_cflags += ['-D__BSD_VISIBLE']
endif
# When calling pkg-config --static --libs, pkg-config will always output the
# regular libs first, and then the extra libs from Libs.private field,
# since the assumption is that those are additional dependencies for building
# statically that the .a files depend upon. The output order of .pc fields is:
# Libs Libs.private Requires Requires.private
# The fields Requires* are for package names.
# The flags of the DPDK libraries must be defined in Libs* fields.
# However, the DPDK drivers are linked only in static builds (Libs.private),
# and those need to come *before* the regular libraries (Libs field).
# This requirement is satisfied by moving the regular libs in a separate file
# included in the field Requires (after Libs.private).
# Another requirement is to allow linking dependencies as shared libraries,
# while linking static DPDK libraries and drivers. It is satisfied by
# listing the static files in Libs.private with the explicit syntax -l:libfoo.a.
# As a consequence, the regular DPDK libraries are already listed as static
# in the field Libs.private. The second occurences of DPDK libraries,
# included from Requires and used for shared library linkage case,
# are skipped in the case of static linkage thanks to the flag --as-needed.
pkg.generate(name: 'dpdk-libs',
filebase: 'libdpdk-libs',
description: '''Internal-only DPDK pkgconfig file. Not for direct use.
Use libdpdk.pc instead of this file to query DPDK compile/link arguments''',
version: meson.project_version(),
subdirs: [get_option('include_subdir_arch'), '.'],
extra_cflags: pkg_extra_cflags,
libraries: ['-Wl,--as-needed'] + dpdk_libraries,
libraries_private: dpdk_extra_ldflags)
pkg.generate(name: 'DPDK', # main DPDK pkgconfig file
filebase: 'libdpdk',
version: meson.project_version(),
description: '''The Data Plane Development Kit (DPDK).
Note that CFLAGS might contain an -march flag higher than typical baseline.
This is required for a number of static inline functions in the public headers.''',
requires: ['libdpdk-libs', libbsd], # may need libbsd for string funcs
# if libbsd is not enabled, then this is blank
libraries_private: ['-Wl,--whole-archive'] +
dpdk_drivers + dpdk_static_libraries +
['-Wl,--no-whole-archive']
)
# For static linking with dependencies as shared libraries,
# the internal static libraries must be flagged explicitly.
run_command(py3, 'set-static-linker-flags.py', check: true)

View File

@ -0,0 +1,38 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2020 Intel Corporation
# Script to fix flags for static linking in pkgconfig files from meson
# Should be called from meson build itself
import os
import sys
def fix_ldflag(f):
if not f.startswith('-lrte_'):
return f
return '-l:lib' + f[2:] + '.a'
def fix_libs_private(line):
if not line.startswith('Libs.private'):
return line
ldflags = [fix_ldflag(flag) for flag in line.split()]
return ' '.join(ldflags) + '\n'
def process_pc_file(filepath):
print('Processing', filepath)
with open(filepath) as src:
lines = src.readlines()
with open(filepath, 'w') as dst:
dst.writelines([fix_libs_private(line) for line in lines])
if 'MESON_BUILD_ROOT' not in os.environ:
print('This script must be called from a meson build environment')
sys.exit(1)
for root, dirs, files in os.walk(os.environ['MESON_BUILD_ROOT']):
pc_files = [f for f in files if f.endswith('.pc')]
for f in pc_files:
process_pc_file(os.path.join(root, f))

View File

@ -82,7 +82,7 @@ if ((fend) == ELFDATA2LSB) \
___x = le##width##toh(x); \
else \
___x = be##width##toh(x); \
___x; \
___x; \
})
#define TO_NATIVE(fend, width, x) CONVERT_NATIVE(fend, width, x)

View File

@ -328,7 +328,6 @@ CONFIG_RTE_LIBRTE_ICE_PMD=y
CONFIG_RTE_LIBRTE_ICE_DEBUG_RX=n
CONFIG_RTE_LIBRTE_ICE_DEBUG_TX=n
CONFIG_RTE_LIBRTE_ICE_DEBUG_TX_FREE=n
CONFIG_RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC=y
CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC=n
# Compile burst-oriented IAVF PMD driver
@ -573,7 +572,6 @@ CONFIG_RTE_CRYPTO_MAX_DEVS=64
# Compile PMD for ARMv8 Crypto device
#
CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO=n
CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO_DEBUG=n
#
# Compile NXP CAAM JR crypto Driver

View File

@ -45,7 +45,6 @@ CONFIG_RTE_LIBRTE_CXGBE_PMD=n
CONFIG_RTE_LIBRTE_E1000_PMD=n
CONFIG_RTE_LIBRTE_ENIC_PMD=n
CONFIG_RTE_LIBRTE_FM10K_PMD=n
CONFIG_RTE_LIBRTE_I40E_PMD=n
CONFIG_RTE_LIBRTE_IXGBE_PMD=n
CONFIG_RTE_LIBRTE_MLX4_PMD=n
CONFIG_RTE_LIBRTE_VMXNET3_PMD=n

View File

@ -0,0 +1 @@
defconfig_arm64-graviton2-linuxapp-gcc

View File

@ -0,0 +1,13 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) Amazon.com, Inc or its affiliates
#
#include "defconfig_arm64-armv8a-linux-gcc"
CONFIG_RTE_MACHINE="graviton2"
CONFIG_RTE_MAX_LCORE=64
CONFIG_RTE_CACHE_LINE_SIZE=64
CONFIG_RTE_MAX_MEM_MB=1048576
CONFIG_RTE_MAX_NUMA_NODES=1
CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n
CONFIG_RTE_LIBRTE_VHOST_NUMA=n

View File

@ -0,0 +1 @@
defconfig_arm64-graviton2-linuxapp-gcc

View File

@ -14,6 +14,10 @@ foreach env:supported_exec_envs
set_variable('is_' + env, exec_env == env)
endforeach
# MS linker requires special treatment.
# TODO: use cc.get_linker_id() with Meson >= 0.54
is_ms_linker = is_windows and (cc.get_id() == 'clang')
# set the major version, which might be used by drivers and libraries
# depending on the configuration options
pver = meson.project_version().split('.')
@ -50,9 +54,11 @@ eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
# driver .so files often depend upon the bus drivers for their connect bus,
# e.g. ixgbe depends on librte_bus_pci. This means that the bus drivers need
# to be in the library path, so symlink the drivers from the main lib directory.
meson.add_install_script('../buildtools/symlink-drivers-solibs.sh',
get_option('libdir'),
pmd_subdir_opt)
if not is_windows
meson.add_install_script('../buildtools/symlink-drivers-solibs.sh',
get_option('libdir'),
pmd_subdir_opt)
endif
# set the machine type and cflags for it
if meson.is_cross_build()
@ -98,11 +104,15 @@ dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper(), 1)
dpdk_conf.set('RTE_ARCH_64', cc.sizeof('void *') == 8)
add_project_link_arguments('-Wl,--no-as-needed', language: 'c')
if not is_windows
add_project_link_arguments('-Wl,--no-as-needed', language: 'c')
endif
# use pthreads
add_project_link_arguments('-pthread', language: 'c')
dpdk_extra_ldflags += '-pthread'
# use pthreads if available for the platform
if not is_ms_linker
add_project_link_arguments('-pthread', language: 'c')
dpdk_extra_ldflags += '-pthread'
endif
# on some OS, maths functions are in a separate library
if cc.find_library('m', required : false).found()
@ -136,6 +146,15 @@ if numa_dep.found() and cc.has_header('numaif.h')
dpdk_extra_ldflags += '-lnuma'
endif
has_libfdt = 0
fdt_dep = cc.find_library('libfdt', required: false)
if fdt_dep.found() and cc.has_header('fdt.h')
dpdk_conf.set10('RTE_HAS_LIBFDT', true)
has_libfdt = 1
add_project_link_arguments('-lfdt', language: 'c')
dpdk_extra_ldflags += '-lfdt'
endif
# check for libbsd
libbsd = dependency('libbsd', required: false)
if libbsd.found()
@ -143,11 +162,9 @@ if libbsd.found()
endif
# check for pcap
pcap_dep = dependency('pcap', required: false)
if pcap_dep.found()
# pcap got a pkg-config file only in 1.9.0 and before that meson uses
# an internal pcap-config finder, which is not compatible with
# cross-compilation, so try to fallback to find_library
pcap_dep = dependency('libpcap', required: false, method: 'pkg-config')
if not pcap_dep.found()
# pcap got a pkg-config file only in 1.9.0
pcap_dep = cc.find_library('pcap', required: false)
endif
if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
@ -166,6 +183,7 @@ warning_flags = [
# additional warnings in alphabetical order
'-Wcast-qual',
'-Wdeprecated',
'-Wformat',
'-Wformat-nonliteral',
'-Wformat-security',
'-Wmissing-declarations',
@ -183,6 +201,10 @@ warning_flags = [
'-Wno-packed-not-aligned',
'-Wno-missing-field-initializers'
]
if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0')
# FIXME: Bugzilla 396
warning_flags += '-Wno-zero-length-bounds'
endif
if not dpdk_conf.get('RTE_ARCH_64')
# for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!!
warning_flags += '-Wno-pointer-to-int-cast'
@ -202,6 +224,11 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64)
dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64)
dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true)
if dpdk_conf.get('RTE_ARCH_64')
dpdk_conf.set('RTE_MAX_MEM_MB', 524288)
else # for 32-bit we need smaller reserved memory areas
dpdk_conf.set('RTE_MAX_MEM_MB', 2048)
endif
compile_time_cpuflags = []
@ -231,6 +258,16 @@ if is_freebsd
add_project_arguments('-D__BSD_VISIBLE', language: 'c')
endif
if is_windows
# Minimum supported API is Windows 7.
add_project_arguments('-D_WIN32_WINNT=0x0601', language: 'c')
# Use MinGW-w64 stdio, because DPDK assumes ANSI-compliant formatting.
if cc.get_id() == 'gcc'
add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: 'c')
endif
endif
if get_option('b_lto')
if cc.has_argument('-ffat-lto-objects')
add_project_arguments('-ffat-lto-objects', language: 'c')

View File

@ -38,7 +38,6 @@
#define RTE_MAX_MEM_MB_PER_LIST 32768
#define RTE_MAX_MEMSEG_PER_TYPE 32768
#define RTE_MAX_MEM_MB_PER_TYPE 65536
#define RTE_MAX_MEM_MB 524288
#define RTE_MAX_MEMZONE 2560
#define RTE_MAX_TAILQ 32
#define RTE_LOG_DP_LEVEL RTE_LOG_INFO
@ -100,6 +99,9 @@
/****** driver defines ********/
/* Packet prefetching in PMDs */
#define RTE_PMD_PACKET_PREFETCH 1
/* QuickAssist device */
/* Max. number of QuickAssist devices which can be attached */
#define RTE_PMD_QAT_MAX_PCI_DEVICES 48

View File

@ -54,7 +54,7 @@ BEGIN {
}
for (i in deny_folders) {
re = "^\\+\\+\\+ b/" deny_folders[i];
if ($0 ~ deny_folders[i]) {
if ($0 ~ re) {
in_file = 1
last_file = $0
}
@ -62,7 +62,7 @@ BEGIN {
}
END {
if (count > 0) {
print "Warning in " substr(last_file,6) ":"
print "Warning in " substr(last_file,7) ":"
print MESSAGE
exit RET_ON_FAIL
}

View File

@ -17,13 +17,11 @@ build_map_changes()
# map files are altered, and all section/symbol names
# appearing between a triggering of this rule and the
# next trigger of this rule are associated with this file
/[-+] a\/.*\.map/ {map=$2; in_map=1}
/[-+] [ab]\/.*\.map/ {map=$2; in_map=1; next}
# Same pattern as above, only it matches on anything that
# does not end in 'map', indicating we have left the map chunk.
# When we hit this, turn off the in_map variable, which
# supresses the subordonate rules below
/[-+] a\/.*\.[^map]/ {in_map=0}
# The previous rule catches all .map files, anything else
# indicates we left the map chunk.
/[-+] [ab]\// {in_map=0}
# Triggering this rule, which starts a line and ends it
# with a { identifies a versioned section. The section name is

View File

@ -70,6 +70,14 @@ check_forbidden_additions() { # <patch>
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
# links must prefer https over http
awk -v FOLDERS='doc' \
-v EXPRESSIONS='http://.*dpdk.org' \
-v RET_ON_FAIL=1 \
-v MESSAGE='Using non https link to dpdk.org' \
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
return $res
}

View File

@ -38,20 +38,21 @@ else
fi
default_path=$PATH
default_pkgpath=$PKG_CONFIG_PATH
default_cppflags=$CPPFLAGS
default_cflags=$CFLAGS
default_ldflags=$LDFLAGS
default_meson_options=$DPDK_MESON_OPTIONS
load_env () # <target compiler>
{
targetcc=$1
# reset variables before target-specific config
export PATH=$default_path
export PKG_CONFIG_PATH=$default_pkgpath
unset PKG_CONFIG_PATH # global default makes no sense
export CPPFLAGS=$default_cppflags
export CFLAGS=$default_cflags
export LDFLAGS=$default_ldflags
unset DPDK_MESON_OPTIONS
export DPDK_MESON_OPTIONS=$default_meson_options
command -v $targetcc >/dev/null 2>&1 || return 1
DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p')
. $srcdir/devtools/load-devel-config
@ -134,19 +135,17 @@ done
# Test installation of the x86-default target, to be used for checking
# the sample apps build using the pkg-config file for cflags and libs
load_env cc
build_path=$(readlink -f $builds_dir/build-x86-default)
export DESTDIR=$build_path/install-root
$ninja_cmd -C $build_path install
load_env cc
pc_file=$(find $DESTDIR -name libdpdk.pc)
export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH
# if pkg-config defines the necessary flags, test building some examples
if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then
export PKGCONF="pkg-config --define-prefix"
for example in cmdline helloworld l2fwd l3fwd skeleton timer; do
echo "## Building $example"
$MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean all
$MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean shared static
done
fi

View File

@ -1,4 +1,4 @@
API {#index}
API
===
<!--
@ -107,8 +107,6 @@ The public API headers are grouped by topics:
[GRO] (@ref rte_gro.h),
[GSO] (@ref rte_gso.h),
[frag/reass] (@ref rte_ip_frag.h),
[LPM IPv4 route] (@ref rte_lpm.h),
[LPM IPv6 route] (@ref rte_lpm6.h),
[VXLAN] (@ref rte_vxlan.h)
- **QoS**:
@ -116,6 +114,14 @@ The public API headers are grouped by topics:
[scheduler] (@ref rte_sched.h),
[RED congestion] (@ref rte_red.h)
- **routing**:
[LPM IPv4 route] (@ref rte_lpm.h),
[LPM IPv6 route] (@ref rte_lpm6.h),
[RIB IPv4] (@ref rte_rib.h),
[RIB IPv6] (@ref rte_rib6.h),
[FIB IPv4] (@ref rte_fib.h),
[FIB IPv6] (@ref rte_fib6.h)
- **hashes**:
[hash] (@ref rte_hash.h),
[jhash] (@ref rte_jhash.h),

View File

@ -3,6 +3,7 @@
PROJECT_NAME = DPDK
PROJECT_NUMBER = @VERSION@
USE_MDFILE_AS_MAINPAGE = @TOPDIR@/doc/api/doxy-api-index.md
INPUT = @TOPDIR@/doc/api/doxy-api-index.md \
@TOPDIR@/drivers/bus/vdev \
@TOPDIR@/drivers/crypto/scheduler \

View File

@ -1,3 +1,6 @@
.. SPDX-License-Identifier: BSD-3-Clause
Copyright(c) 2018 Intel Corporation.
INSTALLING DPDK USING THE MESON BUILD SYSTEM
---------------------------------------------
@ -94,14 +97,17 @@ Examples of setting the same options using meson configure::
meson configure -Dmax_lcores=8
NOTE: once meson has been run to configure a build in a directory, it
cannot be run again on the same directory. Instead ``meson configure``
should be used to change the build settings within the directory, and when
``ninja`` is called to do the build itself, it will trigger the necessary
re-scan from meson.
.. note::
NOTE: machine=default uses a config that works on all supported architectures
regardless of the capabilities of the machine where the build is happening.
once meson has been run to configure a build in a directory, it
cannot be run again on the same directory. Instead ``meson configure``
should be used to change the build settings within the directory, and when
``ninja`` is called to do the build itself, it will trigger the necessary
re-scan from meson.
.. note::
machine=default uses a config that works on all supported architectures
regardless of the capabilities of the machine where the build is happening.
As well as those settings taken from ``meson configure``, other options
such as the compiler to use can be passed via environment variables. For
@ -109,9 +115,11 @@ example::
CC=clang meson clang-build
NOTE: for more comprehensive overriding of compilers or other environment
settings, the tools for cross-compilation may be considered. However, for
basic overriding of the compiler etc., the above form works as expected.
.. note::
for more comprehensive overriding of compilers or other environment
settings, the tools for cross-compilation may be considered. However, for
basic overriding of the compiler etc., the above form works as expected.
Performing the Build
@ -182,7 +190,7 @@ From examples/helloworld/Makefile::
PC_FILE := $(shell pkg-config --path libdpdk)
CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
LDFLAGS_STATIC = $(shell pkg-config --static --libs libdpdk)
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)

View File

@ -37,7 +37,10 @@ Limitations
-----------
* Compressdev level 0, no compression, is not supported.
* Queue pairs are not thread-safe (that is, within a single queue pair, RX and TX from different lcores is not supported).
* Queue-pairs are thread-safe on Intel CPUs but Queues are not (that is, within a single
queue-pair all enqueues to the TX queue must be done from one thread and all dequeues
from the RX queue must be done from one thread, but enqueues and dequeues may be done
in different threads.)
* No BSD support as BSD QAT kernel driver not available.
* When using Deflate dynamic huffman encoding for compression, the input size (op.src.length)
must be < CONFIG_RTE_PMD_QAT_COMP_IM_BUFFER_SIZE from the config file,

View File

@ -314,16 +314,22 @@ def print_table_css(outfile, table_id):
cursor: default;
overflow: hidden;
}
table#idx p {
margin: 0;
line-height: inherit;
}
table#idx th, table#idx td {
text-align: center;
border: solid 1px #ddd;
}
table#idx th {
font-size: 72%;
padding: 0.5em 0;
}
table#idx th, table#idx th p {
font-size: 11px;
white-space: pre-wrap;
vertical-align: top;
padding: 0.5em 0;
min-width: 0.9em;
width: 2em;
}
table#idx col:first-child {
width: 0;
@ -332,9 +338,11 @@ def print_table_css(outfile, table_id):
vertical-align: bottom;
}
table#idx td {
font-size: 70%;
padding: 1px;
}
table#idx td, table#idx td p {
font-size: 11px;
}
table#idx td:first-child {
padding-left: 1em;
text-align: left;
@ -410,4 +418,8 @@ def setup(app):
# Process the numref references once the doctree has been created.
app.connect('doctree-resolved', process_numref)
app.add_stylesheet('css/custom.css')
try:
# New function in sphinx 1.8
app.add_css_file('css/custom.css')
except:
app.add_stylesheet('css/custom.css')

View File

@ -27,8 +27,8 @@ General Guidelines
#. The removal of symbols is considered an :ref:`ABI breakage <abi_breakages>`,
once approved these will form part of the next ABI version.
#. Libraries or APIs marked as :ref:`experimental <experimental_apis>` may
change without constraint, as they are not considered part of an ABI version.
Experimental libraries have the major ABI version ``0``.
be changed or removed without prior notice, as they are not considered part
of an ABI version.
#. Updates to the :ref:`minimum hardware requirements <hw_rqmts>`, which drop
support for hardware which was previously supported, should be treated as an
ABI change.
@ -220,19 +220,18 @@ Examples of ABI Changes
The following are examples of allowable ABI changes occurring between
declarations of major ABI versions.
* DPDK 19.11 release, defines the function ``rte_foo()``, and ``rte_foo()``
as part of the major ABI version ``20``.
* DPDK 19.11 release defines the function ``rte_foo()`` ; ``rte_foo()``
is part of the major ABI version ``20``.
* DPDK 20.02 release defines a new function ``rte_foo(uint8_t bar)``, and
this is not a problem as long as the symbol ``rte_foo@DPDK20`` is
* DPDK 20.02 release defines a new function ``rte_foo(uint8_t bar)``.
This is not a problem as long as the symbol ``rte_foo@DPDK20`` is
preserved through :ref:`abi_versioning`.
- The new function may be marked with the ``__rte_experimental`` tag for a
number of releases, as described in the section :ref:`experimental_apis`.
- Once ``rte_foo(uint8_t bar)`` becomes non-experimental ``rte_foo()`` is then
declared as ``__rte_depreciated``, with an associated deprecation notice
provided.
- Once ``rte_foo(uint8_t bar)`` becomes non-experimental, ``rte_foo()`` is
declared as ``__rte_deprecated`` and an deprecation notice is provided.
* DPDK 19.11 is not re-released to include ``rte_foo(uint8_t bar)``, the new
version of ``rte_foo`` only exists from DPDK 20.02 onwards as described in the
@ -242,13 +241,13 @@ declarations of major ABI versions.
rte_baz()``. This function may or may not exist in the DPDK 20.05 release.
* An application ``dPacket`` wishes to use ``rte_foo(uint8_t bar)``, before the
declaration of the DPDK ``21`` major API version. The application can only
declaration of the DPDK ``21`` major ABI version. The application can only
ensure its runtime dependencies are met by specifying ``DPDK (>= 20.2)`` as
an explicit package dependency, as the soname only may only indicate the
an explicit package dependency, as the soname can only indicate the
supported major ABI version.
* At the release of DPDK 20.11, the function ``rte_foo(uint8_t bar)`` becomes
formally part of then new major ABI version DPDK 21.0 and ``rte_foo()`` may be
formally part of then new major ABI version DPDK ``21`` and ``rte_foo()`` may be
removed.
.. _deprecation_notices:
@ -290,7 +289,7 @@ APIs
~~~~
APIs marked as ``experimental`` are not considered part of an ABI version and
may change without warning at any time. Since changes to APIs are most likely
may be changed or removed without prior notice. Since changes to APIs are most likely
immediately after their introduction, as users begin to take advantage of those
new APIs and start finding issues with them, new DPDK APIs will be automatically
marked as ``experimental`` to allow for a period of stabilization before they
@ -321,7 +320,5 @@ Libraries
~~~~~~~~~
Libraries marked as ``experimental`` are entirely not considered part of an ABI
version, and may change without warning at any time. Experimental libraries
always have a major version of ``0`` to indicate they exist outside of
:ref:`abi_versioning` , with the minor version incremented with each ABI change
to library.
version.
All functions in such libraries may be changed or removed without prior notice.

View File

@ -200,7 +200,7 @@ private, is safe), but it also requires modifying the code as follows
Note also that, being a public function, the header file prototype must also be
changed, as must all the call sites, to reflect the new ABI footprint. We will
maintain previous ABI versions that are accessible only to previously compiled
binaries
binaries.
The addition of a parameter to the function is ABI breaking as the function is
public, and existing application may use it in its current form. However, the
@ -266,12 +266,12 @@ This file needs to be modified as follows
} DPDK_20;
The addition of the new block tells the linker that a new version node is
available (DPDK_21), which contains the symbol rte_acl_create, and inherits
The addition of the new block tells the linker that a new version node
``DPDK_21`` is available, which contains the symbol rte_acl_create, and inherits
the symbols from the DPDK_20 node. This list is directly translated into a
list of exported symbols when DPDK is compiled as a shared library
list of exported symbols when DPDK is compiled as a shared library.
Next, we need to specify in the code which function map to the rte_acl_create
Next, we need to specify in the code which function maps to the rte_acl_create
symbol at which versions. First, at the site of the initial symbol definition,
we need to update the function so that it is uniquely named, and not in conflict
with the public symbol name
@ -288,24 +288,29 @@ with the public symbol name
...
Note that the base name of the symbol was kept intact, as this is conducive to
the macros used for versioning symbols and we have annotated the function as an
implementation of versioned symbol. That is our next step, mapping this new
symbol name to the initial symbol name at version node 20. Immediately after
the function, we add this line of code
the macros used for versioning symbols and we have annotated the function as
``__vsym``, an implementation of a versioned symbol . That is our next step,
mapping this new symbol name to the initial symbol name at version node 20.
Immediately after the function, we add the VERSION_SYMBOL macro.
.. code-block:: c
#include <rte_function_versioning.h>
...
VERSION_SYMBOL(rte_acl_create, _v20, 20);
Remembering to also add the rte_function_versioning.h header to the requisite c
file where these changes are being made. The above macro instructs the linker to
file where these changes are being made. The macro instructs the linker to
create a new symbol ``rte_acl_create@DPDK_20``, which matches the symbol created
in older builds, but now points to the above newly named function. We have now
mapped the original rte_acl_create symbol to the original function (but with a
new name).
Next, we need to create the 21 version of the symbol. We create a new function
name, with a different suffix, and implement it appropriately
Please see the section :ref:`Enabling versioning macros
<enabling_versioning_macros>` to enable this macro in the meson/ninja build.
Next, we need to create the new ``v21`` version of the symbol. We create a new
function name, with the ``v21`` suffix, and implement it appropriately.
.. code-block:: c
@ -320,35 +325,58 @@ name, with a different suffix, and implement it appropriately
}
This code serves as our new API call. Its the same as our old call, but adds the
new parameter in place. Next we need to map this function to the symbol
``rte_acl_create@DPDK_21``. To do this, we modify the public prototype of the
call in the header file, adding the macro there to inform all including
applications, that on re-link, the default rte_acl_create symbol should point to
this function. Note that we could do this by simply naming the function above
rte_acl_create, and the linker would chose the most recent version tag to apply
in the version script, but we can also do this in the header file
new parameter in place. Next we need to map this function to the new default
symbol ``rte_acl_create@DPDK_21``. To do this, immediately after the function,
we add the BIND_DEFAULT_SYMBOL macro.
.. code-block:: c
#include <rte_function_versioning.h>
...
BIND_DEFAULT_SYMBOL(rte_acl_create, _v21, 21);
The macro instructs the linker to create the new default symbol
``rte_acl_create@DPDK_21``, which points to the above newly named function.
We finally modify the prototype of the call in the public header file,
such that it contains both versions of the symbol and the public API.
.. code-block:: c
struct rte_acl_ctx *
-rte_acl_create(const struct rte_acl_param *param);
+rte_acl_create_v21(const struct rte_acl_param *param, int debug);
+BIND_DEFAULT_SYMBOL(rte_acl_create, _v21, 21);
rte_acl_create(const struct rte_acl_param *param);
The BIND_DEFAULT_SYMBOL macro explicitly tells applications that include this
header, to link to the rte_acl_create_v21 function and apply the DPDK_21
version node to it. This method is more explicit and flexible than just
re-implementing the exact symbol name, and allows for other features (such as
linking to the old symbol version by default, when the new ABI is to be opt-in
for a period.
struct rte_acl_ctx * __vsym
rte_acl_create_v20(const struct rte_acl_param *param);
One last thing we need to do. Note that we've taken what was a public symbol,
and duplicated it into two uniquely and differently named symbols. We've then
mapped each of those back to the public symbol ``rte_acl_create`` with different
version tags. This only applies to dynamic linking, as static linking has no
notion of versioning. That leaves this code in a position of no longer having a
symbol simply named ``rte_acl_create`` and a static build will fail on that
missing symbol.
struct rte_acl_ctx * __vsym
rte_acl_create_v21(const struct rte_acl_param *param, int debug);
And that's it, on the next shared library rebuild, there will be two versions of
rte_acl_create, an old DPDK_20 version, used by previously built applications,
and a new DPDK_21 version, used by future built applications.
.. note::
**Before you leave**, please take care reviewing the sections on
:ref:`mapping static symbols <mapping_static_symbols>`,
:ref:`enabling versioning macros <enabling_versioning_macros>`,
and :ref:`ABI deprecation <abi_deprecation>`.
.. _mapping_static_symbols:
Mapping static symbols
______________________
Now we've taken what was a public symbol, and duplicated it into two uniquely
and differently named symbols. We've then mapped each of those back to the
public symbol ``rte_acl_create`` with different version tags. This only applies
to dynamic linking, as static linking has no notion of versioning. That leaves
this code in a position of no longer having a symbol simply named
``rte_acl_create`` and a static build will fail on that missing symbol.
To correct this, we can simply map a function of our choosing back to the public
symbol in the static build with the ``MAP_STATIC_SYMBOL`` macro. Generally the
@ -369,15 +397,31 @@ defined, we add this
That tells the compiler that, when building a static library, any calls to the
symbol ``rte_acl_create`` should be linked to ``rte_acl_create_v21``
That's it, on the next shared library rebuild, there will be two versions of
rte_acl_create, an old DPDK_20 version, used by previously built applications,
and a new DPDK_21 version, used by future built applications.
.. _enabling_versioning_macros:
Enabling versioning macros
__________________________
Finally, we need to indicate to the meson/ninja build system
to enable versioning macros when building the
library or driver. In the libraries or driver where we have added symbol
versioning, in the ``meson.build`` file we add the following
.. code-block:: none
use_function_versioning = true
at the start of the head of the file. This will indicate to the tool-chain to
enable the function version macros when building. There is no corresponding
directive required for the ``make`` build system.
.. _abi_deprecation:
Deprecating part of a public API
________________________________
Lets assume that you've done the above update, and in preparation for the next
Lets assume that you've done the above updates, and in preparation for the next
major ABI version you decide you would like to retire the old version of the
function. After having gone through the ABI deprecation announcement process,
removal is easy. Start by removing the symbol from the requisite version map
@ -421,8 +465,8 @@ Next remove the corresponding versioned export.
Note that the internal function definition could also be removed, but its used
in our example by the newer version v21, so we leave it in place and declare it
as static. This is a coding style choice.
in our example by the newer version ``v21``, so we leave it in place and declare
it as static. This is a coding style choice.
.. _deprecating_entire_abi:

View File

@ -82,7 +82,7 @@ added to by the developer.
* **API documentation**
The API documentation explains how to use the public DPDK functions.
The `API index page <http://doc.dpdk.org/api/>`_ shows the generated API documentation with related groups of functions.
The `API index page <https://doc.dpdk.org/api/>`_ shows the generated API documentation with related groups of functions.
The API documentation should be updated via Doxygen comments when new functions are added.
@ -561,14 +561,14 @@ Hyperlinks
~~~~~~~~~~
* Links to external websites can be plain URLs.
The following is rendered as http://dpdk.org::
The following is rendered as https://dpdk.org::
http://dpdk.org
https://dpdk.org
* They can contain alternative text.
The following is rendered as `Check out DPDK <http://dpdk.org>`_::
The following is rendered as `Check out DPDK <https://dpdk.org>`_::
`Check out DPDK <http://dpdk.org>`_
`Check out DPDK <https://dpdk.org>`_
* An internal link can be generated by placing labels in the document with the format ``.. _label_name``.
@ -666,7 +666,7 @@ The following are some guidelines for use of Doxygen in the DPDK API documentati
*/
In the API documentation the functions will be rendered as links, see the
`online section of the rte_ethdev.h docs <http://doc.dpdk.org/api/rte__ethdev_8h.html>`_ that contains the above text.
`online section of the rte_ethdev.h docs <https://doc.dpdk.org/api/rte__ethdev_8h.html>`_ that contains the above text.
* The ``@see`` keyword can be used to create a *see also* link to another file or library.
This directive should be placed on one line at the bottom of the documentation section.

View File

@ -28,9 +28,9 @@ The DPDK development process has the following features:
* All sub-repositories are merged into main repository for ``-rc1`` and ``-rc2`` versions of the release.
* After the ``-rc2`` release all patches should target the main repository.
The mailing list for DPDK development is `dev@dpdk.org <http://mails.dpdk.org/archives/dev/>`_.
Contributors will need to `register for the mailing list <http://mails.dpdk.org/listinfo/dev>`_ in order to submit patches.
It is also worth registering for the DPDK `Patchwork <http://patches.dpdk.org/project/dpdk/list/>`_
The mailing list for DPDK development is `dev@dpdk.org <https://mails.dpdk.org/archives/dev/>`_.
Contributors will need to `register for the mailing list <https://mails.dpdk.org/listinfo/dev>`_ in order to submit patches.
It is also worth registering for the DPDK `Patchwork <https://patches.dpdk.org/project/dpdk/list/>`_
If you are using the GitHub service, you can link your repository to
the ``travis-ci.org`` build service. When you push patches to your GitHub
@ -130,12 +130,12 @@ The source code can be cloned using either of the following:
main repository::
git clone git://dpdk.org/dpdk
git clone http://dpdk.org/git/dpdk
git clone https://dpdk.org/git/dpdk
sub-repositories (`list <http://git.dpdk.org/next>`_)::
sub-repositories (`list <https://git.dpdk.org/next>`_)::
git clone git://dpdk.org/next/dpdk-next-*
git clone http://dpdk.org/git/next/dpdk-next-*
git clone https://dpdk.org/git/next/dpdk-next-*
Make your Changes
-----------------
@ -182,7 +182,7 @@ A good way of thinking about whether a patch should be split is to consider whet
applied without dependencies as a backport.
It is better to keep the related documentation changes in the same patch
file as the code, rather than one big documentation patch at then end of a
file as the code, rather than one big documentation patch at the end of a
patchset. This makes it easier for future maintenance and development of the
code.
@ -320,7 +320,7 @@ Patch for Stable Releases
~~~~~~~~~~~~~~~~~~~~~~~~~
All fix patches to the master branch that are candidates for backporting
should also be CCed to the `stable@dpdk.org <http://mails.dpdk.org/listinfo/stable>`_
should also be CCed to the `stable@dpdk.org <https://mails.dpdk.org/listinfo/stable>`_
mailing list.
In the commit message body the Cc: stable@dpdk.org should be inserted as follows::
@ -423,7 +423,7 @@ are loaded from the following files, in order of preference::
~/.config/dpdk/devel.config
/etc/dpdk/devel.config.
Once the environment variable the script can be run as follows::
Once the environment variable is set, the script can be run as follows::
devtools/checkpatches.sh ~/patch/
@ -548,7 +548,7 @@ If the patch is in relation to a previous email thread you can add it to the sam
git send-email --to dev@dpdk.org --in-reply-to <1234-foo@bar.com> 000*.patch
The Message ID can be found in the raw text of emails or at the top of each Patchwork patch,
`for example <http://patches.dpdk.org/patch/7646/>`_.
`for example <https://patches.dpdk.org/patch/7646/>`_.
Shallow threading (``--thread --no-chain-reply-to``) is preferred for a patch series.
Once submitted your patches will appear on the mailing list and in Patchwork.

View File

@ -51,7 +51,7 @@ agreement and a commitment from a maintainer. The current policy is that each
year's November (X.11) release will be maintained as an LTS for 2 years.
After the X.11 release, an LTS branch will be created for it at
http://git.dpdk.org/dpdk-stable where bugfixes will be backported to.
https://git.dpdk.org/dpdk-stable where bugfixes will be backported to.
A LTS release may align with the declaration of a new major ABI version,
please read the :doc:`abi_policy` for more information.
@ -107,7 +107,7 @@ The Stable and LTS release are coordinated on the stable@dpdk.org mailing
list.
All fix patches to the master branch that are candidates for backporting
should also be CCed to the `stable@dpdk.org <http://mails.dpdk.org/listinfo/stable>`_
should also be CCed to the `stable@dpdk.org <https://mails.dpdk.org/listinfo/stable>`_
mailing list.
@ -118,7 +118,7 @@ A Stable Release will be released by:
* Tagging the release with YY.MM.n (year, month, number).
* Uploading a tarball of the release to dpdk.org.
* Sending an announcement to the `announce@dpdk.org <http://mails.dpdk.org/listinfo/announce>`_
* Sending an announcement to the `announce@dpdk.org <https://mails.dpdk.org/listinfo/announce>`_
list.
Stable releases are available on the `dpdk.org download page <http://core.dpdk.org/download/>`_.
Stable releases are available on the `dpdk.org download page <https://core.dpdk.org/download/>`_.

View File

@ -36,11 +36,11 @@ Report
Do not use Bugzilla (unsecured).
Instead, send GPG-encrypted emails
to `security@dpdk.org <http://core.dpdk.org/security#contact>`_.
to `security@dpdk.org <https://core.dpdk.org/security#contact>`_.
Anyone can post to this list.
In order to reduce the disclosure of a vulnerability in the early stages,
membership of this list is intentionally limited to a `small number of people
<http://mails.dpdk.org/roster/security>`_.
<https://mails.dpdk.org/roster/security>`_.
It is additionally encouraged to GPG-sign one-on-one conversations
as part of the security process.
@ -188,7 +188,7 @@ Downstream stakeholders are expected not to deploy or disclose patches
until the embargo is passed, otherwise they will be removed from the list.
Downstream stakeholders (in `security-prerelease list
<http://mails.dpdk.org/roster/security-prerelease>`_), are:
<https://mails.dpdk.org/roster/security-prerelease>`_), are:
* Operating system vendors known to package DPDK
* Major DPDK users, considered trustworthy by the technical board, who

View File

@ -45,6 +45,19 @@ can be downloaded in `<https://github.com/01org/intel-ipsec-mb/archive/v0.53.zip
make
make install
The library requires NASM to be built. Depending on the library version, it might require a minimum NASM version (e.g. v0.53 requires at least NASM 2.13.03).
NASM is packaged for different OS. However, on some OS the version is too old, so a manual installation is required.
In that case, NASM can be downloaded from
`NASM website <https://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D>`_.
Once it is downloaded, extract it and follow these steps:
.. code-block:: console
./configure
make
make install
As a reference, the following table shows a mapping between the past DPDK versions
and the external crypto libraries supported by them:

View File

@ -72,6 +72,19 @@ can be downloaded from `<https://github.com/01org/intel-ipsec-mb/archive/v0.53.z
make
make install
The library requires NASM to be built. Depending on the library version, it might require a minimum NASM version (e.g. v0.53 requires at least NASM 2.13.03).
NASM is packaged for different OS. However, on some OS the version is too old, so a manual installation is required.
In that case, NASM can be downloaded from
`NASM website <https://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D>`_.
Once it is downloaded, extract it and follow these steps:
.. code-block:: console
./configure
make
make install
As a reference, the following table shows a mapping between the past DPDK versions
and the Multi-Buffer library version supported by them:

View File

@ -6,6 +6,7 @@
[Features]
Symmetric crypto = Y
Sym operation chaining = Y
OOP LB In LB Out = Y
;
; Supported crypto algorithms of the 'kasumi' crypto driver.

View File

@ -11,6 +11,7 @@ HW Accelerated = Y
In Place SGL = Y
OOP SGL In LB Out = Y
OOP SGL In SGL Out = Y
OOP LB In LB Out = Y
RSA PRIV OP KEY QT = Y
;

View File

@ -11,6 +11,7 @@ HW Accelerated = Y
In Place SGL = Y
OOP SGL In LB Out = Y
OOP SGL In SGL Out = Y
OOP LB In LB Out = Y
RSA PRIV OP KEY QT = Y
;

View File

@ -44,10 +44,15 @@ ZUC EEA3 = Y
[Auth]
NULL = Y
MD5 HMAC = Y
SHA1 = Y
SHA1 HMAC = Y
SHA224 = Y
SHA224 HMAC = Y
SHA256 = Y
SHA256 HMAC = Y
SHA384 = Y
SHA384 HMAC = Y
SHA512 = Y
SHA512 HMAC = Y
AES GMAC = Y
SNOW3G UIA2 = Y

View File

@ -6,6 +6,7 @@
[Features]
Symmetric crypto = Y
Sym operation chaining = Y
OOP LB In LB Out = Y
;
; Supported crypto algorithms of the 'snow3g' crypto driver.

View File

@ -6,6 +6,7 @@
[Features]
Symmetric crypto = Y
Sym operation chaining = Y
OOP LB In LB Out = Y
;
; Supported crypto algorithms of the 'zuc' crypto driver.

View File

@ -52,10 +52,15 @@ Cipher algorithms:
Hash algorithms:
* ``RTE_CRYPTO_AUTH_SHA1``
* ``RTE_CRYPTO_AUTH_SHA1_HMAC``
* ``RTE_CRYPTO_AUTH_SHA224``
* ``RTE_CRYPTO_AUTH_SHA224_HMAC``
* ``RTE_CRYPTO_AUTH_SHA256``
* ``RTE_CRYPTO_AUTH_SHA256_HMAC``
* ``RTE_CRYPTO_AUTH_SHA384``
* ``RTE_CRYPTO_AUTH_SHA384_HMAC``
* ``RTE_CRYPTO_AUTH_SHA512``
* ``RTE_CRYPTO_AUTH_SHA512_HMAC``
* ``RTE_CRYPTO_AUTH_AES_XCBC_MAC``
* ``RTE_CRYPTO_AUTH_SNOW3G_UIA2``
@ -72,6 +77,29 @@ Supported AEAD algorithms:
* ``RTE_CRYPTO_AEAD_AES_CCM``
Supported Chains
~~~~~~~~~~~~~~~~
All the usual chains are supported and also some mixed chains:
.. table:: Supported hash-cipher chains for wireless digest-encrypted cases
+------------------+-----------+-------------+----------+----------+
| Cipher algorithm | NULL AUTH | SNOW3G UIA2 | ZUC EIA3 | AES CMAC |
+==================+===========+=============+==========+==========+
| NULL CIPHER | Y | 2&3 | 2&3 | Y |
+------------------+-----------+-------------+----------+----------+
| SNOW3G UEA2 | 2&3 | Y | 2&3 | 2&3 |
+------------------+-----------+-------------+----------+----------+
| ZUC EEA3 | 2&3 | 2&3 | 2&3 | 2&3 |
+------------------+-----------+-------------+----------+----------+
| AES CTR | Y | 2&3 | 2&3 | Y |
+------------------+-----------+-------------+----------+----------+
* The combinations marked as "Y" are supported on all QAT hardware versions.
* The combinations marked as "2&3" are supported on GEN2/GEN3 QAT hardware only.
Limitations
~~~~~~~~~~~
@ -81,7 +109,10 @@ Limitations
* No BSD support as BSD QAT kernel driver not available.
* ZUC EEA3/EIA3 is not supported by dh895xcc devices
* Maximum additional authenticated data (AAD) for GCM is 240 bytes long and must be passed to the device in a buffer rounded up to the nearest block-size multiple (x16) and padded with zeros.
* Queue pairs are not thread-safe (that is, within a single queue pair, RX and TX from different lcores is not supported).
* Queue-pairs are thread-safe on Intel CPUs but Queues are not (that is, within a single
queue-pair all enqueues to the TX queue must be done from one thread and all dequeues
from the RX queue must be done from one thread, but enqueues and dequeues may be done
in different threads.)
* A GCM limitation exists, but only in the case where there are multiple
generations of QAT devices on a single platform.
To optimise performance, the GCM crypto session should be initialised for the
@ -93,6 +124,8 @@ Limitations
enqueued to the device and will be marked as failed. The simplest way to
mitigate this is to use the bdf whitelist to avoid mixing devices of different
generations in the same process if planning to use for GCM.
* The mixed algo feature on GEN2 is not supported by all kernel drivers. Check
the notes under the Available Kernel Drivers table below for specific details.
Extra notes on KASUMI F9
~~~~~~~~~~~~~~~~~~~~~~~~
@ -133,7 +166,10 @@ Limitations
~~~~~~~~~~~
* Big integers longer than 4096 bits are not supported.
* Queue pairs are not thread-safe (that is, within a single queue pair, RX and TX from different lcores is not supported).
* Queue-pairs are thread-safe on Intel CPUs but Queues are not (that is, within a single
queue-pair all enqueues to the TX queue must be done from one thread and all dequeues
from the RX queue must be done from one thread, but enqueues and dequeues may be done
in different threads.)
* RSA-2560, RSA-3584 are not supported
.. _building_qat:
@ -237,6 +273,27 @@ allocated while for GEN1 devices, 12 buffers are allocated, plus 1472 bytes over
larger than the input size).
Running QAT PMD with minimum threshold for burst size
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If only a small number or packets can be enqueued. Each enqueue causes an expensive MMIO write.
These MMIO write occurrences can be optimised by setting any of the following parameters
- qat_sym_enq_threshold
- qat_asym_enq_threshold
- qat_comp_enq_threshold
When any of these parameters is set rte_cryptodev_enqueue_burst function will
return 0 (thereby avoiding an MMIO) if the device is congested and number of packets
possible to enqueue is smaller.
To use this feature the user must set the parameter on process start as a device additional parameter::
example: -w 03:01.1,qat_sym_enq_threshold=32,qat_comp_enq_threshold=16
All parameters can be used with the same device regardless of order. Parameters are separated
by comma. When the same parameter is used more than once first occurrence of the parameter
is used.
Maximum threshold that can be set is 32.
Device and driver naming
~~~~~~~~~~~~~~~~~~~~~~~~
@ -326,6 +383,8 @@ to see the full table)
| Yes | No | No | 3 | C4xxx | p | qat_c4xxx | c4xxx | 18a0 | 1 | 18a1 | 128 |
+-----+-----+-----+-----+----------+---------------+---------------+------------+--------+------+--------+--------+
* Note: Symmetric mixed crypto algorithms feature on Gen 2 works only with 01.org driver version 4.9.0+
The first 3 columns indicate the service:
* S = Symmetric crypto service (via cryptodev API)

View File

@ -5,7 +5,7 @@ Event Device Drivers
====================
The following are a list of event device PMDs, which can be used from an
application trough the eventdev API.
application through the eventdev API.
.. toctree::
:maxdepth: 2

View File

@ -62,7 +62,7 @@ environmental variables should be set as below:
.. note::
To install a copy of the DPDK compiled using gcc, please download the
official DPDK package from http://core.dpdk.org/download/ and install manually using
official DPDK package from https://core.dpdk.org/download/ and install manually using
the instructions given in the next chapter, :ref:`building_from_source`
An example application can therefore be copied to a user's home directory and

View File

@ -167,60 +167,32 @@ Installation of DPDK Target Environment using Make
is therefore recommended that DPDK installation is done using meson and
ninja as described above.
The format of a DPDK target is::
Get a native target environment automatically::
ARCH-MACHINE-EXECENV-TOOLCHAIN
where:
* ``ARCH`` can be: ``i686``, ``x86_64``, ``ppc_64``, ``arm64``
* ``MACHINE`` can be: ``native``, ``power8``, ``armv8a``
* ``EXECENV`` can be: ``linux``, ``freebsd``
* ``TOOLCHAIN`` can be: ``gcc``, ``icc``
The targets to be installed depend on the 32-bit and/or 64-bit packages and compilers installed on the host.
Available targets can be found in the DPDK/config directory.
The defconfig\_ prefix should not be used.
make defconfig O=mybuild
.. note::
Configuration files are provided with the ``RTE_MACHINE`` optimization level set.
Within the configuration files, the ``RTE_MACHINE`` configuration value is set to native,
which means that the compiled software is tuned for the platform on which it is built.
For more information on this setting, and its possible values, see the *DPDK Programmers Guide*.
When using the Intel® C++ Compiler (icc), one of the following commands should be invoked for 64-bit or 32-bit use respectively.
Notice that the shell scripts update the ``$PATH`` variable and therefore should not be performed in the same session.
Also, verify the compiler's installation directory since the path may be different:
Or get a specific target environment::
.. code-block:: console
make config T=x86_64-native-linux-gcc O=mybuild
source /opt/intel/bin/iccvars.sh intel64
source /opt/intel/bin/iccvars.sh ia32
The format of a DPDK target is "ARCH-MACHINE-EXECENV-TOOLCHAIN".
Available targets can be found with::
To install and make targets, use the ``make install T=<target>`` command in the top-level DPDK directory.
make help
For example, to compile a 64-bit target using icc, run:
Customize the target configuration in the generated ``.config`` file.
Example for enabling the pcap PMD::
.. code-block:: console
sed -ri 's,(PMD_PCAP=).*,\1y,' mybuild/.config
make install T=x86_64-native-linux-icc
Compile the target::
To compile a 32-bit build using gcc, the make command should be:
.. code-block:: console
make install T=i686-native-linux-gcc
To prepare a target without building it, for example, if the configuration changes need to be made before compilation,
use the ``make config T=<target>`` command:
.. code-block:: console
make config T=x86_64-native-linux-gcc
make -j4 O=mybuild
.. warning::
@ -229,15 +201,13 @@ use the ``make config T=<target>`` command:
If the DPDK is not being built on the target machine,
the ``RTE_KERNELDIR`` environment variable should be used to point the compilation at a copy of the kernel version to be used on the target machine.
Once the target environment is created, the user may move to the target environment directory and continue to make code changes and re-compile.
The user may also make modifications to the compile-time DPDK configuration by editing the .config file in the build directory.
(This is a build-local copy of the defconfig file from the top- level config directory).
Install the target in a separate directory::
.. code-block:: console
make install O=mybuild DESTDIR=myinstall prefix=
cd x86_64-native-linux-gcc
vi .config
make
The environment is ready to build a DPDK application::
RTE_SDK=$(pwd)/myinstall/share/dpdk RTE_TARGET=x86_64-native-linux-gcc make -C myapp
In addition, the make clean command can be used to remove any existing compiled files for a subsequent full, clean rebuild of the code.
@ -245,5 +215,5 @@ Browsing the Installed DPDK Environment Target
----------------------------------------------
Once a target is created it contains all libraries, including poll-mode drivers, and header files for the DPDK environment that are required to build customer applications.
In addition, the test and testpmd applications are built under the build/app directory, which may be used for testing.
In addition, the test applications are built under the app directory, which may be used for testing.
A kmod directory is also present that contains kernel modules which may be loaded if needed.

View File

@ -4,7 +4,7 @@
Compiling and Running Sample Applications
=========================================
The chapter describes how to compile and run applications in an DPDK environment.
The chapter describes how to compile and run applications in a DPDK environment.
It also provides a pointer to where sample applications are stored.
.. note::
@ -185,7 +185,7 @@ Each bit of the mask corresponds to the equivalent logical core number as report
Since these logical core numbers, and their mapping to specific cores on specific NUMA sockets, can vary from platform to platform,
it is recommended that the core layout for each platform be considered when choosing the coremask/corelist to use in each case.
On initialization of the EAL layer by an DPDK application, the logical cores to be used and their socket location are displayed.
On initialization of the EAL layer by a DPDK application, the logical cores to be used and their socket location are displayed.
This information can also be determined for all cores on the system by examining the ``/proc/cpuinfo`` file, for example, by running cat ``/proc/cpuinfo``.
The physical id attribute listed for each processor indicates the CPU socket to which it belongs.
This can be useful when using other processors to understand the mapping of the logical cores to the sockets.

View File

@ -132,7 +132,7 @@ Debugging options
Specify log level for a specific component. For example::
--log-level eal:8
--log-level lib.eal:debug
Can be specified multiple times.

View File

@ -58,22 +58,51 @@ The application can then determine what action to take, if any, if the HPET is n
if any, and on what is available on the system at runtime.
Running DPDK Applications Without Root Privileges
--------------------------------------------------------
-------------------------------------------------
In order to run DPDK as non-root, the following Linux filesystem objects'
permissions should be adjusted to ensure that the Linux account being used to
run the DPDK application has access to them:
* All directories which serve as hugepage mount points, for example, ``/dev/hugepages``
* If the HPET is to be used, ``/dev/hpet``
When running as non-root user, there may be some additional resource limits
that are imposed by the system. Specifically, the following resource limits may
need to be adjusted in order to ensure normal DPDK operation:
* RLIMIT_LOCKS (number of file locks that can be held by a process)
* RLIMIT_NOFILE (number of open file descriptors that can be held open by a process)
* RLIMIT_MEMLOCK (amount of pinned pages the process is allowed to have)
The above limits can usually be adjusted by editing
``/etc/security/limits.conf`` file, and rebooting.
Additionally, depending on which kernel driver is in use, the relevant
resources also should be accessible by the user running the DPDK application.
For ``vfio-pci`` kernel driver, the following Linux file system objects'
permissions should be adjusted:
* The VFIO device file, ``/dev/vfio/vfio``
* The directories under ``/dev/vfio`` that correspond to IOMMU group numbers of
devices intended to be used by DPDK, for example, ``/dev/vfio/50``
.. note::
The instructions below will allow running DPDK as non-root with older
Linux kernel versions. However, since version 4.0, the kernel does not allow
unprivileged processes to read the physical address information from
the pagemaps file, making it impossible for those processes to use HW
devices which require physical addresses
The instructions below will allow running DPDK with ``igb_uio`` or
``uio_pci_generic`` drivers as non-root with older Linux kernel versions.
However, since version 4.0, the kernel does not allow unprivileged processes
to read the physical address information from the pagemaps file, making it
impossible for those processes to be used by non-privileged users. In such
cases, using the VFIO driver is recommended.
Although applications using the DPDK use network ports and other hardware resources directly,
with a number of small permission adjustments it is possible to run these applications as a user other than "root".
To do so, the ownership, or permissions, on the following Linux file system objects should be adjusted to ensure that
the Linux user account being used to run the DPDK application has access to them:
* All directories which serve as hugepage mount points, for example, ``/mnt/huge``
For ``igb_uio`` or ``uio_pci_generic`` kernel drivers, the following Linux file
system objects' permissions should be adjusted:
* The userspace-io device files in ``/dev``, for example, ``/dev/uio0``, ``/dev/uio1``, and so on
@ -82,11 +111,6 @@ the Linux user account being used to run the DPDK application has access to them
/sys/class/uio/uio0/device/config
/sys/class/uio/uio0/device/resource*
* If the HPET is to be used, ``/dev/hpet``
.. note::
On some Linux installations, ``/dev/hugepages`` is also a hugepage mount point created by default.
Power Management and Power Saving Functionality
-----------------------------------------------
@ -112,7 +136,7 @@ In addition, C3 and C6 should be enabled as well for power management. The path
Using Linux Core Isolation to Reduce Context Switches
-----------------------------------------------------
While the threads used by an DPDK application are pinned to logical cores on the system,
While the threads used by a DPDK application are pinned to logical cores on the system,
it is possible for the Linux scheduler to run other tasks on those cores also.
To help prevent additional workloads from running on those cores,
it is possible to use the ``isolcpus`` Linux kernel parameter to isolate them from the general Linux scheduler.

View File

@ -52,8 +52,8 @@ be loaded as shown below:
If the devices used for DPDK are bound to the ``uio_pci_generic`` kernel module,
please make sure that the IOMMU is disabled or passthrough. One can add
``intel_iommu=off`` or ``amd_iommu=off`` or ``intel_iommu=on iommu=pt``in GRUB
command line on x86_64 systems, or add ``iommu.passthrough=1`` on arm64 system.
``intel_iommu=off`` or ``amd_iommu=off`` or ``intel_iommu=on iommu=pt`` in GRUB
command line on x86_64 systems, or add ``iommu.passthrough=1`` on aarch64 system.
Since DPDK release 1.7 onward provides VFIO support, use of UIO is optional
for platforms that support using VFIO.
@ -120,7 +120,7 @@ Binding and Unbinding Network Ports to/from the Kernel Modules
PMDs Which use the bifurcated driver should not be unbind from their kernel drivers. this section is for PMDs which use the UIO or VFIO drivers.
As of release 1.4, DPDK applications no longer automatically unbind all supported network ports from the kernel driver in use.
Instead, in case the PMD being used use the UIO or VFIO drivers, all ports that are to be used by an DPDK application must be bound to the
Instead, in case the PMD being used use the UIO or VFIO drivers, all ports that are to be used by a DPDK application must be bound to the
``uio_pci_generic``, ``igb_uio`` or ``vfio-pci`` module before the application is run.
For such PMDs, any network ports under Linux* control will be ignored and cannot be used by the application.

View File

@ -1,3 +1,6 @@
.. SPDX-License-Identifier: BSD-3-Clause
Copyright(c) 2015 Intel Corporation.
How to get best performance with NICs on Intel platforms
========================================================
@ -64,7 +67,7 @@ This aligns with the previous output which showed that each channel has one memo
Network Interface Card Requirements
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use a `DPDK supported <http://core.dpdk.org/supported/>`_ high end NIC such as the Intel XL710 40GbE.
Use a `DPDK supported <https://core.dpdk.org/supported/>`_ high end NIC such as the Intel XL710 40GbE.
Make sure each NIC has been flashed the latest version of NVM/firmware.

View File

@ -107,7 +107,7 @@ e.g. :doc:`../nics/index`
Running DPDK Applications
-------------------------
To run an DPDK application, some customization may be required on the target machine.
To run a DPDK application, some customization may be required on the target machine.
System Software
~~~~~~~~~~~~~~~
@ -157,8 +157,36 @@ Without hugepages, high TLB miss rates would occur with the standard 4k page siz
Reserving Hugepages for DPDK Use
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The allocation of hugepages should be done at boot time or as soon as possible after system boot
to prevent memory from being fragmented in physical memory.
The reservation of hugepages can be performed at run time.
This is done by echoing the number of hugepages required
to a ``nr_hugepages`` file in the ``/sys/kernel/`` directory
corresponding to a specific page size (in Kilobytes).
For a single-node system, the command to use is as follows
(assuming that 1024 of 2MB pages are required)::
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
On a NUMA machine, the above command will usually divide the number of hugepages
equally across all NUMA nodes (assuming there is enough memory on all NUMA nodes).
However, pages can also be reserved explicitly on individual NUMA nodes
using a ``nr_hugepages`` file in the ``/sys/devices/`` directory::
echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo 1024 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
.. note::
Some kernel versions may not allow reserving 1 GB hugepages at run time,
so reserving them at boot time may be the only option.
Please see below for instructions.
**Alternative:**
In the general case, reserving hugepages at run time is perfectly fine,
but in use cases where having lots of physically contiguous memory is required,
it is preferable to reserve hugepages at boot time,
as that will help in preventing physical memory from becoming heavily fragmented.
To reserve hugepages at boot time, a parameter is passed to the Linux kernel on the kernel command line.
For 2 MB pages, just pass the hugepages option to the kernel. For example, to reserve 1024 pages of 2 MB, use::
@ -187,35 +215,29 @@ the number of hugepages reserved at boot time is generally divided equally betwe
See the Documentation/admin-guide/kernel-parameters.txt file in your Linux source tree for further details of these and other kernel options.
**Alternative:**
For 2 MB pages, there is also the option of allocating hugepages after the system has booted.
This is done by echoing the number of hugepages required to a nr_hugepages file in the ``/sys/devices/`` directory.
For a single-node system, the command to use is as follows (assuming that 1024 pages are required)::
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
On a NUMA machine, pages should be allocated explicitly on separate nodes::
echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
echo 1024 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
.. note::
For 1G pages, it is not possible to reserve the hugepage memory after the system has booted.
Using Hugepages with the DPDK
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Once the hugepage memory is reserved, to make the memory available for DPDK use, perform the following steps::
If secondary process support is not required, DPDK is able to use hugepages
without any configuration by using "in-memory" mode.
Please see :doc:`linux_eal_parameters` for more details.
If secondary process support is required,
mount points for hugepages need to be created.
On modern Linux distributions, a default mount point for hugepages
is provided by the system and is located at ``/dev/hugepages``.
This mount point will use the default hugepage size
set by the kernel parameters as described above.
However, in order to use hugepage sizes other than the default, it is necessary
to manually create mount points for those hugepage sizes (e.g. 1GB pages).
To make the hugepages of size 1GB available for DPDK use,
following steps must be performed::
mkdir /mnt/huge
mount -t hugetlbfs nodev /mnt/huge
mount -t hugetlbfs pagesize=1GB /mnt/huge
The mount point can be made permanent across reboots, by adding the following line to the ``/etc/fstab`` file::
nodev /mnt/huge hugetlbfs defaults 0 0
For 1GB pages, the page size must be specified as a mount option::
nodev /mnt/huge_1GB hugetlbfs pagesize=1GB 0 0
nodev /mnt/huge hugetlbfs pagesize=1GB 0 0

Some files were not shown because too many files have changed in this diff Show More