Imported Upstream version 16.07-rc3 88/1988/1
authorRicardo Salveti <ricardo.salveti@linaro.org>
Mon, 18 Jul 2016 18:30:53 +0000 (15:30 -0300)
committerRicardo Salveti <ricardo.salveti@linaro.org>
Mon, 18 Jul 2016 18:31:22 +0000 (15:31 -0300)
Change-Id: I321148bfa234858ba1986d109470b7aa280cd429
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
113 files changed:
MAINTAINERS
app/pdump/main.c
app/test-pmd/testpmd.c
app/test/Makefile
app/test/autotest_data.py
app/test/autotest_runner.py
app/test/test.h
app/test/test_acl.c
app/test/test_alarm.c
app/test/test_atomic.c
app/test/test_byteorder.c
app/test/test_cmdline.c
app/test/test_common.c
app/test/test_cpuflags.c
app/test/test_cryptodev.c
app/test/test_cryptodev_perf.c
app/test/test_cycles.c
app/test/test_debug.c
app/test/test_devargs.c
app/test/test_distributor.c
app/test/test_distributor_perf.c
app/test/test_eal_flags.c
app/test/test_eal_fs.c
app/test/test_errno.c
app/test/test_func_reentrancy.c
app/test/test_hash.c
app/test/test_hash_functions.c
app/test/test_hash_multiwriter.c
app/test/test_hash_perf.c
app/test/test_hash_scaling.c
app/test/test_interrupts.c
app/test/test_ivshmem.c
app/test/test_kni.c
app/test/test_kvargs.c
app/test/test_link_bonding.c
app/test/test_link_bonding_mode4.c
app/test/test_link_bonding_rssconf.c
app/test/test_logs.c
app/test/test_lpm.c
app/test/test_lpm6.c
app/test/test_lpm6_perf.c
app/test/test_lpm_perf.c
app/test/test_malloc.c
app/test/test_mbuf.c
app/test/test_memcpy.c
app/test/test_memcpy_perf.c
app/test/test_memory.c
app/test/test_mempool.c
app/test/test_mempool_perf.c
app/test/test_memzone.c
app/test/test_meter.c
app/test/test_mp_secondary.c
app/test/test_pci.c
app/test/test_per_lcore.c
app/test/test_pmd_perf.c
app/test/test_pmd_ring.c
app/test/test_pmd_ring_perf.c
app/test/test_power.c
app/test/test_power_acpi_cpufreq.c
app/test/test_power_kvm_vm.c
app/test/test_prefetch.c
app/test/test_red.c
app/test/test_reorder.c
app/test/test_resource.c
app/test/test_ring.c
app/test/test_ring_perf.c
app/test/test_rwlock.c
app/test/test_sched.c
app/test/test_spinlock.c
app/test/test_string_fns.c
app/test/test_table.c
app/test/test_tailq.c
app/test/test_thash.c
app/test/test_timer.c
app/test/test_timer_perf.c
app/test/test_timer_racecond.c
app/test/test_version.c
doc/guides/contributing/patches.rst
doc/guides/prog_guide/env_abstraction_layer.rst
doc/guides/prog_guide/pdump_lib.rst
doc/guides/prog_guide/ring_lib.rst
doc/guides/rel_notes/release_16_07.rst
doc/guides/sample_app_ug/pdump.rst
drivers/net/enic/enic.h
drivers/net/enic/enic_clsf.c
drivers/net/enic/enic_ethdev.c
drivers/net/enic/enic_main.c
drivers/net/enic/enic_rxtx.c
drivers/net/fm10k/fm10k_ethdev.c
drivers/net/i40e/i40e_ethdev.c
drivers/net/mlx5/mlx5_rxtx.c
drivers/net/virtio/virtio_user_ethdev.c
examples/distributor/main.c
examples/ipsec-secgw/ipsec-secgw.c
examples/l2fwd-crypto/main.c
lib/librte_eal/bsdapp/eal/Makefile
lib/librte_eal/bsdapp/eal/rte_eal_version.map
lib/librte_eal/common/arch/x86/rte_spinlock.c [new file with mode: 0644]
lib/librte_eal/common/include/arch/x86/rte_spinlock.h
lib/librte_eal/common/include/rte_version.h
lib/librte_eal/linuxapp/eal/Makefile
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
lib/librte_eal/linuxapp/eal/eal_vfio.c
lib/librte_eal/linuxapp/eal/rte_eal_version.map
lib/librte_ip_frag/rte_ip_frag.h
lib/librte_mempool/rte_mempool.c
lib/librte_mempool/rte_mempool.h
lib/librte_pdump/rte_pdump.c
lib/librte_vhost/vhost_rxtx.c
lib/librte_vhost/vhost_user/fd_man.c
lib/librte_vhost/vhost_user/vhost-net-user.c
mk/rte.app.mk
scripts/test-build.sh

index f996c2e..9c76352 100644 (file)
@@ -253,7 +253,7 @@ F: app/test/test_link_bonding*
 F: examples/bond/
 
 Linux KNI
-M: Helin Zhang <helin.zhang@intel.com>
+M: Ferruh Yigit <ferruh.yigit@intel.com>
 F: lib/librte_eal/linuxapp/kni/
 F: lib/librte_kni/
 F: doc/guides/prog_guide/kernel_nic_interface.rst
index 2087c15..e0ff8be 100644 (file)
@@ -55,6 +55,7 @@
 #include <rte_ring.h>
 #include <rte_pdump.h>
 
+#define CMD_LINE_OPT_PDUMP "pdump"
 #define PDUMP_PORT_ARG "port"
 #define PDUMP_PCI_ARG "device_id"
 #define PDUMP_QUEUE_ARG "queue"
@@ -64,6 +65,8 @@
 #define PDUMP_RING_SIZE_ARG "ring-size"
 #define PDUMP_MSIZE_ARG "mbuf-size"
 #define PDUMP_NUM_MBUFS_ARG "total-num-mbufs"
+#define CMD_LINE_OPT_SER_SOCK_PATH "server-socket-path"
+#define CMD_LINE_OPT_CLI_SOCK_PATH "client-socket-path"
 
 #define VDEV_PCAP "eth_pcap_%s_%d,tx_pcap=%s"
 #define VDEV_IFACE "eth_pcap_%s_%d,tx_iface=%s"
@@ -166,6 +169,8 @@ struct parse_val {
 int num_tuples;
 static struct rte_eth_conf port_conf_default;
 volatile uint8_t quit_signal;
+static char server_socket_path[PATH_MAX];
+static char client_socket_path[PATH_MAX];
 
 /**< display usage */
 static void
@@ -178,8 +183,11 @@ pdump_usage(const char *prgname)
                        " tx-dev=<iface or pcap file>,"
                        "[ring-size=<ring size>default:16384],"
                        "[mbuf-size=<mbuf data size>default:2176],"
-                       "[total-num-mbufs=<number of mbufs>default:65535]"
-                       "'\n",
+                       "[total-num-mbufs=<number of mbufs>default:65535]'\n"
+                       "[--server-socket-path=<server socket dir>"
+                               "default:/var/run/.dpdk/ (or) ~/.dpdk/]\n"
+                       "[--client-socket-path=<client socket dir>"
+                               "default:/var/run/.dpdk/ (or) ~/.dpdk/]\n",
                        prgname);
 }
 
@@ -226,9 +234,6 @@ parse_rxtxdev(const char *key, const char *value, void *extra_args)
                /* identify the tx stream type for pcap vdev */
                if (if_nametoindex(pt->tx_dev))
                        pt->tx_vdev_stream_type = IFACE;
-       } else {
-               printf("invalid dev type %s, must be rx or tx\n", value);
-               return -1;
        }
 
        return 0;
@@ -407,6 +412,8 @@ launch_args_parse(int argc, char **argv, char *prgname)
        int option_index;
        static struct option long_option[] = {
                {"pdump", 1, 0, 0},
+               {"server-socket-path", 1, 0, 0},
+               {"client-socket-path", 1, 0, 0},
                {NULL, 0, 0, 0}
        };
 
@@ -418,14 +425,32 @@ launch_args_parse(int argc, char **argv, char *prgname)
                        long_option, &option_index)) != EOF) {
                switch (opt) {
                case 0:
-                       if (!strncmp(long_option[option_index].name, "pdump",
-                                       MAX_LONG_OPT_SZ)) {
+                       if (!strncmp(long_option[option_index].name,
+                                       CMD_LINE_OPT_PDUMP,
+                                       sizeof(CMD_LINE_OPT_PDUMP))) {
                                ret = parse_pdump(optarg);
                                if (ret) {
                                        pdump_usage(prgname);
                                        return -1;
                                }
                        }
+
+                       if (!strncmp(long_option[option_index].name,
+                                       CMD_LINE_OPT_SER_SOCK_PATH,
+                                       sizeof(CMD_LINE_OPT_SER_SOCK_PATH))) {
+                               snprintf(server_socket_path,
+                                       sizeof(server_socket_path), "%s",
+                                       optarg);
+                       }
+
+                       if (!strncmp(long_option[option_index].name,
+                                       CMD_LINE_OPT_CLI_SOCK_PATH,
+                                       sizeof(CMD_LINE_OPT_CLI_SOCK_PATH))) {
+                               snprintf(client_socket_path,
+                                       sizeof(client_socket_path), "%s",
+                                       optarg);
+                       }
+
                        break;
                default:
                        pdump_usage(prgname);
@@ -719,6 +744,22 @@ enable_pdump(void)
        struct pdump_tuples *pt;
        int ret = 0, ret1 = 0;
 
+       if (server_socket_path[0] != 0)
+               ret = rte_pdump_set_socket_dir(server_socket_path,
+                               RTE_PDUMP_SOCKET_SERVER);
+       if (ret == 0 && client_socket_path[0] != 0) {
+               ret = rte_pdump_set_socket_dir(client_socket_path,
+                               RTE_PDUMP_SOCKET_CLIENT);
+       }
+       if (ret < 0) {
+               cleanup_pdump_resources();
+               rte_exit(EXIT_FAILURE,
+                               "failed to set socket paths of server:%s, "
+                               "client:%s\n",
+                               server_socket_path,
+                               client_socket_path);
+       }
+
        for (i = 0; i < num_tuples; i++) {
                pt = &pdump_t[i];
                if (pt->dir == RTE_PDUMP_FLAG_RXTX) {
@@ -729,7 +770,7 @@ enable_pdump(void)
                                                RTE_PDUMP_FLAG_RX,
                                                pt->rx_ring,
                                                pt->mp, NULL);
-                               ret = rte_pdump_enable_by_deviceid(
+                               ret1 = rte_pdump_enable_by_deviceid(
                                                pt->device_id,
                                                pt->queue,
                                                RTE_PDUMP_FLAG_TX,
index b7f28e9..1428974 100644 (file)
@@ -907,7 +907,6 @@ flush_fwd_rx_queues(void)
                                        timer_tsc += diff_tsc;
                                } while ((nb_rx > 0) &&
                                        (timer_tsc < timer_period));
-                               prev_tsc = cur_tsc;
                                timer_tsc = 0;
                        }
                }
index 2de8c7a..6015b19 100644 (file)
@@ -33,6 +33,9 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 ifeq ($(CONFIG_RTE_APP_TEST),y)
 
+# default rule
+all:
+
 # Define an externally linked resource. A linked resource is an arbitrary
 # file that is linked into the test binary. The application refers to this
 # resource by name. The linked generates identifiers beg_<name> and end_<name>
index 1e6b422..c69705e 100644 (file)
@@ -99,18 +99,6 @@ parallel_test_group_list = [
                 "Func" :       default_autotest,
                 "Report" :     None,
                },
-               {
-                "Name" :       "Dump rings",
-                "Command" :    "dump_ring",
-                "Func" :       dump_autotest,
-                "Report" :     None,
-               },
-               {
-                "Name" :       "Dump mempools",
-                "Command" :    "dump_mempool",
-                "Func" :       dump_autotest,
-                "Report" :     None,
-               },
        ]
 },
 {
index 291a821..bd99e19 100644 (file)
@@ -33,7 +33,7 @@
 
 # The main logic behind running autotests in parallel
 
-import multiprocessing, sys, pexpect, time, os, StringIO, csv
+import multiprocessing, subprocess, sys, pexpect, re, time, os, StringIO, csv
 
 # wait for prompt
 def wait_prompt(child):
@@ -105,6 +105,11 @@ def run_test_group(cmdline, test_group):
        results.append((0, "Success", "Start %s" % test_group["Prefix"],
                time.time() - start_time, startuplog.getvalue(), None))
 
+       # parse the binary for available test commands
+       binary = cmdline.split()[0]
+       symbols = subprocess.check_output(['nm', binary]).decode('utf-8')
+       avail_cmds = re.findall('test_register_(\w+)', symbols)
+
        # run all tests in test group
        for test in test_group["Tests"]:
 
@@ -124,7 +129,10 @@ def run_test_group(cmdline, test_group):
                        print >>logfile, "\n%s %s\n" % ("-"*20, test["Name"])
 
                        # run test function associated with the test
-                       result = test["Func"](child, test["Command"])
+                       if test["Command"] in avail_cmds:
+                               result = test["Func"](child, test["Command"])
+                       else:
+                               result = (0, "Skipped [Not Available]")
 
                        # make a note when the test was finished
                        end_time = time.time()
index 81828be..467b9c0 100644 (file)
@@ -250,11 +250,16 @@ struct test_command {
 
 void add_test_command(struct test_command *t);
 
-#define REGISTER_TEST_COMMAND(t) \
-static void __attribute__((used)) testfn_##t(void);\
-void __attribute__((constructor, used)) testfn_##t(void)\
-{\
-       add_test_command(&t);\
-}
+/* Register a test function with its command string */
+#define REGISTER_TEST_COMMAND(cmd, func) \
+       static struct test_command test_struct_##cmd = { \
+               .command = RTE_STR(cmd), \
+               .callback = func, \
+       }; \
+       static void __attribute__((constructor, used)) \
+       test_register_##cmd(void) \
+       { \
+               add_test_command(&test_struct_##cmd); \
+       }
 
 #endif
index 2b82790..28955f0 100644 (file)
@@ -1682,8 +1682,4 @@ test_acl(void)
        return 0;
 }
 
-static struct test_command acl_cmd = {
-       .command = "acl_autotest",
-       .callback = test_acl,
-};
-REGISTER_TEST_COMMAND(acl_cmd);
+REGISTER_TEST_COMMAND(acl_autotest, test_acl);
index d83591c..ecb2f6d 100644 (file)
@@ -253,8 +253,4 @@ test_alarm(void)
        return 0;
 }
 
-static struct test_command alarm_cmd = {
-       .command = "alarm_autotest",
-       .callback = test_alarm,
-};
-REGISTER_TEST_COMMAND(alarm_cmd);
+REGISTER_TEST_COMMAND(alarm_autotest, test_alarm);
index 588f530..b5e7e1b 100644 (file)
@@ -374,8 +374,4 @@ test_atomic(void)
        return 0;
 }
 
