Skip to content

Commit f27ff49

Browse files
committed
DPDK: Upgrade to 22.11.6.
1 parent 1152067 commit f27ff49

File tree

587 files changed

+11958
-7618
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

587 files changed

+11958
-7618
lines changed

dpdk/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.11.3
1+
22.11.6

dpdk/a.txt

Lines changed: 0 additions & 364 deletions
This file was deleted.

dpdk/app/dumpcap/main.c

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include <pcap/pcap.h>
4545
#include <pcap/bpf.h>
4646

47-
#define RING_NAME "capture-ring"
4847
#define MONITOR_INTERVAL (500 * 1000)
4948
#define MBUF_POOL_CACHE_SIZE 32
5049
#define BURST_SIZE 32
@@ -547,6 +546,11 @@ static void dpdk_init(void)
547546
eal_argv[i++] = strdup(file_prefix);
548547
}
549548

549+
for (i = 0; i < (unsigned int)eal_argc; i++) {
550+
if (eal_argv[i] == NULL)
551+
rte_panic("No memory\n");
552+
}
553+
550554
if (rte_eal_init(eal_argc, eal_argv) < 0)
551555
rte_exit(EXIT_FAILURE, "EAL init failed: is primary process running?\n");
552556
}
@@ -555,6 +559,7 @@ static void dpdk_init(void)
555559
static struct rte_ring *create_ring(void)
556560
{
557561
struct rte_ring *ring;
562+
char ring_name[RTE_RING_NAMESIZE];
558563
size_t size, log2;
559564

560565
/* Find next power of 2 >= size. */
@@ -568,31 +573,31 @@ static struct rte_ring *create_ring(void)
568573
ring_size = size;
569574
}
570575

571-
ring = rte_ring_lookup(RING_NAME);
572-
if (ring == NULL) {
573-
ring = rte_ring_create(RING_NAME, ring_size,
574-
rte_socket_id(), 0);
575-
if (ring == NULL)
576-
rte_exit(EXIT_FAILURE, "Could not create ring :%s\n",
577-
rte_strerror(rte_errno));
578-
}
576+
/* Want one ring per invocation of program */
577+
snprintf(ring_name, sizeof(ring_name),
578+
"dumpcap-%d", getpid());
579+
580+
ring = rte_ring_create(ring_name, ring_size,
581+
rte_socket_id(), 0);
582+
if (ring == NULL)
583+
rte_exit(EXIT_FAILURE, "Could not create ring :%s\n",
584+
rte_strerror(rte_errno));
585+
579586
return ring;
580587
}
581588

582589
static struct rte_mempool *create_mempool(void)
583590
{
584-
static const char pool_name[] = "capture_mbufs";
591+
char pool_name[RTE_MEMPOOL_NAMESIZE];
585592
size_t num_mbufs = 2 * ring_size;
586593
struct rte_mempool *mp;
587594

588-
mp = rte_mempool_lookup(pool_name);
589-
if (mp)
590-
return mp;
595+
snprintf(pool_name, sizeof(pool_name), "capture_%d", getpid());
591596

592597
mp = rte_pktmbuf_pool_create_by_ops(pool_name, num_mbufs,
593598
MBUF_POOL_CACHE_SIZE, 0,
594599
rte_pcapng_mbuf_size(snaplen),
595-
rte_socket_id(), "ring_mp_sc");
600+
rte_socket_id(), "ring_mp_mc");
596601
if (mp == NULL)
597602
rte_exit(EXIT_FAILURE,
598603
"Mempool (%s) creation failed: %s\n", pool_name,
@@ -800,6 +805,11 @@ int main(int argc, char **argv)
800805
{
801806
struct rte_ring *r;
802807
struct rte_mempool *mp;
808+
struct sigaction action = {
809+
.sa_flags = SA_RESTART,
810+
.sa_handler = signal_handler,
811+
};
812+
struct sigaction origaction;
803813
dumpcap_out_t out;
804814
char *p;
805815

@@ -827,6 +837,14 @@ int main(int argc, char **argv)
827837
if (TAILQ_EMPTY(&interfaces))
828838
set_default_interface();
829839

840+
sigemptyset(&action.sa_mask);
841+
sigaction(SIGTERM, &action, NULL);
842+
sigaction(SIGINT, &action, NULL);
843+
sigaction(SIGPIPE, &action, NULL);
844+
sigaction(SIGHUP, NULL, &origaction);
845+
if (origaction.sa_handler == SIG_DFL)
846+
sigaction(SIGHUP, &action, NULL);
847+
830848
r = create_ring();
831849
mp = create_mempool();
832850
out = create_output();

dpdk/app/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ foreach app:apps
8383
if not build
8484
if reason != ''
8585
dpdk_apps_disabled += app
86-
set_variable(app.underscorify() + '_disable_reason', reason)
86+
set_variable('app_' + app.underscorify() + '_disable_reason', reason)
8787
endif
8888
continue
8989
endif

dpdk/app/pdump/main.c

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ parse_device_id(const char *key __rte_unused, const char *value,
171171
struct pdump_tuples *pt = extra_args;
172172

173173
pt->device_id = strdup(value);
174+
if (pt->device_id == NULL)
175+
return -1;
176+
174177
pt->dump_by_type = DEVICE_ID;
175178

176179
return 0;
@@ -568,13 +571,9 @@ disable_primary_monitor(void)
568571
}
569572

570573
static void
571-
signal_handler(int sig_num)
574+
signal_handler(int sig_num __rte_unused)
572575
{
573-
if (sig_num == SIGINT) {
574-
printf("\n\nSignal %d received, preparing to exit...\n",
575-
sig_num);
576-
quit_signal = 1;
577-
}
576+
quit_signal = 1;
578577
}
579578

580579
static inline int
@@ -971,6 +970,11 @@ enable_primary_monitor(void)
971970
int
972971
main(int argc, char **argv)
973972
{
973+
struct sigaction action = {
974+
.sa_flags = SA_RESTART,
975+
.sa_handler = signal_handler,
976+
};
977+
struct sigaction origaction;
974978
int diag;
975979
int ret;
976980
int i;
@@ -979,8 +983,14 @@ main(int argc, char **argv)
979983
char mp_flag[] = "--proc-type=secondary";
980984
char *argp[argc + 2];
981985

982-
/* catch ctrl-c so we can print on exit */
983-
signal(SIGINT, signal_handler);
986+
/* catch ctrl-c so we can cleanup on exit */
987+
sigemptyset(&action.sa_mask);
988+
sigaction(SIGTERM, &action, NULL);
989+
sigaction(SIGINT, &action, NULL);
990+
sigaction(SIGPIPE, &action, NULL);
991+
sigaction(SIGHUP, NULL, &origaction);
992+
if (origaction.sa_handler == SIG_DFL)
993+
sigaction(SIGHUP, &action, NULL);
984994

985995
argp[0] = argv[0];
986996
argp[1] = n_flag;

dpdk/app/proc-info/main.c

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <rte_common.h>
2020
#include <rte_debug.h>
2121
#include <rte_ethdev.h>
22-
#include <rte_malloc.h>
2322
#include <rte_memory.h>
2423
#include <rte_memzone.h>
2524
#include <rte_launch.h>
@@ -132,6 +131,8 @@ struct desc_param {
132131
static struct desc_param rx_desc_param;
133132
static struct desc_param tx_desc_param;
134133

134+
#define RSS_HASH_KEY_SIZE 64
135+
135136
/* display usage */
136137
static void
137138
proc_info_usage(const char *prgname)
@@ -719,24 +720,23 @@ metrics_display(int port_id)
719720
return;
720721
}
721722

722-
metrics = rte_malloc("proc_info_metrics",
723-
sizeof(struct rte_metric_value) * len, 0);
723+
metrics = malloc(sizeof(struct rte_metric_value) * len);
724724
if (metrics == NULL) {
725725
printf("Cannot allocate memory for metrics\n");
726726
return;
727727
}
728728

729-
names = rte_malloc(NULL, sizeof(struct rte_metric_name) * len, 0);
729+
names = malloc(sizeof(struct rte_metric_name) * len);
730730
if (names == NULL) {
731731
printf("Cannot allocate memory for metrics names\n");
732-
rte_free(metrics);
732+
free(metrics);
733733
return;
734734
}
735735

736736
if (len != rte_metrics_get_names(names, len)) {
737737
printf("Cannot get metrics names\n");
738-
rte_free(metrics);
739-
rte_free(names);
738+
free(metrics);
739+
free(names);
740740
return;
741741
}
742742

@@ -748,8 +748,8 @@ metrics_display(int port_id)
748748
ret = rte_metrics_get_values(port_id, metrics, len);
749749
if (ret < 0 || ret > len) {
750750
printf("Cannot get metrics values\n");
751-
rte_free(metrics);
752-
rte_free(names);
751+
free(metrics);
752+
free(names);
753753
return;
754754
}
755755

@@ -758,8 +758,8 @@ metrics_display(int port_id)
758758
printf("%s: %"PRIu64"\n", names[i].name, metrics[i].value);
759759

760760
printf("%s############################\n", nic_stats_border);
761-
rte_free(metrics);
762-
rte_free(names);
761+
free(metrics);
762+
free(names);
763763
}
764764
#endif
765765

@@ -823,6 +823,7 @@ show_port(void)
823823
struct rte_eth_fc_conf fc_conf;
824824
struct rte_ether_addr mac;
825825
struct rte_eth_dev_owner owner;
826+
uint8_t rss_key[RSS_HASH_KEY_SIZE];
826827

827828
/* Skip if port is not in mask */
828829
if ((enabled_port_mask & (1ul << i)) == 0)
@@ -981,17 +982,18 @@ show_port(void)
981982
printf("\n");
982983
}
983984

985+
rss_conf.rss_key = rss_key;
986+
rss_conf.rss_key_len = dev_info.hash_key_size;
984987
ret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf);
985988
if (ret == 0) {
986-
if (rss_conf.rss_key) {
987-
printf(" - RSS\n");
988-
printf("\t -- RSS len %u key (hex):",
989-
rss_conf.rss_key_len);
990-
for (k = 0; k < rss_conf.rss_key_len; k++)
991-
printf(" %x", rss_conf.rss_key[k]);
992-
printf("\t -- hf 0x%"PRIx64"\n",
993-
rss_conf.rss_hf);
994-
}
989+
printf(" - RSS info\n");
990+
printf("\t -- key len : %u\n",
991+
rss_conf.rss_key_len);
992+
printf("\t -- key (hex) : ");
993+
for (k = 0; k < rss_conf.rss_key_len; k++)
994+
printf("%02x", rss_conf.rss_key[k]);
995+
printf("\n\t -- hash function : 0x%"PRIx64"\n",
996+
rss_conf.rss_hf);
995997
}
996998