-static struct test_command atomic_cmd = {
-       .command = "atomic_autotest",
-       .callback = test_atomic,
-};
-REGISTER_TEST_COMMAND(atomic_cmd);
+REGISTER_TEST_COMMAND(atomic_autotest, test_atomic);
index a088489..8ae3114 100644 (file)
@@ -92,8 +92,4 @@ test_byteorder(void)
        return 0;
 }
 
-static struct test_command byteorder_cmd = {
-       .command = "byteorder_autotest",
-       .callback = test_byteorder,
-};
-REGISTER_TEST_COMMAND(byteorder_cmd);
+REGISTER_TEST_COMMAND(byteorder_autotest, test_byteorder);
index 2b5840f..38c7256 100644 (file)
@@ -89,8 +89,4 @@ test_cmdline(void)
        return 0;
 }
 
-static struct test_command cmdline_cmd = {
-       .command = "cmdline_autotest",
-       .callback = test_cmdline,
-};
-REGISTER_TEST_COMMAND(cmdline_cmd);
+REGISTER_TEST_COMMAND(cmdline_autotest, test_cmdline);
index 66e9109..8effa2f 100644 (file)
@@ -169,8 +169,4 @@ test_common(void)
        return ret;
 }
 
-static struct test_command common_cmd = {
-       .command = "common_autotest",
-       .callback = test_common,
-};
-REGISTER_TEST_COMMAND(common_cmd);
+REGISTER_TEST_COMMAND(common_autotest, test_common);
index d083c86..0e5ebe7 100644 (file)
@@ -199,8 +199,4 @@ test_cpuflags(void)
        return 0;
 }
 
-static struct test_command cpuflags_cmd = {
-       .command = "cpuflags_autotest",
-       .callback = test_cpuflags,
-};
-REGISTER_TEST_COMMAND(cpuflags_cmd);
+REGISTER_TEST_COMMAND(cpuflags_autotest, test_cpuflags);
index 33325a8..647787d 100644 (file)
@@ -4164,10 +4164,6 @@ test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
        gbl_cryptodev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
        return unit_test_suite_runner(&cryptodev_qat_testsuite);
 }
-static struct test_command cryptodev_qat_cmd = {
-       .command = "cryptodev_qat_autotest",
-       .callback = test_cryptodev_qat,
-};
 
 static int
 test_cryptodev_aesni_mb(void /*argv __rte_unused, int argc __rte_unused*/)
@@ -4177,11 +4173,6 @@ test_cryptodev_aesni_mb(void /*argv __rte_unused, int argc __rte_unused*/)
        return unit_test_suite_runner(&cryptodev_aesni_mb_testsuite);
 }
 
-static struct test_command cryptodev_aesni_mb_cmd = {
-       .command = "cryptodev_aesni_mb_autotest",
-       .callback = test_cryptodev_aesni_mb,
-};
-
 static int
 test_cryptodev_aesni_gcm(void)
 {
@@ -4190,11 +4181,6 @@ test_cryptodev_aesni_gcm(void)
        return unit_test_suite_runner(&cryptodev_aesni_gcm_testsuite);
 }
 
-static struct test_command cryptodev_aesni_gcm_cmd = {
-       .command = "cryptodev_aesni_gcm_autotest",
-       .callback = test_cryptodev_aesni_gcm,
-};
-
 static int
 test_cryptodev_null(void)
 {
@@ -4203,11 +4189,6 @@ test_cryptodev_null(void)
        return unit_test_suite_runner(&cryptodev_null_testsuite);
 }
 
-static struct test_command cryptodev_null_cmd = {
-       .command = "cryptodev_null_autotest",
-       .callback = test_cryptodev_null,
-};
-
 static int
 test_cryptodev_sw_snow3g(void /*argv __rte_unused, int argc __rte_unused*/)
 {
@@ -4216,11 +4197,6 @@ test_cryptodev_sw_snow3g(void /*argv __rte_unused, int argc __rte_unused*/)
        return unit_test_suite_runner(&cryptodev_sw_snow3g_testsuite);
 }
 
-static struct test_command cryptodev_sw_snow3g_cmd = {
-       .command = "cryptodev_sw_snow3g_autotest",
-       .callback = test_cryptodev_sw_snow3g,
-};
-
 static int
 test_cryptodev_sw_kasumi(void /*argv __rte_unused, int argc __rte_unused*/)
 {
@@ -4229,14 +4205,9 @@ test_cryptodev_sw_kasumi(void /*argv __rte_unused, int argc __rte_unused*/)
        return unit_test_suite_runner(&cryptodev_sw_kasumi_testsuite);
 }
 
-static struct test_command cryptodev_sw_kasumi_cmd = {
-       .command = "cryptodev_sw_kasumi_autotest",
-       .callback = test_cryptodev_sw_kasumi,
-};
-
-REGISTER_TEST_COMMAND(cryptodev_qat_cmd);
-REGISTER_TEST_COMMAND(cryptodev_aesni_mb_cmd);
-REGISTER_TEST_COMMAND(cryptodev_aesni_gcm_cmd);
-REGISTER_TEST_COMMAND(cryptodev_null_cmd);
-REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_cmd);
-REGISTER_TEST_COMMAND(cryptodev_sw_kasumi_cmd);
+REGISTER_TEST_COMMAND(cryptodev_qat_autotest, test_cryptodev_qat);
+REGISTER_TEST_COMMAND(cryptodev_aesni_mb_autotest, test_cryptodev_aesni_mb);
+REGISTER_TEST_COMMAND(cryptodev_aesni_gcm_autotest, test_cryptodev_aesni_gcm);
+REGISTER_TEST_COMMAND(cryptodev_null_autotest, test_cryptodev_null);
+REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_autotest, test_cryptodev_sw_snow3g);
+REGISTER_TEST_COMMAND(cryptodev_sw_kasumi_autotest, test_cryptodev_sw_kasumi);
index 815c41f..2398d84 100644 (file)
@@ -2919,27 +2919,7 @@ perftest_qat_snow3g_cryptodev(void /*argv __rte_unused, int argc __rte_unused*/)
        return unit_test_suite_runner(&cryptodev_snow3g_testsuite);
 }
 
-static struct test_command cryptodev_aesni_mb_perf_cmd = {
-       .command = "cryptodev_aesni_mb_perftest",
-       .callback = perftest_aesni_mb_cryptodev,
-};
-
-static struct test_command cryptodev_qat_perf_cmd = {
-       .command = "cryptodev_qat_perftest",
-       .callback = perftest_qat_cryptodev,
-};
-
-static struct test_command cryptodev_sw_snow3g_perf_cmd = {
-       .command = "cryptodev_sw_snow3g_perftest",
-       .callback = perftest_sw_snow3g_cryptodev,
-};
-
-static struct test_command cryptodev_qat_snow3g_perf_cmd = {
-       .command = "cryptodev_qat_snow3g_perftest",
-       .callback = perftest_qat_snow3g_cryptodev,
-};
-
-REGISTER_TEST_COMMAND(cryptodev_aesni_mb_perf_cmd);
-REGISTER_TEST_COMMAND(cryptodev_qat_perf_cmd);
-REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_perf_cmd);
-REGISTER_TEST_COMMAND(cryptodev_qat_snow3g_perf_cmd);
+REGISTER_TEST_COMMAND(cryptodev_aesni_mb_perftest, perftest_aesni_mb_cryptodev);
+REGISTER_TEST_COMMAND(cryptodev_qat_perftest, perftest_qat_cryptodev);
+REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_perftest, perftest_sw_snow3g_cryptodev);
+REGISTER_TEST_COMMAND(cryptodev_qat_snow3g_perftest, perftest_qat_snow3g_cryptodev);
index d8fa517..f6c043a 100644 (file)
@@ -89,8 +89,4 @@ test_cycles(void)
        return 0;
 }
 
-static struct test_command cycles_cmd = {
-       .command = "cycles_autotest",
-       .callback = test_cycles,
-};
-REGISTER_TEST_COMMAND(cycles_cmd);
+REGISTER_TEST_COMMAND(cycles_autotest, test_cycles);
index 7c3ee92..0a3b2c4 100644 (file)
@@ -146,8 +146,4 @@ test_debug(void)
        return 0;
 }
 
-static struct test_command debug_cmd = {
-       .command = "debug_autotest",
-       .callback = test_debug,
-};
-REGISTER_TEST_COMMAND(debug_cmd);
+REGISTER_TEST_COMMAND(debug_autotest, test_debug);
index e5a9aa0..151ac2a 100644 (file)
@@ -131,8 +131,4 @@ test_devargs(void)
        return -1;
 }
 
-static struct test_command devargs_cmd = {
-       .command = "devargs_autotest",
-       .callback = test_devargs,
-};
-REGISTER_TEST_COMMAND(devargs_cmd);
+REGISTER_TEST_COMMAND(devargs_autotest, test_devargs);
index 00b1d41..85cb8f3 100644 (file)
@@ -576,8 +576,4 @@ err:
        return -1;
 }
 
-static struct test_command distributor_cmd = {
-       .command = "distributor_autotest",
-       .callback = test_distributor,
-};
-REGISTER_TEST_COMMAND(distributor_cmd);
+REGISTER_TEST_COMMAND(distributor_autotest, test_distributor);
index 92b2220..7947fe9 100644 (file)
@@ -257,8 +257,4 @@ test_distributor_perf(void)
        return 0;
 }
 
-static struct test_command distributor_perf_cmd = {
-       .command = "distributor_perf_autotest",
-       .callback = test_distributor_perf,
-};
-REGISTER_TEST_COMMAND(distributor_perf_cmd);
+REGISTER_TEST_COMMAND(distributor_perf_autotest, test_distributor_perf);
index 93ae6e7..6202f05 100644 (file)
@@ -1441,8 +1441,4 @@ test_eal_flags(void)
        return ret;
 }
 
-static struct test_command eal_flags_cmd = {
-       .command = "eal_flags_autotest",
-       .callback = test_eal_flags,
-};
-REGISTER_TEST_COMMAND(eal_flags_cmd);
+REGISTER_TEST_COMMAND(eal_flags_autotest, test_eal_flags);
index 1cbcb9d..7897812 100644 (file)
@@ -203,8 +203,4 @@ test_eal_fs(void)
        return 0;
 }
 
-static struct test_command eal_fs_cmd = {
-       .command = "eal_fs_autotest",
-       .callback = test_eal_fs,
-};
-REGISTER_TEST_COMMAND(eal_fs_cmd);
+REGISTER_TEST_COMMAND(eal_fs_autotest, test_eal_fs);
index f221eac..388decb 100644 (file)
@@ -113,8 +113,4 @@ test_errno(void)
        return 0;
 }
 
-static struct test_command errno_cmd = {
-       .command = "errno_autotest",
-       .callback = test_errno,
-};
-REGISTER_TEST_COMMAND(errno_cmd);
+REGISTER_TEST_COMMAND(errno_autotest, test_errno);
index d6e9dd8..baa01ff 100644 (file)
@@ -507,8 +507,4 @@ test_func_reentrancy(void)
        return 0;
 }
 
-static struct test_command func_reentrancy_cmd = {
-       .command = "func_reentrancy_autotest",
-       .callback = test_func_reentrancy,
-};
-REGISTER_TEST_COMMAND(func_reentrancy_cmd);
+REGISTER_TEST_COMMAND(func_reentrancy_autotest, test_func_reentrancy);
index 29abcd9..94300e1 100644 (file)
@@ -1514,8 +1514,4 @@ test_hash(void)
        return 0;
 }
 
-static struct test_command hash_cmd = {
-       .command = "hash_autotest",
-       .callback = test_hash,
-};
-REGISTER_TEST_COMMAND(hash_cmd);
+REGISTER_TEST_COMMAND(hash_autotest, test_hash);
index f767a48..9652b04 100644 (file)
@@ -319,8 +319,4 @@ test_hash_functions(void)
        return 0;
 }
 
-static struct test_command hash_functions_cmd = {
-       .command = "hash_functions_autotest",
-       .callback = test_hash_functions,
-};
-REGISTER_TEST_COMMAND(hash_functions_cmd);
+REGISTER_TEST_COMMAND(hash_functions_autotest, test_hash_functions);
index b0f31b0..40af95d 100644 (file)
@@ -278,10 +278,4 @@ test_hash_multiwriter_main(void)
        return r;
 }
 
-
-static struct test_command hash_scaling_cmd = {
-       .command = "hash_multiwriter_autotest",
-       .callback = test_hash_multiwriter_main,
-};
-
-REGISTER_TEST_COMMAND(hash_scaling_cmd);
+REGISTER_TEST_COMMAND(hash_multiwriter_autotest, test_hash_multiwriter_main);
index 9d53c14..c0051b2 100644 (file)
@@ -656,8 +656,4 @@ test_hash_perf(void)
        return 0;
 }
 
-static struct test_command hash_perf_cmd = {
-               .command = "hash_perf_autotest",
-               .callback = test_hash_perf,
-};
-REGISTER_TEST_COMMAND(hash_perf_cmd);
+REGISTER_TEST_COMMAND(hash_perf_autotest, test_hash_perf);
index 1c4c75d..46c48e5 100644 (file)
@@ -217,9 +217,4 @@ test_hash_scaling_main(void)
        return r;
 }
 
-
-static struct test_command hash_scaling_cmd = {
-       .command = "hash_scaling_autotest",
-       .callback = test_hash_scaling_main,
-};
-REGISTER_TEST_COMMAND(hash_scaling_cmd);
+REGISTER_TEST_COMMAND(hash_scaling_autotest, test_hash_scaling_main);
index df6d261..371101f 100644 (file)
@@ -548,8 +548,4 @@ out:
        return ret;
 }
 
-static struct test_command interrupt_cmd = {
-       .command = "interrupt_autotest",
-       .callback = test_interrupt,
-};
-REGISTER_TEST_COMMAND(interrupt_cmd);
+REGISTER_TEST_COMMAND(interrupt_autotest, test_interrupt);
index 4e61488..ae9fd6c 100644 (file)
@@ -430,8 +430,4 @@ test_ivshmem(void)
        return -1;
 }
 
-static struct test_command ivshmem_cmd = {
-       .command = "ivshmem_autotest",
-       .callback = test_ivshmem,
-};
-REGISTER_TEST_COMMAND(ivshmem_cmd);
+REGISTER_TEST_COMMAND(ivshmem_autotest, test_ivshmem);
index 7243ade..309741c 100644 (file)
@@ -633,8 +633,4 @@ fail:
        return ret;
 }
 
-static struct test_command kni_cmd = {
-       .command = "kni_autotest",
-       .callback = test_kni,
-};
-REGISTER_TEST_COMMAND(kni_cmd);
+REGISTER_TEST_COMMAND(kni_autotest, test_kni);
index 6be8512..4d9e805 100644 (file)
@@ -232,8 +232,4 @@ test_kvargs(void)
        return 0;
 }
 
-static struct test_command kvargs_cmd = {
-       .command = "kvargs_autotest",
-       .callback = test_kvargs,
-};
-REGISTER_TEST_COMMAND(kvargs_cmd);
+REGISTER_TEST_COMMAND(kvargs_autotest, test_kvargs);
index eeb1395..3229660 100644 (file)
@@ -5002,8 +5002,4 @@ test_link_bonding(void)
        return unit_test_suite_runner(&link_bonding_test_suite);
 }
 
-static struct test_command link_bonding_cmd = {
-       .command = "link_bonding_autotest",
-       .callback = test_link_bonding,
-};
-REGISTER_TEST_COMMAND(link_bonding_cmd);
+REGISTER_TEST_COMMAND(link_bonding_autotest, test_link_bonding);
index a3f1f08..53caa3e 100644 (file)
@@ -1599,9 +1599,4 @@ test_link_bonding_mode4(void)
        return unit_test_suite_runner(&link_bonding_mode4_test_suite);
 }
 
-static struct test_command link_bonding_cmd = {
-       .command = "link_bonding_mode4_autotest",
-       .callback = test_link_bonding_mode4,
-};
-
-REGISTER_TEST_COMMAND(link_bonding_cmd);
+REGISTER_TEST_COMMAND(link_bonding_mode4_autotest, test_link_bonding_mode4);
index 0a3162e..34f1c16 100644 (file)
@@ -670,9 +670,4 @@ test_link_bonding_rssconf(void)
        return unit_test_suite_runner(&link_bonding_rssconf_test_suite);
 }
 
-static struct test_command test_link_bonding_rssconf_cmd = {
-       .command = "link_bonding_rssconf_autotest",
-       .callback = test_link_bonding_rssconf,
-};
-
-REGISTER_TEST_COMMAND(test_link_bonding_rssconf_cmd);
+REGISTER_TEST_COMMAND(link_bonding_rssconf_autotest, test_link_bonding_rssconf);
index d0a9962..6985ddd 100644 (file)
@@ -86,8 +86,4 @@ test_logs(void)
        return 0;
 }
 
-static struct test_command logs_cmd = {
-       .command = "logs_autotest",
-       .callback = test_logs,
-};
-REGISTER_TEST_COMMAND(logs_cmd);
+REGISTER_TEST_COMMAND(logs_autotest, test_logs);
index f6930fb..b6ad2eb 100644 (file)
@@ -1238,8 +1238,4 @@ test_lpm(void)
        return global_status;
 }
 
-static struct test_command lpm_cmd = {
-       .command = "lpm_autotest",
-       .callback = test_lpm,
-};
-REGISTER_TEST_COMMAND(lpm_cmd);
+REGISTER_TEST_COMMAND(lpm_autotest, test_lpm);
index 458a10b..0fd0ef7 100644 (file)
@@ -1764,8 +1764,4 @@ test_lpm6(void)
        return global_status;
 }
 
-static struct test_command lpm6_cmd = {
-       .command = "lpm6_autotest",
-       .callback = test_lpm6,
-};
-REGISTER_TEST_COMMAND(lpm6_cmd);
+REGISTER_TEST_COMMAND(lpm6_autotest, test_lpm6);
index b7d4631..be47d4a 100644 (file)
@@ -184,8 +184,4 @@ test_lpm6_perf(void)
        return 0;
 }
 
-static struct test_command lpm6_perf_cmd = {
-       .command = "lpm6_perf_autotest",
-       .callback = test_lpm6_perf,
-};
-REGISTER_TEST_COMMAND(lpm6_perf_cmd);
+REGISTER_TEST_COMMAND(lpm6_perf_autotest, test_lpm6_perf);
index 41da811..58eb415 100644 (file)
@@ -242,8 +242,4 @@ test_lpm_perf(void)
        return 0;
 }
 
-static struct test_command lpm_perf_cmd = {
-       .command = "lpm_perf_autotest",
-       .callback = test_lpm_perf,
-};
-REGISTER_TEST_COMMAND(lpm_perf_cmd);
+REGISTER_TEST_COMMAND(lpm_perf_autotest, test_lpm_perf);
index a04a751..0673d85 100644 (file)
@@ -959,8 +959,4 @@ test_malloc(void)
        return 0;
 }
 
-static struct test_command malloc_cmd = {
-       .command = "malloc_autotest",
-       .callback = test_malloc,
-};
-REGISTER_TEST_COMMAND(malloc_cmd);
+REGISTER_TEST_COMMAND(malloc_autotest, test_malloc);
index 8664885..684ad80 100644 (file)
@@ -1026,8 +1026,4 @@ test_mbuf(void)
        return 0;
 }
 
-static struct test_command mbuf_cmd = {
-       .command = "mbuf_autotest",
-       .callback = test_mbuf,
-};
-REGISTER_TEST_COMMAND(mbuf_cmd);
+REGISTER_TEST_COMMAND(mbuf_autotest, test_mbuf);
index 8195e20..1d93dd5 100644 (file)
@@ -159,8 +159,4 @@ test_memcpy(void)
        return 0;
 }
 
-static struct test_command memcpy_cmd = {
-       .command = "memcpy_autotest",
-       .callback = test_memcpy,
-};
-REGISTER_TEST_COMMAND(memcpy_cmd);
+REGISTER_TEST_COMMAND(memcpy_autotest, test_memcpy);
index be69ead..ff3aaaa 100644 (file)
@@ -351,8 +351,4 @@ test_memcpy_perf(void)
        return 0;
 }
 
-static struct test_command memcpy_perf_cmd = {
-       .command = "memcpy_perf_autotest",
-       .callback = test_memcpy_perf,
-};
-REGISTER_TEST_COMMAND(memcpy_perf_cmd);
+REGISTER_TEST_COMMAND(memcpy_perf_autotest, test_memcpy_perf);
index 6816385..921bdc8 100644 (file)
@@ -86,8 +86,4 @@ test_memory(void)
        return 0;
 }
 
-static struct test_command memory_cmd = {
-       .command = "memory_autotest",
-       .callback = test_memory,
-};
-REGISTER_TEST_COMMAND(memory_cmd);
+REGISTER_TEST_COMMAND(memory_autotest, test_memory);
index 9ea9831..46ad670 100644 (file)
@@ -609,8 +609,4 @@ err:
        return -1;
 }
 
-static struct test_command mempool_cmd = {
-       .command = "mempool_autotest",
-       .callback = test_mempool,
-};
-REGISTER_TEST_COMMAND(mempool_cmd);
+REGISTER_TEST_COMMAND(mempool_autotest, test_mempool);
index 4fac04c..c0b3f5c 100644 (file)
@@ -381,8 +381,4 @@ test_mempool_perf(void)
        return 0;
 }
 
-static struct test_command mempool_perf_cmd = {
-       .command = "mempool_perf_autotest",
-       .callback = test_mempool_perf,
-};
-REGISTER_TEST_COMMAND(mempool_perf_cmd);
+REGISTER_TEST_COMMAND(mempool_perf_autotest, test_mempool_perf);
index cadd86f..7ae31cf 100644 (file)
@@ -872,8 +872,4 @@ test_memzone(void)
        return 0;
 }
 