997999
#ifdef RTE_LIB_SECURITY

dpdk/app/test-bbdev/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ endif
2323
if dpdk_conf.has('RTE_BASEBAND_ACC')
2424
deps += ['baseband_acc']
2525
endif
26-
if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_LA12XX')
26+
if dpdk_conf.has('RTE_BASEBAND_LA12XX')
2727
deps += ['baseband_la12xx']
2828
endif

dpdk/app/test-bbdev/test-bbdev.py

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,18 @@ def kill(process):
9191
params_string = " ".join(call_params)
9292

9393
print("Executing: {}".format(params_string))
94-
app_proc = subprocess.Popen(call_params)
95-
if args.timeout > 0:
96-
timer = Timer(args.timeout, kill, [app_proc])
97-
timer.start()
98-
9994
try:
100-
app_proc.communicate()
101-
except:
102-
print("Error: failed to execute: {}".format(params_string))
103-
finally:
104-
timer.cancel()
105-
106-
if app_proc.returncode != 0:
107-
exit_status = 1
108-
print("ERROR TestCase failed. Failed test for vector {}. Return code: {}".format(
109-
vector, app_proc.returncode))
110-
95+
output = subprocess.run(call_params, timeout=args.timeout, universal_newlines=True)
96+
except subprocess.TimeoutExpired as e:
97+
print("Starting Test Suite : BBdev TimeOut Tests")
98+
print("== test: timeout")
99+
print("TestCase [ 0] : timeout passed")
100+
print(" + Tests Failed : 1")
101+
print("Unexpected Error")
102+
if output.returncode < 0:
103+
print("Starting Test Suite : BBdev Exception Tests")
104+
print("== test: exception")
105+
print("TestCase [ 0] : exception passed")
106+
print(" + Tests Failed : 1")
107+
print("Unexpected Error")
111108
sys.exit(exit_status)

dpdk/app/test-bbdev/test_bbdev.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ test_bbdev_configure_stop_queue(void)
366366
* - queue should be started if deferred_start ==
367367
*/
368368
ts_params->qconf.deferred_start = 0;
369-
rte_bbdev_queue_configure(dev_id, queue_id, &ts_params->qconf);
369+
TEST_ASSERT_SUCCESS(rte_bbdev_queue_configure(dev_id, queue_id, &ts_params->qconf),
370+
"Failed test for rte_bbdev_queue_configure");
370371
rte_bbdev_start(dev_id);
371372

372373
TEST_ASSERT_SUCCESS(return_value = rte_bbdev_queue_info_get(dev_id,

0 commit comments

Comments
 (0)