-static struct test_command memzone_cmd = {
-       .command = "memzone_autotest",
-       .callback = test_memzone,
-};
-REGISTER_TEST_COMMAND(memzone_cmd);
+REGISTER_TEST_COMMAND(memzone_autotest, test_memzone);
index bc76391..26b0565 100644 (file)
@@ -494,8 +494,4 @@ test_meter(void)
 
 }
 
-static struct test_command meter_cmd = {
-       .command = "meter_autotest",
-       .callback = test_meter,
-};
-REGISTER_TEST_COMMAND(meter_cmd);
+REGISTER_TEST_COMMAND(meter_autotest, test_meter);
index f66b68f..26c4afd 100644 (file)
@@ -282,8 +282,4 @@ test_mp_secondary(void)
        return run_object_creation_tests();
 }
 
-static struct test_command multiprocess_cmd = {
-       .command = "multiprocess_autotest",
-       .callback = test_mp_secondary,
-};
-REGISTER_TEST_COMMAND(multiprocess_cmd);
+REGISTER_TEST_COMMAND(multiprocess_autotest, test_mp_secondary);
index 354a0ad..69f78d9 100644 (file)
@@ -315,8 +315,4 @@ test_pci(void)
        return 0;
 }
 
-static struct test_command pci_cmd = {
-       .command = "pci_autotest",
-       .callback = test_pci,
-};
-REGISTER_TEST_COMMAND(pci_cmd);
+REGISTER_TEST_COMMAND(pci_autotest, test_pci);
index f452cdb..747513d 100644 (file)
@@ -136,8 +136,4 @@ test_per_lcore(void)
        return 0;
 }
 
-static struct test_command per_lcore_cmd = {
-       .command = "per_lcore_autotest",
-       .callback = test_per_lcore,
-};
-REGISTER_TEST_COMMAND(per_lcore_cmd);
+REGISTER_TEST_COMMAND(per_lcore_autotest, test_per_lcore);
index 3d56cd2..e055aa0 100644 (file)
@@ -910,8 +910,4 @@ test_set_rxtx_sc(cmdline_fixed_string_t type)
        return -1;
 }
 
-static struct test_command pmd_perf_cmd = {
-       .command = "pmd_perf_autotest",
-       .callback = test_pmd_perf,
-};
-REGISTER_TEST_COMMAND(pmd_perf_cmd);
+REGISTER_TEST_COMMAND(pmd_perf_autotest, test_pmd_perf);
index 34fea09..47374db 100644 (file)
@@ -526,8 +526,4 @@ test_pmd_ring(void)
        return 0;
 }
 
-static struct test_command ring_pmd_cmd = {
-       .command = "ring_pmd_autotest",
-       .callback = test_pmd_ring,
-};
-REGISTER_TEST_COMMAND(ring_pmd_cmd);
+REGISTER_TEST_COMMAND(ring_pmd_autotest, test_pmd_ring);
index 3077dba..af011f7 100644 (file)
@@ -181,8 +181,4 @@ test_ring_pmd_perf(void)
        return 0;
 }
 
-static struct test_command ring_pmd_perf_cmd = {
-       .command = "ring_pmd_perf_autotest",
-       .callback = test_ring_pmd_perf,
-};
-REGISTER_TEST_COMMAND(ring_pmd_perf_cmd);
+REGISTER_TEST_COMMAND(ring_pmd_perf_autotest, test_ring_pmd_perf);
index 64a2305..b2e1344 100644 (file)
@@ -104,8 +104,4 @@ fail_all:
        return -1;
 }
 
-static struct test_command power_cmd = {
-       .command = "power_autotest",
-       .callback = test_power,
-};
-REGISTER_TEST_COMMAND(power_cmd);
+REGISTER_TEST_COMMAND(power_autotest, test_power);
index 0fb1569..64f5dd5 100644 (file)
@@ -537,8 +537,4 @@ fail_all:
        return -1;
 }
 
-static struct test_command power_acpi_cpufreq_cmd = {
-       .command = "power_acpi_cpufreq_autotest",
-       .callback = test_power_acpi_cpufreq,
-};
-REGISTER_TEST_COMMAND(power_acpi_cpufreq_cmd);
+REGISTER_TEST_COMMAND(power_acpi_cpufreq_autotest, test_power_acpi_cpufreq);
index ff468c1..253a5f8 100644 (file)
@@ -300,8 +300,4 @@ fail_all:
        return -1;
 }
 
-static struct test_command power_kvm_vm_cmd = {
-       .command = "power_kvm_vm_autotest",
-       .callback = test_power_kvm_vm,
-};
-REGISTER_TEST_COMMAND(power_kvm_vm_cmd);
+REGISTER_TEST_COMMAND(power_kvm_vm_autotest, test_power_kvm_vm);
index f8615e2..80afaaf 100644 (file)
@@ -58,8 +58,4 @@ test_prefetch(void)
        return 0;
 }
 
-static struct test_command prefetch_cmd = {
-       .command = "prefetch_autotest",
-       .callback = test_prefetch,
-};
-REGISTER_TEST_COMMAND(prefetch_cmd);
+REGISTER_TEST_COMMAND(prefetch_autotest, test_prefetch);
index 7d1c32c..348075d 100644 (file)
@@ -1880,20 +1880,6 @@ test_red_all(void)
        return tell_the_result(num_tests, num_pass);
 }
 
-static struct test_command red_cmd = {
-       .command = "red_autotest",
-       .callback = test_red,
-};
-REGISTER_TEST_COMMAND(red_cmd);
-
-static struct test_command red_cmd_perf = {
-       .command = "red_perf",
-       .callback = test_red_perf,
-};
-REGISTER_TEST_COMMAND(red_cmd_perf);
-
-static struct test_command red_cmd_all = {
-       .command = "red_all",
-       .callback = test_red_all,
-};
-REGISTER_TEST_COMMAND(red_cmd_all);
+REGISTER_TEST_COMMAND(red_autotest, test_red);
+REGISTER_TEST_COMMAND(red_perf, test_red_perf);
+REGISTER_TEST_COMMAND(red_all, test_red_all);
index 67f3151..e8a0a2f 100644 (file)
@@ -383,8 +383,4 @@ test_reorder(void)
        return unit_test_suite_runner(&reorder_test_suite);
 }
 
-static struct test_command reorder_cmd = {
-       .command = "reorder_autotest",
-       .callback = test_reorder,
-};
-REGISTER_TEST_COMMAND(reorder_cmd);
+REGISTER_TEST_COMMAND(reorder_autotest, test_reorder);
index 39a6468..a3a82f1 100644 (file)
@@ -130,8 +130,4 @@ static int test_resource(void)
        return 0;
 }
 
-static struct test_command resource_cmd = {
-       .command = "resource_autotest",
-       .callback = test_resource,
-};
-REGISTER_TEST_COMMAND(resource_cmd);
+REGISTER_TEST_COMMAND(resource_autotest, test_resource);
index 9095e59..ebcb896 100644 (file)
@@ -1378,8 +1378,4 @@ test_ring(void)
        return 0;
 }
 
-static struct test_command ring_cmd = {
-       .command = "ring_autotest",
-       .callback = test_ring,
-};
-REGISTER_TEST_COMMAND(ring_cmd);
+REGISTER_TEST_COMMAND(ring_autotest, test_ring);
index 8c47ccb..320c20c 100644 (file)
@@ -414,8 +414,4 @@ test_ring_perf(void)
        return 0;
 }
 
-static struct test_command ring_perf_cmd = {
-       .command = "ring_perf_autotest",
-       .callback = test_ring_perf,
-};
-REGISTER_TEST_COMMAND(ring_perf_cmd);
+REGISTER_TEST_COMMAND(ring_perf_autotest, test_ring_perf);
index b383bba..50f58ad 100644 (file)
@@ -129,8 +129,4 @@ test_rwlock(void)
        return 0;
 }
 
-static struct test_command rwlock_cmd = {
-       .command = "rwlock_autotest",
-       .callback = test_rwlock,
-};
-REGISTER_TEST_COMMAND(rwlock_cmd);
+REGISTER_TEST_COMMAND(rwlock_autotest, test_rwlock);
index 9712f9f..63ab084 100644 (file)
@@ -213,8 +213,4 @@ test_sched(void)
        return 0;
 }
 
-static struct test_command sched_cmd = {
-       .command = "sched_autotest",
-       .callback = test_sched,
-};
-REGISTER_TEST_COMMAND(sched_cmd);
+REGISTER_TEST_COMMAND(sched_autotest, test_sched);
index 180d6de..2d94eec 100644 (file)
@@ -333,8 +333,4 @@ test_spinlock(void)
        return ret;
 }
 
-static struct test_command spinlock_cmd = {
-       .command = "spinlock_autotest",
-       .callback = test_spinlock,
-};
-REGISTER_TEST_COMMAND(spinlock_cmd);
+REGISTER_TEST_COMMAND(spinlock_autotest, test_spinlock);
index 39e6a9d..8b4359a 100644 (file)
@@ -166,8 +166,4 @@ test_string_fns(void)
        return 0;
 }
 
-static struct test_command string_cmd = {
-       .command = "string_autotest",
-       .callback = test_string_fns,
-};
-REGISTER_TEST_COMMAND(string_cmd);
+REGISTER_TEST_COMMAND(string_autotest, test_string_fns);
index 676dab2..1faa0a6 100644 (file)
@@ -199,8 +199,4 @@ test_table(void)
        return 0;
 }
 
-static struct test_command table_cmd = {
-       .command = "table_autotest",
-       .callback = test_table,
-};
-REGISTER_TEST_COMMAND(table_cmd);
+REGISTER_TEST_COMMAND(table_autotest, test_table);
index c046a8a..33a3e8a 100644 (file)
@@ -154,8 +154,4 @@ test_tailq(void)
        return ret;
 }
 
-static struct test_command tailq_cmd = {
-       .command = "tailq_autotest",
-       .callback = test_tailq,
-};
-REGISTER_TEST_COMMAND(tailq_cmd);
+REGISTER_TEST_COMMAND(tailq_autotest, test_tailq);
index 8e9dca0..61754a9 100644 (file)
@@ -169,8 +169,4 @@ test_thash(void)
        return 0;
 }
 
-static struct test_command thash_cmd = {
-       .command = "thash_autotest",
-       .callback = test_thash,
-};
-REGISTER_TEST_COMMAND(thash_cmd);
+REGISTER_TEST_COMMAND(thash_autotest, test_thash);
index bc07925..2f6525a 100644 (file)
@@ -626,8 +626,4 @@ test_timer(void)
        return TEST_SUCCESS;
 }
 
-static struct test_command timer_cmd = {
-       .command = "timer_autotest",
-       .callback = test_timer,
-};
-REGISTER_TEST_COMMAND(timer_cmd);
+REGISTER_TEST_COMMAND(timer_autotest, test_timer);
index 3f7ddd3..fa77efb 100644 (file)
@@ -158,8 +158,4 @@ test_timer_perf(void)
        return 0;
 }
 
-static struct test_command timer_perf_cmd = {
-       .command = "timer_perf_autotest",
-       .callback = test_timer_perf,
-};
-REGISTER_TEST_COMMAND(timer_perf_cmd);
+REGISTER_TEST_COMMAND(timer_perf_autotest, test_timer_perf);
index aef3203..7824ec4 100644 (file)
@@ -202,8 +202,4 @@ test_timer_racecond(void)
        return TEST_SUCCESS;
 }
 
-static struct test_command timer_racecond_cmd = {
-       .command = "timer_racecond_autotest",
-       .callback = test_timer_racecond,
-};
-REGISTER_TEST_COMMAND(timer_racecond_cmd);
+REGISTER_TEST_COMMAND(timer_racecond_autotest, test_timer_racecond);
index f66827d..afc0d0b 100644 (file)
@@ -54,8 +54,4 @@ test_version(void)
        return 0;
 }
 
-static struct test_command version_cmd = {
-       .command = "version_autotest",
-       .callback = test_version,
-};
-REGISTER_TEST_COMMAND(version_cmd);
+REGISTER_TEST_COMMAND(version_autotest, test_version);
index 06af91d..16a21a5 100644 (file)
@@ -22,7 +22,7 @@ The DPDK development process has the following features:
 * Patches are reviewed publicly on the mailing list.
 * Successfully reviewed patches are merged to the master branch of the repository.
 
-The mailing list for DPDK development is `dev@dpkg.org <http://dpdk.org/ml/archives/dev/>`_.
+The mailing list for DPDK development is `dev@dpdk.org <http://dpdk.org/ml/archives/dev/>`_.
 Contributors will need to `register for the mailing list <http://dpdk.org/ml/listinfo/dev>`_ in order to submit patches.
 It is also worth registering for the DPDK `Patchwork <http://dpdk.org/dev/patchwxispork/project/dpdk/list/>`_
 
index 4b9895e..10a10a8 100644 (file)
@@ -341,7 +341,7 @@ Known Issues
       be preempted by another pthread doing a multi-consumer dequeue on
       the same ring.
 
-    Bypassing this constraint it may cause the 2nd pthread to spin until the 1st one is scheduled again.
+    Bypassing this constraint may cause the 2nd pthread to spin until the 1st one is scheduled again.
     Moreover, if the 1st pthread is preempted by a context that has an higher priority, it may even cause a dead lock.
 
   This does not mean it cannot be used, simply, there is a need to narrow down the situation when it is used by multi-pthread on the same core.
index 580ffcb..0136781 100644 (file)
@@ -75,13 +75,13 @@ the packet capture.
 
 The packet capture framework, as part of its initialization, creates the pthread and the server socket in
 the pthread. The application that calls the framework initialization will have the server socket created,
-either under the path that the application has passed or under the default path i.e. either ``/var/run`` for
-root user or ``$HOME`` for non root user.
+either under the path that the application has passed or under the default path i.e. either ``/var/run/.dpdk`` for
+root user or ``~/.dpdk`` for non root user.
 
 Applications that request enabling or disabling of the packet capture will have the client socket created either under
-the path that the application has passed or under the default path i.e. either ``/var/run/`` for root user or ``$HOME``
-for not root user to send the requests to the server.
-The server socket will listen for client requests for enabling or disabling the packet capture.
+the path that the application has passed or under the default path i.e. either ``/var/run/.dpdk`` for root user or
+``~/.dpdk`` for not root user to send the requests to the server. The server socket will listen for client requests for
+enabling or disabling the packet capture.
 
 
 Implementation Details
@@ -111,7 +111,7 @@ server socket.
 
 The library API ``rte_pdump_set_socket_dir()``, sets the given path as either server socket path
 or client socket path based on the ``type`` argument of the API.
-If the given path is ``NULL``, default path will be selected, i.e. either ``/var/run/`` for root user or ``$HOME``
+If the given path is ``NULL``, default path will be selected, i.e. either ``/var/run/.dpdk`` for root user or ``~/.dpdk``
 for non root user. Clients also need to call this API to set their server socket path if the server socket
 path is different from default path.
 
index 3b92a8f..9f69753 100644 (file)
@@ -252,8 +252,8 @@ In this example, only the producer head and tail (prod_head and prod_tail) are m
 
 The initial state is to have a prod_head and prod_tail pointing at the same location.
 
-Multiple Consumer Enqueue First Step
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Multiple Producers Enqueue First Step
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 On both cores, *ring->prod_head* and ring->cons_tail are copied in local variables.
 The prod_next local variable points to the next element of the table,
@@ -266,11 +266,11 @@ If there is not enough room in the ring (this is detected by checking cons_tail)
 
 .. figure:: img/ring-mp-enqueue1.*
 
-   Multiple consumer enqueue first step
+   Multiple producer enqueue first step
 
 
-Multiple Consumer Enqueue Second Step
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Multiple Producers Enqueue Second Step
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The second step is to modify ring->prod_head in the ring structure to point to the same location as prod_next.
 This operation is done using a Compare And Swap (CAS) instruction, which does the following operations atomically:
@@ -288,11 +288,11 @@ In the figure, the operation succeeded on core 1, and step one restarted on core
 
 .. figure:: img/ring-mp-enqueue2.*
 
-   Multiple consumer enqueue second step
+   Multiple producer enqueue second step
 
 
-Multiple Consumer Enqueue Third Step
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Multiple Producers Enqueue Third Step
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The CAS operation is retried on core 2 with success.
 
@@ -303,11 +303,11 @@ The core 1 updates one element of the ring(obj4), and the core 2 updates another
 
 .. figure:: img/ring-mp-enqueue3.*
 
-   Multiple consumer enqueue third step
+   Multiple producer enqueue third step
 
 
-Multiple Consumer Enqueue Fourth Step
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Multiple Producers Enqueue Fourth Step
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Each core now wants to update ring->prod_tail.
 A core can only update it if ring->prod_tail is equal to the prod_head local variable.
@@ -318,11 +318,11 @@ This is only true on core 1. The operation is finished on core 1.
 
 .. figure:: img/ring-mp-enqueue4.*
 
-   Multiple consumer enqueue fourth step
+   Multiple producer enqueue fourth step
 
 
-Multiple Consumer Enqueue Last Step
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Multiple Producers Enqueue Last Step
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Once ring->prod_tail is updated by core 1, core 2 is allowed to update it too.
 The operation is also finished on core 2.
@@ -332,7 +332,7 @@ The operation is also finished on core 2.
 
 .. figure:: img/ring-mp-enqueue5.*
 
-   Multiple consumer enqueue last step
+   Multiple producer enqueue last step
 
 
 Modulo 32-bit Indexes
index e2af147..d3a144f 100644 (file)
@@ -333,6 +333,7 @@ The libraries prepended with a plus sign were incremented in this version.
      librte_mbuf.so.2
    + librte_mempool.so.2
      librte_meter.so.1
+     librte_pdump.so.1
      librte_pipeline.so.3
      librte_pmd_bond.so.1
      librte_pmd_ring.so.2
index 96c8709..ceb038e 100644 (file)
 dpdk_pdump Application
 ======================
 
-The ``dpdk_pdump`` application is a Data Plane Development Kit (DPDK) application that runs as a DPDK secondary process and
-is capable of enabling packet capture on dpdk ports.
+The ``dpdk_pdump`` tool is a Data Plane Development Kit (DPDK) tool that runs as
+a DPDK secondary process and is capable of enabling packet capture on dpdk ports.
+
+   .. Note::
+
+      * The ``dpdk_pdump`` tool depends on libpcap based PMD which is disabled
+        by default in the build configuration files,
+        owing to an external dependency on the libpcap development files
+        which must be installed on the board.
+        Once the libpcap development files are installed, the libpcap based PMD
+        can be enabled by setting CONFIG_RTE_LIBRTE_PMD_PCAP=y and recompiling the DPDK.
 
 
 Running the Application
 -----------------------
 
-The application has a ``--pdump`` command line option with various sub arguments:
+The tool has a number of command line options:
 
 .. code-block:: console
 
@@ -52,18 +61,31 @@ The application has a ``--pdump`` command line option with various sub arguments
                                    [ring-size=<ring size>],
                                    [mbuf-size=<mbuf data size>],
                                    [total-num-mbufs=<number of mbufs>]'
+                          [--server-socket-path=<server socket dir>]
+                          [--client-socket-path=<client socket dir>]
+
+The ``--pdump`` command line option is mandatory and it takes various sub arguments which are described in
+below section.
+
+   .. Note::
+
+      * Parameters inside the parentheses represents mandatory parameters.
 
-Note:
+      * Parameters inside the square brackets represents optional parameters.
 
-* Parameters inside the parentheses represents mandatory parameters.
+      * Multiple instances of ``--pdump`` can be passed to capture packets on different port and queue combinations.
 
-* Parameters inside the square brackets represents optional parameters.
+The ``--server-socket-path`` command line option is optional. This represents the server socket directory.
+If no value is passed default values are used i.e. ``/var/run/.dpdk/`` for root users and ``~/.dpdk/``
+for non root users.
 
-Multiple instances of ``--pdump`` can be passed to capture packets on different port and queue combinations.
+The ``--client-socket-path`` command line option is optional. This represents the client socket directory.
+If no value is passed default values are used i.e. ``/var/run/.dpdk/`` for root users and ``~/.dpdk/``
+for non root users.
 
 
-Parameters
-~~~~~~~~~~
+The ``--pdump`` parameters
+~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 ``port``:
 Port id of the eth device on which packets should be captured.
index a5e2e38..4c16ef1 100644 (file)
@@ -51,7 +51,6 @@
 
 #define DRV_NAME               "enic_pmd"
 #define DRV_DESCRIPTION                "Cisco VIC Ethernet NIC Poll-mode Driver"
-#define DRV_VERSION            "1.0.0.6"
 #define DRV_COPYRIGHT          "Copyright 2008-2015 Cisco Systems, Inc"
 
 #define ENIC_WQ_MAX            8
index 3365176..e6f57be 100644 (file)
@@ -218,6 +218,7 @@ int enic_fdir_add_fltr(struct enic *enic, struct rte_eth_fdir_filter *params)
 
        pos = rte_hash_add_key(enic->fdir.hash, params);
        if (pos < 0) {
+               enic->fdir.stats.f_add++;
                dev_err(enic, "Add hash key failed\n");
                return pos;
        }
index 3c87b49..59082d2 100644 (file)
@@ -142,9 +142,21 @@ static int enicpmd_dev_setup_intr(struct enic *enic)
                if (!enic->cq[index].ctrl)
                        break;
        }
-
        if (enic->cq_count != index)
                return 0;
+       for (index = 0; index < enic->wq_count; index++) {
+               if (!enic->wq[index].ctrl)
+                       break;
+       }
+       if (enic->wq_count != index)
+               return 0;
+       /* check start of packet (SOP) RQs only in case scatter is disabled. */
+       for (index = 0; index < enic->rq_count; index++) {
+               if (!enic->rq[enic_sop_rq(index)].ctrl)
+                       break;
+       }
+       if (enic->rq_count != index)
+               return 0;
 
        ret = enic_alloc_intr_resources(enic);
        if (ret) {
@@ -196,7 +208,6 @@ static int enicpmd_dev_tx_queue_start(struct rte_eth_dev *eth_dev,
        ENICPMD_FUNC_TRACE();
 
        enic_start_wq(enic, queue_idx);
-       eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
 
        return 0;
 }
@@ -212,8 +223,6 @@ static int enicpmd_dev_tx_queue_stop(struct rte_eth_dev *eth_dev,
        ret = enic_stop_wq(enic, queue_idx);
        if (ret)
                dev_err(enic, "error in stopping wq %d\n", queue_idx);
-       else
-               eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
 
        return ret;
 }
@@ -226,7 +235,6 @@ static int enicpmd_dev_rx_queue_start(struct rte_eth_dev *eth_dev,
        ENICPMD_FUNC_TRACE();
 
        enic_start_rq(enic, queue_idx);
-       eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
 
        return 0;
 }
@@ -242,8 +250,6 @@ static int enicpmd_dev_rx_queue_stop(struct rte_eth_dev *eth_dev,
        ret = enic_stop_rq(enic, queue_idx);
        if (ret)
                dev_err(enic, "error in stopping rq %d\n", queue_idx);
-       else
-               eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
 
        return ret;
 }
index d8669cc..542f095 100644 (file)
@@ -106,7 +106,7 @@ static void enic_free_wq_buf(struct vnic_wq_buf *buf)
 {
        struct rte_mbuf *mbuf = (struct rte_mbuf *)buf->mb;
 
-       rte_mempool_put(mbuf->pool, mbuf);
+       rte_pktmbuf_free_seg(mbuf);
        buf->mb = NULL;
 }
 
@@ -123,6 +123,8 @@ static void enic_log_q_error(struct enic *enic)
        }
 
        for (i = 0; i < enic_vnic_rq_count(enic); i++) {
+               if (!enic->rq[i].in_use)
+                       continue;
                error_status = vnic_rq_error_status(&enic->rq[i]);
                if (error_status)
                        dev_err(enic, "RQ[%d] error_status %d\n", i,
@@ -172,7 +174,8 @@ void enic_dev_stats_get(struct enic *enic, struct rte_eth_stats *r_stats)
         * which can make ibytes be slightly higher than it should be.
         */
        rx_packet_errors = rte_atomic64_read(&soft_stats->rx_packet_errors);
-       rx_truncated = rx_packet_errors - stats->rx.rx_errors;
+       rx_truncated = rx_packet_errors - stats->rx.rx_errors -
+               stats->rx.rx_no_bufs;
 
        r_stats->ipackets = stats->rx.rx_frames_ok - rx_truncated;
        r_stats->opackets = stats->tx.tx_frames_ok;
@@ -518,30 +521,41 @@ void enic_free_rq(void *rxq)
 
 void enic_start_wq(struct enic *enic, uint16_t queue_idx)
 {
+       struct rte_eth_dev *eth_dev = enic->rte_dev;
        vnic_wq_enable(&enic->wq[queue_idx]);
+       eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
 }
 
 int enic_stop_wq(struct enic *enic, uint16_t queue_idx)
 {
-       return vnic_wq_disable(&enic->wq[queue_idx]);
+       struct rte_eth_dev *eth_dev = enic->rte_dev;
+       int ret;
+
+       ret = vnic_wq_disable(&enic->wq[queue_idx]);
+       if (ret)
+               return ret;
+
+       eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
+       return 0;
 }
 
 void enic_start_rq(struct enic *enic, uint16_t queue_idx)
 {
        struct vnic_rq *rq_sop = &enic->rq[enic_sop_rq(queue_idx)];
        struct vnic_rq *rq_data = &enic->rq[rq_sop->data_queue_idx];
+       struct rte_eth_dev *eth_dev = enic->rte_dev;
 
        if (rq_data->in_use)
                vnic_rq_enable(rq_data);
        rte_mb();
        vnic_rq_enable(rq_sop);
-
+       eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
 }
 
 int enic_stop_rq(struct enic *enic, uint16_t queue_idx)
 {
        int ret1 = 0, ret2 = 0;
-
+       struct rte_eth_dev *eth_dev = enic->rte_dev;
        struct vnic_rq *rq_sop = &enic->rq[enic_sop_rq(queue_idx)];
        struct vnic_rq *rq_data = &enic->rq[rq_sop->data_queue_idx];
 
@@ -552,8 +566,11 @@ int enic_stop_rq(struct enic *enic, uint16_t queue_idx)
 
        if (ret2)
                return ret2;
-       else
+       else if (ret1)
                return ret1;
+
+       eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
+       return 0;
 }
 
 int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
@@ -1128,7 +1145,7 @@ int enic_probe(struct enic *enic)
        struct rte_pci_device *pdev = enic->pdev;
        int err = -1;
 
-       dev_debug(enic, " Initializing ENIC PMD version %s\n", DRV_VERSION);
+       dev_debug(enic, " Initializing ENIC PMD\n");
 
        enic->bar0.vaddr = (void *)pdev->mem_resource[0].addr;
        enic->bar0.len = pdev->mem_resource[0].len;
index 2f4a08c..845a8e6 100644 (file)
@@ -398,7 +398,14 @@ static inline void enic_free_wq_bufs(struct vnic_wq *wq, u16 completed_index)
        pool = ((struct rte_mbuf *)buf->mb)->pool;
        for (i = 0; i < nb_to_free; i++) {
                buf = &wq->bufs[tail_idx];
-               m = (struct rte_mbuf *)(buf->mb);
+               m = __rte_pktmbuf_prefree_seg((struct rte_mbuf *)(buf->mb));
+               buf->mb = NULL;
+
+               if (unlikely(m == NULL)) {
+                       tail_idx = enic_ring_incr(desc_count, tail_idx);
+                       continue;
+               }
+
                if (likely(m->pool == pool)) {
                        RTE_ASSERT(nb_free < ENIC_MAX_WQ_DESCS);
                        free[nb_free++] = m;
@@ -409,7 +416,6 @@ static inline void enic_free_wq_bufs(struct vnic_wq *wq, u16 completed_index)
                        pool = m->pool;
                }
                tail_idx = enic_ring_incr(desc_count, tail_idx);
-               buf->mb = NULL;
        }
 
        rte_mempool_put_bulk(pool, (void **)free, nb_free);
index 217853f..144b2de 100644 (file)
@@ -2738,10 +2738,8 @@ fm10k_set_tx_function(struct rte_eth_dev *dev)
                txq = dev->data->tx_queues[i];
                txq->tx_ftag_en = tx_ftag_en;
                /* Check if Vector Tx is satisfied */
-               if (fm10k_tx_vec_condition_check(txq)) {
+               if (fm10k_tx_vec_condition_check(txq))
                        use_sse = 0;
-                       break;
-               }
        }
 
        if (use_sse) {
index daac236..3f9f05e 100644 (file)
@@ -2718,16 +2718,12 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 {
        struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
        struct i40e_vsi *vsi = pf->main_vsi;
-       struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
        if (mask & ETH_VLAN_FILTER_MASK) {
-               if (dev->data->dev_conf.rxmode.hw_vlan_filter) {
-                       i40e_aq_set_vsi_vlan_promisc(hw, vsi->seid, false, NULL);
+               if (dev->data->dev_conf.rxmode.hw_vlan_filter)
                        i40e_vsi_config_vlan_filter(vsi, TRUE);
-               } else {
-                       i40e_aq_set_vsi_vlan_promisc(hw, vsi->seid, true, NULL);
+               else
                        i40e_vsi_config_vlan_filter(vsi, FALSE);
-               }
        }
 
        if (mask & ETH_VLAN_STRIP_MASK) {
@@ -5777,28 +5773,17 @@ i40e_set_vlan_filter(struct i40e_vsi *vsi,
                         uint16_t vlan_id, bool on)
 {
        uint32_t vid_idx, vid_bit;
-       struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
-       struct i40e_aqc_add_remove_vlan_element_data vlan_data = {0};
-       int ret;
 
        if (vlan_id > ETH_VLAN_ID_MAX)
                return;
 
        vid_idx = I40E_VFTA_IDX(vlan_id);
        vid_bit = I40E_VFTA_BIT(vlan_id);
-       vlan_data.vlan_tag = rte_cpu_to_le_16(vlan_id);
 
-       if (on) {
-               ret = i40e_aq_add_vlan(hw, vsi->seid, &vlan_data, 1, NULL);
-               if (ret != I40E_SUCCESS)
-                       PMD_DRV_LOG(ERR, "Failed to add vlan filter");
+       if (on)
                vsi->vfta[vid_idx] |= vid_bit;
-       } else {
-               ret = i40e_aq_remove_vlan(hw, vsi->seid, &vlan_data, 1, NULL);
-               if (ret != I40E_SUCCESS)
-                       PMD_DRV_LOG(ERR, "Failed to remove vlan filter");
+       else
                vsi->vfta[vid_idx] &= ~vid_bit;
-       }
 }
 
 /**
index 615de94..fce3381 100644 (file)
@@ -472,8 +472,8 @@ mlx5_wqe_write_inline_vlan(struct txq *txq, volatile union mlx5_wqe *wqe,
                   (uint8_t *)addr, 12);
        rte_memcpy((uint8_t *)(uintptr_t)wqe->inl.eseg.inline_hdr_start + 12,
                   &vlan, sizeof(vlan));
-       rte_memcpy((uint8_t *)(uintptr_t)wqe->inl.eseg.inline_hdr_start + 16,
-                  ((uint8_t *)addr + 12), 2);
+       rte_memcpy((uint8_t *)((uintptr_t)wqe->inl.eseg.inline_hdr_start + 16),
+                  (uint8_t *)(addr + 12), 2);
        addr += MLX5_ETH_VLAN_INLINE_HEADER_SIZE - sizeof(vlan);
        length -= MLX5_ETH_VLAN_INLINE_HEADER_SIZE - sizeof(vlan);
        size = (sizeof(wqe->inl.ctrl.ctrl) +
index 782d7d3..6b4f66e 100644 (file)
@@ -342,7 +342,7 @@ virtio_user_pmd_devinit(const char *name, const char *params)
                goto end;
        }
 
-       if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1)
+       if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1) {
                ret = rte_kvargs_process(kvlist, VIRTIO_USER_ARG_PATH,
                                         &get_string_arg, &path);
                if (ret < 0) {
@@ -350,7 +350,7 @@ virtio_user_pmd_devinit(const char *name, const char *params)
                                     VIRTIO_USER_ARG_PATH);
                        goto end;
                }
-       else {
+       else {
                PMD_INIT_LOG(ERR, "arg %s is mandatory for virtio-user\n",
                          VIRTIO_USER_ARG_QUEUE_SIZE);
                goto end;
index 24857f2..537cee1 100644 (file)
@@ -221,14 +221,22 @@ lcore_rx(struct lcore_params *p)
                struct rte_mbuf *bufs[BURST_SIZE*2];
                const uint16_t nb_rx = rte_eth_rx_burst(port, 0, bufs,
                                BURST_SIZE);
+               if (unlikely(nb_rx == 0)) {
+                       if (++port == nb_ports)
+                               port = 0;
+                       continue;
+               }
                app_stats.rx.rx_pkts += nb_rx;
 
                rte_distributor_process(d, bufs, nb_rx);
                const uint16_t nb_ret = rte_distributor_returned_pkts(d,
                                bufs, BURST_SIZE*2);
                app_stats.rx.returned_pkts += nb_ret;
-               if (unlikely(nb_ret == 0))
+               if (unlikely(nb_ret == 0)) {
+                       if (++port == nb_ports)
+                               port = 0;
                        continue;
+               }
 
                uint16_t sent = rte_ring_enqueue_burst(r, (void *)bufs, nb_ret);
                app_stats.rx.enqueued_pkts += sent;
index f78743d..1ca144b 100644 (file)
@@ -384,7 +384,8 @@ send_single_packet(struct rte_mbuf *m, uint8_t port)
 }
 
 static inline void
-inbound_sp_sa(struct sp_ctx *sp, struct sa_ctx *sa, struct traffic_type *ip)
+inbound_sp_sa(struct sp_ctx *sp, struct sa_ctx *sa, struct traffic_type *ip,
+               uint16_t lim)
 {
        struct rte_mbuf *m;
        uint32_t i, j, res, sa_idx;
@@ -399,15 +400,15 @@ inbound_sp_sa(struct sp_ctx *sp, struct sa_ctx *sa, struct traffic_type *ip)
        for (i = 0; i < ip->num; i++) {
                m = ip->pkts[i];
                res = ip->res[i];
-               if (res & DISCARD) {
-                       rte_pktmbuf_free(m);
-                       continue;
-               }
                if (res & BYPASS) {
                        ip->pkts[j++] = m;
                        continue;
                }
-               /* Check return SA SPI matches pkt SPI */
+               if (res & DISCARD || i < lim) {
+                       rte_pktmbuf_free(m);
+                       continue;
+               }
+               /* Only check SPI match for processed IPSec packets */
                sa_idx = ip->res[i] & PROTECT_MASK;
                if (sa_idx == 0 || !inbound_sa_check(sa, m, sa_idx)) {
                        rte_pktmbuf_free(m);
@@ -423,11 +424,14 @@ process_pkts_inbound(struct ipsec_ctx *ipsec_ctx,
                struct ipsec_traffic *traffic)
 {
        struct rte_mbuf *m;
-       uint16_t idx, nb_pkts_in, i;
+       uint16_t idx, nb_pkts_in, i, n_ip4, n_ip6;
 
        nb_pkts_in = ipsec_inbound(ipsec_ctx, traffic->ipsec.pkts,
                        traffic->ipsec.num, MAX_PKT_BURST);
 
+       n_ip4 = traffic->ip4.num;
+       n_ip6 = traffic->ip6.num;
+
        /* SP/ACL Inbound check ipsec and ip4 */
        for (i = 0; i < nb_pkts_in; i++) {
                m = traffic->ipsec.pkts[i];
@@ -447,9 +451,11 @@ process_pkts_inbound(struct ipsec_ctx *ipsec_ctx,
                        rte_pktmbuf_free(m);
        }
 
-       inbound_sp_sa(ipsec_ctx->sp4_ctx, ipsec_ctx->sa_ctx, &traffic->ip4);
+       inbound_sp_sa(ipsec_ctx->sp4_ctx, ipsec_ctx->sa_ctx, &traffic->ip4,
+                       n_ip4);
 
-       inbound_sp_sa(ipsec_ctx->sp6_ctx, ipsec_ctx->sa_ctx, &traffic->ip6);
+       inbound_sp_sa(ipsec_ctx->sp6_ctx, ipsec_ctx->sa_ctx, &traffic->ip6,
+                       n_ip6);
 }
 
 static inline void
index a1ce712..dd39cc1 100644 (file)
@@ -45,6 +45,8 @@
 #include <ctype.h>
 #include <errno.h>
 #include <getopt.h>
+#include <fcntl.h>
+#include <unistd.h>
 
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
@@ -588,10 +590,18 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid)
 static void
 generate_random_key(uint8_t *key, unsigned length)
 {
-       unsigned i;
+       int fd;
+       int ret;
+
+       fd = open("/dev/urandom", O_RDONLY);
+       if (fd < 0)
+               rte_exit(EXIT_FAILURE, "Failed to generate random key\n");
 
-       for (i = 0; i < length; i++)
-               key[i] = rand() % 0xff;
+       ret = read(fd, key, length);
+       close(fd);
+
+       if (ret != (signed)length)
+               rte_exit(EXIT_FAILURE, "Failed to generate random key\n");
 }
 
 static struct rte_cryptodev_sym_session *
@@ -1195,8 +1205,6 @@ l2fwd_crypto_parse_timer_period(struct l2fwd_crypto_options *options,
 static void
 l2fwd_crypto_default_options(struct l2fwd_crypto_options *options)
 {
-       srand(time(NULL));
-
        options->portmask = 0xffffffff;
        options->nb_ports_per_lcore = 1;
        options->refresh_period = 10000;
index 698fa0a..988cbbc 100644 (file)
@@ -89,6 +89,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += rte_keepalive.c
 
 # from arch dir
 SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += rte_cpuflags.c
+SRCS-$(CONFIG_RTE_ARCH_X86) += rte_spinlock.c
 
 CFLAGS_eal_common_cpuflags.o := $(CPUFLAGS_LIST)
 
index 1852c4a..a335e04 100644 (file)
@@ -158,6 +158,7 @@ DPDK_16.07 {
        pci_get_sysfs_path;
        rte_keepalive_mark_sleep;
        rte_keepalive_register_relay_callback;
+       rte_rtm_supported;
        rte_thread_setname;
 
 } DPDK_16.04;
diff --git a/lib/librte_eal/common/arch/x86/rte_spinlock.c b/lib/librte_eal/common/arch/x86/rte_spinlock.c
new file mode 100644 (file)
index 0000000..c383e9f
--- /dev/null
@@ -0,0 +1,45 @@
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of Intel Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "rte_cpuflags.h"
+
+uint8_t rte_rtm_supported; /* cache the flag to avoid the overhead
+                             of the rte_cpu_get_flag_enabled function */
+
+static void __attribute__((constructor))
+rte_rtm_init(void)
+{
+       rte_rtm_supported = rte_cpu_get_flag_enabled(RTE_CPUFLAG_RTM);
+}
index 02f95cb..8e630c2 100644 (file)
@@ -94,24 +94,17 @@ rte_spinlock_trylock (rte_spinlock_t *sl)
 }
 #endif
 
-static uint8_t rtm_supported; /* cache the flag to avoid the overhead
-                                of the rte_cpu_get_flag_enabled function */
-
-static inline void __attribute__((constructor))
-rte_rtm_init(void)
-{
-       rtm_supported = rte_cpu_get_flag_enabled(RTE_CPUFLAG_RTM);
-}
+extern uint8_t rte_rtm_supported;
 
 static inline int rte_tm_supported(void)
 {
-       return rtm_supported;
+       return rte_rtm_supported;
 }
 
 static inline int
 rte_try_tm(volatile int *lock)
 {
-       if (!rtm_supported)
+       if (!rte_rtm_supported)
                return 0;
 
        int retries = RTE_RTM_MAX_RETRIES;
index 3710222..eacc86c 100644 (file)
@@ -77,7 +77,7 @@ extern "C" {
  *   0-15 = release candidates
  *   16   = release
  */
-#define RTE_VER_RELEASE 2
+#define RTE_VER_RELEASE 3
 
 /**
  * Macro to compute a version number usable for comparisons
index 1a97693..182729c 100644 (file)
@@ -106,6 +106,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_keepalive.c
 
 # from arch dir
 SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_cpuflags.c
+SRCS-$(CONFIG_RTE_ARCH_X86) += rte_spinlock.c
 
 CFLAGS_eal_common_cpuflags.o := $(CPUFLAGS_LIST)
 
index 46cd683..5f478c5 100644 (file)
@@ -431,7 +431,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
                        } else {
                                memreg[0].offset = reg.offset;
                                memreg[0].size = table_start;
-                               memreg[1].offset = table_end;
+                               memreg[1].offset = reg.offset + table_end;
                                memreg[1].size = reg.size - table_end;
 
                                RTE_LOG(DEBUG, EAL,
@@ -474,7 +474,9 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
                        /* if there's a second part, try to map it */
                        if (map_addr != MAP_FAILED
                            && memreg[1].offset && memreg[1].size) {
-                               void *second_addr = RTE_PTR_ADD(bar_addr, memreg[1].offset);
+                               void *second_addr = RTE_PTR_ADD(bar_addr,
+                                                               memreg[1].offset -
+                                                               (uintptr_t)reg.offset);
                                map_addr = pci_map_resource(second_addr,
                                                            vfio_dev_fd, memreg[1].offset,
                                                            memreg[1].size,
index fcb0ab3..702f7a2 100644 (file)
@@ -344,7 +344,8 @@ vfio_is_enabled(const char *modname)
 }
 
 const struct vfio_iommu_type *
-vfio_set_iommu_type(int vfio_container_fd) {
+vfio_set_iommu_type(int vfio_container_fd)
+{
        unsigned idx;
        for (idx = 0; idx < RTE_DIM(iommu_types); idx++) {
                const struct vfio_iommu_type *t = &iommu_types[idx];
@@ -366,7 +367,8 @@ vfio_set_iommu_type(int vfio_container_fd) {
 }
 
 int
-vfio_has_supported_extensions(int vfio_container_fd) {
+vfio_has_supported_extensions(int vfio_container_fd)
+{
        int ret;
        unsigned idx, n_extensions = 0;
        for (idx = 0; idx < RTE_DIM(iommu_types); idx++) {
index a617b9e..db8c984 100644 (file)
@@ -162,6 +162,7 @@ DPDK_16.07 {
        pci_get_sysfs_path;
        rte_keepalive_mark_sleep;
        rte_keepalive_register_relay_callback;
+       rte_rtm_supported;
        rte_thread_setname;
 
 } DPDK_16.04;
index 92cedf2..9ac7081 100644 (file)
@@ -77,7 +77,7 @@ struct ip_frag_key {
        uint32_t key_len;      /**< src/dst key length */
 };
 
-/*
+/**
  * @internal Fragmented packet to reassemble.
  * First two entries in the frags[] array are for the last and first fragments.
  */
@@ -151,7 +151,7 @@ struct ipv6_extension_fragment {
 
 
 
-/*
+/**
  * Create a new IP fragmentation table.
  *
  * @param bucket_num
@@ -174,14 +174,14 @@ struct rte_ip_frag_tbl * rte_ip_frag_table_create(uint32_t bucket_num,
                uint32_t bucket_entries,  uint32_t max_entries,
                uint64_t max_cycles, int socket_id);
 
-/*
+/**
  * Free allocated IP fragmentation table.
  *
- * @param btl
+ * @param tbl
  *   Fragmentation table to free.
  */
 static inline void
-rte_ip_frag_table_destroy( struct rte_ip_frag_tbl *tbl)
+rte_ip_frag_table_destroy(struct rte_ip_frag_tbl *tbl)
 {
        rte_free(tbl);
 }
@@ -215,7 +215,7 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in,
                struct rte_mempool *pool_direct,
                struct rte_mempool *pool_indirect);
 
-/*
+/**
  * This function implements reassembly of fragmented IPv6 packets.
  * Incoming mbuf should have its l2_len/l3_len fields setup correctly.
  *
@@ -241,7 +241,7 @@ struct rte_mbuf *rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
                struct rte_mbuf *mb, uint64_t tms, struct ipv6_hdr *ip_hdr,
                struct ipv6_extension_fragment *frag_hdr);
 
-/*
+/**
  * Return a pointer to the packet's fragment header, if found.
  * It only looks at the extension header that's right after the fixed IPv6
  * header, and doesn't follow the whole chain of extension headers.
@@ -291,7 +291,7 @@ int32_t rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in,
                        struct rte_mempool *pool_direct,
                        struct rte_mempool *pool_indirect);
 
-/*
+/**
  * This function implements reassembly of fragmented IPv4 packets.
  * Incoming mbufs should have its l2_len/l3_len fields setup correclty.
  *
@@ -314,7 +314,7 @@ struct rte_mbuf * rte_ipv4_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
                struct rte_ip_frag_death_row *dr,
                struct rte_mbuf *mb, uint64_t tms, struct ipv4_hdr *ip_hdr);
 
-/*
+/**
  * Check if the IPv4 packet is fragmented
  *
  * @param hdr
@@ -333,7 +333,7 @@ rte_ipv4_frag_pkt_is_fragmented(const struct ipv4_hdr * hdr) {
        return ip_flag != 0 || ip_ofs  != 0;
 }
 
-/*
+/**
  * Free mbufs on a given death row.
  *
  * @param dr
@@ -345,7 +345,7 @@ void rte_ip_frag_free_death_row(struct rte_ip_frag_death_row *dr,
                uint32_t prefetch);
 
 
-/*
+/**
  * Dump fragmentation table statistics to file.
  *
  * @param f
index 6ec0906..8806633 100644 (file)
@@ -199,7 +199,11 @@ rte_mempool_calc_obj_size(uint32_t elt_size, uint32_t flags,
                sz->header_size = RTE_ALIGN_CEIL(sz->header_size,
                        RTE_MEMPOOL_ALIGN);
 
+#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
        sz->trailer_size = sizeof(struct rte_mempool_objtlr);
+#else
+       sz->trailer_size = 0;
+#endif
 
        /* element size is 8 bytes-aligned at least */
        sz->elt_size = RTE_ALIGN_CEIL(elt_size, sizeof(uint64_t));
index fb7052e..4a8fbb1 100644 (file)
@@ -163,6 +163,8 @@ struct rte_mempool_objhdr {
  */
 STAILQ_HEAD(rte_mempool_objhdr_list, rte_mempool_objhdr);
 
+#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
+
 /**
  * Mempool object trailer structure
  *
@@ -170,11 +172,11 @@ STAILQ_HEAD(rte_mempool_objhdr_list, rte_mempool_objhdr);
  * trailer structure containing a cookie preventing memory corruptions.
  */
 struct rte_mempool_objtlr {
-#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
        uint64_t cookie;                 /**< Debug cookie. */
-#endif
 };
 
+#endif
+
 /**
  * A list of memory where objects are stored
  */
index 22ed476..9b921ce 100644 (file)
@@ -449,6 +449,7 @@ pdump_get_socket_path(char *buffer, int bufsz, enum rte_pdump_socktype type)
        char dpdk_dir[PATH_MAX] = {0};
        char dir[PATH_MAX] = {0};
        char *dir_home = NULL;
+       int ret = 0;
 
        if (type == RTE_PDUMP_SOCKET_SERVER && server_socket_dir[0] != 0)
                snprintf(dir, sizeof(dir), "%s", server_socket_dir);
@@ -475,7 +476,16 @@ pdump_get_socket_path(char *buffer, int bufsz, enum rte_pdump_socktype type)
                                        dpdk_dir, SOCKET_DIR);
        }
 
-       mkdir(dir, 700);
+       ret =  mkdir(dir, 700);
+       /* if user passed socket path is invalid, return immediately */
+       if (ret < 0 && errno != EEXIST) {
+               RTE_LOG(ERR, PDUMP,
+                       "Failed to create dir:%s:%s\n", dir,
+                       strerror(errno));
+               rte_errno = errno;
+               return -1;
+       }
+
        if (type == RTE_PDUMP_SOCKET_SERVER)
                snprintf(buffer, bufsz, SERVER_SOCKET, dir);
        else
@@ -667,8 +677,8 @@ pdump_create_client_socket(struct pdump_request *p)
                        "client socket(): %s:pid(%d):tid(%u), %s:%d\n",
                        strerror(errno), pid, rte_sys_gettid(),
                        __func__, __LINE__);
-               ret = errno;
-               return ret;
+               rte_errno = errno;
+               return -1;
        }
 
        ret = pdump_get_socket_path(addr.sun_path, sizeof(addr.sun_path),
@@ -677,6 +687,7 @@ pdump_create_client_socket(struct pdump_request *p)
                RTE_LOG(ERR, PDUMP,
                        "Failed to get client socket path: %s:%d\n",
                        __func__, __LINE__);
+               rte_errno = errno;
                goto exit;
        }
        addr.sun_family = AF_UNIX;
@@ -688,7 +699,7 @@ pdump_create_client_socket(struct pdump_request *p)
                        RTE_LOG(ERR, PDUMP,
                                "client bind(): %s, %s:%d\n",
                                strerror(errno), __func__, __LINE__);
-                       ret = errno;
+                       rte_errno = errno;
                        break;
                }
 
@@ -701,6 +712,7 @@ pdump_create_client_socket(struct pdump_request *p)
                        RTE_LOG(ERR, PDUMP,
                                "Failed to get server socket path: %s:%d\n",
                                __func__, __LINE__);
+                       rte_errno = errno;
                        break;
                }
                serv_addr.sun_family = AF_UNIX;
@@ -711,7 +723,8 @@ pdump_create_client_socket(struct pdump_request *p)
                        RTE_LOG(ERR, PDUMP,
                                "failed to send to server:%s, %s:%d\n",
                                strerror(errno), __func__, __LINE__);
-                       ret =  errno;
+                       rte_errno = errno;
+                       ret = -1;
                        break;
                }
 
@@ -722,7 +735,8 @@ pdump_create_client_socket(struct pdump_request *p)
                        RTE_LOG(ERR, PDUMP,
                                "failed to recv from server:%s, %s:%d\n",
                                strerror(errno), __func__, __LINE__);
-                       ret = errno;
+                       rte_errno = errno;
+                       ret = -1;
                        break;
                }
                ret = server_resp.err_value;
index 15ca956..bc00518 100644 (file)
@@ -147,10 +147,15 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,
        struct virtio_net_hdr_mrg_rxbuf virtio_hdr = {{0, 0, 0, 0, 0, 0}, 0};
 
        desc = &vq->desc[desc_idx];
-       if (unlikely(desc->len < dev->vhost_hlen))
+       desc_addr = gpa_to_vva(dev, desc->addr);
+       /*
+        * Checking of 'desc_addr' placed outside of 'unlikely' macro to avoid
+        * performance issue with some versions of gcc (4.8.4 and 5.3.0) which
+        * otherwise stores offset on the stack instead of in a register.
+        */
+       if (unlikely(desc->len < dev->vhost_hlen) || !desc_addr)
                return -1;
 
-       desc_addr = gpa_to_vva(dev, desc->addr);
        rte_prefetch0((void *)(uintptr_t)desc_addr);
 
        virtio_enqueue_offload(m, &virtio_hdr.hdr);
@@ -182,7 +187,10 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,
                                return -1;
 
                        desc = &vq->desc[desc->next];
-                       desc_addr   = gpa_to_vva(dev, desc->addr);
+                       desc_addr = gpa_to_vva(dev, desc->addr);
+                       if (unlikely(!desc_addr))
+                               return -1;
+
                        desc_offset = 0;
                        desc_avail  = desc->len;
                }
@@ -387,10 +395,10 @@ copy_mbuf_to_desc_mergeable(struct virtio_net *dev, struct vhost_virtqueue *vq,
        LOG_DEBUG(VHOST_DATA, "(%d) current index %d | end index %d\n",
                dev->vid, cur_idx, end_idx);
 
-       if (buf_vec[vec_idx].buf_len < dev->vhost_hlen)
-               return -1;
-
        desc_addr = gpa_to_vva(dev, buf_vec[vec_idx].buf_addr);
+       if (buf_vec[vec_idx].buf_len < dev->vhost_hlen || !desc_addr)
+               return 0;
+
        rte_prefetch0((void *)(uintptr_t)desc_addr);
 
        virtio_hdr.num_buffers = end_idx - start_idx;
@@ -425,6 +433,8 @@ copy_mbuf_to_desc_mergeable(struct virtio_net *dev, struct vhost_virtqueue *vq,
 
                        vec_idx++;
                        desc_addr = gpa_to_vva(dev, buf_vec[vec_idx].buf_addr);
+                       if (unlikely(!desc_addr))
+                               return 0;
 
                        /* Prefetch buffer address. */
                        rte_prefetch0((void *)(uintptr_t)desc_addr);
@@ -507,7 +517,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id,
                *(volatile uint16_t *)&vq->used->idx += nr_used;
                vhost_log_used_vring(dev, vq, offsetof(struct vring_used, idx),
                        sizeof(vq->used->idx));
-               vq->last_used_idx = end;
+               vq->last_used_idx += nr_used;
        }
 
        if (likely(pkt_idx)) {
@@ -688,6 +698,9 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,
                return -1;
 
        desc_addr = gpa_to_vva(dev, desc->addr);
+       if (unlikely(!desc_addr))
+               return -1;
+
        hdr = (struct virtio_net_hdr *)((uintptr_t)desc_addr);
        rte_prefetch0(hdr);
 
@@ -701,6 +714,9 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,
                desc = &vq->desc[desc->next];
 
                desc_addr = gpa_to_vva(dev, desc->addr);
+               if (unlikely(!desc_addr))
+                       return -1;
+
                rte_prefetch0((void *)(uintptr_t)desc_addr);
 
                desc_offset = 0;
@@ -737,6 +753,9 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,
                        desc = &vq->desc[desc->next];
 
                        desc_addr = gpa_to_vva(dev, desc->addr);
+                       if (unlikely(!desc_addr))
+                               return -1;
+
                        rte_prefetch0((void *)(uintptr_t)desc_addr);
 
                        desc_offset = 0;
index 087aaed..c691339 100644 (file)
@@ -71,20 +71,22 @@ fdset_find_free_slot(struct fdset *pfdset)
        return fdset_find_fd(pfdset, -1);
 }
 
-static void
+static int
 fdset_add_fd(struct fdset  *pfdset, int idx, int fd,
        fd_cb rcb, fd_cb wcb, void *dat)
 {
        struct fdentry *pfdentry;
 
-       if (pfdset == NULL || idx >= MAX_FDS)
-               return;
+       if (pfdset == NULL || idx >= MAX_FDS || fd >= FD_SETSIZE)
+               return -1;
 
        pfdentry = &pfdset->fd[idx];
        pfdentry->fd = fd;
        pfdentry->rcb = rcb;
        pfdentry->wcb = wcb;
        pfdentry->dat = dat;
+
+       return 0;
 }
 
 /**
@@ -150,12 +152,11 @@ fdset_add(struct fdset *pfdset, int fd, fd_cb rcb, fd_cb wcb, void *dat)
 
        /* Find a free slot in the list. */
        i = fdset_find_free_slot(pfdset);
-       if (i == -1) {
+       if (i == -1 || fdset_add_fd(pfdset, i, fd, rcb, wcb, dat) < 0) {
                pthread_mutex_unlock(&pfdset->fd_mutex);
                return -2;
        }
 
-       fdset_add_fd(pfdset, i, fd, rcb, wcb, dat);
        pfdset->num++;
 
        pthread_mutex_unlock(&pfdset->fd_mutex);
index a0d83f3..f0ea3a2 100644 (file)
@@ -257,6 +257,7 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
        int vid;
        size_t size;
        struct vhost_user_connection *conn;
+       int ret;
 
        conn = malloc(sizeof(*conn));
        if (conn == NULL) {
@@ -278,7 +279,15 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)
 
        conn->vsocket = vsocket;
        conn->vid = vid;
-       fdset_add(&vhost_user.fdset, fd, vhost_user_msg_handler, NULL, conn);
+       ret = fdset_add(&vhost_user.fdset, fd, vhost_user_msg_handler,
+                       NULL, conn);
+       if (ret < 0) {
+               free(conn);
+               close(fd);
+               RTE_LOG(ERR, VHOST_CONFIG,
+                       "failed to add fd %d into vhost server fdset\n",
+                       fd);
+       }
 }
 
 /* call back when there is new vhost-user connection from client  */
@@ -470,8 +479,14 @@ vhost_user_create_server(struct vhost_user_socket *vsocket)
                goto err;
 
        vsocket->listenfd = fd;
-       fdset_add(&vhost_user.fdset, fd, vhost_user_server_new_connection,
+       ret = fdset_add(&vhost_user.fdset, fd, vhost_user_server_new_connection,
                  NULL, vsocket);
+       if (ret < 0) {
+               RTE_LOG(ERR, VHOST_CONFIG,
+                       "failed to add listen fd %d to vhost server fdset\n",
+                       fd);
+               goto err;
+       }
 
        return 0;
 
index ea22961..886dbdd 100644 (file)
@@ -176,6 +176,8 @@ ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy)
 LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib
 endif
 
+MAPFLAGS = -Map=$@.map --cref
+
 .PHONY: all
 all: install
 
@@ -190,13 +192,13 @@ build: _postbuild
 exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
 
 ifeq ($(LINK_USING_CC),1)
-override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS))
-O_TO_EXE = $(CC) $(CFLAGS) $(LDFLAGS_$(@)) \
-       -Wl,-Map=$(@).map,--cref -o $@ $(OBJS-y) $(call linkerprefix,$(LDFLAGS)) \
-       $(EXTRA_LDFLAGS) $(call linkerprefix,$(LDLIBS))
+O_TO_EXE = $(CC) -o $@ $(CFLAGS) $(OBJS-y) $(call linkerprefix, \
+       $(LDLIBS) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
+       $(MAPFLAGS))
 else
-O_TO_EXE = $(LD) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
-       -Map=$(@).map --cref -o $@ $(OBJS-y) $(LDLIBS)
+O_TO_EXE = $(LD) -o $@ $(OBJS-y) \
+       $(LDLIBS) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
+       $(MAPFLAGS)
 endif
 O_TO_EXE_STR = $(subst ','\'',$(O_TO_EXE)) #'# fix syntax highlight
 O_TO_EXE_DISP = $(if $(V),"$(O_TO_EXE_STR)","  LD $(@)")
index 5bcecfc..d2cafc1 100755 (executable)
@@ -39,6 +39,7 @@ default_path=$PATH
 # - DPDK_DEP_CFLAGS
 # - DPDK_DEP_LDFLAGS
 # - DPDK_DEP_MOFED (y/[n])
+# - DPDK_DEP_NUMA (y/[n])
 # - DPDK_DEP_PCAP (y/[n])
 # - DPDK_DEP_SSL (y/[n])
 # - DPDK_DEP_SZE (y/[n])
@@ -95,12 +96,13 @@ configs=${*:-$DPDK_BUILD_TEST_CONFIGS}
 success=false
 on_exit ()
 {
-       if [ "$DPDK_NOTIFY" = notify-send ] ; then
-               if $success ; then
+       if $success ; then
+               [ "$DPDK_NOTIFY" != notify-send ] || \
                        notify-send -u low --icon=dialog-information 'DPDK build' 'finished'
-               elif [ -z "$signal" ] ; then
+       elif [ -z "$signal" ] ; then
+               [ -z "$dir" ] || echo "failed to build $dir" >&2
+               [ "$DPDK_NOTIFY" != notify-send ] || \
                        notify-send -u low --icon=dialog-error 'DPDK build' 'failed'
-               fi
        fi
 }
 # catch manual interrupt to ignore notification
@@ -118,6 +120,7 @@ reset_env ()
        unset DPDK_DEP_CFLAGS
        unset DPDK_DEP_LDFLAGS
        unset DPDK_DEP_MOFED
+       unset DPDK_DEP_NUMA
        unset DPDK_DEP_PCAP
        unset DPDK_DEP_SSL
        unset DPDK_DEP_SZE
@@ -154,9 +157,8 @@ config () # <directory> <target> <options>
                sed -ri 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config )
 
                # Automatic configuration
-               ! echo $2 | grep -q '^x86_64' || \
+               test "$DPDK_DEP_NUMA" != y || \
                sed -ri               's,(NUMA=)n,\1y,' $1/.config
-               sed -ri         's,(PCI_CONFIG=)n,\1y,' $1/.config
                sed -ri    's,(LIBRTE_IEEE1588=)n,\1y,' $1/.config
                sed -ri             's,(BYPASS=)n,\1y,' $1/.config
                test "$DPDK_DEP_ARCHIVE" != y || \
@@ -231,6 +233,7 @@ for conf in $configs ; do
                O=$(readlink -m $dir/examples/performance-thread)
        unset RTE_TARGET
        echo "################## $dir done."
+       unset dir
 done
 
 if ! $short ; then