diff -Nru dpdk-19.11.7/app/meson.build dpdk-19.11.10~rc1/app/meson.build --- dpdk-19.11.7/app/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -18,8 +18,6 @@ 'test-pmd', 'test-sad'] -# for BSD only -lib_execinfo = cc.find_library('execinfo', required: false) default_cflags = machine_args default_ldflags = [] @@ -51,7 +49,6 @@ dep_objs += get_variable(get_option('default_library') + '_rte_' + d) endforeach - dep_objs += lib_execinfo link_libs = [] if get_option('default_library') == 'static' diff -Nru dpdk-19.11.7/app/test/autotest_test_funcs.py dpdk-19.11.10~rc1/app/test/autotest_test_funcs.py --- dpdk-19.11.7/app/test/autotest_test_funcs.py 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/autotest_test_funcs.py 2021-08-18 14:45:29.000000000 +0000 @@ -12,13 +12,16 @@ def default_autotest(child, test_name): child.sendline(test_name) result = child.expect(["Test OK", "Test Failed", - "Command not found", pexpect.TIMEOUT], timeout=900) + "Command not found", pexpect.TIMEOUT, + "Test Skipped"], timeout=900) if result == 1: return -1, "Fail" elif result == 2: return -1, "Fail [Not found]" elif result == 3: return -1, "Fail [Timeout]" + elif result == 4: + return 0, "Skipped [Not Run]" return 0, "Success" # autotest used to run dump commands diff -Nru dpdk-19.11.7/app/test/meson.build dpdk-19.11.10~rc1/app/test/meson.build --- dpdk-19.11.7/app/test/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -387,11 +387,10 @@ def_lib = get_option('default_library') test_dep_objs += get_variable(def_lib + '_rte_' + d) endforeach -test_dep_objs += cc.find_library('execinfo', required: false) link_libs = [] if get_option('default_library') == 'static' - link_libs = dpdk_static_libraries + dpdk_drivers + link_libs = dpdk_drivers endif dpdk_test = executable('dpdk-test', diff -Nru dpdk-19.11.7/app/test/packet_burst_generator.c dpdk-19.11.10~rc1/app/test/packet_burst_generator.c --- dpdk-19.11.7/app/test/packet_burst_generator.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/packet_burst_generator.c 2021-08-18 14:45:29.000000000 +0000 @@ -117,6 +117,7 @@ memset(tcp_hdr, 0, sizeof(struct rte_tcp_hdr)); tcp_hdr->src_port = rte_cpu_to_be_16(src_port); tcp_hdr->dst_port = rte_cpu_to_be_16(dst_port); + tcp_hdr->data_off = (sizeof(struct rte_tcp_hdr) << 2) & 0xF0; return pkt_len; } @@ -141,8 +142,8 @@ initialize_ipv6_header(struct rte_ipv6_hdr *ip_hdr, uint8_t *src_addr, uint8_t *dst_addr, uint16_t pkt_data_len) { - ip_hdr->vtc_flow = 0; - ip_hdr->payload_len = pkt_data_len; + ip_hdr->vtc_flow = rte_cpu_to_be_32(0x60000000); /* Set version to 6. */ + ip_hdr->payload_len = rte_cpu_to_be_16(pkt_data_len); ip_hdr->proto = IPPROTO_UDP; ip_hdr->hop_limits = IP_DEFTTL; diff -Nru dpdk-19.11.7/app/test/process.h dpdk-19.11.10~rc1/app/test/process.h --- dpdk-19.11.7/app/test/process.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/process.h 2021-08-18 14:45:29.000000000 +0000 @@ -48,6 +48,7 @@ #ifdef RTE_LIBRTE_PDUMP #ifdef RTE_LIBRTE_RING_PMD pthread_t thread; + int rc; #endif #endif @@ -126,8 +127,13 @@ /* parent process does a wait */ #ifdef RTE_LIBRTE_PDUMP #ifdef RTE_LIBRTE_RING_PMD - if ((strcmp(env_value, "run_pdump_server_tests") == 0)) - pthread_create(&thread, NULL, &send_pkts, NULL); + if ((strcmp(env_value, "run_pdump_server_tests") == 0)) { + rc = pthread_create(&thread, NULL, &send_pkts, NULL); + if (rc != 0) { + rte_panic("Cannot start send pkts thread: %s\n", + strerror(rc)); + } + } #endif #endif diff -Nru dpdk-19.11.7/app/test/test_bpf.c dpdk-19.11.10~rc1/app/test/test_bpf.c --- dpdk-19.11.7/app/test/test_bpf.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_bpf.c 2021-08-18 14:45:29.000000000 +0000 @@ -2744,7 +2744,7 @@ printf("%s@%d: check_result(%s) failed, " "error: %d(%s);\n", __func__, __LINE__, tst->name, - rv, strerror(ret)); + rv, strerror(rv)); } } diff -Nru dpdk-19.11.7/app/test/test.c dpdk-19.11.10~rc1/app/test/test.c --- dpdk-19.11.7/app/test/test.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test.c 2021-08-18 14:45:29.000000000 +0000 @@ -134,8 +134,13 @@ goto out; } + argv += ret; + + prgname = argv[0]; + #ifdef RTE_LIBRTE_TIMER - if (rte_timer_subsystem_init() < 0) { + ret = rte_timer_subsystem_init(); + if (ret < 0 && ret != -EALREADY) { ret = -1; goto out; } @@ -146,10 +151,6 @@ goto out; } - argv += ret; - - prgname = argv[0]; - recursive_call = getenv(RECURSIVE_ENV_VAR); if (recursive_call != NULL) { ret = do_recursive_call(); diff -Nru dpdk-19.11.7/app/test/test_cmdline_ipaddr.c dpdk-19.11.10~rc1/app/test/test_cmdline_ipaddr.c --- dpdk-19.11.7/app/test/test_cmdline_ipaddr.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_cmdline_ipaddr.c 2021-08-18 14:45:29.000000000 +0000 @@ -255,7 +255,7 @@ /** misc **/ /* too long */ - "1234:1234:1234:1234:1234:1234:1234:1234:1234:1234:1234" + "1234:1234:1234:1234:1234:1234:1234:1234:1234:1234:1234", "random invalid text", "", "\0", diff -Nru dpdk-19.11.7/app/test/test_cmdline_num.c dpdk-19.11.10~rc1/app/test/test_cmdline_num.c --- dpdk-19.11.7/app/test/test_cmdline_num.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_cmdline_num.c 2021-08-18 14:45:29.000000000 +0000 @@ -200,8 +200,8 @@ "-0x1234580A", "-0b0111010101", /* too long (128+ chars) */ - "0b1111000011110000111100001111000011110000111100001111000011110000" - "1111000011110000111100001111000011110000111100001111000011110000", + ("0b1111000011110000111100001111000011110000111100001111000011110000" + "1111000011110000111100001111000011110000111100001111000011110000"), "1E3", "0A", "-B", diff -Nru dpdk-19.11.7/app/test/test_cryptodev_aes_test_vectors.h dpdk-19.11.10~rc1/app/test/test_cryptodev_aes_test_vectors.h --- dpdk-19.11.7/app/test/test_cryptodev_aes_test_vectors.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_cryptodev_aes_test_vectors.h 2021-08-18 14:45:29.000000000 +0000 @@ -2212,7 +2212,7 @@ BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX2 }, { - .test_descr = "AES-192-CBC Encryption Scater gather", + .test_descr = "AES-192-CBC Encryption Scatter gather", .test_data = &aes_test_data_10, .op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT, .feature_mask = BLOCKCIPHER_TEST_FEATURE_SG | diff -Nru dpdk-19.11.7/app/test/test_cryptodev.c dpdk-19.11.10~rc1/app/test/test_cryptodev.c --- dpdk-19.11.7/app/test/test_cryptodev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_cryptodev.c 2021-08-18 14:45:29.000000000 +0000 @@ -112,10 +112,11 @@ struct rte_mbuf *m = rte_pktmbuf_alloc(mpool); size_t t_len = len - (blocksize ? (len % blocksize) : 0); - memset(m->buf_addr, 0, m->buf_len); if (m) { - char *dst = rte_pktmbuf_append(m, t_len); + char *dst; + memset(m->buf_addr, 0, m->buf_len); + dst = rte_pktmbuf_append(m, t_len); if (!dst) { rte_pktmbuf_free(m); return NULL; @@ -4761,16 +4762,20 @@ /* Validate obuf */ if (verify) { - TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( + TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT_OFFSET( plaintext, tdata->plaintext.data, - tdata->plaintext.len >> 3, + (tdata->plaintext.len - tdata->cipher.offset_bits - + (tdata->digest.len << 3)), + tdata->cipher.offset_bits, "SNOW 3G Plaintext data not as expected"); } else { - TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( + TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT_OFFSET( ciphertext, tdata->ciphertext.data, - tdata->validDataLenInBits.len, + (tdata->validDataLenInBits.len - + tdata->cipher.offset_bits), + tdata->cipher.offset_bits, "SNOW 3G Ciphertext data not as expected"); TEST_ASSERT_BUFFERS_ARE_EQUAL( @@ -4945,16 +4950,20 @@ /* Validate obuf */ if (verify) { - TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( + TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT_OFFSET( plaintext, tdata->plaintext.data, - tdata->plaintext.len >> 3, + (tdata->plaintext.len - tdata->cipher.offset_bits - + (tdata->digest.len << 3)), + tdata->cipher.offset_bits, "SNOW 3G Plaintext data not as expected"); } else { - TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( + TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT_OFFSET( ciphertext, tdata->ciphertext.data, - tdata->validDataLenInBits.len, + (tdata->validDataLenInBits.len - + tdata->cipher.offset_bits), + tdata->cipher.offset_bits, "SNOW 3G Ciphertext data not as expected"); TEST_ASSERT_BUFFERS_ARE_EQUAL( @@ -9653,8 +9662,8 @@ rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); sessions = rte_malloc(NULL, - (sizeof(struct rte_cryptodev_sym_session *) * - MAX_NB_SESSIONS) + 1, 0); + sizeof(struct rte_cryptodev_sym_session *) * + (MAX_NB_SESSIONS + 1), 0); /* Create multiple crypto sessions*/ for (i = 0; i < MAX_NB_SESSIONS; i++) { @@ -9699,6 +9708,7 @@ } } + sessions[i] = NULL; /* Next session create should fail */ rte_cryptodev_sym_session_init(ts_params->valid_devs[0], sessions[i], &ut_params->auth_xform, @@ -11202,7 +11212,7 @@ } static int -test_authenticated_encryt_with_esn( +test_authenticated_encrypt_with_esn( struct crypto_testsuite_params *ts_params, struct crypto_unittest_params *ut_params, const struct test_crypto_vector *reference) @@ -11867,7 +11877,7 @@ static int auth_encrypt_AES128CBC_HMAC_SHA1_esn_check(void) { - return test_authenticated_encryt_with_esn( + return test_authenticated_encrypt_with_esn( &testsuite_params, &unittest_params, &aes128cbc_hmac_sha1_aad_test_vector); diff -Nru dpdk-19.11.7/app/test/test_distributor_perf.c dpdk-19.11.10~rc1/app/test/test_distributor_perf.c --- dpdk-19.11.7/app/test/test_distributor_perf.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_distributor_perf.c 2021-08-18 14:45:29.000000000 +0000 @@ -188,13 +188,15 @@ rte_mempool_get_bulk(p, (void *)bufs, num_workers); quit = 1; - for (i = 0; i < num_workers; i++) + for (i = 0; i < num_workers; i++) { bufs[i]->hash.usr = i << 1; - rte_distributor_process(d, bufs, num_workers); + rte_distributor_process(d, &bufs[i], 1); + } rte_mempool_put_bulk(p, (void *)bufs, num_workers); rte_distributor_process(d, NULL, 0); + rte_distributor_flush(d); rte_eal_mp_wait_lcore(); quit = 0; worker_idx = 0; diff -Nru dpdk-19.11.7/app/test/test_eal_flags.c dpdk-19.11.10~rc1/app/test/test_eal_flags.c --- dpdk-19.11.7/app/test/test_eal_flags.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_eal_flags.c 2021-08-18 14:45:29.000000000 +0000 @@ -125,6 +125,7 @@ case HUGEPAGE_CHECK_EXISTS: { /* file exists, return */ + closedir(hugepage_dir); result = 1; goto end; } diff -Nru dpdk-19.11.7/app/test/test_event_crypto_adapter.c dpdk-19.11.10~rc1/app/test/test_event_crypto_adapter.c --- dpdk-19.11.7/app/test/test_event_crypto_adapter.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_event_crypto_adapter.c 2021-08-18 14:45:29.000000000 +0000 @@ -224,8 +224,7 @@ op->sess_type = RTE_CRYPTO_OP_SESSIONLESS; first_xform = &cipher_xform; sym_op->xform = first_xform; - uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH + - (sizeof(struct rte_crypto_sym_xform) * 2); + uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH; op->private_data_offset = len; /* Fill in private data information */ rte_memcpy(&m_data.response_info, &response_info, @@ -419,8 +418,7 @@ op->sess_type = RTE_CRYPTO_OP_SESSIONLESS; first_xform = &cipher_xform; sym_op->xform = first_xform; - uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH + - (sizeof(struct rte_crypto_sym_xform) * 2); + uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH; op->private_data_offset = len; /* Fill in private data information */ rte_memcpy(&m_data.response_info, &response_info, @@ -516,7 +514,8 @@ NUM_MBUFS, MBUF_CACHE_SIZE, DEFAULT_NUM_XFORMS * sizeof(struct rte_crypto_sym_xform) + - MAXIMUM_IV_LENGTH, + MAXIMUM_IV_LENGTH + + sizeof(union rte_event_crypto_metadata), rte_socket_id()); if (params.op_mpool == NULL) { RTE_LOG(ERR, USER1, "Can't create CRYPTO_OP_POOL\n"); diff -Nru dpdk-19.11.7/app/test/test_event_timer_adapter.c dpdk-19.11.10~rc1/app/test/test_event_timer_adapter.c --- dpdk-19.11.7/app/test/test_event_timer_adapter.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_event_timer_adapter.c 2021-08-18 14:45:29.000000000 +0000 @@ -3,6 +3,8 @@ * Copyright(c) 2017-2018 Intel Corporation. */ +#include + #include #include #include @@ -46,7 +48,7 @@ static volatile uint8_t arm_done; #define CALC_TICKS(tks) \ - ((tks * global_bkt_tck_ns) / global_info_bkt_tck_ns) + ceil((double)(tks * global_bkt_tck_ns) / global_info_bkt_tck_ns) static bool using_services; diff -Nru dpdk-19.11.7/app/test/test_flow_classify.c dpdk-19.11.10~rc1/app/test/test_flow_classify.c --- dpdk-19.11.7/app/test/test_flow_classify.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_flow_classify.c 2021-08-18 14:45:29.000000000 +0000 @@ -828,6 +828,12 @@ cls_params.name = "flow_classifier"; cls_params.socket_id = 0; cls->cls = rte_flow_classifier_create(&cls_params); + if (cls->cls == NULL) { + printf("Line %i: flow classifier create has failed!\n", + __LINE__); + rte_free(cls); + return TEST_FAILED; + } /* initialise ACL table params */ table_acl_params.n_rule_fields = RTE_DIM(ipv4_defs); diff -Nru dpdk-19.11.7/app/test/test_kni.c dpdk-19.11.10~rc1/app/test/test_kni.c --- dpdk-19.11.7/app/test/test_kni.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_kni.c 2021-08-18 14:45:29.000000000 +0000 @@ -562,8 +562,12 @@ } closedir(dir); - /* Initialize KNI subsytem */ - rte_kni_init(KNI_TEST_MAX_PORTS); + /* Initialize KNI subsystem */ + ret = rte_kni_init(KNI_TEST_MAX_PORTS); + if (ret < 0) { + printf("fail to initialize KNI subsystem\n"); + return -1; + } if (test_kni_allocate_lcores() < 0) { printf("No enough lcores for kni processing\n"); diff -Nru dpdk-19.11.7/app/test/test_mbuf.c dpdk-19.11.10~rc1/app/test/test_mbuf.c --- dpdk-19.11.7/app/test/test_mbuf.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_mbuf.c 2021-08-18 14:45:29.000000000 +0000 @@ -2344,7 +2344,7 @@ if (rte_mbuf_refcnt_read(m) != 1) GOTO_FAIL("%s: Invalid refcnt in mbuf\n", __func__); - buf_iova = rte_mempool_virt2iova(ext_buf_addr); + buf_iova = rte_mem_virt2iova(ext_buf_addr); rte_pktmbuf_attach_extbuf(m, ext_buf_addr, buf_iova, buf_len, ret_shinfo); if (m->ol_flags != EXT_ATTACHED_MBUF) diff -Nru dpdk-19.11.7/app/test/test_mempool.c dpdk-19.11.10~rc1/app/test/test_mempool.c --- dpdk-19.11.7/app/test/test_mempool.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_mempool.c 2021-08-18 14:45:29.000000000 +0000 @@ -552,7 +552,7 @@ GOTO_ERR(ret, err); /* test to initialize mempool objects and memory */ - nb_objs = rte_mempool_obj_iter(mp_stack_mempool_iter, rte_pktmbuf_init, + nb_objs = rte_mempool_obj_iter(mp_stack_mempool_iter, my_obj_init, NULL); if (nb_objs == 0) GOTO_ERR(ret, err); diff -Nru dpdk-19.11.7/app/test/test_power_cpufreq.c dpdk-19.11.10~rc1/app/test/test_power_cpufreq.c --- dpdk-19.11.7/app/test/test_power_cpufreq.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_power_cpufreq.c 2021-08-18 14:45:29.000000000 +0000 @@ -8,6 +8,7 @@ #include #include #include +#include #include "test.h" @@ -34,37 +35,79 @@ #define TEST_POWER_LCORE_INVALID ((unsigned)RTE_MAX_LCORE) #define TEST_POWER_FREQS_NUM_MAX ((unsigned)RTE_MAX_LCORE_FREQS) -#define TEST_POWER_SYSFILE_CUR_FREQ \ +/* macros used for rounding frequency to nearest 100000 */ +#define TEST_FREQ_ROUNDING_DELTA 50000 +#define TEST_ROUND_FREQ_TO_N_100000 100000 + +#define TEST_POWER_SYSFILE_CPUINFO_FREQ \ "/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_cur_freq" +#define TEST_POWER_SYSFILE_SCALING_FREQ \ + "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_cur_freq" static uint32_t total_freq_num; static uint32_t freqs[TEST_POWER_FREQS_NUM_MAX]; static int -check_cur_freq(unsigned lcore_id, uint32_t idx) +check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo) { #define TEST_POWER_CONVERT_TO_DECIMAL 10 +#define MAX_LOOP 100 FILE *f; char fullpath[PATH_MAX]; char buf[BUFSIZ]; uint32_t cur_freq; int ret = -1; + int i; if (snprintf(fullpath, sizeof(fullpath), - TEST_POWER_SYSFILE_CUR_FREQ, lcore_id) < 0) { + TEST_POWER_SYSFILE_SCALING_FREQ, lcore_id) < 0) { return 0; } f = fopen(fullpath, "r"); if (f == NULL) { - return 0; - } - if (fgets(buf, sizeof(buf), f) == NULL) { - goto fail_get_cur_freq; + if (snprintf(fullpath, sizeof(fullpath), + TEST_POWER_SYSFILE_CPUINFO_FREQ, lcore_id) < 0) { + return 0; + } + f = fopen(fullpath, "r"); + if (f == NULL) { + return 0; + } + } + for (i = 0; i < MAX_LOOP; i++) { + fflush(f); + if (fgets(buf, sizeof(buf), f) == NULL) + goto fail_all; + + cur_freq = strtoul(buf, NULL, TEST_POWER_CONVERT_TO_DECIMAL); + + /* convert the frequency to nearest 100000 value + * Ex: if cur_freq=1396789 then freq_conv=1400000 + * Ex: if cur_freq=800030 then freq_conv=800000 + */ + unsigned int freq_conv = 0; + freq_conv = (cur_freq + TEST_FREQ_ROUNDING_DELTA) + / TEST_ROUND_FREQ_TO_N_100000; + freq_conv = freq_conv * TEST_ROUND_FREQ_TO_N_100000; + + if (turbo) + ret = (freqs[idx] <= freq_conv ? 0 : -1); + else + ret = (freqs[idx] == freq_conv ? 0 : -1); + + if (ret == 0) + break; + + if (fseek(f, 0, SEEK_SET) < 0) { + printf("Fail to set file position indicator to 0\n"); + goto fail_all; + } + + /* wait for the value to be updated */ + rte_delay_ms(10); } - cur_freq = strtoul(buf, NULL, TEST_POWER_CONVERT_TO_DECIMAL); - ret = (freqs[idx] == cur_freq ? 0 : -1); -fail_get_cur_freq: +fail_all: fclose(f); return ret; @@ -143,7 +186,7 @@ } /* Check the current frequency */ - ret = check_cur_freq(TEST_POWER_LCORE_ID, count); + ret = check_cur_freq(TEST_POWER_LCORE_ID, count, false); if (ret < 0) return -1; @@ -193,7 +236,7 @@ } /* Check the current frequency */ - ret = check_cur_freq(TEST_POWER_LCORE_ID, total_freq_num - 1); + ret = check_cur_freq(TEST_POWER_LCORE_ID, total_freq_num - 1, false); if (ret < 0) return -1; @@ -206,6 +249,8 @@ { int ret; + rte_power_freq_enable_turbo(TEST_POWER_LCORE_ID); + /* test with an invalid lcore id */ ret = rte_power_freq_down(TEST_POWER_LCORE_INVALID); if (ret >= 0) { @@ -229,7 +274,7 @@ } /* Check the current frequency */ - ret = check_cur_freq(TEST_POWER_LCORE_ID, total_freq_num - 1); + ret = check_cur_freq(TEST_POWER_LCORE_ID, total_freq_num - 1, false); if (ret < 0) return -1; @@ -248,7 +293,7 @@ } /* Check the current frequency */ - ret = check_cur_freq(TEST_POWER_LCORE_ID, 1); + ret = check_cur_freq(TEST_POWER_LCORE_ID, 1, false); if (ret < 0) return -1; @@ -284,7 +329,7 @@ } /* Check the current frequency */ - ret = check_cur_freq(TEST_POWER_LCORE_ID, total_freq_num - 2); + ret = check_cur_freq(TEST_POWER_LCORE_ID, total_freq_num - 2, false); if (ret < 0) return -1; @@ -303,7 +348,7 @@ } /* Check the current frequency */ - ret = check_cur_freq(TEST_POWER_LCORE_ID, 0); + ret = check_cur_freq(TEST_POWER_LCORE_ID, 0, true); if (ret < 0) return -1; @@ -331,7 +376,7 @@ } /* Check the current frequency */ - ret = check_cur_freq(TEST_POWER_LCORE_ID, 0); + ret = check_cur_freq(TEST_POWER_LCORE_ID, 0, true); if (ret < 0) return -1; @@ -359,7 +404,7 @@ } /* Check the current frequency */ - ret = check_cur_freq(TEST_POWER_LCORE_ID, total_freq_num - 1); + ret = check_cur_freq(TEST_POWER_LCORE_ID, total_freq_num - 1, false); if (ret < 0) return -1; @@ -391,9 +436,15 @@ TEST_POWER_LCORE_ID); return -1; } + ret = rte_power_freq_max(TEST_POWER_LCORE_ID); + if (ret < 0) { + printf("Fail to scale up the freq to max on lcore %u\n", + TEST_POWER_LCORE_ID); + return -1; + } /* Check the current frequency */ - ret = check_cur_freq(TEST_POWER_LCORE_ID, 0); + ret = check_cur_freq(TEST_POWER_LCORE_ID, 0, true); if (ret < 0) return -1; @@ -410,9 +461,15 @@ TEST_POWER_LCORE_ID); return -1; } + ret = rte_power_freq_max(TEST_POWER_LCORE_ID); + if (ret < 0) { + printf("Fail to scale up the freq to max on lcore %u\n", + TEST_POWER_LCORE_ID); + return -1; + } /* Check the current frequency */ - ret = check_cur_freq(TEST_POWER_LCORE_ID, 1); + ret = check_cur_freq(TEST_POWER_LCORE_ID, 1, false); if (ret < 0) return -1; diff -Nru dpdk-19.11.7/app/test/test_prefetch.c dpdk-19.11.10~rc1/app/test/test_prefetch.c --- dpdk-19.11.7/app/test/test_prefetch.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_prefetch.c 2021-08-18 14:45:29.000000000 +0000 @@ -20,7 +20,7 @@ static int test_prefetch(void) { - int a; + int a = 0; rte_prefetch0(&a); rte_prefetch1(&a); diff -Nru dpdk-19.11.7/app/test/test_reciprocal_division_perf.c dpdk-19.11.10~rc1/app/test/test_reciprocal_division_perf.c --- dpdk-19.11.7/app/test/test_reciprocal_division_perf.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_reciprocal_division_perf.c 2021-08-18 14:45:29.000000000 +0000 @@ -71,10 +71,12 @@ tot_cyc_n); printf("Total number of cycles reciprocal division : %"PRIu64"\n", tot_cyc_r); - printf("Cycles per division(normal) : %3.2f\n", - ((double)tot_cyc_n)/i); - printf("Cycles per division(reciprocal) : %3.2f\n\n", - ((double)tot_cyc_r)/i); + if (i != 0) { + printf("Cycles per division(normal) : %3.2f\n", + ((double)tot_cyc_n)/i); + printf("Cycles per division(reciprocal) : %3.2f\n\n", + ((double)tot_cyc_r)/i); + } tot_cyc_n = 0; tot_cyc_r = 0; @@ -111,11 +113,12 @@ tot_cyc_n); printf("Total number of cycles reciprocal division : %"PRIu64"\n", tot_cyc_r); - printf("Cycles per division(normal) : %3.2f\n", - ((double)tot_cyc_n)/i); - printf("Cycles per division(reciprocal) : %3.2f\n\n", - ((double)tot_cyc_r)/i); - + if (i != 0) { + printf("Cycles per division(normal) : %3.2f\n", + ((double)tot_cyc_n)/i); + printf("Cycles per division(reciprocal) : %3.2f\n\n", + ((double)tot_cyc_r)/i); + } tot_cyc_n = 0; tot_cyc_r = 0; @@ -152,10 +155,12 @@ tot_cyc_n); printf("Total number of cycles reciprocal division : %"PRIu64"\n", tot_cyc_r); - printf("Cycles per division(normal) : %3.2f\n", - ((double)tot_cyc_n)/i); - printf("Cycles per division(reciprocal) : %3.2f\n\n", - ((double)tot_cyc_r)/i); + if (i != 0) { + printf("Cycles per division(normal) : %3.2f\n", + ((double)tot_cyc_n)/i); + printf("Cycles per division(reciprocal) : %3.2f\n\n", + ((double)tot_cyc_r)/i); + } tot_cyc_n = 0; tot_cyc_r = 0; @@ -190,10 +195,12 @@ tot_cyc_n); printf("Total number of cycles reciprocal division : %"PRIu64"\n", tot_cyc_r); - printf("Cycles per division(normal) : %3.2f\n", - ((double)tot_cyc_n)/i); - printf("Cycles per division(reciprocal) : %3.2f\n", - ((double)tot_cyc_r)/i); + if (i != 0) { + printf("Cycles per division(normal) : %3.2f\n", + ((double)tot_cyc_n)/i); + printf("Cycles per division(reciprocal) : %3.2f\n", + ((double)tot_cyc_r)/i); + } return result; } diff -Nru dpdk-19.11.7/app/test/test_stack.c dpdk-19.11.10~rc1/app/test/test_stack.c --- dpdk-19.11.7/app/test/test_stack.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_stack.c 2021-08-18 14:45:29.000000000 +0000 @@ -419,7 +419,11 @@ static int test_lf_stack(void) { +#if defined(RTE_STACK_LF_SUPPORTED) return __test_stack(RTE_STACK_F_LF); +#else + return TEST_SKIPPED; +#endif } REGISTER_TEST_COMMAND(stack_autotest, test_stack); diff -Nru dpdk-19.11.7/app/test/test_stack_perf.c dpdk-19.11.10~rc1/app/test/test_stack_perf.c --- dpdk-19.11.7/app/test/test_stack_perf.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_stack_perf.c 2021-08-18 14:45:29.000000000 +0000 @@ -349,7 +349,11 @@ static int test_lf_stack_perf(void) { +#if defined(RTE_STACK_LF_SUPPORTED) return __test_stack_perf(RTE_STACK_F_LF); +#else + return TEST_SKIPPED; +#endif } REGISTER_TEST_COMMAND(stack_perf_autotest, test_stack_perf); diff -Nru dpdk-19.11.7/app/test/test_table_tables.c dpdk-19.11.10~rc1/app/test/test_table_tables.c --- dpdk-19.11.7/app/test/test_table_tables.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_table_tables.c 2021-08-18 14:45:29.000000000 +0000 @@ -28,7 +28,8 @@ APP_METADATA_OFFSET(0)); \ key = RTE_MBUF_METADATA_UINT8_PTR(mbuf, \ APP_METADATA_OFFSET(32)); \ - memset(key, 0, 32); \ + if (mbuf->priv_size + mbuf->buf_len >= 64) \ + memset(key, 0, 32); \ k32 = (uint32_t *) key; \ k32[0] = (value); \ *signature = pipeline_test_hash(key, NULL, 0, 0); \ diff -Nru dpdk-19.11.7/app/test/test_timer_secondary.c dpdk-19.11.10~rc1/app/test/test_timer_secondary.c --- dpdk-19.11.7/app/test/test_timer_secondary.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test/test_timer_secondary.c 2021-08-18 14:45:29.000000000 +0000 @@ -126,9 +126,9 @@ mz = rte_memzone_reserve(TEST_INFO_MZ_NAME, sizeof(*test_info), SOCKET_ID_ANY, 0); - test_info = mz->addr; - TEST_ASSERT_NOT_NULL(test_info, "Couldn't allocate memory for " + TEST_ASSERT_NOT_NULL(mz, "Couldn't allocate memory for " "test data"); + test_info = mz->addr; test_info->tim_mempool = rte_mempool_create("test_timer_mp", NUM_TIMERS, sizeof(struct rte_timer), 0, 0, @@ -172,9 +172,9 @@ int i; mz = rte_memzone_lookup(TEST_INFO_MZ_NAME); - test_info = mz->addr; - TEST_ASSERT_NOT_NULL(test_info, "Couldn't lookup memzone for " + TEST_ASSERT_NOT_NULL(mz, "Couldn't lookup memzone for " "test info"); + test_info = mz->addr; for (i = 0; i < NUM_TIMERS; i++) { rte_mempool_get(test_info->tim_mempool, (void **)&tim); diff -Nru dpdk-19.11.7/app/test-bbdev/test_bbdev_perf.c dpdk-19.11.10~rc1/app/test-bbdev/test_bbdev_perf.c --- dpdk-19.11.7/app/test-bbdev/test_bbdev_perf.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-bbdev/test_bbdev_perf.c 2021-08-18 14:45:29.000000000 +0000 @@ -327,14 +327,14 @@ if (nb_harq_inputs > cap->num_buffers_hard_out) { printf( "Too many HARQ inputs defined: %u, max: %u\n", - nb_hard_outputs, + nb_harq_inputs, cap->num_buffers_hard_out); return TEST_FAILED; } if (nb_harq_outputs > cap->num_buffers_hard_out) { printf( "Too many HARQ outputs defined: %u, max: %u\n", - nb_hard_outputs, + nb_harq_outputs, cap->num_buffers_hard_out); return TEST_FAILED; } diff -Nru dpdk-19.11.7/app/test-compress-perf/comp_perf_options_parse.c dpdk-19.11.10~rc1/app/test-compress-perf/comp_perf_options_parse.c --- dpdk-19.11.7/app/test-compress-perf/comp_perf_options_parse.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-compress-perf/comp_perf_options_parse.c 2021-08-18 14:45:29.000000000 +0000 @@ -598,7 +598,7 @@ switch (opt) { case 'h': usage(argv[0]); - rte_exit(EXIT_SUCCESS, "Displayed help\n"); + exit(EXIT_SUCCESS); break; /* long options */ case 0: diff -Nru dpdk-19.11.7/app/test-crypto-perf/cperf_options_parsing.c dpdk-19.11.10~rc1/app/test-crypto-perf/cperf_options_parsing.c --- dpdk-19.11.7/app/test-crypto-perf/cperf_options_parsing.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-crypto-perf/cperf_options_parsing.c 2021-08-18 14:45:29.000000000 +0000 @@ -495,6 +495,12 @@ { char *test_name = (char *) rte_zmalloc(NULL, sizeof(char) * (strlen(arg) + 3), 0); + if (test_name == NULL) { + RTE_LOG(ERR, USER1, "Failed to rte zmalloc with size: %zu\n", + strlen(arg) + 3); + return -1; + } + snprintf(test_name, strlen(arg) + 3, "[%s]", arg); opts->test_name = test_name; @@ -953,7 +959,7 @@ switch (opt) { case 'h': usage(argv[0]); - rte_exit(EXIT_SUCCESS, "Displayed help\n"); + exit(EXIT_SUCCESS); break; /* long options */ case 0: diff -Nru dpdk-19.11.7/app/test-crypto-perf/cperf_test_common.c dpdk-19.11.10~rc1/app/test-crypto-perf/cperf_test_common.c --- dpdk-19.11.7/app/test-crypto-perf/cperf_test_common.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-crypto-perf/cperf_test_common.c 2021-08-18 14:45:29.000000000 +0000 @@ -194,7 +194,7 @@ (mbuf_size * segments_nb); params.dst_buf_offset = *dst_buf_offset; /* Destination buffer will be one segment only */ - obj_size += max_size; + obj_size += max_size + sizeof(struct rte_mbuf); } *pool = rte_mempool_create_empty(pool_name, diff -Nru dpdk-19.11.7/app/test-eventdev/evt_options.c dpdk-19.11.10~rc1/app/test-eventdev/evt_options.c --- dpdk-19.11.7/app/test-eventdev/evt_options.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-eventdev/evt_options.c 2021-08-18 14:45:29.000000000 +0000 @@ -218,7 +218,7 @@ { int ret; - ret = parse_lcores_list(opt->plcores, corelist); + ret = parse_lcores_list(opt->plcores, RTE_MAX_LCORE, corelist); if (ret == -E2BIG) evt_err("duplicate lcores in plcores"); @@ -230,7 +230,7 @@ { int ret; - ret = parse_lcores_list(opt->wlcores, corelist); + ret = parse_lcores_list(opt->wlcores, RTE_MAX_LCORE, corelist); if (ret == -E2BIG) evt_err("duplicate lcores in wlcores"); diff -Nru dpdk-19.11.7/app/test-eventdev/parser.c dpdk-19.11.10~rc1/app/test-eventdev/parser.c --- dpdk-19.11.7/app/test-eventdev/parser.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-eventdev/parser.c 2021-08-18 14:45:29.000000000 +0000 @@ -310,7 +310,7 @@ } int -parse_lcores_list(bool lcores[], const char *corelist) +parse_lcores_list(bool lcores[], int lcores_num, const char *corelist) { int i, idx = 0; int min, max; @@ -332,6 +332,8 @@ if (*corelist == '\0') return -1; idx = strtoul(corelist, &end, 10); + if (idx < 0 || idx > lcores_num) + return -1; if (end == NULL) return -1; diff -Nru dpdk-19.11.7/app/test-eventdev/parser.h dpdk-19.11.10~rc1/app/test-eventdev/parser.h --- dpdk-19.11.7/app/test-eventdev/parser.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-eventdev/parser.h 2021-08-18 14:45:29.000000000 +0000 @@ -46,5 +46,5 @@ int parse_tokenize_string(char *string, char *tokens[], uint32_t *n_tokens); -int parse_lcores_list(bool lcores[], const char *corelist); +int parse_lcores_list(bool lcores[], int lcores_num, const char *corelist); #endif diff -Nru dpdk-19.11.7/app/test-pmd/bpf_cmd.c dpdk-19.11.10~rc1/app/test-pmd/bpf_cmd.c --- dpdk-19.11.7/app/test-pmd/bpf_cmd.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-pmd/bpf_cmd.c 2021-08-18 14:45:29.000000000 +0000 @@ -20,7 +20,7 @@ .name = RTE_STR(stdout), .type = RTE_BPF_XTYPE_VAR, .var = { - .val = &stdout, + .val = (void *)(uintptr_t)&stdout, .desc = { .type = RTE_BPF_ARG_PTR, .size = sizeof(stdout), diff -Nru dpdk-19.11.7/app/test-pmd/cmdline.c dpdk-19.11.10~rc1/app/test-pmd/cmdline.c --- dpdk-19.11.7/app/test-pmd/cmdline.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-pmd/cmdline.c 2021-08-18 14:45:29.000000000 +0000 @@ -1324,7 +1324,7 @@ cmdline_parse_inst_t cmd_operate_port = { .f = cmd_operate_port_parsed, .data = NULL, - .help_str = "port start|stop|close all: Start/Stop/Close/Reset all ports", + .help_str = "port start|stop|close|reset all: Start/Stop/Close/Reset all ports", .tokens = { (void *)&cmd_operate_port_all_cmd, (void *)&cmd_operate_port_all_port, @@ -1371,7 +1371,7 @@ cmdline_parse_inst_t cmd_operate_specific_port = { .f = cmd_operate_specific_port_parsed, .data = NULL, - .help_str = "port start|stop|close : Start/Stop/Close/Reset port_id", + .help_str = "port start|stop|close|reset : Start/Stop/Close/Reset port_id", .tokens = { (void *)&cmd_operate_specific_port_cmd, (void *)&cmd_operate_specific_port_port, @@ -1618,6 +1618,9 @@ } } + if (*speed != ETH_LINK_SPEED_AUTONEG) + *speed |= ETH_LINK_SPEED_FIXED; + return 0; } @@ -1701,13 +1704,13 @@ struct cmd_config_speed_specific *res = parsed_result; uint32_t link_speed; - if (!all_ports_stopped()) { - printf("Please stop all ports first\n"); + if (port_id_is_invalid(res->id, ENABLED_WARN)) return; - } - if (port_id_is_invalid(res->id, ENABLED_WARN)) + if (!port_is_stopped(res->id)) { + printf("Please stop port %d first\n", res->id); return; + } if (parse_and_check_speed_duplex(res->value1, res->value2, &link_speed) < 0) @@ -2846,6 +2849,10 @@ if (!numa_support || socket_id == NUMA_NO_CONFIG) socket_id = port->socket_id; + if (port->nb_tx_desc[res->qid] < tx_pkt_nb_segs) { + printf("Failed to setup TX queue: not enough descriptors\n"); + return; + } ret = rte_eth_tx_queue_setup(res->portid, res->qid, port->nb_tx_desc[res->qid], @@ -4461,7 +4468,7 @@ int k; /* Apply queue tx offloads configuration */ - for (k = 0; k < port->dev_info.max_rx_queues; k++) + for (k = 0; k < port->dev_info.max_tx_queues; k++) port->tx_conf[k].offloads = port->dev_conf.txmode.offloads; } @@ -9100,7 +9107,7 @@ /* *** CONFIGURE TUNNEL UDP PORT *** */ struct cmd_tunnel_udp_config { - cmdline_fixed_string_t cmd; + cmdline_fixed_string_t rx_vxlan_port; cmdline_fixed_string_t what; uint16_t udp_port; portid_t port_id; @@ -9116,9 +9123,7 @@ int ret; tunnel_udp.udp_port = res->udp_port; - - if (!strcmp(res->cmd, "rx_vxlan_port")) - tunnel_udp.prot_type = RTE_TUNNEL_TYPE_VXLAN; + tunnel_udp.prot_type = RTE_TUNNEL_TYPE_VXLAN; if (!strcmp(res->what, "add")) ret = rte_eth_dev_udp_tunnel_port_add(res->port_id, @@ -9131,9 +9136,9 @@ printf("udp tunneling add error: (%s)\n", strerror(-ret)); } -cmdline_parse_token_string_t cmd_tunnel_udp_config_cmd = +cmdline_parse_token_string_t cmd_tunnel_udp_config_rx_vxlan_port = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_udp_config, - cmd, "rx_vxlan_port"); + rx_vxlan_port, "rx_vxlan_port"); cmdline_parse_token_string_t cmd_tunnel_udp_config_what = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_udp_config, what, "add#rm"); @@ -9150,7 +9155,7 @@ .help_str = "rx_vxlan_port add|rm : " "Add/Remove a tunneling UDP port filter", .tokens = { - (void *)&cmd_tunnel_udp_config_cmd, + (void *)&cmd_tunnel_udp_config_rx_vxlan_port, (void *)&cmd_tunnel_udp_config_what, (void *)&cmd_tunnel_udp_config_udp_port, (void *)&cmd_tunnel_udp_config_port_id, @@ -19038,7 +19043,8 @@ rc = rte_eth_rx_descriptor_status(res->cmd_pid, res->cmd_qid, res->cmd_did); if (rc < 0) { - printf("Invalid queueid = %d\n", res->cmd_qid); + printf("Invalid input: queue id = %d, desc id = %d\n", + res->cmd_qid, res->cmd_did); return; } if (rc == RTE_ETH_RX_DESC_AVAIL) @@ -19051,7 +19057,8 @@ rc = rte_eth_tx_descriptor_status(res->cmd_pid, res->cmd_qid, res->cmd_did); if (rc < 0) { - printf("Invalid queueid = %d\n", res->cmd_qid); + printf("Invalid input: queue id = %d, desc id = %d\n", + res->cmd_qid, res->cmd_did); return; } if (rc == RTE_ETH_TX_DESC_FULL) diff -Nru dpdk-19.11.7/app/test-pmd/cmdline_flow.c dpdk-19.11.10~rc1/app/test-pmd/cmdline_flow.c --- dpdk-19.11.7/app/test-pmd/cmdline_flow.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-pmd/cmdline_flow.c 2021-08-18 14:45:29.000000000 +0000 @@ -4250,7 +4250,11 @@ .src_addr = nvgre_encap_conf.ipv4_src, .dst_addr = nvgre_encap_conf.ipv4_dst, }, - .item_nvgre.flow_id = 0, + .item_nvgre = { + .c_k_s_rsvd0_ver = RTE_BE16(0x2000), + .protocol = RTE_BE16(RTE_ETHER_TYPE_TEB), + .flow_id = 0, + }, }; memcpy(action_nvgre_encap_data->item_eth.dst.addr_bytes, nvgre_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN); diff -Nru dpdk-19.11.7/app/test-pmd/config.c dpdk-19.11.10~rc1/app/test-pmd/config.c --- dpdk-19.11.7/app/test-pmd/config.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-pmd/config.c 2021-08-18 14:45:29.000000000 +0000 @@ -2138,7 +2138,7 @@ void port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key, - uint hash_key_len) + uint8_t hash_key_len) { struct rte_eth_rss_conf rss_conf; int diag; @@ -2328,6 +2328,21 @@ } } +static uint16_t +get_fwd_port_total_tc_num(void) +{ + struct rte_eth_dcb_info dcb_info; + uint16_t total_tc_num = 0; + unsigned int i; + + for (i = 0; i < nb_fwd_ports; i++) { + (void)rte_eth_dev_get_dcb_info(fwd_ports_ids[i], &dcb_info); + total_tc_num += dcb_info.nb_tcs; + } + + return total_tc_num; +} + /** * For the DCB forwarding test, each core is assigned on each traffic class. * @@ -2347,12 +2362,42 @@ lcoreid_t lc_id; uint16_t nb_rx_queue, nb_tx_queue; uint16_t i, j, k, sm_id = 0; + uint16_t total_tc_num; + struct rte_port *port; uint8_t tc = 0; + portid_t pid; + int ret; + + /* + * The fwd_config_setup() is called when the port is RTE_PORT_STARTED + * or RTE_PORT_STOPPED. + * + * Re-configure ports to get updated mapping between tc and queue in + * case the queue number of the port is changed. Skip for started ports + * since modifying queue number and calling dev_configure need to stop + * ports first. + */ + for (pid = 0; pid < nb_fwd_ports; pid++) { + if (port_is_started(pid) == 1) + continue; + + port = &ports[pid]; + ret = rte_eth_dev_configure(pid, nb_rxq, nb_txq, + &port->dev_conf); + if (ret < 0) { + printf("Failed to re-configure port %d, ret = %d.\n", + pid, ret); + return; + } + } cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores; cur_fwd_config.nb_fwd_ports = nb_fwd_ports; cur_fwd_config.nb_fwd_streams = (streamid_t) (nb_rxq * cur_fwd_config.nb_fwd_ports); + total_tc_num = get_fwd_port_total_tc_num(); + if (cur_fwd_config.nb_fwd_lcores > total_tc_num) + cur_fwd_config.nb_fwd_lcores = total_tc_num; /* reinitialize forwarding streams */ init_fwd_streams(); @@ -2843,13 +2888,15 @@ RTE_ETH_FOREACH_DEV(port_id) { for (queue_id = 0; queue_id < nb_txq; queue_id++) { ret = get_tx_ring_size(port_id, queue_id, &ring_size); - - if (ret) - return true; - + if (ret) { + /* Port may not be initialized yet, can't say + * the port is invalid in this stage. + */ + continue; + } if (ring_size < nb_segs) { - printf("nb segments per TX packets=%u >= " - "TX queue(%u) ring_size=%u - ignored\n", + printf("nb segments per TX packets=%u >= TX " + "queue(%u) ring_size=%u - txpkts ignored\n", nb_segs, queue_id, ring_size); return true; } @@ -2865,12 +2912,26 @@ uint16_t tx_pkt_len; unsigned i; - if (nb_segs_is_invalid(nb_segs)) + /* + * For single segment settings failed check is ignored. + * It is a very basic capability to send the single segment + * packets, suppose it is always supported. + */ + if (nb_segs > 1 && nb_segs_is_invalid(nb_segs)) { + printf("Tx segment size(%u) is not supported - txpkts ignored\n", + nb_segs); return; + } + + if (nb_segs > RTE_MAX_SEGS_PER_PKT) { + printf("Tx segment size(%u) is bigger than max number of segment(%u)\n", + nb_segs, RTE_MAX_SEGS_PER_PKT); + return; + } /* * Check that each segment length is greater or equal than - * the mbuf data sise. + * the mbuf data size. * Check also that the total packet length is greater or equal than the * size of an empty UDP/IP packet (sizeof(struct rte_ether_hdr) + * 20 + 8). diff -Nru dpdk-19.11.7/app/test-pmd/csumonly.c dpdk-19.11.10~rc1/app/test-pmd/csumonly.c --- dpdk-19.11.7/app/test-pmd/csumonly.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-pmd/csumonly.c 2021-08-18 14:45:29.000000000 +0000 @@ -451,17 +451,18 @@ if (info->ethertype == _htons(RTE_ETHER_TYPE_IPV4)) { ipv4_hdr = l3_hdr; - ipv4_hdr->hdr_checksum = 0; ol_flags |= PKT_TX_IPV4; if (info->l4_proto == IPPROTO_TCP && tso_segsz) { ol_flags |= PKT_TX_IP_CKSUM; } else { - if (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) + if (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) { ol_flags |= PKT_TX_IP_CKSUM; - else + } else { + ipv4_hdr->hdr_checksum = 0; ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr); + } } } else if (info->ethertype == _htons(RTE_ETHER_TYPE_IPV6)) ol_flags |= PKT_TX_IPV6; @@ -472,10 +473,10 @@ udp_hdr = (struct rte_udp_hdr *)((char *)l3_hdr + info->l3_len); /* do not recalculate udp cksum if it was 0 */ if (udp_hdr->dgram_cksum != 0) { - udp_hdr->dgram_cksum = 0; - if (tx_offloads & DEV_TX_OFFLOAD_UDP_CKSUM) + if (tx_offloads & DEV_TX_OFFLOAD_UDP_CKSUM) { ol_flags |= PKT_TX_UDP_CKSUM; - else { + } else { + udp_hdr->dgram_cksum = 0; udp_hdr->dgram_cksum = get_udptcp_checksum(l3_hdr, udp_hdr, info->ethertype); @@ -485,12 +486,12 @@ ol_flags |= PKT_TX_UDP_SEG; } else if (info->l4_proto == IPPROTO_TCP) { tcp_hdr = (struct rte_tcp_hdr *)((char *)l3_hdr + info->l3_len); - tcp_hdr->cksum = 0; if (tso_segsz) ol_flags |= PKT_TX_TCP_SEG; - else if (tx_offloads & DEV_TX_OFFLOAD_TCP_CKSUM) + else if (tx_offloads & DEV_TX_OFFLOAD_TCP_CKSUM) { ol_flags |= PKT_TX_TCP_CKSUM; - else { + } else { + tcp_hdr->cksum = 0; tcp_hdr->cksum = get_udptcp_checksum(l3_hdr, tcp_hdr, info->ethertype); @@ -500,13 +501,13 @@ } else if (info->l4_proto == IPPROTO_SCTP) { sctp_hdr = (struct rte_sctp_hdr *) ((char *)l3_hdr + info->l3_len); - sctp_hdr->cksum = 0; /* sctp payload must be a multiple of 4 to be * offloaded */ if ((tx_offloads & DEV_TX_OFFLOAD_SCTP_CKSUM) && ((ipv4_hdr->total_length & 0x3) == 0)) { ol_flags |= PKT_TX_SCTP_CKSUM; } else { + sctp_hdr->cksum = 0; /* XXX implement CRC32c, example available in * RFC3309 */ } diff -Nru dpdk-19.11.7/app/test-pmd/parameters.c dpdk-19.11.10~rc1/app/test-pmd/parameters.c --- dpdk-19.11.7/app/test-pmd/parameters.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-pmd/parameters.c 2021-08-18 14:45:29.000000000 +0000 @@ -694,7 +694,7 @@ case 0: /*long options */ if (!strcmp(lgopts[opt_idx].name, "help")) { usage(argv[0]); - rte_exit(EXIT_SUCCESS, "Displayed help\n"); + exit(EXIT_SUCCESS); } #ifdef RTE_LIBRTE_CMDLINE if (!strcmp(lgopts[opt_idx].name, "interactive")) { @@ -1356,7 +1356,7 @@ break; case 'h': usage(argv[0]); - rte_exit(EXIT_SUCCESS, "Displayed help\n"); + exit(EXIT_SUCCESS); break; default: usage(argv[0]); diff -Nru dpdk-19.11.7/app/test-pmd/testpmd.c dpdk-19.11.10~rc1/app/test-pmd/testpmd.c --- dpdk-19.11.7/app/test-pmd/testpmd.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-pmd/testpmd.c 2021-08-18 14:45:29.000000000 +0000 @@ -228,9 +228,6 @@ /* current configuration is in DCB or not,0 means it is not in DCB mode */ uint8_t dcb_config = 0; -/* Whether the dcb is in testing status */ -uint8_t dcb_test = 0; - /* * Configurable number of RX/TX queues. */ @@ -1293,22 +1290,68 @@ } static void +init_config_port_offloads(portid_t pid, uint32_t socket_id) +{ + struct rte_port *port = &ports[pid]; + uint16_t data_size; + int ret; + int i; + + port->dev_conf.txmode = tx_mode; + port->dev_conf.rxmode = rx_mode; + + ret = eth_dev_info_get_print_err(pid, &port->dev_info); + if (ret != 0) + rte_exit(EXIT_FAILURE, "rte_eth_dev_info_get() failed\n"); + + ret = update_jumbo_frame_offload(pid); + if (ret != 0) + printf("Updating jumbo frame offload failed for port %u\n", + pid); + + if (!(port->dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)) + port->dev_conf.txmode.offloads &= + ~DEV_TX_OFFLOAD_MBUF_FAST_FREE; + + /* Apply Rx offloads configuration */ + for (i = 0; i < port->dev_info.max_rx_queues; i++) + port->rx_conf[i].offloads = port->dev_conf.rxmode.offloads; + /* Apply Tx offloads configuration */ + for (i = 0; i < port->dev_info.max_tx_queues; i++) + port->tx_conf[i].offloads = port->dev_conf.txmode.offloads; + + /* set flag to initialize port/queue */ + port->need_reconfig = 1; + port->need_reconfig_queues = 1; + port->socket_id = socket_id; + port->tx_metadata = 0; + + /* + * Check for maximum number of segments per MTU. + * Accordingly update the mbuf data size. + */ + if (port->dev_info.rx_desc_lim.nb_mtu_seg_max != UINT16_MAX && + port->dev_info.rx_desc_lim.nb_mtu_seg_max != 0) { + data_size = rx_mode.max_rx_pkt_len / + port->dev_info.rx_desc_lim.nb_mtu_seg_max; + + if ((data_size + RTE_PKTMBUF_HEADROOM) > mbuf_data_size) { + mbuf_data_size = data_size + RTE_PKTMBUF_HEADROOM; + TESTPMD_LOG(WARNING, "Configured mbuf size %hu\n", + mbuf_data_size); + } + } +} + +static void init_config(void) { portid_t pid; - struct rte_port *port; struct rte_mempool *mbp; unsigned int nb_mbuf_per_pool; lcoreid_t lc_id; - uint8_t port_per_socket[RTE_MAX_NUMA_NODES]; struct rte_gro_param gro_param; uint32_t gso_types; - uint16_t data_size; - bool warning = 0; - int k; - int ret; - - memset(port_per_socket,0,RTE_MAX_NUMA_NODES); /* Configuration of logical cores. */ fwd_lcores = rte_zmalloc("testpmd: fwd_lcores", @@ -1330,30 +1373,12 @@ } RTE_ETH_FOREACH_DEV(pid) { - port = &ports[pid]; - /* Apply default TxRx configuration for all ports */ - port->dev_conf.txmode = tx_mode; - port->dev_conf.rxmode = rx_mode; - - ret = eth_dev_info_get_print_err(pid, &port->dev_info); - if (ret != 0) - rte_exit(EXIT_FAILURE, - "rte_eth_dev_info_get() failed\n"); + uint32_t socket_id; - ret = update_jumbo_frame_offload(pid); - if (ret != 0) - printf("Updating jumbo frame offload failed for port %u\n", - pid); - - if (!(port->dev_info.tx_offload_capa & - DEV_TX_OFFLOAD_MBUF_FAST_FREE)) - port->dev_conf.txmode.offloads &= - ~DEV_TX_OFFLOAD_MBUF_FAST_FREE; if (numa_support) { - if (port_numa[pid] != NUMA_NO_CONFIG) - port_per_socket[port_numa[pid]]++; - else { - uint32_t socket_id = rte_eth_dev_socket_id(pid); + socket_id = port_numa[pid]; + if (port_numa[pid] == NUMA_NO_CONFIG) { + socket_id = rte_eth_dev_socket_id(pid); /* * if socket_id is invalid, @@ -1361,45 +1386,15 @@ */ if (check_socket_id(socket_id) < 0) socket_id = socket_ids[0]; - port_per_socket[socket_id]++; - } - } - - /* Apply Rx offloads configuration */ - for (k = 0; k < port->dev_info.max_rx_queues; k++) - port->rx_conf[k].offloads = - port->dev_conf.rxmode.offloads; - /* Apply Tx offloads configuration */ - for (k = 0; k < port->dev_info.max_tx_queues; k++) - port->tx_conf[k].offloads = - port->dev_conf.txmode.offloads; - - /* set flag to initialize port/queue */ - port->need_reconfig = 1; - port->need_reconfig_queues = 1; - port->tx_metadata = 0; - - /* Check for maximum number of segments per MTU. Accordingly - * update the mbuf data size. - */ - if (port->dev_info.rx_desc_lim.nb_mtu_seg_max != UINT16_MAX && - port->dev_info.rx_desc_lim.nb_mtu_seg_max != 0) { - data_size = rx_mode.max_rx_pkt_len / - port->dev_info.rx_desc_lim.nb_mtu_seg_max; - - if ((data_size + RTE_PKTMBUF_HEADROOM) > - mbuf_data_size) { - mbuf_data_size = data_size + - RTE_PKTMBUF_HEADROOM; - warning = 1; } + } else { + socket_id = (socket_num == UMA_NO_CONFIG) ? + 0 : socket_num; } + /* Apply default TxRx configuration for all ports */ + init_config_port_offloads(pid, socket_id); } - if (warning) - TESTPMD_LOG(WARNING, "Configured mbuf size %hu\n", - mbuf_data_size); - /* * Create pools of mbuf. * If NUMA support is disabled, create a single pool of mbuf in @@ -1482,7 +1477,7 @@ #if defined RTE_LIBRTE_PMD_SOFTNIC if (strcmp(cur_fwd_eng->fwd_mode_name, "softnic") == 0) { RTE_ETH_FOREACH_DEV(pid) { - port = &ports[pid]; + struct rte_port *port = &ports[pid]; const char *driver = port->dev_info.driver_name; if (strcmp(driver, "net_softnic") == 0) @@ -1497,21 +1492,8 @@ void reconfig(portid_t new_port_id, unsigned socket_id) { - struct rte_port *port; - int ret; - /* Reconfiguration of Ethernet ports. */ - port = &ports[new_port_id]; - - ret = eth_dev_info_get_print_err(new_port_id, &port->dev_info); - if (ret != 0) - return; - - /* set flag to initialize port/queue */ - port->need_reconfig = 1; - port->need_reconfig_queues = 1; - port->socket_id = socket_id; - + init_config_port_offloads(new_port_id, socket_id); init_port_config(); } @@ -2105,8 +2087,7 @@ return; } - - if(dcb_test) { + if (dcb_config) { for (i = 0; i < nb_fwd_ports; i++) { pt_id = fwd_ports_ids[i]; port = &ports[pt_id]; @@ -2321,14 +2302,11 @@ portid_t pi; queueid_t qi; struct rte_port *port; - struct rte_ether_addr mac_addr; struct rte_eth_hairpin_cap cap; if (port_id_is_invalid(pid, ENABLED_WARN)) return 0; - if(dcb_config) - dcb_test = 1; RTE_ETH_FOREACH_DEV(pi) { if (pid != pi && pid != (portid_t)RTE_PORT_ALL) continue; @@ -2487,11 +2465,14 @@ RTE_PORT_HANDLING, RTE_PORT_STARTED) == 0) printf("Port %d can not be set into started\n", pi); - if (eth_macaddr_get_print_err(pi, &mac_addr) == 0) + if (eth_macaddr_get_print_err(pi, &port->eth_addr) == 0) printf("Port %d: %02X:%02X:%02X:%02X:%02X:%02X\n", pi, - mac_addr.addr_bytes[0], mac_addr.addr_bytes[1], - mac_addr.addr_bytes[2], mac_addr.addr_bytes[3], - mac_addr.addr_bytes[4], mac_addr.addr_bytes[5]); + port->eth_addr.addr_bytes[0], + port->eth_addr.addr_bytes[1], + port->eth_addr.addr_bytes[2], + port->eth_addr.addr_bytes[3], + port->eth_addr.addr_bytes[4], + port->eth_addr.addr_bytes[5]); /* at least one port started, need checking link status */ need_check_link_status = 1; @@ -2513,11 +2494,6 @@ struct rte_port *port; int need_check_link_status = 0; - if (dcb_test) { - dcb_test = 0; - dcb_config = 0; - } - if (port_id_is_invalid(pid, ENABLED_WARN)) return; @@ -3499,8 +3475,6 @@ rte_port = &ports[pid]; memset(&port_conf, 0, sizeof(struct rte_eth_conf)); - /* Enter DCB configuration status */ - dcb_config = 1; port_conf.rxmode = rte_port->dev_conf.rxmode; port_conf.txmode = rte_port->dev_conf.txmode; @@ -3570,6 +3544,9 @@ rte_port->dcb_flag = 1; + /* Enter DCB configuration status */ + dcb_config = 1; + return 0; } diff -Nru dpdk-19.11.7/app/test-pmd/testpmd.h dpdk-19.11.10~rc1/app/test-pmd/testpmd.h --- dpdk-19.11.7/app/test-pmd/testpmd.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/app/test-pmd/testpmd.h 2021-08-18 14:45:29.000000000 +0000 @@ -404,7 +404,6 @@ extern uint64_t noisy_lkup_num_reads_writes; extern uint8_t dcb_config; -extern uint8_t dcb_test; extern uint16_t mbuf_data_size; /**< Mbuf data space size. */ extern uint32_t param_total_num_mbufs; @@ -820,7 +819,7 @@ void port_rss_hash_conf_show(portid_t port_id, int show_rss_key); void port_rss_hash_key_update(portid_t port_id, char rss_type[], - uint8_t *hash_key, uint hash_key_len); + uint8_t *hash_key, uint8_t hash_key_len); int rx_queue_id_is_invalid(queueid_t rxq_id); int tx_queue_id_is_invalid(queueid_t txq_id); void setup_gro(const char *onoff, portid_t port_id); diff -Nru dpdk-19.11.7/buildtools/check-experimental-syms.sh dpdk-19.11.10~rc1/buildtools/check-experimental-syms.sh --- dpdk-19.11.7/buildtools/check-experimental-syms.sh 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/buildtools/check-experimental-syms.sh 2021-08-18 14:45:29.000000000 +0000 @@ -18,7 +18,7 @@ exit 0 fi -DUMPFILE=$(mktemp -t dpdk.${0##*/}.XXX.objdump) +DUMPFILE=$(mktemp -t dpdk.${0##*/}.objdump.XXXXXX) trap 'rm -f "$DUMPFILE"' EXIT objdump -t $OBJFILE >$DUMPFILE diff -Nru dpdk-19.11.7/buildtools/map-list-symbol.sh dpdk-19.11.10~rc1/buildtools/map-list-symbol.sh --- dpdk-19.11.7/buildtools/map-list-symbol.sh 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/buildtools/map-list-symbol.sh 2021-08-18 14:45:29.000000000 +0000 @@ -44,7 +44,7 @@ ret = 1; } } - /^.*{/ { + /^.*\{/ { if ("'$section'" == "all" || $1 == "'$section'") { current_section = $1; } diff -Nru dpdk-19.11.7/buildtools/pkg-config/meson.build dpdk-19.11.10~rc1/buildtools/pkg-config/meson.build --- dpdk-19.11.7/buildtools/pkg-config/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/buildtools/pkg-config/meson.build 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2020 Intel Corporation - -pkg = import('pkgconfig') -pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args -if is_freebsd - pkg_extra_cflags += ['-D__BSD_VISIBLE'] -endif - -# When calling pkg-config --static --libs, pkg-config will always output the -# regular libs first, and then the extra libs from Libs.private field, -# since the assumption is that those are additional dependencies for building -# statically that the .a files depend upon. The output order of .pc fields is: -# Libs Libs.private Requires Requires.private -# The fields Requires* are for package names. -# The flags of the DPDK libraries must be defined in Libs* fields. -# However, the DPDK drivers are linked only in static builds (Libs.private), -# and those need to come *before* the regular libraries (Libs field). -# This requirement is satisfied by moving the regular libs in a separate file -# included in the field Requires (after Libs.private). -# Another requirement is to allow linking dependencies as shared libraries, -# while linking static DPDK libraries and drivers. It is satisfied by -# listing the static files in Libs.private with the explicit syntax -l:libfoo.a. -# As a consequence, the regular DPDK libraries are already listed as static -# in the field Libs.private. The second occurences of DPDK libraries, -# included from Requires and used for shared library linkage case, -# are skipped in the case of static linkage thanks to the flag --as-needed. - - -pkg.generate(name: 'dpdk-libs', - filebase: 'libdpdk-libs', - description: '''Internal-only DPDK pkgconfig file. Not for direct use. -Use libdpdk.pc instead of this file to query DPDK compile/link arguments''', - version: meson.project_version(), - subdirs: [get_option('include_subdir_arch'), '.'], - extra_cflags: pkg_extra_cflags, - libraries: ['-Wl,--as-needed'] + dpdk_libraries, - libraries_private: dpdk_extra_ldflags) - -platform_flags = [] -if not is_windows - platform_flags += ['-Wl,--export-dynamic'] # ELF only -endif -pkg.generate(name: 'DPDK', # main DPDK pkgconfig file - filebase: 'libdpdk', - version: meson.project_version(), - description: '''The Data Plane Development Kit (DPDK). -Note that CFLAGS might contain an -march flag higher than typical baseline. -This is required for a number of static inline functions in the public headers.''', - requires: ['libdpdk-libs', libbsd], # may need libbsd for string funcs - # if libbsd is not enabled, then this is blank - libraries_private: ['-Wl,--whole-archive'] + - dpdk_drivers + dpdk_static_libraries + - ['-Wl,--no-whole-archive'] + platform_flags -) - -# For static linking with dependencies as shared libraries, -# the internal static libraries must be flagged explicitly. -run_command(py3, 'set-static-linker-flags.py', check: true) diff -Nru dpdk-19.11.7/buildtools/pkg-config/set-static-linker-flags.py dpdk-19.11.10~rc1/buildtools/pkg-config/set-static-linker-flags.py --- dpdk-19.11.7/buildtools/pkg-config/set-static-linker-flags.py 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/buildtools/pkg-config/set-static-linker-flags.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2020 Intel Corporation - -# Script to fix flags for static linking in pkgconfig files from meson -# Should be called from meson build itself -import os -import sys - - -def fix_ldflag(f): - if not f.startswith('-lrte_'): - return f - return '-l:lib' + f[2:] + '.a' - - -def fix_libs_private(line): - if not line.startswith('Libs.private'): - return line - ldflags = [fix_ldflag(flag) for flag in line.split()] - return ' '.join(ldflags) + '\n' - - -def process_pc_file(filepath): - print('Processing', filepath) - with open(filepath) as src: - lines = src.readlines() - with open(filepath, 'w') as dst: - dst.writelines([fix_libs_private(line) for line in lines]) - - -if 'MESON_BUILD_ROOT' not in os.environ: - print('This script must be called from a meson build environment') - sys.exit(1) -for root, dirs, files in os.walk(os.environ['MESON_BUILD_ROOT']): - pc_files = [f for f in files if f.endswith('.pc')] - for f in pc_files: - process_pc_file(os.path.join(root, f)) diff -Nru dpdk-19.11.7/config/meson.build dpdk-19.11.10~rc1/config/meson.build --- dpdk-19.11.7/config/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/config/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -121,11 +121,8 @@ dpdk_extra_ldflags += '-lm' endif -# for linux link against dl, for bsd execinfo if is_linux link_lib = 'dl' -elif is_freebsd - link_lib = 'execinfo' else link_lib = '' endif @@ -155,6 +152,12 @@ dpdk_extra_ldflags += '-lfdt' endif +libexecinfo = cc.find_library('libexecinfo', required: false) +if libexecinfo.found() and cc.has_header('execinfo.h') + add_project_link_arguments('-lexecinfo', language: 'c') + dpdk_extra_ldflags += '-lexecinfo' +endif + # check for libbsd libbsd = dependency('libbsd', required: false, method: 'pkg-config') if libbsd.found() diff -Nru dpdk-19.11.7/config/ppc_64/meson.build dpdk-19.11.10~rc1/config/ppc_64/meson.build --- dpdk-19.11.7/config/ppc_64/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/config/ppc_64/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -17,9 +17,20 @@ dpdk_conf.set('RTE_MACHINE','power8') endif -# overrides specific to ppc64 -dpdk_conf.set('RTE_MAX_LCORE', 1536) -dpdk_conf.set('RTE_MAX_NUMA_NODES', 32) +# Certain POWER9 systems can scale as high as 1536 LCORES, but setting such a +# high value can waste memory, cause timeouts in time limited autotests, and is +# unlikely to be used in many production situations. Similarly, keeping the +# default 64 LCORES seems too small as most POWER9 dual socket systems will have +# at least 128 LCORES available. Set RTE_MAX_LCORE to 128 for POWER systems as +# a compromise. +dpdk_conf.set('RTE_MAX_LCORE', 128) + +# POWER systems do not allocate NUMA nodes sequentially. A dual socket system +# will have CPUs associated with NUMA nodes 0 & 8, so ensure that the second +# NUMA node will be supported by setting RTE_MAX_NUMA_NODES to 16. High end +# systems can scale even higher with as many as 32 NUMA nodes. +dpdk_conf.set('RTE_MAX_NUMA_NODES', 16) + dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128) dpdk_conf.set('RTE_MACHINE_CPUFLAG_ALTIVEC', 1) dpdk_conf.set('RTE_MACHINE_CPUFLAG_VSX', 1) diff -Nru dpdk-19.11.7/debian/changelog dpdk-19.11.10~rc1/debian/changelog --- dpdk-19.11.7/debian/changelog 2021-02-23 10:03:38.000000000 +0000 +++ dpdk-19.11.10~rc1/debian/changelog 2021-08-24 09:51:47.000000000 +0000 @@ -1,4 +1,14 @@ -dpdk (19.11.7-0ubuntu0.20.04.1~focalppa1) focal; urgency=medium +dpdk (19.11.10~rc1-0ubuntu0.20.04.1~focalppa1) focal; urgency=medium + + * Merge the latest upstream stable minor release 19.11.10-rc1 + Release notes available at: + https://doc.dpdk.org/guides-19.11/rel_notes/release_19_11.html + * Revert "fix linking back to pre be like 19.11.6 behavior (LP 1920141)" + [now part of upstream] + + -- Christian Ehrhardt Tue, 24 Aug 2021 11:51:47 +0200 + +dpdk (19.11.7-0ubuntu0.20.04.1) focal; urgency=medium * Merge the latest upstream stable minor release 19.11.7-rc1 19.11.7 at https://doc.dpdk.org/guides-19.11/rel_notes/release_19_11.html diff -Nru dpdk-19.11.7/debian/patches/lp-1920141-01-Revert-Revert-Revert-build-pkg-config-prevent-overli.patch dpdk-19.11.10~rc1/debian/patches/lp-1920141-01-Revert-Revert-Revert-build-pkg-config-prevent-overli.patch --- dpdk-19.11.7/debian/patches/lp-1920141-01-Revert-Revert-Revert-build-pkg-config-prevent-overli.patch 2021-02-23 10:03:38.000000000 +0000 +++ dpdk-19.11.10~rc1/debian/patches/lp-1920141-01-Revert-Revert-Revert-build-pkg-config-prevent-overli.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -From 9a776641702dcfdccc53feff143b4d3fea3d84f8 Mon Sep 17 00:00:00 2001 -From: Christian Ehrhardt -Date: Mon, 22 Mar 2021 10:51:03 +0100 -Subject: [PATCH 1/7] Revert "Revert "Revert "build/pkg-config: prevent - overlinking""" - -This reverts commit f49248a990b5c34938c5246e013bc82f1296959f. -This series changes linking behavior in 19.11.x and thereby should stay -out. It breaks - for example - a rebuild of OVS 2.13 or builds -of later OVS 2.13.x stable releases. - -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1920141 -Forwarded: http://mails.dpdk.org/archives/stable/2021-March/029484.html -Last-Update: 2021-03-22 ---- - buildtools/pkg-config/meson.build | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - -diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build -index 39a8fd1c8e..63a76b56d3 100644 ---- a/buildtools/pkg-config/meson.build -+++ b/buildtools/pkg-config/meson.build -@@ -21,11 +21,6 @@ endif - # Another requirement is to allow linking dependencies as shared libraries, - # while linking static DPDK libraries and drivers. It is satisfied by - # listing the static files in Libs.private with the explicit syntax -l:libfoo.a. --# As a consequence, the regular DPDK libraries are already listed as static --# in the field Libs.private. The second occurences of DPDK libraries, --# included from Requires and used for shared library linkage case, --# are skipped in the case of static linkage thanks to the flag --as-needed. -- - - pkg.generate(name: 'dpdk-libs', - filebase: 'libdpdk-libs', -@@ -34,7 +29,7 @@ Use libdpdk.pc instead of this file to query DPDK compile/link arguments''', - version: meson.project_version(), - subdirs: [get_option('include_subdir_arch'), '.'], - extra_cflags: pkg_extra_cflags, -- libraries: ['-Wl,--as-needed'] + dpdk_libraries, -+ libraries: dpdk_libraries, - libraries_private: dpdk_extra_ldflags) - - platform_flags = [] --- -2.30.0 - diff -Nru dpdk-19.11.7/debian/patches/lp-1920141-02-Revert-Revert-Revert-build-pkg-config-improve-static.patch dpdk-19.11.10~rc1/debian/patches/lp-1920141-02-Revert-Revert-Revert-build-pkg-config-improve-static.patch --- dpdk-19.11.7/debian/patches/lp-1920141-02-Revert-Revert-Revert-build-pkg-config-improve-static.patch 2021-02-23 10:03:38.000000000 +0000 +++ dpdk-19.11.10~rc1/debian/patches/lp-1920141-02-Revert-Revert-Revert-build-pkg-config-improve-static.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,708 +0,0 @@ -From 44763bcba2cd7853065458db6dd214b47ac91a1c Mon Sep 17 00:00:00 2001 -From: Christian Ehrhardt -Date: Mon, 22 Mar 2021 10:56:06 +0100 -Subject: [PATCH 2/7] Revert "Revert "Revert "build/pkg-config: improve static - linking flags""" - -This reverts commit 39586a4cf0e320a15392342411532e398e0c5c8d. -This series changes linking behavior in 19.11.x and thereby should stay -out. It breaks - for example - a rebuild of OVS 2.13 or builds -of later OVS 2.13.x stable releases. - -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1920141 -Forwarded: http://mails.dpdk.org/archives/stable/2021-March/029484.html -Last-Update: 2021-03-22 ---- - buildtools/pkg-config/meson.build | 16 +++----- - .../pkg-config/set-static-linker-flags.py | 38 ------------------- - doc/build-sdk-meson.txt | 2 +- - examples/bbdev_app/Makefile | 2 +- - examples/bond/Makefile | 2 +- - examples/cmdline/Makefile | 2 +- - examples/distributor/Makefile | 2 +- - examples/eventdev_pipeline/Makefile | 2 +- - examples/fips_validation/Makefile | 2 +- - examples/flow_classify/Makefile | 2 +- - examples/flow_filtering/Makefile | 2 +- - examples/helloworld/Makefile | 2 +- - examples/ioat/Makefile | 2 +- - examples/ip_fragmentation/Makefile | 2 +- - examples/ip_pipeline/Makefile | 2 +- - examples/ip_reassembly/Makefile | 2 +- - examples/ipsec-secgw/Makefile | 2 +- - examples/ipv4_multicast/Makefile | 2 +- - examples/kni/Makefile | 2 +- - examples/l2fwd-cat/Makefile | 2 +- - examples/l2fwd-crypto/Makefile | 2 +- - examples/l2fwd-event/Makefile | 2 +- - examples/l2fwd-jobstats/Makefile | 2 +- - examples/l2fwd-keepalive/Makefile | 2 +- - examples/l2fwd/Makefile | 2 +- - examples/l3fwd-acl/Makefile | 2 +- - examples/l3fwd-power/Makefile | 2 +- - examples/l3fwd/Makefile | 2 +- - examples/link_status_interrupt/Makefile | 2 +- - examples/ntb/Makefile | 2 +- - examples/packet_ordering/Makefile | 2 +- - examples/ptpclient/Makefile | 2 +- - examples/qos_meter/Makefile | 2 +- - examples/qos_sched/Makefile | 2 +- - examples/rxtx_callbacks/Makefile | 2 +- - examples/service_cores/Makefile | 2 +- - examples/skeleton/Makefile | 2 +- - examples/tep_termination/Makefile | 2 +- - examples/timer/Makefile | 2 +- - examples/vdpa/Makefile | 2 +- - examples/vhost/Makefile | 2 +- - examples/vhost_blk/Makefile | 2 +- - examples/vhost_crypto/Makefile | 2 +- - examples/vmdq/Makefile | 2 +- - examples/vmdq_dcb/Makefile | 2 +- - 45 files changed, 49 insertions(+), 91 deletions(-) - delete mode 100644 buildtools/pkg-config/set-static-linker-flags.py - -diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build -index 63a76b56d3..ccb34dcab3 100644 ---- a/buildtools/pkg-config/meson.build -+++ b/buildtools/pkg-config/meson.build -@@ -1,6 +1,10 @@ - # SPDX-License-Identifier: BSD-3-Clause - # Copyright(c) 2020 Intel Corporation - -+# for static builds, include the drivers as libs and we need to "whole-archive" -+# them. -+dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive'] -+ - pkg = import('pkgconfig') - pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args - if is_freebsd -@@ -18,9 +22,6 @@ endif - # and those need to come *before* the regular libraries (Libs field). - # This requirement is satisfied by moving the regular libs in a separate file - # included in the field Requires (after Libs.private). --# Another requirement is to allow linking dependencies as shared libraries, --# while linking static DPDK libraries and drivers. It is satisfied by --# listing the static files in Libs.private with the explicit syntax -l:libfoo.a. - - pkg.generate(name: 'dpdk-libs', - filebase: 'libdpdk-libs', -@@ -44,11 +45,6 @@ Note that CFLAGS might contain an -march flag higher than typical baseline. - This is required for a number of static inline functions in the public headers.''', - requires: ['libdpdk-libs', libbsd], # may need libbsd for string funcs - # if libbsd is not enabled, then this is blank -- libraries_private: ['-Wl,--whole-archive'] + -- dpdk_drivers + dpdk_static_libraries + -- ['-Wl,--no-whole-archive'] + platform_flags -+ libraries_private: dpdk_drivers + dpdk_static_libraries + -+ ['-Wl,-Bdynamic'] + platform_flags - ) -- --# For static linking with dependencies as shared libraries, --# the internal static libraries must be flagged explicitly. --run_command(py3, 'set-static-linker-flags.py', check: true) -diff --git a/buildtools/pkg-config/set-static-linker-flags.py b/buildtools/pkg-config/set-static-linker-flags.py -deleted file mode 100644 -index 2745db34c2..0000000000 ---- a/buildtools/pkg-config/set-static-linker-flags.py -+++ /dev/null -@@ -1,38 +0,0 @@ --#!/usr/bin/env python3 --# SPDX-License-Identifier: BSD-3-Clause --# Copyright(c) 2020 Intel Corporation -- --# Script to fix flags for static linking in pkgconfig files from meson --# Should be called from meson build itself --import os --import sys -- -- --def fix_ldflag(f): -- if not f.startswith('-lrte_'): -- return f -- return '-l:lib' + f[2:] + '.a' -- -- --def fix_libs_private(line): -- if not line.startswith('Libs.private'): -- return line -- ldflags = [fix_ldflag(flag) for flag in line.split()] -- return ' '.join(ldflags) + '\n' -- -- --def process_pc_file(filepath): -- print('Processing', filepath) -- with open(filepath) as src: -- lines = src.readlines() -- with open(filepath, 'w') as dst: -- dst.writelines([fix_libs_private(line) for line in lines]) -- -- --if 'MESON_BUILD_ROOT' not in os.environ: -- print('This script must be called from a meson build environment') -- sys.exit(1) --for root, dirs, files in os.walk(os.environ['MESON_BUILD_ROOT']): -- pc_files = [f for f in files if f.endswith('.pc')] -- for f in pc_files: -- process_pc_file(os.path.join(root, f)) -diff --git a/doc/build-sdk-meson.txt b/doc/build-sdk-meson.txt -index 8fb60a7c11..61c8e3515c 100644 ---- a/doc/build-sdk-meson.txt -+++ b/doc/build-sdk-meson.txt -@@ -190,7 +190,7 @@ From examples/helloworld/Makefile:: - PC_FILE := $(shell pkg-config --path libdpdk) - CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) - LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -- LDFLAGS_STATIC = $(shell pkg-config --static --libs libdpdk) -+ LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/bbdev_app/Makefile b/examples/bbdev_app/Makefile -index 3c8eb75a4e..ead3f016b8 100644 ---- a/examples/bbdev_app/Makefile -+++ b/examples/bbdev_app/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -DALLOW_EXPERIMENTAL_API - -diff --git a/examples/bond/Makefile b/examples/bond/Makefile -index 4e4289e151..2030ca410a 100644 ---- a/examples/bond/Makefile -+++ b/examples/bond/Makefile -@@ -24,7 +24,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -DALLOW_EXPERIMENTAL_API - -diff --git a/examples/cmdline/Makefile b/examples/cmdline/Makefile -index 9418b50b87..0b6b54540a 100644 ---- a/examples/cmdline/Makefile -+++ b/examples/cmdline/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile -index 5253780793a..4192d8a4ae 100644 ---- a/examples/distributor/Makefile -+++ b/examples/distributor/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/eventdev_pipeline/Makefile b/examples/eventdev_pipeline/Makefile -index 95a8d0884a..96cd244378 100644 ---- a/examples/eventdev_pipeline/Makefile -+++ b/examples/eventdev_pipeline/Makefile -@@ -24,7 +24,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/fips_validation/Makefile b/examples/fips_validation/Makefile -index 5bcf1872c4..e5ae22b521 100644 ---- a/examples/fips_validation/Makefile -+++ b/examples/fips_validation/Makefile -@@ -31,7 +31,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -DALLOW_EXPERIMENTAL_API - -diff --git a/examples/flow_classify/Makefile b/examples/flow_classify/Makefile -index 161d576b60..6864941b3e 100644 ---- a/examples/flow_classify/Makefile -+++ b/examples/flow_classify/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -DALLOW_EXPERIMENTAL_API - -diff --git a/examples/flow_filtering/Makefile b/examples/flow_filtering/Makefile -index 0ce20d3485..6c51c0b7a0 100644 ---- a/examples/flow_filtering/Makefile -+++ b/examples/flow_filtering/Makefile -@@ -20,7 +20,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/helloworld/Makefile b/examples/helloworld/Makefile -index 9a07f89efc..16d82b02f0 100644 ---- a/examples/helloworld/Makefile -+++ b/examples/helloworld/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/ioat/Makefile b/examples/ioat/Makefile -index dd4930136e..ef63f5d689 100644 ---- a/examples/ioat/Makefile -+++ b/examples/ioat/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/ip_fragmentation/Makefile b/examples/ip_fragmentation/Makefile -index d200cc627d..ede0c4f02b 100644 ---- a/examples/ip_fragmentation/Makefile -+++ b/examples/ip_fragmentation/Makefile -@@ -23,7 +23,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile -index b8e086267b..1e404ff5d0 100644 ---- a/examples/ip_pipeline/Makefile -+++ b/examples/ip_pipeline/Makefile -@@ -35,7 +35,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -I. -DALLOW_EXPERIMENTAL_API -D_GNU_SOURCE - -diff --git a/examples/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile -index c7424da2b7..3f2888b338 100644 ---- a/examples/ip_reassembly/Makefile -+++ b/examples/ip_reassembly/Makefile -@@ -23,7 +23,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/ipsec-secgw/Makefile b/examples/ipsec-secgw/Makefile -index 38c456daa2..a4977f61f8 100644 ---- a/examples/ipsec-secgw/Makefile -+++ b/examples/ipsec-secgw/Makefile -@@ -33,7 +33,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -DALLOW_EXPERIMENTAL_API - -diff --git a/examples/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile -index 5e34bbba00..92d3db0f4d 100644 ---- a/examples/ipv4_multicast/Makefile -+++ b/examples/ipv4_multicast/Makefile -@@ -23,7 +23,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/kni/Makefile b/examples/kni/Makefile -index 10b42891da..f687765510 100644 ---- a/examples/kni/Makefile -+++ b/examples/kni/Makefile -@@ -23,7 +23,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - CFLAGS += -DALLOW_EXPERIMENTAL_API - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - LDFLAGS += -pthread - -diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile -index e8fdc46d74..b0e53c37e8 100644 ---- a/examples/l2fwd-cat/Makefile -+++ b/examples/l2fwd-cat/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - LDFLAGS += -lpqos - -diff --git a/examples/l2fwd-crypto/Makefile b/examples/l2fwd-crypto/Makefile -index cafe778fc6..7c170cfb53 100644 ---- a/examples/l2fwd-crypto/Makefile -+++ b/examples/l2fwd-crypto/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -DALLOW_EXPERIMENTAL_API - CONFIG_DEFINES = $(shell $(CC) $(CFLAGS) -dM -E - < /dev/null) -diff --git a/examples/l2fwd-event/Makefile b/examples/l2fwd-event/Makefile -index bf0ee890d5..4cdae36f17 100644 ---- a/examples/l2fwd-event/Makefile -+++ b/examples/l2fwd-event/Makefile -@@ -28,7 +28,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile -index c26803909f..73c91faa8d 100644 ---- a/examples/l2fwd-jobstats/Makefile -+++ b/examples/l2fwd-jobstats/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile -index ea3a9cbbf3..94d1e58bb5 100644 ---- a/examples/l2fwd-keepalive/Makefile -+++ b/examples/l2fwd-keepalive/Makefile -@@ -24,7 +24,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile -index 15105ac57e..8b7b26cb90 100644 ---- a/examples/l2fwd/Makefile -+++ b/examples/l2fwd/Makefile -@@ -24,7 +24,7 @@ CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - # Add flag to allow experimental API as l2fwd uses rte_ethdev_set_ptype API - CFLAGS += -DALLOW_EXPERIMENTAL_API - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile -index 156dc19606..d9909584b1 100644 ---- a/examples/l3fwd-acl/Makefile -+++ b/examples/l3fwd-acl/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/l3fwd-power/Makefile b/examples/l3fwd-power/Makefile -index 74441f98cf..729d49639b 100644 ---- a/examples/l3fwd-power/Makefile -+++ b/examples/l3fwd-power/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -DALLOW_EXPERIMENTAL_API - -diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile -index 38a370c2cf..b2dbf26075 100644 ---- a/examples/l3fwd/Makefile -+++ b/examples/l3fwd/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile -index 879ee7384d..4f02a89013 100644 ---- a/examples/link_status_interrupt/Makefile -+++ b/examples/link_status_interrupt/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/ntb/Makefile b/examples/ntb/Makefile -index f41ccfac27..bdc0d6e80f 100644 ---- a/examples/ntb/Makefile -+++ b/examples/ntb/Makefile -@@ -26,7 +26,7 @@ LDFLAGS += -pthread - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/packet_ordering/Makefile b/examples/packet_ordering/Makefile -index 1e50389421..261b7f06a8 100644 ---- a/examples/packet_ordering/Makefile -+++ b/examples/packet_ordering/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile -index 9e47a60117..82d72b3e31 100644 ---- a/examples/ptpclient/Makefile -+++ b/examples/ptpclient/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/qos_meter/Makefile b/examples/qos_meter/Makefile -index f733facaeb..7c2bf88a90 100644 ---- a/examples/qos_meter/Makefile -+++ b/examples/qos_meter/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -DALLOW_EXPERIMENTAL_API - -diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile -index 736ac00a36..525061ca07 100644 ---- a/examples/qos_sched/Makefile -+++ b/examples/qos_sched/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/rxtx_callbacks/Makefile b/examples/rxtx_callbacks/Makefile -index eecdcada3e..418f47c4d7 100644 ---- a/examples/rxtx_callbacks/Makefile -+++ b/examples/rxtx_callbacks/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -DALLOW_EXPERIMENTAL_API - -diff --git a/examples/service_cores/Makefile b/examples/service_cores/Makefile -index b8669fdf7e..c47055813e 100644 ---- a/examples/service_cores/Makefile -+++ b/examples/service_cores/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile -index 5059f3123f..2c29004d79 100644 ---- a/examples/skeleton/Makefile -+++ b/examples/skeleton/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile -index 548ca3cee3..645112498d 100644 ---- a/examples/tep_termination/Makefile -+++ b/examples/tep_termination/Makefile -@@ -24,7 +24,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -Wno-deprecated-declarations - -diff --git a/examples/timer/Makefile b/examples/timer/Makefile -index b34c8baa6b..bf86339ab7 100644 ---- a/examples/timer/Makefile -+++ b/examples/timer/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/vdpa/Makefile b/examples/vdpa/Makefile -index bc0b6793e6..6a25497cd8 100644 ---- a/examples/vdpa/Makefile -+++ b/examples/vdpa/Makefile -@@ -23,7 +23,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile -index ef6f3550f3..f2b1615418 100644 ---- a/examples/vhost/Makefile -+++ b/examples/vhost/Makefile -@@ -24,7 +24,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -DALLOW_EXPERIMENTAL_API - -diff --git a/examples/vhost_blk/Makefile b/examples/vhost_blk/Makefile -index 3952791784..39244320d8 100644 ---- a/examples/vhost_blk/Makefile -+++ b/examples/vhost_blk/Makefile -@@ -25,7 +25,7 @@ LDFLAGS += -pthread - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - CFLAGS += -DALLOW_EXPERIMENTAL_API - -diff --git a/examples/vhost_crypto/Makefile b/examples/vhost_crypto/Makefile -index 28e3e4de74..ae8cb81f87 100644 ---- a/examples/vhost_crypto/Makefile -+++ b/examples/vhost_crypto/Makefile -@@ -23,7 +23,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile -index 7e59e4d658..0767c715a1 100644 ---- a/examples/vmdq/Makefile -+++ b/examples/vmdq/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) -diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile -index 2302577d00..2a9b04143f 100644 ---- a/examples/vmdq_dcb/Makefile -+++ b/examples/vmdq_dcb/Makefile -@@ -22,7 +22,7 @@ PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) - CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) - LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) --LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) -+LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) - - build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build - $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) --- -2.30.0 - diff -Nru dpdk-19.11.7/debian/patches/lp-1920141-03-Revert-Revert-Revert-build-pkg-config-output-drivers.patch dpdk-19.11.10~rc1/debian/patches/lp-1920141-03-Revert-Revert-Revert-build-pkg-config-output-drivers.patch --- dpdk-19.11.7/debian/patches/lp-1920141-03-Revert-Revert-Revert-build-pkg-config-output-drivers.patch 2021-02-23 10:03:38.000000000 +0000 +++ dpdk-19.11.10~rc1/debian/patches/lp-1920141-03-Revert-Revert-Revert-build-pkg-config-output-drivers.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -From d4b956825f34022474bf98cbfde999e87ba940b5 Mon Sep 17 00:00:00 2001 -From: Christian Ehrhardt -Date: Mon, 22 Mar 2021 11:19:54 +0100 -Subject: [PATCH 3/7] Revert "Revert "Revert "build/pkg-config: output drivers - first for static build""" - -This reverts commit 906e935a1fd1f6cf01ff12d70c2f040aa91984c6. -This series changes linking behavior in 19.11.x and thereby should stay -out. It breaks - for example - a rebuild of OVS 2.13 or builds -of later OVS 2.13.x stable releases. - -Reverting this drops the two following 19.11.7 changes which need to be -re-created in the new (old) place of meson.build - -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1920141 -Forwarded: http://mails.dpdk.org/archives/stable/2021-March/029484.html -Last-Update: 2021-03-22 ---- - buildtools/pkg-config/meson.build | 36 ++++--------------------------- - 1 file changed, 4 insertions(+), 32 deletions(-) - -diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build -index ccb34dcab3..c93711b5e8 100644 ---- a/buildtools/pkg-config/meson.build -+++ b/buildtools/pkg-config/meson.build -@@ -10,41 +10,13 @@ pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args - if is_freebsd - pkg_extra_cflags += ['-D__BSD_VISIBLE'] - endif -- --# When calling pkg-config --static --libs, pkg-config will always output the --# regular libs first, and then the extra libs from Libs.private field, --# since the assumption is that those are additional dependencies for building --# statically that the .a files depend upon. The output order of .pc fields is: --# Libs Libs.private Requires Requires.private --# The fields Requires* are for package names. --# The flags of the DPDK libraries must be defined in Libs* fields. --# However, the DPDK drivers are linked only in static builds (Libs.private), --# and those need to come *before* the regular libraries (Libs field). --# This requirement is satisfied by moving the regular libs in a separate file --# included in the field Requires (after Libs.private). -- --pkg.generate(name: 'dpdk-libs', -- filebase: 'libdpdk-libs', -- description: '''Internal-only DPDK pkgconfig file. Not for direct use. --Use libdpdk.pc instead of this file to query DPDK compile/link arguments''', -+pkg.generate(name: meson.project_name(), -+ filebase: 'lib' + meson.project_name().to_lower(), - version: meson.project_version(), -- subdirs: [get_option('include_subdir_arch'), '.'], -- extra_cflags: pkg_extra_cflags, - libraries: dpdk_libraries, -- libraries_private: dpdk_extra_ldflags) -- --platform_flags = [] --if not is_windows -- platform_flags += ['-Wl,--export-dynamic'] # ELF only --endif --pkg.generate(name: 'DPDK', # main DPDK pkgconfig file -- filebase: 'libdpdk', -- version: meson.project_version(), - description: '''The Data Plane Development Kit (DPDK). - Note that CFLAGS might contain an -march flag higher than typical baseline. - This is required for a number of static inline functions in the public headers.''', -- requires: ['libdpdk-libs', libbsd], # may need libbsd for string funcs -- # if libbsd is not enabled, then this is blank -- libraries_private: dpdk_drivers + dpdk_static_libraries + -- ['-Wl,-Bdynamic'] + platform_flags -+ subdirs: [get_option('include_subdir_arch'), '.'], -+ extra_cflags: pkg_extra_cflag - ) --- -2.30.0 - diff -Nru dpdk-19.11.7/debian/patches/lp-1920141-04-Revert-Revert-Revert-build-pkg-config-move-pkg-confi.patch dpdk-19.11.10~rc1/debian/patches/lp-1920141-04-Revert-Revert-Revert-build-pkg-config-move-pkg-confi.patch --- dpdk-19.11.7/debian/patches/lp-1920141-04-Revert-Revert-Revert-build-pkg-config-move-pkg-confi.patch 2021-02-23 10:03:38.000000000 +0000 +++ dpdk-19.11.10~rc1/debian/patches/lp-1920141-04-Revert-Revert-Revert-build-pkg-config-move-pkg-confi.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ -From 9171fe0b7f859c082ca648d2a84af7490dc4f93a Mon Sep 17 00:00:00 2001 -From: Christian Ehrhardt -Date: Mon, 22 Mar 2021 11:22:04 +0100 -Subject: [PATCH 4/7] Revert "Revert "Revert "build/pkg-config: move pkg-config - file creation""" - -This reverts commit deebf952394cef1d14912f3dc2fc5121431c16a5. -This series changes linking behavior in 19.11.x and thereby should stay -out. It breaks - for example - a rebuild of OVS 2.13 or builds -of later OVS 2.13.x stable releases. - -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1920141 -Forwarded: http://mails.dpdk.org/archives/stable/2021-March/029484.html -Last-Update: 2021-03-22 ---- - MAINTAINERS | 2 -- - buildtools/pkg-config/meson.build | 22 ---------------------- - meson.build | 25 +++++++++++++++++++++++-- - 3 files changed, 23 insertions(+), 26 deletions(-) - delete mode 100644 buildtools/pkg-config/meson.build - -diff --git a/MAINTAINERS b/MAINTAINERS -index 952ded7b00..75431e333b 100644 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -131,8 +131,6 @@ F: config/rte_config.h - F: buildtools/call-sphinx-build.py - F: buildtools/gen-pmdinfo-cfile.sh - F: buildtools/map_to_def.py --F: buildtools/list-dir-globs.py --F: buildtools/pkg-config/ - F: buildtools/symlink-drivers-solibs.sh - - Public CI -diff --git a/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build -deleted file mode 100644 -index c93711b5e8..0000000000 ---- a/buildtools/pkg-config/meson.build -+++ /dev/null -@@ -1,22 +0,0 @@ --# SPDX-License-Identifier: BSD-3-Clause --# Copyright(c) 2020 Intel Corporation -- --# for static builds, include the drivers as libs and we need to "whole-archive" --# them. --dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive'] -- --pkg = import('pkgconfig') --pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args --if is_freebsd -- pkg_extra_cflags += ['-D__BSD_VISIBLE'] --endif --pkg.generate(name: meson.project_name(), -- filebase: 'lib' + meson.project_name().to_lower(), -- version: meson.project_version(), -- libraries: dpdk_libraries, -- description: '''The Data Plane Development Kit (DPDK). --Note that CFLAGS might contain an -march flag higher than typical baseline. --This is required for a number of static inline functions in the public headers.''', -- subdirs: [get_option('include_subdir_arch'), '.'], -- extra_cflags: pkg_extra_cflag --) -diff --git a/meson.build b/meson.build -index 00949de995..58995252bd 100644 ---- a/meson.build -+++ b/meson.build -@@ -64,8 +64,29 @@ configure_file(output: build_cfg, - install_dir: join_paths(get_option('includedir'), - get_option('include_subdir_arch'))) - --# build pkg-config files for dpdk --subdir('buildtools/pkg-config') -+# for static builds, include the drivers as libs and we need to "whole-archive" -+# them. -+dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive'] -+ -+pkg = import('pkgconfig') -+pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args -+if is_freebsd -+ pkg_extra_cflags += ['-D__BSD_VISIBLE'] -+endif -+pkg.generate(name: meson.project_name(), -+ filebase: 'lib' + meson.project_name().to_lower(), -+ version: meson.project_version(), -+ libraries: dpdk_libraries, -+ libraries_private: dpdk_drivers + dpdk_static_libraries + -+ ['-Wl,-Bdynamic'] + dpdk_extra_ldflags, -+ requires: libbsd, # apps using rte_string_fns.h may need this if enabled -+ # if libbsd is not enabled, then this is blank -+ description: '''The Data Plane Development Kit (DPDK). -+Note that CFLAGS might contain an -march flag higher than typical baseline. -+This is required for a number of static inline functions in the public headers.''', -+ subdirs: [get_option('include_subdir_arch'), '.'], -+ extra_cflags: pkg_extra_cflags -+) - - # final output, list all the libs and drivers to be built - # this does not affect any part of the build, for information only. --- -2.30.0 - diff -Nru dpdk-19.11.7/debian/patches/lp-1920141-05-Revert-Revert-Revert-build-always-link-whole-DPDK-st.patch dpdk-19.11.10~rc1/debian/patches/lp-1920141-05-Revert-Revert-Revert-build-always-link-whole-DPDK-st.patch --- dpdk-19.11.7/debian/patches/lp-1920141-05-Revert-Revert-Revert-build-always-link-whole-DPDK-st.patch 2021-02-23 10:03:38.000000000 +0000 +++ dpdk-19.11.10~rc1/debian/patches/lp-1920141-05-Revert-Revert-Revert-build-always-link-whole-DPDK-st.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -From 4fad50ad66b511904ae3729a115e14db4bf2d94e Mon Sep 17 00:00:00 2001 -From: Christian Ehrhardt -Date: Mon, 22 Mar 2021 11:25:54 +0100 -Subject: [PATCH 5/7] Revert "Revert "Revert "build: always link whole DPDK - static libraries""" - -This reverts commit a3bd9a34bf9988de641b6e78b825fafb69d2d13f. -This series changes linking behavior in 19.11.x and thereby should stay -out. It breaks - for example - a rebuild of OVS 2.13 or builds -of later OVS 2.13.x stable releases. - -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1920141 -Forwarded: http://mails.dpdk.org/archives/stable/2021-March/029484.html -Last-Update: 2021-03-22 ---- - app/test/meson.build | 2 +- - drivers/meson.build | 2 +- - examples/meson.build | 6 +++--- - lib/meson.build | 2 +- - 4 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/app/test/meson.build b/app/test/meson.build -index 24fb59f74f..860728bb07 100644 ---- a/app/test/meson.build -+++ b/app/test/meson.build -@@ -391,7 +391,7 @@ test_dep_objs += cc.find_library('execinfo', required: false) - - link_libs = [] - if get_option('default_library') == 'static' -- link_libs = dpdk_static_libraries + dpdk_drivers -+ link_libs = dpdk_drivers - endif - - dpdk_test = executable('dpdk-test', -diff --git a/drivers/meson.build b/drivers/meson.build -index 696079680b..0400d84675 100644 ---- a/drivers/meson.build -+++ b/drivers/meson.build -@@ -198,7 +198,7 @@ foreach class:dpdk_driver_classes - shared_dep = declare_dependency(link_with: shared_lib, - include_directories: includes, - dependencies: shared_deps) -- static_dep = declare_dependency( -+ static_dep = declare_dependency(link_with: static_lib, - include_directories: includes, - dependencies: static_deps) - -diff --git a/examples/meson.build b/examples/meson.build -index 9e081f3fb7..4dc292fbd1 100644 ---- a/examples/meson.build -+++ b/examples/meson.build -@@ -1,9 +1,9 @@ - # SPDX-License-Identifier: BSD-3-Clause - # Copyright(c) 2017-2019 Intel Corporation - --link_whole_libs = [] -+driver_libs = [] - if get_option('default_library') == 'static' -- link_whole_libs = dpdk_static_libraries + dpdk_drivers -+ driver_libs = dpdk_drivers - endif - - execinfo = cc.find_library('execinfo', required: false) -@@ -97,7 +97,7 @@ foreach example: examples - endif - executable('dpdk-' + name, sources, - include_directories: includes, -- link_whole: link_whole_libs, -+ link_whole: driver_libs, - link_args: ldflags, - c_args: cflags, - dependencies: dep_objs) -diff --git a/lib/meson.build b/lib/meson.build -index b60396428c..f8da4f3168 100644 ---- a/lib/meson.build -+++ b/lib/meson.build -@@ -127,7 +127,7 @@ foreach l:libraries - dependencies: static_deps, - include_directories: includes, - install: true) -- static_dep = declare_dependency( -+ static_dep = declare_dependency(link_with: static_lib, - include_directories: includes, - dependencies: static_deps) - --- -2.30.0 - diff -Nru dpdk-19.11.7/debian/patches/lp-1920141-06-Revert-Revert-Revert-devtools-test-static-linkage-wi.patch dpdk-19.11.10~rc1/debian/patches/lp-1920141-06-Revert-Revert-Revert-devtools-test-static-linkage-wi.patch --- dpdk-19.11.7/debian/patches/lp-1920141-06-Revert-Revert-Revert-devtools-test-static-linkage-wi.patch 2021-02-23 10:03:38.000000000 +0000 +++ dpdk-19.11.10~rc1/debian/patches/lp-1920141-06-Revert-Revert-Revert-devtools-test-static-linkage-wi.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -From b6473c5a0b7f8fa314d4fd47d6c0931da8c8d083 Mon Sep 17 00:00:00 2001 -From: Christian Ehrhardt -Date: Mon, 22 Mar 2021 11:26:09 +0100 -Subject: [PATCH 6/7] Revert "Revert "Revert "devtools: test static linkage - with pkg-config""" - -This reverts commit d4bc12443836ccb8a5032b34f1d412b33a1d2384. -This series changes linking behavior in 19.11.x and thereby should stay -out. It breaks - for example - a rebuild of OVS 2.13 or builds -of later OVS 2.13.x stable releases. - -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1920141 -Forwarded: http://mails.dpdk.org/archives/stable/2021-March/029484.html -Last-Update: 2021-03-22 ---- - devtools/test-meson-builds.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh -index 8678a3d824..47fdb9dfb5 100755 ---- a/devtools/test-meson-builds.sh -+++ b/devtools/test-meson-builds.sh -@@ -146,6 +146,6 @@ if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then - export PKGCONF="pkg-config --define-prefix" - for example in cmdline helloworld l2fwd l3fwd skeleton timer; do - echo "## Building $example" -- $MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean shared static -+ $MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean all - done - fi --- -2.30.0 - diff -Nru dpdk-19.11.7/debian/patches/lp-1920141-07-Regenerate-meson.build-changes-required-due-to-rever.patch dpdk-19.11.10~rc1/debian/patches/lp-1920141-07-Regenerate-meson.build-changes-required-due-to-rever.patch --- dpdk-19.11.7/debian/patches/lp-1920141-07-Regenerate-meson.build-changes-required-due-to-rever.patch 2021-02-23 10:03:38.000000000 +0000 +++ dpdk-19.11.10~rc1/debian/patches/lp-1920141-07-Regenerate-meson.build-changes-required-due-to-rever.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -From 2604819f25ff15066d5c67bc4ae340183cd4eef1 Mon Sep 17 00:00:00 2001 -From: Christian Ehrhardt -Date: Mon, 22 Mar 2021 11:29:01 +0100 -Subject: [PATCH 7/7] Regenerate meson.build changes required due to reverts - -Due to a series of re-re-reverts by this case: -http://mails.dpdk.org/archives/stable/2021-March/029418.html -http://mails.dpdk.org/archives/stable/2020-September/024796.html -The two changes of: - 3f33f5056 build: fix plugin load on static build - 4a2baf099 build: fix linker flags on Windows -would have been lost. -Re-apply them here to have the reverts only remove what was added by them. - -Fixes: 16ade738fd0d ("app/testpmd: build with meson") -Fixes: 89f0711f9ddf ("examples: build some samples with meson") -Fixes: b031e13d7f0d ("build: fix plugin load on static build") - -Signed-off-by: Christian Ehrhardt - -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1920141 -Forwarded: http://mails.dpdk.org/archives/stable/2021-March/029484.html -Last-Update: 2021-03-22 ---- - meson.build | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 58995252bd..01bbb556ec 100644 ---- a/meson.build -+++ b/meson.build -@@ -64,9 +64,14 @@ configure_file(output: build_cfg, - install_dir: join_paths(get_option('includedir'), - get_option('include_subdir_arch'))) - -+platform_flags = [] -+if not is_windows -+ platform_flags += ['-Wl,--export-dynamic'] # ELF only -+endif -+ - # for static builds, include the drivers as libs and we need to "whole-archive" - # them. --dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive'] -+dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive'] + platform_flags - - pkg = import('pkgconfig') - pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args --- -2.30.0 - diff -Nru dpdk-19.11.7/debian/patches/series dpdk-19.11.10~rc1/debian/patches/series --- dpdk-19.11.7/debian/patches/series 2021-02-23 10:03:38.000000000 +0000 +++ dpdk-19.11.10~rc1/debian/patches/series 2021-08-24 09:51:47.000000000 +0000 @@ -1,8 +1 @@ revert-net-ipn3ke-fix-meson-build.patch -lp-1920141-01-Revert-Revert-Revert-build-pkg-config-prevent-overli.patch -lp-1920141-02-Revert-Revert-Revert-build-pkg-config-improve-static.patch -lp-1920141-03-Revert-Revert-Revert-build-pkg-config-output-drivers.patch -lp-1920141-04-Revert-Revert-Revert-build-pkg-config-move-pkg-confi.patch -lp-1920141-05-Revert-Revert-Revert-build-always-link-whole-DPDK-st.patch -lp-1920141-06-Revert-Revert-Revert-devtools-test-static-linkage-wi.patch -lp-1920141-07-Regenerate-meson.build-changes-required-due-to-rever.patch diff -Nru dpdk-19.11.7/devtools/check-maintainers.sh dpdk-19.11.10~rc1/devtools/check-maintainers.sh --- dpdk-19.11.7/devtools/check-maintainers.sh 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/devtools/check-maintainers.sh 2021-08-18 14:45:29.000000000 +0000 @@ -15,10 +15,10 @@ if [ -z "$1" ] ; then return fi - if [ -d .git ] ; then + if [ -r .git ] ; then git ls-files "$1" else - find "$1" -type f | + find $1 -type f | sed 's,^\./,,' fi | # if not ended by / diff -Nru dpdk-19.11.7/devtools/test-meson-builds.sh dpdk-19.11.10~rc1/devtools/test-meson-builds.sh --- dpdk-19.11.7/devtools/test-meson-builds.sh 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/devtools/test-meson-builds.sh 2021-08-18 14:45:29.000000000 +0000 @@ -146,6 +146,6 @@ export PKGCONF="pkg-config --define-prefix" for example in cmdline helloworld l2fwd l3fwd skeleton timer; do echo "## Building $example" - $MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean shared static + $MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean all done fi diff -Nru dpdk-19.11.7/doc/build-sdk-meson.txt dpdk-19.11.10~rc1/doc/build-sdk-meson.txt --- dpdk-19.11.7/doc/build-sdk-meson.txt 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/build-sdk-meson.txt 2021-08-18 14:45:29.000000000 +0000 @@ -190,7 +190,7 @@ PC_FILE := $(shell pkg-config --path libdpdk) CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) - LDFLAGS_STATIC = $(shell pkg-config --static --libs libdpdk) + LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/doc/guides/bbdevs/fpga_lte_fec.rst dpdk-19.11.10~rc1/doc/guides/bbdevs/fpga_lte_fec.rst --- dpdk-19.11.7/doc/guides/bbdevs/fpga_lte_fec.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/bbdevs/fpga_lte_fec.rst 2021-08-18 14:45:29.000000000 +0000 @@ -50,7 +50,7 @@ Installation -------------- -Section 3 of the DPDK manual provides instuctions on installing and compiling DPDK. The +Section 3 of the DPDK manual provides instructions on installing and compiling DPDK. The default set of bbdev compile flags may be found in config/common_base, where for example the flag to build the FPGA LTE FEC device, ``CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC``, is already set. It is assumed DPDK has been compiled using for instance: diff -Nru dpdk-19.11.7/doc/guides/conf.py dpdk-19.11.10~rc1/doc/guides/conf.py --- dpdk-19.11.7/doc/guides/conf.py 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/conf.py 2021-08-18 14:45:29.000000000 +0000 @@ -25,7 +25,6 @@ import sphinx_rtd_theme html_theme = "sphinx_rtd_theme" - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] except: print('Install the sphinx ReadTheDocs theme for improved html documentation ' 'layout: pip install sphinx_rtd_theme') @@ -34,7 +33,10 @@ project = 'Data Plane Development Kit' html_logo = '../logo/DPDK_logo_vertical_rev_small.png' latex_logo = '../logo/DPDK_logo_horizontal_tag.png' -html_add_permalinks = "" +if LooseVersion(sphinx_version) >= LooseVersion('3.5'): + html_permalinks = False +else: + html_add_permalinks = "" html_show_copyright = False highlight_language = 'none' diff -Nru dpdk-19.11.7/doc/guides/contributing/stable.rst dpdk-19.11.10~rc1/doc/guides/contributing/stable.rst --- dpdk-19.11.7/doc/guides/contributing/stable.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/contributing/stable.rst 2021-08-18 14:45:29.000000000 +0000 @@ -95,7 +95,7 @@ limited cases, to back port features for the LTS release where: * There is a justifiable use case (for example a new PMD). -* The change is non-invasive. +* The change is noninvasive. * The work of preparing the backport is done by the proposer. * There is support within the community. diff -Nru dpdk-19.11.7/doc/guides/cryptodevs/caam_jr.rst dpdk-19.11.10~rc1/doc/guides/cryptodevs/caam_jr.rst --- dpdk-19.11.7/doc/guides/cryptodevs/caam_jr.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/cryptodevs/caam_jr.rst 2021-08-18 14:45:29.000000000 +0000 @@ -24,7 +24,7 @@ SEC HW accelerator above 4.x+ version are also known as CAAM. -caam_jr PMD is one of DPAA drivers which uses uio interface to interact with +caam_jr PMD is one of DPAA drivers which uses UIO interface to interact with Linux kernel for configure and destroy the device instance (ring). diff -Nru dpdk-19.11.7/doc/guides/cryptodevs/scheduler.rst dpdk-19.11.10~rc1/doc/guides/cryptodevs/scheduler.rst --- dpdk-19.11.7/doc/guides/cryptodevs/scheduler.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/cryptodevs/scheduler.rst 2021-08-18 14:45:29.000000000 +0000 @@ -126,7 +126,7 @@ than the designated threshold, otherwise it will be handled by the secondary slave. - A typical usecase in this mode is with the QAT cryptodev as the primary and + A typical use case in this mode is with the QAT cryptodev as the primary and a software cryptodev as the secondary slave. This may help applications to process additional crypto workload than what the QAT cryptodev can handle on its own, by making use of the available CPU cycles to deal with smaller diff -Nru dpdk-19.11.7/doc/guides/cryptodevs/virtio.rst dpdk-19.11.10~rc1/doc/guides/cryptodevs/virtio.rst --- dpdk-19.11.7/doc/guides/cryptodevs/virtio.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/cryptodevs/virtio.rst 2021-08-18 14:45:29.000000000 +0000 @@ -63,7 +63,7 @@ -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 [...] -Secondly bind the uio_generic driver for the virtio-crypto device. +Secondly bind the uio_pci_generic driver for the virtio-crypto device. For example, 0000:00:04.0 is the domain, bus, device and function number of the virtio-crypto device: diff -Nru dpdk-19.11.7/doc/guides/howto/pvp_reference_benchmark.rst dpdk-19.11.10~rc1/doc/guides/howto/pvp_reference_benchmark.rst --- dpdk-19.11.7/doc/guides/howto/pvp_reference_benchmark.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/howto/pvp_reference_benchmark.rst 2021-08-18 14:45:29.000000000 +0000 @@ -26,7 +26,7 @@ PVP setup using 2 NICs -In this diagram, each red arrow represents one logical core. This use-case +In this diagram, each red arrow represents one logical core. This use case requires 6 dedicated logical cores. A forwarding configuration with a single NIC is also possible, requiring 3 logical cores. diff -Nru dpdk-19.11.7/doc/guides/linux_gsg/linux_drivers.rst dpdk-19.11.10~rc1/doc/guides/linux_gsg/linux_drivers.rst --- dpdk-19.11.7/doc/guides/linux_gsg/linux_drivers.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/linux_gsg/linux_drivers.rst 2021-08-18 14:45:29.000000000 +0000 @@ -72,6 +72,16 @@ VFIO kernel modules have been included in the Linux kernel since version 3.6.0 and are usually present by default, however please consult your distributions documentation to make sure that is the case. +For DMA mapping of either external memory or hugepages, VFIO interface is used. +VFIO does not support partial unmap of once mapped memory. Hence DPDK's memory is +mapped in hugepage granularity or system page granularity. Number of DMA +mappings is limited by kernel with user locked memory limit of a process (rlimit) +for system/hugepage memory. Another per-container overall limit applicable both +for external memory and system memory was added in kernel 5.1 defined by +VFIO module parameter ``dma_entry_limit`` with a default value of 64K. +When application is out of DMA entries, these limits need to be adjusted to +increase the allowed limit. + Also, to use VFIO, both kernel and BIOS must support and be configured to use IO virtualization (such as Intel® VT-d). .. note:: diff -Nru dpdk-19.11.7/doc/guides/nics/bnxt.rst dpdk-19.11.10~rc1/doc/guides/nics/bnxt.rst --- dpdk-19.11.7/doc/guides/nics/bnxt.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/nics/bnxt.rst 2021-08-18 14:45:29.000000000 +0000 @@ -54,14 +54,14 @@ RX Requirements for Vector Mode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Vector mode receive will be enabled if the following constrainsts are met: +Vector mode receive will be enabled if the following constraints are met: * Packets must fit within a single mbuf (no scatter RX). * LRO offload must be disabled. TX Requirements for Vector Mode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Vector mode transmit will be enabled if the following constrainsts are met: +Vector mode transmit will be enabled if the following constraints are met: * Packets must be contained within a single mbuf (no gather TX). * All transmit offloads other than VLAN insertion must be disabled. @@ -123,7 +123,7 @@ `_ of the `Broadcom website `_. - * **Broadcom StrataGX® BCM5871X Series of Communucations Processors** + * **Broadcom StrataGX® BCM5871X Series of Communications Processors** These ARM based processors target a broad range of networking applications including virtual CPE (vCPE) and NFV appliances, 10G service routers and diff -Nru dpdk-19.11.7/doc/guides/nics/ena.rst dpdk-19.11.10~rc1/doc/guides/nics/ena.rst --- dpdk-19.11.7/doc/guides/nics/ena.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/nics/ena.rst 2021-08-18 14:45:29.000000000 +0000 @@ -198,7 +198,7 @@ [...] EAL: PCI device 0000:00:06.0 on NUMA socket -1 - EAL: Invalid NUMA socket, default to 0 + EAL: Device 0000:00:06.0 is not NUMA-aware, defaulting socket to 0 EAL: probe driver: 1d0f:ec20 net_ena Interactive-mode selected diff -Nru dpdk-19.11.7/doc/guides/nics/hns3.rst dpdk-19.11.10~rc1/doc/guides/nics/hns3.rst --- dpdk-19.11.7/doc/guides/nics/hns3.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/nics/hns3.rst 2021-08-18 14:45:29.000000000 +0000 @@ -1,12 +1,12 @@ .. SPDX-License-Identifier: BSD-3-Clause - Copyright(c) 2018-2019 Hisilicon Limited. + Copyright(c) 2018-2019 HiSilicon Limited. HNS3 Poll Mode Driver =============================== The hns3 PMD (librte_pmd_hns3) provides poll mode driver support -for the inbuilt Hisilicon Network Subsystem(HNS) network engine -found in the Hisilicon Kunpeng 920 SoC. +for the inbuilt HiSilicon Network Subsystem(HNS) network engine +found in the HiSilicon Kunpeng 920 SoC. Features -------- diff -Nru dpdk-19.11.7/doc/guides/nics/mlx5.rst dpdk-19.11.10~rc1/doc/guides/nics/mlx5.rst --- dpdk-19.11.7/doc/guides/nics/mlx5.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/nics/mlx5.rst 2021-08-18 14:45:29.000000000 +0000 @@ -498,6 +498,13 @@ it is not recommended and may prevent NIC from sending packets over some configurations. + For ConnectX-4 and ConnectX-4 Lx NICs, automatically configured value + is insufficient for some traffic, because they require at least all L2 headers + to be inlined. For example, Q-in-Q adds 4 bytes to default 18 bytes + of Ethernet and VLAN, thus ``txq_inline_min`` must be set to 22. + MPLS would add 4 bytes per label. Final value must account for all possible + L2 encapsulation headers used in particular environment. + Please, note, this minimal data inlining disengages eMPW feature (Enhanced Multi-Packet Write), because last one does not support partial packet inlining. This is not very critical due to minimal data inlining is mostly required @@ -1088,7 +1095,7 @@ echo -n " /sys/bus/pci/drivers/mlx5_core/unbind -5. Enbale switchdev mode:: +5. Enable switchdev mode:: echo switchdev > /sys/class/net//compat/devlink/mode diff -Nru dpdk-19.11.7/doc/guides/nics/netvsc.rst dpdk-19.11.10~rc1/doc/guides/nics/netvsc.rst --- dpdk-19.11.7/doc/guides/nics/netvsc.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/nics/netvsc.rst 2021-08-18 14:45:29.000000000 +0000 @@ -62,7 +62,7 @@ .. _`UUID`: https://en.wikipedia.org/wiki/Universally_unique_identifier -There are several possible ways to assign the uio device driver for a device. +There are several possible ways to assign the UIO device driver for a device. The easiest way (but only on 4.18 or later) is to use the `driverctl Device Driver control utility`_ to override the normal kernel device. diff -Nru dpdk-19.11.7/doc/guides/nics/nfp.rst dpdk-19.11.10~rc1/doc/guides/nics/nfp.rst --- dpdk-19.11.7/doc/guides/nics/nfp.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/nics/nfp.rst 2021-08-18 14:45:29.000000000 +0000 @@ -121,15 +121,15 @@ PCI ports. NFP ports belonging to same PF can be seen inside PMD initialization with a -suffix added to the PCI ID: wwww:xx:yy.z_port_n. For example, a PF with PCI ID +suffix added to the PCI ID: wwww:xx:yy.z_portn. For example, a PF with PCI ID 0000:03:00.0 and four ports is seen by the PMD code as: .. code-block:: console - 0000:03:00.0_port_0 - 0000:03:00.0_port_1 - 0000:03:00.0_port_2 - 0000:03:00.0_port_3 + 0000:03:00.0_port0 + 0000:03:00.0_port1 + 0000:03:00.0_port2 + 0000:03:00.0_port3 .. Note:: diff -Nru dpdk-19.11.7/doc/guides/nics/octeontx2.rst dpdk-19.11.10~rc1/doc/guides/nics/octeontx2.rst --- dpdk-19.11.7/doc/guides/nics/octeontx2.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/nics/octeontx2.rst 2021-08-18 14:45:29.000000000 +0000 @@ -162,7 +162,7 @@ -w 0002:02:00.0,max_sqb_count=64 - With the above configuration, each send queue's decscriptor buffer count is + With the above configuration, each send queue's descriptor buffer count is limited to a maximum of 64 buffers. - ``switch header enable`` (default ``none``) diff -Nru dpdk-19.11.7/doc/guides/nics/virtio.rst dpdk-19.11.10~rc1/doc/guides/nics/virtio.rst --- dpdk-19.11.7/doc/guides/nics/virtio.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/nics/virtio.rst 2021-08-18 14:45:29.000000000 +0000 @@ -71,7 +71,7 @@ * Virtio supports software vlan stripping and inserting. -* Virtio supports using port IO to get PCI resource when uio/igb_uio module is not available. +* Virtio supports using port IO to get PCI resource when UIO module is not available. Prerequisites ------------- @@ -103,7 +103,8 @@ insmod rte_kni.ko - Other basic DPDK preparations like hugepage enabling, uio port binding are not listed here. + Other basic DPDK preparations like hugepage enabling, + UIO port binding are not listed here. Please refer to the *DPDK Getting Started Guide* for detailed instructions. #. Launch the kni user application: @@ -473,7 +474,7 @@ Split virtqueue in-order non-mergeable path virtio_recv_pkts_inorder virtio_xmit_pkts_inorder Split virtqueue vectorized Rx path virtio_recv_pkts_vec virtio_xmit_pkts Packed virtqueue mergeable path virtio_recv_mergeable_pkts_packed virtio_xmit_pkts_packed - Packed virtqueue non-meregable path virtio_recv_pkts_packed virtio_xmit_pkts_packed + Packed virtqueue non-mergeable path virtio_recv_pkts_packed virtio_xmit_pkts_packed Packed virtqueue in-order mergeable path virtio_recv_mergeable_pkts_packed virtio_xmit_pkts_packed Packed virtqueue in-order non-mergeable path virtio_recv_pkts_packed virtio_xmit_pkts_packed ============================================ ================================= ======================== diff -Nru dpdk-19.11.7/doc/guides/nics/vmxnet3.rst dpdk-19.11.10~rc1/doc/guides/nics/vmxnet3.rst --- dpdk-19.11.7/doc/guides/nics/vmxnet3.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/nics/vmxnet3.rst 2021-08-18 14:45:29.000000000 +0000 @@ -119,7 +119,8 @@ .. note:: - Other instructions on preparing to use DPDK such as, hugepage enabling, uio port binding are not listed here. + Other instructions on preparing to use DPDK such as, + hugepage enabling, UIO port binding are not listed here. Please refer to *DPDK Getting Started Guide and DPDK Sample Application's User Guide* for detailed instructions. The packet reception and transmission flow path is:: diff -Nru dpdk-19.11.7/doc/guides/prog_guide/bbdev.rst dpdk-19.11.10~rc1/doc/guides/prog_guide/bbdev.rst --- dpdk-19.11.7/doc/guides/prog_guide/bbdev.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/prog_guide/bbdev.rst 2021-08-18 14:45:29.000000000 +0000 @@ -639,7 +639,7 @@ "soft output","soft LLR output buffer (optional)" "op_flags","bitmask of all active operation capabilities" "rv_index","redundancy version index [0..3]" - "iter_max","maximum number of iterations to perofrm in decode all CBs" + "iter_max","maximum number of iterations to perform in decode all CBs" "iter_min","minimum number of iterations to perform in decoding all CBs" "iter_count","number of iterations to performed in decoding all CBs" "ext_scale","scale factor on extrinsic info (5 bits)" diff -Nru dpdk-19.11.7/doc/guides/prog_guide/dev_kit_build_system.rst dpdk-19.11.10~rc1/doc/guides/prog_guide/dev_kit_build_system.rst --- dpdk-19.11.7/doc/guides/prog_guide/dev_kit_build_system.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/prog_guide/dev_kit_build_system.rst 2021-08-18 14:45:29.000000000 +0000 @@ -9,7 +9,7 @@ The DPDK requires a build system for compilation activities and so on. This section describes the constraints and the mechanisms used in the DPDK framework. -There are two use-cases for the framework: +There are two use cases for the framework: * Compilation of the DPDK libraries and sample applications; the framework generates specific binary libraries, diff -Nru dpdk-19.11.7/doc/guides/prog_guide/env_abstraction_layer.rst dpdk-19.11.10~rc1/doc/guides/prog_guide/env_abstraction_layer.rst --- dpdk-19.11.7/doc/guides/prog_guide/env_abstraction_layer.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/prog_guide/env_abstraction_layer.rst 2021-08-18 14:45:29.000000000 +0000 @@ -465,7 +465,7 @@ - By default, the mempool, first asks for IOVA-contiguous memory using ``RTE_MEMZONE_IOVA_CONTIG``. This is slow in RTE_IOVA_PA mode and it may affect the application boot time. - - It is easy to enable large amount of IOVA-contiguous memory use-cases + - It is easy to enable large amount of IOVA-contiguous memory use cases with IOVA in VA mode. It is expected that all PCI drivers work in both RTE_IOVA_PA and diff -Nru dpdk-19.11.7/doc/guides/prog_guide/eventdev.rst dpdk-19.11.10~rc1/doc/guides/prog_guide/eventdev.rst --- dpdk-19.11.7/doc/guides/prog_guide/eventdev.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/prog_guide/eventdev.rst 2021-08-18 14:45:29.000000000 +0000 @@ -120,7 +120,7 @@ ~~~~~ Ports are the points of contact between worker cores and the eventdev. The -general use-case will see one CPU core using one port to enqueue and dequeue +general use case will see one CPU core using one port to enqueue and dequeue events from an eventdev. Ports are linked to queues in order to retrieve events from those queues (more details in `Linking Queues and Ports`_ below). diff -Nru dpdk-19.11.7/doc/guides/prog_guide/multi_proc_support.rst dpdk-19.11.10~rc1/doc/guides/prog_guide/multi_proc_support.rst --- dpdk-19.11.7/doc/guides/prog_guide/multi_proc_support.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/prog_guide/multi_proc_support.rst 2021-08-18 14:45:29.000000000 +0000 @@ -325,7 +325,7 @@ IPC thread, sending messages while processing another message or request is supported. -Since the memory sybsystem uses IPC internally, memory allocations and IPC must +Since the memory subsystem uses IPC internally, memory allocations and IPC must not be mixed: it is not safe to use IPC inside a memory-related callback, nor is it safe to allocate/free memory inside IPC callbacks. Attempting to do so may lead to a deadlock. diff -Nru dpdk-19.11.7/doc/guides/prog_guide/qos_framework.rst dpdk-19.11.10~rc1/doc/guides/prog_guide/qos_framework.rst --- dpdk-19.11.7/doc/guides/prog_guide/qos_framework.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/prog_guide/qos_framework.rst 2021-08-18 14:45:29.000000000 +0000 @@ -737,7 +737,7 @@ which selects the queues in ascending order. Therefore, queue 0 (associated with TC 0, highest priority TC) is handled before queue 1 (TC 1, lower priority than TC 0), -which is handled before queue 2 (TC 2, lower priority than TC 1) and it conitnues until queues of all TCs except the +which is handled before queue 2 (TC 2, lower priority than TC 1) and it continues until queues of all TCs except the lowest priority TC are handled. At last, queues 12..15 (best effort TC, lowest priority TC) are handled. Upper Limit Enforcement diff -Nru dpdk-19.11.7/doc/guides/prog_guide/writing_efficient_code.rst dpdk-19.11.10~rc1/doc/guides/prog_guide/writing_efficient_code.rst --- dpdk-19.11.7/doc/guides/prog_guide/writing_efficient_code.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/prog_guide/writing_efficient_code.rst 2021-08-18 14:45:29.000000000 +0000 @@ -143,20 +143,21 @@ the DPDK attempts to aggregate the cost of processing each packet individually by processing packets in bursts. Using the testpmd application as an example, -the burst size can be set on the command line to a value of 16 (also the default value). -This allows the application to request 16 packets at a time from the PMD. +the burst size can be set on the command line to a value of 32 (also the default value). +This allows the application to request 32 packets at a time from the PMD. The testpmd application then immediately attempts to transmit all the packets that were received, -in this case, all 16 packets. +in this case, all 32 packets. The packets are not transmitted until the tail pointer is updated on the corresponding TX queue of the network port. This behavior is desirable when tuning for high throughput because -the cost of tail pointer updates to both the RX and TX queues can be spread across 16 packets, +the cost of tail pointer updates to both the RX and TX queues can be spread +across 32 packets, effectively hiding the relatively slow MMIO cost of writing to the PCIe* device. However, this is not very desirable when tuning for low latency because -the first packet that was received must also wait for another 15 packets to be received. -It cannot be transmitted until the other 15 packets have also been processed because +the first packet that was received must also wait for another 31 packets to be received. +It cannot be transmitted until the other 31 packets have also been processed because the NIC will not know to transmit the packets until the TX tail pointer has been updated, -which is not done until all 16 packets have been processed for transmission. +which is not done until all 32 packets have been processed for transmission. To consistently achieve low latency, even under heavy system load, the application developer should avoid processing packets in bunches. diff -Nru dpdk-19.11.7/doc/guides/rawdevs/ntb.rst dpdk-19.11.10~rc1/doc/guides/rawdevs/ntb.rst --- dpdk-19.11.7/doc/guides/rawdevs/ntb.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/rawdevs/ntb.rst 2021-08-18 14:45:29.000000000 +0000 @@ -18,7 +18,7 @@ ----------------------------- Intel Non-transparent Bridge needs special BIOS setting. Since the PMD only -supports Intel Skylake platform, introduce BIOS setting here. The referencce +supports Intel Skylake platform, introduce BIOS setting here. The reference is https://www.intel.com/content/dam/support/us/en/documents/server-products/Intel_Xeon_Processor_Scalable_Family_BIOS_User_Guide.pdf - Set the needed PCIe port as NTB to NTB mode on both hosts. diff -Nru dpdk-19.11.7/doc/guides/rel_notes/deprecation.rst dpdk-19.11.10~rc1/doc/guides/rel_notes/deprecation.rst --- dpdk-19.11.7/doc/guides/rel_notes/deprecation.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/rel_notes/deprecation.rst 2021-08-18 14:45:29.000000000 +0000 @@ -59,6 +59,12 @@ - ``rte_eth_dev_stop`` - ``rte_eth_dev_close`` +* ethdev: Will add ``RTE_ETH_`` prefix to all ethdev macros/enums in v21.11. + Macros will be added for backward compatibility. + Backward compatibility macros will be removed on v22.11. + A few old backward compatibility macros from 2013 that does not have + proper prefix will be removed on v21.11. + * ethdev: New offload flags ``DEV_RX_OFFLOAD_FLOW_MARK`` will be added in 19.11. This will allow application to enable or disable PMDs from updating ``rte_mbuf::hash::fdir``. diff -Nru dpdk-19.11.7/doc/guides/rel_notes/known_issues.rst dpdk-19.11.10~rc1/doc/guides/rel_notes/known_issues.rst --- dpdk-19.11.7/doc/guides/rel_notes/known_issues.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/rel_notes/known_issues.rst 2021-08-18 14:45:29.000000000 +0000 @@ -419,7 +419,7 @@ ------------------------------------------------------------------------------------------ **Description**: - A known bug in the uio driver included in Linux kernel version 3.9 prevents more than one PCI device to be + A known bug in the UIO driver included in Linux kernel version 3.9 prevents more than one PCI device to be bound to the igb_uio driver. **Implication**: @@ -614,7 +614,7 @@ Poll Mode Driver (PMD). -uio pci generic module bind failed in X710/XL710/XXV710 +uio_pci_generic module bind failed in X710/XL710/XXV710 ------------------------------------------------------- **Description**: @@ -671,7 +671,7 @@ Poll Mode Driver (PMD). -igb uio legacy mode can not be used in X710/XL710/XXV710 +igb_uio legacy mode can not be used in X710/XL710/XXV710 -------------------------------------------------------- **Description**: @@ -752,7 +752,7 @@ handshake sequence with the host. **Resolution/Workaround**: - Either reboot the guest or remove and reinsert the hv_uio_generic module. + Either reboot the guest or remove and reinsert the uio_hv_generic module. **Affected Environment/Platform**: Linux Hyper-V. @@ -816,7 +816,7 @@ **Reason**: When device is hot-unplugged, igb_uio driver will be removed which will destroy UIO resources. - Later trying to access any uio resource will cause kernel crash. + Later trying to access any UIO resource will cause kernel crash. **Resolution/Workaround**: If using DPDK for PCI HW hot-unplug, prefer to bind device with VFIO instead of IGB_UIO. diff -Nru dpdk-19.11.7/doc/guides/rel_notes/release_16_11.rst dpdk-19.11.10~rc1/doc/guides/rel_notes/release_16_11.rst --- dpdk-19.11.7/doc/guides/rel_notes/release_16_11.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/rel_notes/release_16_11.rst 2021-08-18 14:45:29.000000000 +0000 @@ -77,7 +77,7 @@ the current version, even 64 bytes packets take two slots with Virtio PMD on guest side. - The main impact is better performance for 0% packet loss use-cases, as it + The main impact is better performance for 0% packet loss use cases, as it behaves as if the virtqueue size was enlarged, so more packets can be buffered in the case of system perturbations. On the downside, small performance degradations were measured when running micro-benchmarks. diff -Nru dpdk-19.11.7/doc/guides/rel_notes/release_19_08.rst dpdk-19.11.10~rc1/doc/guides/rel_notes/release_19_08.rst --- dpdk-19.11.7/doc/guides/rel_notes/release_19_08.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/rel_notes/release_19_08.rst 2021-08-18 14:45:29.000000000 +0000 @@ -151,7 +151,7 @@ * Added multi-queue support to allow one af_xdp vdev with multiple netdev queues. * Enabled "need_wakeup" feature which can provide efficient support for the - usecase where the application and driver executing on the same core. + use case where the application and driver executing on the same core. * **Enabled infinite Rx in the PCAP PMD.** diff -Nru dpdk-19.11.7/doc/guides/rel_notes/release_19_11.rst dpdk-19.11.10~rc1/doc/guides/rel_notes/release_19_11.rst --- dpdk-19.11.7/doc/guides/rel_notes/release_19_11.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/rel_notes/release_19_11.rst 2021-08-18 14:45:29.000000000 +0000 @@ -3095,13 +3095,12 @@ * rib: fix insertion in some cases * rib: fix missing header include * rib: fix missing header includes -* (tag: 19.11.7-20.11-21.02-rc2) app/testpmd: fix setting maximum packet length -* (tag: 19.11.7-20.11-21.02-rc2-backports) net/mlx5: fix port attach in secondary process -* (tag: 19.11.7-21.02rc2-21.02-rc3-backports) net/mlx5: fix VXLAN decap on non-VXLAN flow -* (tag: 19.11.7-21.02rc2-21.02-rc3) mempool: fix panic on dump or audit -* (tag: 19.11.7-21.02rc3-21.02-backports) mem: fix build -* (tag: 19.11.7-21.02rc3-21.02) usertools: fix binding built-in kernel driver -* (tag: v19.11.7-rc1) version: 19.11.7-rc1 +* app/testpmd: fix setting maximum packet length +* net/mlx5: fix port attach in secondary process +* net/mlx5: fix VXLAN decap on non-VXLAN flow +* mempool: fix panic on dump or audit +* mem: fix build +* usertools: fix binding built-in kernel driver * test/distributor: fix return buffer queue overload * test/event_crypto: set cipher operation in transform * test: fix buffer overflow in Tx burst @@ -3227,3 +3226,467 @@ * The UDP fragmentation offload feature of Virtio-net device can not be turned on in the VM. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=207075 * mlx5 VLAN packets will not do RSS. Bug: https://bugs.dpdk.org/show_bug.cgi?id=661 + +19.11.8 Release Notes +--------------------- + +19.11.8 Fixes +~~~~~~~~~~~~~ + +* Regenerate meson.build changes required due to reverts +* Revert "Revert "Revert "build: always link whole DPDK static libraries""" +* Revert "Revert "Revert "build/pkg-config: improve static linking flags""" +* Revert "Revert "Revert "build/pkg-config: move pkg-config file creation""" +* Revert "Revert "Revert "build/pkg-config: output drivers first for static build""" +* Revert "Revert "Revert "build/pkg-config: prevent overlinking""" +* Revert "Revert "Revert "devtools: test static linkage with pkg-config""" + +19.11.8 Validation +~~~~~~~~~~~~~~~~~~ + +* Intel(R) Testing + + * Builds + + * Basic Intel NIC (ixgbe, i40e) testing + + * PF (i40e) + * PF (ixgbe) + * VF (i40e) + * VF (ixgbe) + * Compile Testing + * Intel NIC single core/NIC performance + + * Basic cryptodev and virtio testing + + * vhost/virtio basic loopback, PVP and performance test + * cryptodev Function/Performance + +* Intel(R) Testing with Open vSwitch + + * OVS build and link testing with OVS 2.13 (make based) + * OVS build and link testing with OVS 2.14 (make based) + +* Canonical(R) Testing + + * Build tests of DPDK & OVS 2.13.3 on Ubuntu 20.04 (meson based) + * Build tests of DPDK & OVS 2.13.3 on Ubuntu 20.10 (meson based) + * OVS-DPDK tests on x86_64 + +19.11.9 Release Notes +--------------------- + +19.11.9 Fixes +~~~~~~~~~~~~~ + +* app/bbdev: fix HARQ error messages +* app/crypto-perf: check memory allocation +* app/eventdev: fix lcore parsing skipping last core +* app/eventdev: fix overflow in lcore list parsing +* app: fix exit messages +* app/testpmd: fix bitmap of link speeds when force speed +* app/testpmd: fix build with musl +* app/testpmd: fix DCB forwarding configuration +* app/testpmd: fix DCB re-configuration +* app/testpmd: fix forward lcores number for DCB +* app/testpmd: fix max queue number for Tx offloads +* app/testpmd: fix NVGRE encap configuration +* app/testpmd: fix segment number check +* app/testpmd: fix Tx/Rx descriptor query error log +* app/testpmd: remove unnecessary UDP tunnel check +* bpf: fix JSLT validation +* build: detect execinfo library on Linux +* build: exclude meson files from examples installation +* buildtools: fix build with busybox +* bus/dpaa: fix 64-bit arch detection +* bus/dpaa: fix build with musl +* bus/dpaa: fix statistics reading +* bus/fslmc: fix random portal hangs with qbman 5.0 +* bus/fslmc: remove unused debug macro +* common/dpaax/caamflib: fix build with musl +* common/dpaax: fix possible null pointer access +* common/iavf: use pad byte to specify MAC type +* common/qat: increase IM buffer size for GEN3 +* common/sfc_efx/base: limit reported MCDI response length +* compress/qat: enable compression on GEN3 +* config/ppc: reduce number of cores and NUMA nodes +* crypto/dpaa2_sec: fix close and uninit functions +* crypto/dpaa_sec: affine the thread portal affinity +* crypto/qat: fix null authentication request +* crypto/qat: fix offset for out-of-place scatter-gather +* doc: fix build with Sphinx 4 +* doc: fix HiSilicon copyright syntax +* doc: fix multiport syntax in nfp guide +* doc: fix names of UIO drivers +* doc: fix sphinx rtd theme import in GHA +* drivers/crypto: fix build with -fno-common +* drivers/net: check process type in close operation +* eal: add C++ include guard for reciprocal header +* eal/arm64: fix platform register bit +* eal: fix comment of OS-specific header files +* eal: fix hang in control thread creation +* eal: fix race in control thread creation +* eal: fix service core list parsing +* eal/windows: add cleanup function stub +* eal/windows: fix default thread priority +* ethdev: add missing buses in device iterator +* ethdev: fix redundant flow after RSS expansion +* ethdev: update flow item GTP QFI definition +* ethdev: validate input in EEPROM info +* ethdev: validate input in module EEPROM dump +* ethdev: validate input in register info +* eventdev: fix case to initiate crypto adapter service +* eventdev: fix memory leakage on thread creation failure +* eventdev: remove redundant thread name setting +* event/dpaa2: remove unused macros +* event/octeontx2: fix device reconfigure for single slot +* examples: add eal cleanup to examples +* examples/bbdev: fix header include for musl +* examples/ethtool: remove unused parsing +* examples/flow_classify: fix NUMA check of port and core +* examples/l2fwd-cat: fix NUMA check of port and core +* examples/l2fwd-crypto: fix packet length while decryption +* examples/l2fwd-crypto: skip masked devices +* examples/l3fwd: fix LPM IPv6 subnets +* examples/l3fwd-power: fix empty poll thresholds +* examples/packet_ordering: fix port configuration +* examples/ptpclient: remove wrong comment +* examples/rxtx_callbacks: fix port ID format specifier +* examples/skeleton: fix NUMA check of port and core +* examples/timer: fix time interval +* examples/vhost: check memory table query +* examples/vhost_crypto: remove unused short option +* fbarray: fix log message on truncation error +* net/mlx5: fix flow split combined with counter +* ipc: check malloc sync reply result +* ipc: use monotonic clock +* kni: fix compilation on SLES15-SP3 +* license: fix typos +* log/linux: make default output stderr +* mbuf: check shared memory before dumping dynamic space +* mem: fix freeing segments in --huge-unlink mode +* net/af_xdp: fix error handling during Rx queue setup +* net/ark: refactor Rx buffer recovery +* net/ark: update packet director initial state +* net/bnx2x: fix build with GCC 11 +* net/bnx2x: fix build with GCC 11 +* net/bnxt: check PCI config read +* net/bnxt: drop unused attribute +* net/bnxt: fix build failures after merging patches +* net/bnxt: fix configuring LRO +* net/bnxt: fix device readiness check +* net/bnxt: fix double free in port start failure +* net/bnxt: fix dynamic VNIC count +* net/bnxt: fix firmware fatal error handling +* net/bnxt: fix FW readiness check during recovery +* net/bnxt: fix handling of null flow mask +* net/bnxt: fix health check alarm cancellation +* net/bnxt: fix HWRM and FW incompatibility handling +* net/bnxt: fix link state operations +* net/bnxt: fix memory allocation for command response +* net/bnxt: fix mismatched type comparison in MAC restore +* net/bnxt: fix PCI write check +* net/bnxt: fix PTP support for Thor +* net/bnxt: fix queues per VNIC +* net/bnxt: fix ring count calculation for Thor +* net/bnxt: fix RSS context cleanup +* net/bnxt: fix Rx and Tx timestamps +* net/bnxt: fix Rx buffer posting +* net/bnxt: fix Rx descriptor status +* net/bnxt: fix Rx queue count +* net/bnxt: fix Rx timestamp when FIFO pending bit is set +* net/bnxt: fix single PF per port check +* net/bnxt: fix timesync when PTP is not supported +* net/bnxt: fix Tx length hint threshold +* net/bnxt: fix Tx timestamp init +* net/bnxt: fix VF info allocation +* net/bnxt: fix VNIC configuration +* net/bnxt: fix xstats get +* net/bnxt: prevent device access in error state +* net/bnxt: refactor multi-queue Rx configuration +* net/bnxt: remove unnecessary forward declarations +* net/bnxt: remove unused function parameters +* net/bnxt: remove unused macro +* net/bnxt: reset filter indices on free +* net/bnxt: use prefix on global function +* net/bonding: fix adding itself as its slave +* net/bonding: fix LACP system address check +* net/bonding: fix leak on remove +* net/bonding: fix socket ID check +* net/cxgbe: remove use of uint type +* net/dpaa2: fix getting link status +* net/e1000/base: fix timeout for shadow RAM write +* net/e1000: fix flow error message object +* net/e1000: fix max Rx packet size +* net/e1000: fix Rx error counter for bad length +* net/e1000: remove MTU setting limitation +* net/ena/base: fix type conversions by explicit casting +* net/ena: fix releasing Tx ring mbufs +* net/ena: remove endian swap functions +* net/ena: switch memcpy to optimized version +* net/failsafe: fix RSS hash offload reporting +* net/failsafe: report minimum and maximum MTU +* net: fix comment in IPv6 header +* net/hinic: fix crash in secondary process +* net/hns3: clear hash map on flow director clear +* net/hns3: delete redundant blank line +* net/hns3: fix DCB mode check +* net/hns3: fix DCB reconfiguration +* net/hns3: fix flow control exception +* net/hns3: fix flow control mode +* net/hns3: fix flow counter value +* net/hns3: fix FLR miss detection +* net/hns3: fix handling link update +* net/hns3: fix HW buffer size on MTU update +* net/hns3: fix mailbox error message +* net/hns3: fix MTU config complexity +* net/hns3: fix ordering in secondary process initialization +* net/hns3: fix processing Tx offload flags +* net/hns3: fix querying flow director counter for out param +* net/hns3: fix requested FC mode rollback +* net/hns3: fix rollback after setting PVID failure +* net/hns3: fix secondary process request start/stop Rx/Tx +* net/hns3: fix typos on comments +* net/hns3: fix VF mailbox head field +* net/hns3: fix VMDq mode check +* net/hns3: log time delta in decimal format +* net/hns3: remove meaningless packet buffer rollback +* net/hns3: remove unused macro +* net/hns3: remove unused macros +* net/hns3: remove unused macros +* net/hns3: remove unused mailbox macro and struct +* net/hns3: remove unused VMDq code +* net/hns3: return error on PCI config write failure +* net/hns3: support get device version when dump register +* net/hns3: update HiSilicon copyright syntax +* net/i40e: announce request queue capability in PF +* net/i40e: fix input set field mask +* net/i40e: fix IPv4 fragment offload +* net/i40e: fix lack of MAC type when set MAC address +* net/i40e: fix negative VEB index +* net/i40e: fix parsing packet type for NEON +* net/i40e: fix primary MAC type when starting port +* net/i40e: fix VF RSS configuration +* net/i40e: remove redundant VSI check in Tx queue setup +* net/i40evf: fix packet loss for X722 +* net/iavf: fix lack of MAC type when set MAC address +* net/iavf: fix primary MAC type when starting port +* net/iavf: fix TSO max segment size +* net/iavf: fix Tx context descriptor +* net/iavf: fix VF to PF command failure handling +* net/ice/base: cleanup filter list on error +* net/ice/base: fix build with GCC 11 +* net/ice/base: fix memory allocation for MAC addresses +* net/ice/base: fix memory allocation wrapper +* net/ice/base: fix payload indicator on ptype +* net/ice: check some functions return +* net/ice: fix disabling promiscuous mode +* net/ice: fix fast mbuf freeing +* net/ice: fix illegal access when removing MAC filter +* net/ice: fix VLAN filter with PF +* net/ice: fix VSI array out of bounds access +* net/ixgbe: fix RSS RETA being reset after port start +* net/ixgbe: fix Rx errors statistics for UDP checksum +* net/kni: check init result +* net/memif: fix Tx bps statistics for zero-copy +* net/mlx4: fix buffer leakage on device close +* net/mlx4: fix leak when configured repeatedly +* net/mlx4: fix RSS action with null hash key +* net/mlx4: fix secondary process initialization ordering +* net/mlx5: fix drop action for Direct Rules/Verbs +* net/mlx5: fix leak when configured repeatedly +* net/mlx5: fix metadata item validation for ingress flows +* net/mlx5: fix probing device in legacy bonding mode +* net/mlx5: fix Rx metadata leftovers +* net/mlx5: fix Rx segmented packets on mbuf starvation +* net/mlx5: fix secondary process initialization ordering +* net/mlx5: remove drop queue function prototypes +* net/mlx5: support RSS expansion for IPv6 GRE +* net/nfp: fix reporting of RSS capabilities +* net/octeontx2: fix VLAN filter +* net/pcap: fix format string +* net/qede: accept bigger RSS table +* net/qede: reduce log verbosity +* net/tap: check ioctl on restore +* net/tap: fix build with GCC 11 +* net/tap: fix interrupt vector array size +* net/virtio: fix interrupt unregistering for listening socket +* net/virtio: fix vectorized Rx queue rearm +* power: do not skip saving original P-state governor +* power: fix sanity checks for guest channel read +* power: remove duplicated symbols from map file +* power: save original ACPI governor always +* raw/ntb: check memory allocations +* raw/ntb: check SPAD user index +* raw/skeleton: add missing check after setting attribute +* Revert "kni: fix compilation on SLES15-SP3" +* service: clean references to removed symbol +* stack: allow lock-free only on relevant architectures +* test/bpf: fix error message +* test: check flow classifier creation +* test: check thread creation +* test/cmdline: fix inputs array +* test/cmdline: silence clang 12 warning +* test/crypto: fix auth-cipher compare length in OOP +* test/crypto: fix build with GCC 11 +* test/distributor: fix burst flush on worker quit +* test/distributor: fix worker notification in burst mode +* test/event: fix timeout accuracy +* test: fix autotest handling of skipped tests +* test: fix build with GCC 11 +* test: fix division by zero +* test: fix TCP header initialization +* test/kni: check init result +* test/kni: fix a comment +* test/mempool: fix object initializer +* test/power: add delay before checking CPU frequency +* test/power: add turbo mode to frequency check +* test/power: fix CPU frequency check +* test/power: fix low frequency test when turbo enabled +* test/power: fix turbo test +* test/power: round CPU frequency to check +* test: proceed if timer subsystem already initialized +* test/table: fix build with GCC 11 +* test/timer: check memzone allocation +* vdpa/ifc: check PCI config read +* vfio: do not merge contiguous areas +* vfio: fix API description +* vfio: fix DMA mapping granularity for IOVA as VA +* vfio: fix duplicated user mem map +* vfio: fix stdbool usage without include +* vhost: fix batch dequeue potential buffer overflow +* vhost: fix initialization of temporary header +* vhost: fix packed ring potential buffer overflow +* vhost: fix queue initialization +* vhost: fix split ring potential buffer overflow + +19.11.9 Validation +~~~~~~~~~~~~~~~~~~ + +* [Intel(R) Testing](http://mails.dpdk.org/archives/stable/2021-July/032349.html) + + * Builds + + * Basic Intel NIC (ixgbe, i40e) testing + + * PF (i40e) + * PF (ixgbe) + * VF (i40e) + * VF (ixgbe) + * Compile Testing + * Intel NIC single core/NIC performance + + * Basic cryptodev and virtio testing + + * vhost/virtio basic loopback, PVP and performance test + * cryptodev Function/Performance + +* [Intel(R) Testing with Open vSwitch](http://mails.dpdk.org/archives/stable/2021-June/031702.html) + + * OVS build and link testing with OVS 2.13 (make based) + * OVS build and link testing with OVS 2.14 (make based) + * VSPERF tests + + * phy2phy_tput + * pvp_tput + * pvp_cont + * pvvp_tput + * pvpv_cont + * ovsdpdk_jumbo_p2p + * ovsdpdk_jumbo_pvp + * ovsdpdk_jumbo_p2p_upper_bound + * ovsdpdk_mq_pvp_rxqs_testpmd + * ovsdpdk_mq_pvp_rxqs_linux_bridge + +* [Canonical(R) Testing](http://mails.dpdk.org/archives/stable/2021-July/031997.html) + + * Build tests of DPDK & OVS 2.13.3 on Ubuntu 20.04 (meson based) + * Build tests of DPDK & OVS 2.13.3 on Ubuntu 20.10 (meson based) + * Functional and performance tests based on OVS-DPDK on x86_64 + * Autopkgtests for DPDK and OpenvSwitch + +* [Red Hat(R) Testing](http://mails.dpdk.org/archives/stable/2021-June/031619.html) + + * Platform + + * RHEL 8 + * Kernel 4.18 + * Qemu 6.0 + * X540-AT2 NIC(ixgbe, 10G) + * Tested on 19.11.9-RC3 + + * Tests + + * Guest with device assignment(PF) throughput testing(1G hugepage size): PASS + * Guest with device assignment(PF) throughput testing(2M hugepage size) : PASS + * Guest with device assignment(VF) throughput testing: PASS + * PVP (host dpdk testpmd as vswitch) 1Q: throughput testing: PASS + * PVP vhost-user 2Q throughput testing: PASS + * PVP vhost-user 1Q - cross numa node throughput testing: PASS + * Guest with vhost-user 2 queues throughput testing: PASS + * vhost-user reconnect with dpdk-client, qemu-server: qemu reconnect: PASS + * vhost-user reconnect with dpdk-client, qemu-server: ovs reconnect: PASS + * PVP 1Q live migration testing: PASS + * PVP 1Q cross numa node live migration testing: PASS + * Guest with ovs+dpdk+vhost-user 1Q live migration testing: PASS + * Guest with ovs+dpdk+vhost-user 1Q live migration testing (2M): PASS + * Guest with ovs+dpdk+vhost-user 2Q live migration testing: PASS + * Host PF + DPDK testing: PASS + * Host VF + DPDK testing: PASS + +* [Nvidia (R) Testing](http://mails.dpdk.org/archives/stable/2021-July/032381.html) + + * functional tests on Mellanox hardware + + * NIC: ConnectX-4 Lx / OS: Ubuntu 20.04 LTS / Driver: MLNX_OFED_LINUX-5.3-1.0.0.1 / Firmware: 14.30.1004 + * NIC: ConnectX-5 / OS: Ubuntu 20.04 LTS / Driver: MLNX_OFED_LINUX-5.3-1.0.0.1 / Firmware: 16.30.1004 + + * Basic functionality: + + * Send and receive multiple types of traffic. + * testpmd xstats counter test. + * testpmd timestamp test. + * Changing/checking link status through testpmd. + * RTE flow tests: Items: eth / vlan / ipv4 / ipv6 / tcp / udp / icmp / gre / nvgre / vxlan ip in ip / mplsoudp / mplsogre + * Actions: drop / queue / rss / mark / flag / jump / count / raw_encap / raw_decap / vxlan_encap / vxlan_decap / NAT / dec_ttl + * Some RSS tests. + * VLAN filtering, stripping and insertion tests. + * Checksum and TSO tests. + * ptype tests. + * link_status_interrupt example application tests. + * l3fwd-power example application tests. + * Multi-process example applications tests. + + * Compilation tests with multiple configurations in the following OS/driver combinations are also passing: + + * Ubuntu 20.04.2 with MLNX_OFED_LINUX-5.3-1.0.0.1. + * Ubuntu 20.04.2 with rdma-core master (a66e2a5). + * Ubuntu 20.04.2 with rdma-core v28.0. + * Ubuntu 18.04.5 with rdma-core v17.1. + * Ubuntu 18.04.5 with rdma-core master (a66e2a5) (i386). + * Ubuntu 16.04.7 with rdma-core v22.7. + * Fedora 34 with rdma-core v35.0. + * Fedora 35 (Rawhide) with rdma-core v35.0 (only with gcc). + * CentOS 7 7.9.2009 with rdma-core master (a66e2a5). + * CentOS 7 7.9.2009 with MLNX_OFED_LINUX-5.3-1.0.0.1. + * CentOS 8 8.3.2011 with rdma-core master (7f2d460). + * OpenSUSE Leap 15.3 with rdma-core v31.0. + +19.11.9 Known Issues +~~~~~~~~~~~~~~~~~~~~ + +This time there are a few issues which were identified in the tests. But none +of them is an in-place regression. So far they are all issues with newer +compilers, toolchains and kernels that happen to be incompatible with the +19.11.x code. + +* Due to a kernel patch backport in SUSE Linux Enterprise Server 15 SP3 + [compilation of kni fails there](https://bugs.dpdk.org/show_bug.cgi?id=728). + A fix would break existing SP2 installation and + [further options are discussed](http://mails.dpdk.org/archives/stable/2021-June/031210.html) + +* A [Build issue with clang 12.0.1](https://bugs.dpdk.org/show_bug.cgi?id=745) + +* A make [build issue with Fedora 34 with GCC11](https://bugs.dpdk.org/show_bug.cgi?id=744) + +* Meson based [build issues with ICC-19.1.1](https://bugs.dpdk.org/show_bug.cgi?id=747) diff -Nru dpdk-19.11.7/doc/guides/rel_notes/release_2_2.rst dpdk-19.11.10~rc1/doc/guides/rel_notes/release_2_2.rst --- dpdk-19.11.7/doc/guides/rel_notes/release_2_2.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/rel_notes/release_2_2.rst 2021-08-18 14:45:29.000000000 +0000 @@ -322,7 +322,7 @@ Several customers have reported a link flap issue on 82579. The symptoms are random and intermittent link losses when 82579 is connected to specific - switches. the Issue was root caused as an inter-operability problem between + switches. the Issue was root caused as an interoperability problem between the NIC and at least some Broadcom PHYs in the Energy Efficient Ethernet wake mechanism. diff -Nru dpdk-19.11.7/doc/guides/sample_app_ug/l2_forward_cat.rst dpdk-19.11.10~rc1/doc/guides/sample_app_ug/l2_forward_cat.rst --- dpdk-19.11.7/doc/guides/sample_app_ug/l2_forward_cat.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/sample_app_ug/l2_forward_cat.rst 2021-08-18 14:45:29.000000000 +0000 @@ -198,7 +198,7 @@ ``pqos_cap_get(...)`` and ``pqos_cap_get_type(..., PQOS_CAP_TYPE_L3CA, ...)`` calls. When all capability and topology information is collected, the requested CAT configuration is validated. A check is then performed (on per socket basis) -for a sufficient number of un-associated COS. COS are selected and +for a sufficient number of unassociated COS. COS are selected and configured via the ``pqos_l3ca_set(...)`` call. Finally, COS are associated to relevant CPUs via ``pqos_l3ca_assoc_set(...)`` calls. diff -Nru dpdk-19.11.7/doc/guides/sample_app_ug/performance_thread.rst dpdk-19.11.10~rc1/doc/guides/sample_app_ug/performance_thread.rst --- dpdk-19.11.7/doc/guides/sample_app_ug/performance_thread.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/sample_app_ug/performance_thread.rst 2021-08-18 14:45:29.000000000 +0000 @@ -1194,7 +1194,7 @@ at run time. An unmasked event results in a callback that provides information about the event. The default callback simply prints trace information. The default mask is 0 (all events off) the mask can be modified by calling the -function ``lthread_diagniostic_set_mask()``. +function ``lthread_diagnostic_set_mask()``. It is possible register a user callback function to implement more sophisticated diagnostic functions. diff -Nru dpdk-19.11.7/doc/guides/sample_app_ug/vhost.rst dpdk-19.11.10~rc1/doc/guides/sample_app_ug/vhost.rst --- dpdk-19.11.7/doc/guides/sample_app_ug/vhost.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/sample_app_ug/vhost.rst 2021-08-18 14:45:29.000000000 +0000 @@ -72,7 +72,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~ Make sure you have DPDK built inside the guest. Also make sure the -corresponding virtio-net PCI device is bond to a uio driver, which +corresponding virtio-net PCI device is bond to a UIO driver, which could be done by: .. code-block:: console diff -Nru dpdk-19.11.7/doc/guides/testpmd_app_ug/testpmd_funcs.rst dpdk-19.11.10~rc1/doc/guides/testpmd_app_ug/testpmd_funcs.rst --- dpdk-19.11.7/doc/guides/testpmd_app_ug/testpmd_funcs.rst 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/doc/guides/testpmd_app_ug/testpmd_funcs.rst 2021-08-18 14:45:29.000000000 +0000 @@ -3944,7 +3944,8 @@ - ``gtp_psc``: match GTP PDU extension header with type 0x85. - ``pdu_type {unsigned}``: PDU type. - - ``qfi {unsigned}``: QoS flow identifier. + + - ``qfi {unsigned}``: PPP, RQI and QoS flow identifier. - ``pppoes``, ``pppoed``: match PPPoE header. @@ -4732,7 +4733,7 @@ Raw encapsulation configuration can be set by the following commands -Eecapsulating VxLAN:: +Encapsulating VxLAN:: testpmd> set raw_encap 4 eth src is 10:11:22:33:44:55 / vlan tci is 1 inner_type is 0x0800 / ipv4 / udp dst is 4789 / vxlan vni diff -Nru dpdk-19.11.7/drivers/bus/dpaa/base/fman/fman.c dpdk-19.11.10~rc1/drivers/bus/dpaa/base/fman/fman.c --- dpdk-19.11.7/drivers/bus/dpaa/base/fman/fman.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/bus/dpaa/base/fman/fman.c 2021-08-18 14:45:29.000000000 +0000 @@ -50,7 +50,7 @@ free(bp); } cleanup: - free(__if); + rte_free(__if); } static int diff -Nru dpdk-19.11.7/drivers/bus/dpaa/base/fman/fman_hw.c dpdk-19.11.10~rc1/drivers/bus/dpaa/base/fman/fman_hw.c --- dpdk-19.11.7/drivers/bus/dpaa/base/fman/fman_hw.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/bus/dpaa/base/fman/fman_hw.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * - * Copyright 2017 NXP + * Copyright 2017,2020 NXP * */ @@ -219,20 +219,20 @@ struct memac_regs *regs = m->ccsr_map; /* read recved packet count */ - stats->ipackets = ((u64)in_be32(®s->rfrm_u)) << 32 | - in_be32(®s->rfrm_l); - stats->ibytes = ((u64)in_be32(®s->roct_u)) << 32 | - in_be32(®s->roct_l); - stats->ierrors = ((u64)in_be32(®s->rerr_u)) << 32 | - in_be32(®s->rerr_l); + stats->ipackets = (u64)in_be32(®s->rfrm_l) | + ((u64)in_be32(®s->rfrm_u)) << 32; + stats->ibytes = (u64)in_be32(®s->roct_l) | + ((u64)in_be32(®s->roct_u)) << 32; + stats->ierrors = (u64)in_be32(®s->rerr_l) | + ((u64)in_be32(®s->rerr_u)) << 32; /* read xmited packet count */ - stats->opackets = ((u64)in_be32(®s->tfrm_u)) << 32 | - in_be32(®s->tfrm_l); - stats->obytes = ((u64)in_be32(®s->toct_u)) << 32 | - in_be32(®s->toct_l); - stats->oerrors = ((u64)in_be32(®s->terr_u)) << 32 | - in_be32(®s->terr_l); + stats->opackets = (u64)in_be32(®s->tfrm_l) | + ((u64)in_be32(®s->tfrm_u)) << 32; + stats->obytes = (u64)in_be32(®s->toct_l) | + ((u64)in_be32(®s->toct_u)) << 32; + stats->oerrors = (u64)in_be32(®s->terr_l) | + ((u64)in_be32(®s->terr_u)) << 32; } void @@ -244,10 +244,9 @@ uint64_t base_offset = offsetof(struct memac_regs, reoct_l); for (i = 0; i < n; i++) - value[i] = ((u64)in_be32((char *)regs - + base_offset + 8 * i + 4)) << 32 | - ((u64)in_be32((char *)regs - + base_offset + 8 * i)); + value[i] = (((u64)in_be32((char *)regs + base_offset + 8 * i) | + (u64)in_be32((char *)regs + base_offset + + 8 * i + 4)) << 32); } void diff -Nru dpdk-19.11.7/drivers/bus/dpaa/base/fman/netcfg_layer.c dpdk-19.11.10~rc1/drivers/bus/dpaa/base/fman/netcfg_layer.c --- dpdk-19.11.7/drivers/bus/dpaa/base/fman/netcfg_layer.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/bus/dpaa/base/fman/netcfg_layer.c 2021-08-18 14:45:29.000000000 +0000 @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -89,7 +89,7 @@ */ skfd = socket(AF_PACKET, SOCK_RAW, 0); if (unlikely(skfd < 0)) { - error(0, errno, "%s(): open(SOCK_RAW)", __func__); + err(0, "%s(): open(SOCK_RAW)", __func__); return NULL; } diff -Nru dpdk-19.11.7/drivers/bus/dpaa/base/qbman/bman_driver.c dpdk-19.11.10~rc1/drivers/bus/dpaa/base/qbman/bman_driver.c --- dpdk-19.11.7/drivers/bus/dpaa/base/qbman/bman_driver.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/bus/dpaa/base/qbman/bman_driver.c 2021-08-18 14:45:29.000000000 +0000 @@ -11,6 +11,7 @@ #include #include "bman_priv.h" #include +#include /* * Global variables of the max portal/pool number this bman version supported @@ -40,7 +41,8 @@ ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (ret) { - error(0, ret, "pthread_getaffinity_np()"); + errno = ret; + err(0, "pthread_getaffinity_np()"); return ret; } pcfg.cpu = -1; @@ -60,7 +62,8 @@ map.index = idx; ret = process_portal_map(&map); if (ret) { - error(0, ret, "process_portal_map()"); + errno = ret; + err(0, "process_portal_map()"); return ret; } /* Make the portal's cache-[enabled|inhibited] regions */ @@ -104,8 +107,10 @@ cfg = bman_destroy_affine_portal(); DPAA_BUG_ON(cfg != &pcfg); ret = process_portal_unmap(&map.addr); - if (ret) - error(0, ret, "process_portal_unmap()"); + if (ret) { + errno = ret; + err(0, "process_portal_unmap()"); + } return ret; } diff -Nru dpdk-19.11.7/drivers/bus/dpaa/base/qbman/qman_driver.c dpdk-19.11.10~rc1/drivers/bus/dpaa/base/qbman/qman_driver.c --- dpdk-19.11.7/drivers/bus/dpaa/base/qbman/qman_driver.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/bus/dpaa/base/qbman/qman_driver.c 2021-08-18 14:45:29.000000000 +0000 @@ -9,6 +9,8 @@ #include #include "qman_priv.h" #include +#include + #include /* Global variable containing revision id (even on non-control plane systems @@ -40,7 +42,8 @@ map.index = index; ret = process_portal_map(&map); if (ret) { - error(0, ret, "process_portal_map()"); + errno = ret; + err(0, "process_portal_map()"); return ret; } qpcfg.channel = map.channel; @@ -86,8 +89,10 @@ cfg = qman_destroy_affine_portal(NULL); DPAA_BUG_ON(cfg != &qpcfg); ret = process_portal_unmap(&map.addr); - if (ret) - error(0, ret, "process_portal_unmap()"); + if (ret) { + errno = ret; + err(0, "process_portal_unmap()"); + } return ret; } @@ -136,7 +141,8 @@ q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0); if (!q_pcfg) { - error(0, -1, "q_pcfg kzalloc failed"); + /* kzalloc sets errno */ + err(0, "q_pcfg kzalloc failed"); return NULL; } @@ -145,7 +151,8 @@ q_map.index = QBMAN_ANY_PORTAL_IDX; ret = process_portal_map(&q_map); if (ret) { - error(0, ret, "process_portal_map()"); + errno = ret; + err(0, "process_portal_map()"); kfree(q_pcfg); return NULL; } diff -Nru dpdk-19.11.7/drivers/bus/dpaa/include/fsl_qman.h dpdk-19.11.10~rc1/drivers/bus/dpaa/include/fsl_qman.h --- dpdk-19.11.7/drivers/bus/dpaa/include/fsl_qman.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/bus/dpaa/include/fsl_qman.h 2021-08-18 14:45:29.000000000 +0000 @@ -16,7 +16,7 @@ #include /* FQ lookups (turn this on for 64bit user-space) */ -#if (__WORDSIZE == 64) +#ifdef RTE_ARCH_64 #define CONFIG_FSL_QMAN_FQ_LOOKUP /* if FQ lookups are supported, this controls the number of initialised, * s/w-consumed FQs that can be supported at any one time. diff -Nru dpdk-19.11.7/drivers/bus/dpaa/include/netcfg.h dpdk-19.11.10~rc1/drivers/bus/dpaa/include/netcfg.h --- dpdk-19.11.7/drivers/bus/dpaa/include/netcfg.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/bus/dpaa/include/netcfg.h 2021-08-18 14:45:29.000000000 +0000 @@ -9,7 +9,6 @@ #define __NETCFG_H #include -#include /* Configuration information related to a specific ethernet port */ struct fm_eth_port_cfg { diff -Nru dpdk-19.11.7/drivers/bus/fslmc/fslmc_logs.h dpdk-19.11.10~rc1/drivers/bus/fslmc/fslmc_logs.h --- dpdk-19.11.7/drivers/bus/fslmc/fslmc_logs.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/bus/fslmc/fslmc_logs.h 2021-08-18 14:45:29.000000000 +0000 @@ -18,8 +18,6 @@ rte_log(RTE_LOG_DEBUG, dpaa2_logtype_bus, "fslmc: %s(): " fmt "\n", \ __func__, ##args) -#define BUS_INIT_FUNC_TRACE() DPAA2_BUS_DEBUG(" >>") - #define DPAA2_BUS_INFO(fmt, args...) \ DPAA2_BUS_LOG(INFO, fmt, ## args) #define DPAA2_BUS_ERR(fmt, args...) \ diff -Nru dpdk-19.11.7/drivers/bus/fslmc/qbman/qbman_portal.c dpdk-19.11.10~rc1/drivers/bus/fslmc/qbman/qbman_portal.c --- dpdk-19.11.7/drivers/bus/fslmc/qbman/qbman_portal.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/bus/fslmc/qbman/qbman_portal.c 2021-08-18 14:45:29.000000000 +0000 @@ -311,17 +311,9 @@ eqcr_pi = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI); p->eqcr.pi = eqcr_pi & p->eqcr.pi_ci_mask; p->eqcr.pi_vb = eqcr_pi & QB_VALID_BIT; - if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 - && (d->cena_access_mode == qman_cena_fastest_access)) - p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI) - & p->eqcr.pi_ci_mask; - else - p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI) - & p->eqcr.pi_ci_mask; - p->eqcr.available = p->eqcr.pi_ring_size - - qm_cyc_diff(p->eqcr.pi_ring_size, - p->eqcr.ci & (p->eqcr.pi_ci_mask<<1), - p->eqcr.pi & (p->eqcr.pi_ci_mask<<1)); + p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI) + & p->eqcr.pi_ci_mask; + p->eqcr.available = p->eqcr.pi_ring_size; portal_idx_map[p->desc.idx] = p; return p; diff -Nru dpdk-19.11.7/drivers/bus/pci/pci_common.c dpdk-19.11.10~rc1/drivers/bus/pci/pci_common.c --- dpdk-19.11.7/drivers/bus/pci/pci_common.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/bus/pci/pci_common.c 2021-08-18 14:45:29.000000000 +0000 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -150,7 +151,9 @@ } if (dev->device.numa_node < 0) { - RTE_LOG(WARNING, EAL, " Invalid NUMA socket, default to 0\n"); + if (rte_socket_count() > 1) + RTE_LOG(INFO, EAL, "Device %s is not NUMA-aware, defaulting socket to 0\n", + dev->name); dev->device.numa_node = 0; } diff -Nru dpdk-19.11.7/drivers/bus/vmbus/vmbus_common.c dpdk-19.11.10~rc1/drivers/bus/vmbus/vmbus_common.c --- dpdk-19.11.7/drivers/bus/vmbus/vmbus_common.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/bus/vmbus/vmbus_common.c 2021-08-18 14:45:29.000000000 +0000 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -113,7 +114,9 @@ dev->driver = dr; if (dev->device.numa_node < 0) { - VMBUS_LOG(WARNING, " Invalid NUMA socket, default to 0"); + if (rte_socket_count() > 1) + VMBUS_LOG(INFO, "Device %s is not NUMA-aware, defaulting socket to 0", + guid); dev->device.numa_node = 0; } diff -Nru dpdk-19.11.7/drivers/common/dpaax/caamflib/compat.h dpdk-19.11.10~rc1/drivers/common/dpaax/caamflib/compat.h --- dpdk-19.11.7/drivers/common/dpaax/caamflib/compat.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/common/dpaax/caamflib/compat.h 2021-08-18 14:45:29.000000000 +0000 @@ -11,7 +11,7 @@ #include #include -#ifdef __GLIBC__ +#ifdef RTE_EXEC_ENV_LINUX #include #include #include @@ -24,7 +24,7 @@ #error "Undefined endianness" #endif -#else +#else /* !RTE_EXEC_ENV_LINUX */ #error Environment not supported! #endif @@ -40,7 +40,7 @@ #define __maybe_unused __attribute__((unused)) #endif -#if defined(__GLIBC__) && !defined(pr_debug) +#if !defined(pr_debug) #if !defined(SUPPRESS_PRINTS) && defined(RTA_DEBUG) #define pr_debug(fmt, ...) \ RTE_LOG(DEBUG, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) @@ -49,7 +49,7 @@ #endif #endif /* pr_debug */ -#if defined(__GLIBC__) && !defined(pr_err) +#if !defined(pr_err) #if !defined(SUPPRESS_PRINTS) #define pr_err(fmt, ...) \ RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) @@ -58,7 +58,7 @@ #endif #endif /* pr_err */ -#if defined(__GLIBC__) && !defined(pr_warn) +#if !defined(pr_warn) #if !defined(SUPPRESS_PRINTS) #define pr_warn(fmt, ...) \ RTE_LOG(WARNING, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) @@ -101,7 +101,7 @@ #endif /* Use Linux naming convention */ -#ifdef __GLIBC__ +#if defined(RTE_EXEC_ENV_LINUX) || defined(__GLIBC__) #define swab16(x) rte_bswap16(x) #define swab32(x) rte_bswap32(x) #define swab64(x) rte_bswap64(x) diff -Nru dpdk-19.11.7/drivers/common/dpaax/caamflib.c dpdk-19.11.10~rc1/drivers/common/dpaax/caamflib.c --- dpdk-19.11.7/drivers/common/dpaax/caamflib.c 1970-01-01 00:00:00.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/common/dpaax/caamflib.c 2021-08-18 14:45:29.000000000 +0000 @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) + * + * Copyright 2020 NXP + * + */ + +#include + +/* + * SEC HW block revision. + * + * This *must not be confused with SEC version*: + * - SEC HW block revision format is "v" + * - SEC revision format is "x.y" + */ +enum rta_sec_era rta_sec_era; diff -Nru dpdk-19.11.7/drivers/common/dpaax/compat.h dpdk-19.11.10~rc1/drivers/common/dpaax/compat.h --- dpdk-19.11.7/drivers/common/dpaax/compat.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/common/dpaax/compat.h 2021-08-18 14:45:29.000000000 +0000 @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include diff -Nru dpdk-19.11.7/drivers/common/dpaax/dpaax_iova_table.c dpdk-19.11.10~rc1/drivers/common/dpaax/dpaax_iova_table.c --- dpdk-19.11.7/drivers/common/dpaax/dpaax_iova_table.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/common/dpaax/dpaax_iova_table.c 2021-08-18 14:45:29.000000000 +0000 @@ -369,8 +369,10 @@ } DPAAX_DEBUG(" === Start of PA->VA Translation Table ==="); - if (dpaax_iova_table_p == NULL) + if (dpaax_iova_table_p == NULL) { DPAAX_DEBUG("\tNULL"); + return; + } entry = dpaax_iova_table_p->entries; for (i = 0; i < dpaax_iova_table_p->count; i++) { diff -Nru dpdk-19.11.7/drivers/common/dpaax/Makefile dpdk-19.11.10~rc1/drivers/common/dpaax/Makefile --- dpdk-19.11.7/drivers/common/dpaax/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/common/dpaax/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -16,6 +16,7 @@ CFLAGS += -Wno-cast-qual CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib # versioning export map EXPORT_MAP := rte_common_dpaax_version.map @@ -23,7 +24,7 @@ # # all source are stored in SRCS-y # -SRCS-y += dpaax_iova_table.c dpaa_of.c +SRCS-y += dpaax_iova_table.c dpaa_of.c caamflib.c LDLIBS += -lrte_eal diff -Nru dpdk-19.11.7/drivers/common/dpaax/meson.build dpdk-19.11.10~rc1/drivers/common/dpaax/meson.build --- dpdk-19.11.7/drivers/common/dpaax/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/common/dpaax/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -8,7 +8,9 @@ reason = 'only supported on linux' endif -sources = files('dpaax_iova_table.c', 'dpaa_of.c') +sources = files('dpaax_iova_table.c', 'dpaa_of.c', 'caamflib.c') + +includes += include_directories('caamflib') cflags += ['-D_GNU_SOURCE'] if cc.has_argument('-Wno-cast-qual') diff -Nru dpdk-19.11.7/drivers/common/dpaax/rte_common_dpaax_version.map dpdk-19.11.10~rc1/drivers/common/dpaax/rte_common_dpaax_version.map --- dpdk-19.11.7/drivers/common/dpaax/rte_common_dpaax_version.map 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/common/dpaax/rte_common_dpaax_version.map 2021-08-18 14:45:29.000000000 +0000 @@ -21,3 +21,7 @@ local: *; }; + +INTERNAL { + rta_sec_era; +}; diff -Nru dpdk-19.11.7/drivers/common/octeontx2/otx2_dev.h dpdk-19.11.10~rc1/drivers/common/octeontx2/otx2_dev.h --- dpdk-19.11.7/drivers/common/octeontx2/otx2_dev.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/common/octeontx2/otx2_dev.h 2021-08-18 14:45:29.000000000 +0000 @@ -46,6 +46,9 @@ ((RVU_PCI_REV_MAJOR(otx2_dev_revid(dev)) == 0x0) && \ (RVU_PCI_REV_MIDR_ID(otx2_dev_revid(dev)) == 0x0)) +#define otx2_dev_is_98xx(dev) \ + (RVU_PCI_REV_MIDR_ID(otx2_dev_revid(dev)) == 0x3) + struct otx2_dev; /* Link status callback */ diff -Nru dpdk-19.11.7/drivers/common/qat/qat_device.h dpdk-19.11.10~rc1/drivers/common/qat/qat_device.h --- dpdk-19.11.7/drivers/common/qat/qat_device.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/common/qat/qat_device.h 2021-08-18 14:45:29.000000000 +0000 @@ -29,7 +29,7 @@ enum qat_comp_num_im_buffers { QAT_NUM_INTERM_BUFS_GEN1 = 12, QAT_NUM_INTERM_BUFS_GEN2 = 20, - QAT_NUM_INTERM_BUFS_GEN3 = 20 + QAT_NUM_INTERM_BUFS_GEN3 = 64 }; struct qat_device_info { diff -Nru dpdk-19.11.7/drivers/compress/qat/qat_comp.c dpdk-19.11.10~rc1/drivers/compress/qat/qat_comp.c --- dpdk-19.11.7/drivers/compress/qat/qat_comp.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/compress/qat/qat_comp.c 2021-08-18 14:45:29.000000000 +0000 @@ -68,8 +68,8 @@ ICP_QAT_FW_COMP_EOP : ICP_QAT_FW_COMP_NOT_EOP, ICP_QAT_FW_COMP_NOT_BFINAL, - ICP_QAT_FW_COMP_NO_CNV, - ICP_QAT_FW_COMP_NO_CNV_RECOVERY); + ICP_QAT_FW_COMP_CNV, + ICP_QAT_FW_COMP_CNV_RECOVERY); } if (likely(qat_xform->qat_comp_request_type == @@ -286,7 +286,8 @@ rx_op->status = RTE_COMP_OP_STATUS_ERROR; rx_op->debug_status = ERR_CODE_QAT_COMP_WRONG_FW; *op = (void *)rx_op; - QAT_DP_LOG(ERR, "QAT has wrong firmware"); + QAT_DP_LOG(ERR, + "This QAT hardware doesn't support compression operation"); ++(*dequeue_err_count); return 0; } diff -Nru dpdk-19.11.7/drivers/compress/qat/qat_comp_pmd.c dpdk-19.11.10~rc1/drivers/compress/qat/qat_comp_pmd.c --- dpdk-19.11.7/drivers/compress/qat/qat_comp_pmd.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/compress/qat/qat_comp_pmd.c 2021-08-18 14:45:29.000000000 +0000 @@ -82,13 +82,13 @@ qat_private->qat_dev->qps_in_use[QAT_SERVICE_COMPRESSION][queue_pair_id] = NULL; - for (i = 0; i < qp->nb_descriptors; i++) { - - struct qat_comp_op_cookie *cookie = qp->op_cookies[i]; + if (qp != NULL) + for (i = 0; i < qp->nb_descriptors; i++) { + struct qat_comp_op_cookie *cookie = qp->op_cookies[i]; - rte_free(cookie->qat_sgl_src_d); - rte_free(cookie->qat_sgl_dst_d); - } + rte_free(cookie->qat_sgl_src_d); + rte_free(cookie->qat_sgl_dst_d); + } return qat_qp_release((struct qat_qp **) &(dev->data->queue_pairs[queue_pair_id])); @@ -196,7 +196,7 @@ struct array_of_ptrs *array_of_pointers; int size_of_ptr_array; uint32_t full_size; - uint32_t offset_of_sgls, offset_of_flat_buffs = 0; + uint32_t offset_of_flat_buffs; int i; int num_im_sgls = qat_gen_config[ comp_dev->qat_dev->qat_dev_gen].comp_num_im_bufs_required; @@ -211,31 +211,31 @@ return memzone; } - /* Create a memzone to hold intermediate buffers and associated - * meta-data needed by the firmware. The memzone contains 3 parts: + /* Create multiple memzones to hold intermediate buffers and associated + * meta-data needed by the firmware. + * The first memzone contains: * - a list of num_im_sgls physical pointers to sgls - * - the num_im_sgl sgl structures, each pointing to - * QAT_NUM_BUFS_IN_IM_SGL flat buffers - * - the flat buffers: num_im_sgl * QAT_NUM_BUFS_IN_IM_SGL - * buffers, each of buff_size + * All other memzones contain: + * - the sgl structure, pointing to QAT_NUM_BUFS_IN_IM_SGL flat buffers + * - the flat buffers: QAT_NUM_BUFS_IN_IM_SGL buffers, + * each of buff_size * num_im_sgls depends on the hardware generation of the device * buff_size comes from the user via the config file */ size_of_ptr_array = num_im_sgls * sizeof(phys_addr_t); - offset_of_sgls = (size_of_ptr_array + (~QAT_64_BYTE_ALIGN_MASK)) - & QAT_64_BYTE_ALIGN_MASK; - offset_of_flat_buffs = - offset_of_sgls + num_im_sgls * sizeof(struct qat_inter_sgl); + offset_of_flat_buffs = sizeof(struct qat_inter_sgl); full_size = offset_of_flat_buffs + - num_im_sgls * buff_size * QAT_NUM_BUFS_IN_IM_SGL; + buff_size * QAT_NUM_BUFS_IN_IM_SGL; - memzone = rte_memzone_reserve_aligned(inter_buff_mz_name, full_size, + memzone = rte_memzone_reserve_aligned(inter_buff_mz_name, + size_of_ptr_array, comp_dev->compressdev->data->socket_id, RTE_MEMZONE_IOVA_CONTIG, QAT_64_BYTE_ALIGN); if (memzone == NULL) { - QAT_LOG(ERR, "Can't allocate intermediate buffers" - " for device %s", comp_dev->qat_dev->name); + QAT_LOG(ERR, + "Can't allocate intermediate buffers for device %s", + comp_dev->qat_dev->name); return NULL; } @@ -244,17 +244,50 @@ QAT_LOG(DEBUG, "Memzone %s: addr = %p, phys = 0x%"PRIx64 ", size required %d, size created %zu", inter_buff_mz_name, mz_start, mz_start_phys, - full_size, memzone->len); + size_of_ptr_array, memzone->len); array_of_pointers = (struct array_of_ptrs *)mz_start; for (i = 0; i < num_im_sgls; i++) { - uint32_t curr_sgl_offset = - offset_of_sgls + i * sizeof(struct qat_inter_sgl); - struct qat_inter_sgl *sgl = - (struct qat_inter_sgl *)(mz_start + curr_sgl_offset); + const struct rte_memzone *mz; + struct qat_inter_sgl *sgl; int lb; - array_of_pointers->pointer[i] = mz_start_phys + curr_sgl_offset; + snprintf(inter_buff_mz_name, RTE_MEMZONE_NAMESIZE, + "%s_inter_buff_%d", comp_dev->qat_dev->name, i); + mz = rte_memzone_lookup(inter_buff_mz_name); + if (mz == NULL) { + mz = rte_memzone_reserve_aligned(inter_buff_mz_name, + full_size, + comp_dev->compressdev->data->socket_id, + RTE_MEMZONE_IOVA_CONTIG, + QAT_64_BYTE_ALIGN); + if (mz == NULL) { + QAT_LOG(ERR, + "Can't allocate intermediate buffers for device %s", + comp_dev->qat_dev->name); + while (--i >= 0) { + snprintf(inter_buff_mz_name, + RTE_MEMZONE_NAMESIZE, + "%s_inter_buff_%d", + comp_dev->qat_dev->name, + i); + rte_memzone_free( + rte_memzone_lookup( + inter_buff_mz_name)); + } + rte_memzone_free(memzone); + return NULL; + } + } + + QAT_LOG(DEBUG, "Memzone %s: addr = %p, phys = 0x%"PRIx64 + ", size required %d, size created %zu", + inter_buff_mz_name, mz->addr, mz->iova, + full_size, mz->len); + + array_of_pointers->pointer[i] = mz->iova; + + sgl = (struct qat_inter_sgl *) mz->addr; sgl->num_bufs = QAT_NUM_BUFS_IN_IM_SGL; sgl->num_mapped_bufs = 0; sgl->resrvd = 0; @@ -266,8 +299,8 @@ #endif for (lb = 0; lb < QAT_NUM_BUFS_IN_IM_SGL; lb++) { sgl->buffers[lb].addr = - mz_start_phys + offset_of_flat_buffs + - (((i * QAT_NUM_BUFS_IN_IM_SGL) + lb) * buff_size); + mz->iova + offset_of_flat_buffs + + lb * buff_size; sgl->buffers[lb].len = buff_size; sgl->buffers[lb].resrvd = 0; #if QAT_IM_BUFFER_DEBUG @@ -279,7 +312,7 @@ } #if QAT_IM_BUFFER_DEBUG QAT_DP_HEXDUMP_LOG(DEBUG, "IM buffer memzone start:", - mz_start, offset_of_flat_buffs + 32); + memzone->addr, size_of_ptr_array); #endif return memzone; } @@ -442,6 +475,16 @@ { /* Free intermediate buffers */ if (comp_dev->interm_buff_mz) { + char mz_name[RTE_MEMZONE_NAMESIZE]; + int i = qat_gen_config[ + comp_dev->qat_dev->qat_dev_gen].comp_num_im_bufs_required; + + while (--i >= 0) { + snprintf(mz_name, RTE_MEMZONE_NAMESIZE, + "%s_inter_buff_%d", + comp_dev->qat_dev->name, i); + rte_memzone_free(rte_memzone_lookup(mz_name)); + } rte_memzone_free(comp_dev->interm_buff_mz); comp_dev->interm_buff_mz = NULL; } @@ -619,7 +662,8 @@ tmp_qp->qat_dev->comp_dev->compressdev->dev_ops = &compress_qat_dummy_ops; - QAT_LOG(ERR, "QAT PMD detected wrong FW version !"); + QAT_LOG(ERR, + "This QAT hardware doesn't support compression operation"); } else { tmp_qp->qat_dev->comp_dev->compressdev->dequeue_burst = @@ -667,11 +711,6 @@ int i = 0; struct qat_device_info *qat_dev_instance = &qat_pci_devs[qat_pci_dev->qat_dev_id]; - if (qat_pci_dev->qat_dev_gen == QAT_GEN3) { - QAT_LOG(ERR, "Compression PMD not supported on QAT c4xxx"); - return 0; - } - struct rte_compressdev_pmd_init_params init_params = { .name = "", .socket_id = qat_dev_instance->pci_dev->device.numa_node, diff -Nru dpdk-19.11.7/drivers/crypto/caam_jr/caam_jr.c dpdk-19.11.10~rc1/drivers/crypto/caam_jr/caam_jr.c --- dpdk-19.11.7/drivers/crypto/caam_jr/caam_jr.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/caam_jr/caam_jr.c 2021-08-18 14:45:29.000000000 +0000 @@ -37,8 +37,6 @@ static uint8_t cryptodev_driver_id; int caam_jr_logtype; -enum rta_sec_era rta_sec_era; - /* Lists the states possible for the SEC user space driver. */ enum sec_driver_state_e { SEC_DRIVER_STATE_IDLE, /* Driver not initialized */ diff -Nru dpdk-19.11.7/drivers/crypto/caam_jr/Makefile dpdk-19.11.10~rc1/drivers/crypto/caam_jr/Makefile --- dpdk-19.11.7/drivers/crypto/caam_jr/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/caam_jr/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -16,13 +16,6 @@ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) -# FIXME: temporary solution for Bugzilla 469 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1) -CFLAGS += -fcommon -endif -endif - CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib/ diff -Nru dpdk-19.11.7/drivers/crypto/caam_jr/meson.build dpdk-19.11.10~rc1/drivers/crypto/caam_jr/meson.build --- dpdk-19.11.7/drivers/crypto/caam_jr/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/caam_jr/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -14,11 +14,6 @@ allow_experimental_apis = true -# FIXME: temporary solution for Bugzilla 469 -if (toolchain == 'gcc' and cc.version().version_compare('>=10.0.0')) - cflags += '-fcommon' -endif - includes += include_directories('../../bus/dpaa/include/') includes += include_directories('../../common/dpaax/') includes += include_directories('../../common/dpaax/caamflib/') diff -Nru dpdk-19.11.7/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c dpdk-19.11.10~rc1/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c --- dpdk-19.11.7/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c 2021-08-18 14:45:29.000000000 +0000 @@ -56,8 +56,6 @@ #define SEC_FLC_DHR_OUTBOUND -114 #define SEC_FLC_DHR_INBOUND 0 -enum rta_sec_era rta_sec_era = RTA_SEC_ERA_8; - static uint8_t cryptodev_driver_id; int dpaa2_logtype_sec; @@ -3423,32 +3421,10 @@ } static int -dpaa2_sec_dev_close(struct rte_cryptodev *dev) +dpaa2_sec_dev_close(struct rte_cryptodev *dev __rte_unused) { - struct dpaa2_sec_dev_private *priv = dev->data->dev_private; - struct fsl_mc_io *dpseci = (struct fsl_mc_io *)priv->hw; - int ret; - PMD_INIT_FUNC_TRACE(); - /* Function is reverse of dpaa2_sec_dev_init. - * It does the following: - * 1. Detach a DPSECI from attached resources i.e. buffer pools, dpbp_id - * 2. Close the DPSECI device - * 3. Free the allocated resources. - */ - - /*Close the device at underlying layer*/ - ret = dpseci_close(dpseci, CMD_PRI_LOW, priv->token); - if (ret) { - DPAA2_SEC_ERR("Failure closing dpseci device: err(%d)", ret); - return -1; - } - - /*Free the allocated memory for ethernet private data and dpseci*/ - priv->hw = NULL; - rte_free(dpseci); - return 0; } @@ -3704,11 +3680,31 @@ static int dpaa2_sec_uninit(const struct rte_cryptodev *dev) { - struct dpaa2_sec_dev_private *internals = dev->data->dev_private; + struct dpaa2_sec_dev_private *priv = dev->data->dev_private; + struct fsl_mc_io *dpseci = (struct fsl_mc_io *)priv->hw; + int ret; - rte_free(dev->security_ctx); + PMD_INIT_FUNC_TRACE(); + + /* Function is reverse of dpaa2_sec_dev_init. + * It does the following: + * 1. Detach a DPSECI from attached resources i.e. buffer pools, dpbp_id + * 2. Close the DPSECI device + * 3. Free the allocated resources. + */ - rte_mempool_free(internals->fle_pool); + /*Close the device at underlying layer*/ + ret = dpseci_close(dpseci, CMD_PRI_LOW, priv->token); + if (ret) { + DPAA2_SEC_ERR("Failure closing dpseci device: err(%d)", ret); + return -1; + } + + /*Free the allocated memory for ethernet private data and dpseci*/ + priv->hw = NULL; + rte_free(dpseci); + rte_free(dev->security_ctx); + rte_mempool_free(priv->fle_pool); DPAA2_SEC_INFO("Closing DPAA2_SEC device %s on numa socket %u", dev->data->name, rte_socket_id()); @@ -3866,6 +3862,8 @@ if (dpaa2_svr_family == SVR_LX2160A) rta_set_sec_era(RTA_SEC_ERA_10); + else + rta_set_sec_era(RTA_SEC_ERA_8); DPAA2_SEC_INFO("2-SEC ERA is %d", rta_get_sec_era()); diff -Nru dpdk-19.11.7/drivers/crypto/dpaa2_sec/Makefile dpdk-19.11.10~rc1/drivers/crypto/dpaa2_sec/Makefile --- dpdk-19.11.7/drivers/crypto/dpaa2_sec/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/dpaa2_sec/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -20,13 +20,6 @@ endif endif -# FIXME: temporary solution for Bugzilla 469 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1) -CFLAGS += -fcommon -endif -endif - CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax/caamflib CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/ diff -Nru dpdk-19.11.7/drivers/crypto/dpaa2_sec/meson.build dpdk-19.11.10~rc1/drivers/crypto/dpaa2_sec/meson.build --- dpdk-19.11.7/drivers/crypto/dpaa2_sec/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/dpaa2_sec/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -12,9 +12,4 @@ allow_experimental_apis = true -# FIXME: temporary solution for Bugzilla 469 -if (toolchain == 'gcc' and cc.version().version_compare('>=10.0.0')) - cflags += '-fcommon' -endif - includes += include_directories('mc', '../../common/dpaax', '../../common/dpaax/caamflib') diff -Nru dpdk-19.11.7/drivers/crypto/dpaa_sec/dpaa_sec.c dpdk-19.11.10~rc1/drivers/crypto/dpaa_sec/dpaa_sec.c --- dpdk-19.11.7/drivers/crypto/dpaa_sec/dpaa_sec.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/dpaa_sec/dpaa_sec.c 2021-08-18 14:45:29.000000000 +0000 @@ -43,8 +43,6 @@ #include #include -enum rta_sec_era rta_sec_era; - int dpaa_logtype_sec; static uint8_t cryptodev_driver_id; @@ -1690,6 +1688,13 @@ uint32_t index, flags[DPAA_SEC_BURST] = {0}; struct qman_fq *inq[DPAA_SEC_BURST]; + if (unlikely(!RTE_PER_LCORE(dpaa_io))) { + if (rte_dpaa_portal_init((void *)0)) { + DPAA_SEC_ERR("Failure in affining portal"); + return 0; + } + } + while (nb_ops) { frames_to_send = (nb_ops > DPAA_SEC_BURST) ? DPAA_SEC_BURST : nb_ops; @@ -1890,6 +1895,13 @@ uint16_t num_rx; struct dpaa_sec_qp *dpaa_qp = (struct dpaa_sec_qp *)qp; + if (unlikely(!RTE_PER_LCORE(dpaa_io))) { + if (rte_dpaa_portal_init((void *)0)) { + DPAA_SEC_ERR("Failure in affining portal"); + return 0; + } + } + num_rx = dpaa_sec_deq(dpaa_qp, ops, nb_ops); dpaa_qp->rx_pkts += num_rx; diff -Nru dpdk-19.11.7/drivers/crypto/dpaa_sec/Makefile dpdk-19.11.10~rc1/drivers/crypto/dpaa_sec/Makefile --- dpdk-19.11.7/drivers/crypto/dpaa_sec/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/dpaa_sec/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -14,13 +14,6 @@ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) -# FIXME: temporary solution for Bugzilla 469 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1) -CFLAGS += -fcommon -endif -endif - CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/base/qbman diff -Nru dpdk-19.11.7/drivers/crypto/dpaa_sec/meson.build dpdk-19.11.10~rc1/drivers/crypto/dpaa_sec/meson.build --- dpdk-19.11.7/drivers/crypto/dpaa_sec/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/dpaa_sec/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -11,11 +11,6 @@ allow_experimental_apis = true -# FIXME: temporary solution for Bugzilla 469 -if (toolchain == 'gcc' and cc.version().version_compare('>=10.0.0')) - cflags += '-fcommon' -endif - includes += include_directories('../../bus/dpaa/include') includes += include_directories('../../common/dpaax') includes += include_directories('../../common/dpaax/caamflib/') diff -Nru dpdk-19.11.7/drivers/crypto/mvsam/rte_mrvl_pmd.c dpdk-19.11.10~rc1/drivers/crypto/mvsam/rte_mrvl_pmd.c --- dpdk-19.11.7/drivers/crypto/mvsam/rte_mrvl_pmd.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/mvsam/rte_mrvl_pmd.c 2021-08-18 14:45:29.000000000 +0000 @@ -361,6 +361,14 @@ sess->sam_sess_params.cipher_mode = aead_map[aead_xform->aead.algo].cipher_mode; + if (sess->sam_sess_params.cipher_mode == SAM_CIPHER_GCM) { + /* IV must include nonce for all counter modes */ + sess->cipher_iv_offset = aead_xform->cipher.iv.offset; + + /* Set order of authentication then encryption to 0 in GCM */ + sess->sam_sess_params.u.basic.auth_then_encrypt = 0; + } + /* Assume IV will be passed together with data. */ sess->sam_sess_params.cipher_iv = NULL; @@ -917,14 +925,14 @@ ret = rte_kvargs_process(kvlist, RTE_CRYPTODEV_PMD_NAME_ARG, &parse_name_arg, - ¶ms->common); + ¶ms->common.name); if (ret < 0) goto free_kvlist; ret = rte_kvargs_process(kvlist, MRVL_PMD_MAX_NB_SESS_ARG, &parse_integer_arg, - params); + ¶ms->max_nb_sessions); if (ret < 0) goto free_kvlist; diff -Nru dpdk-19.11.7/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c dpdk-19.11.10~rc1/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c --- dpdk-19.11.7/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c 2021-08-18 14:45:29.000000000 +0000 @@ -111,7 +111,7 @@ .increment = 1 }, .digest_size = { - .min = 28, + .min = 12, .max = 28, .increment = 0 }, @@ -232,7 +232,7 @@ }, .digest_size = { .min = 12, - .max = 48, + .max = 64, .increment = 4 }, }, } @@ -252,7 +252,7 @@ }, .digest_size = { .min = 12, - .max = 48, + .max = 64, .increment = 0 }, }, } @@ -336,9 +336,9 @@ .increment = 0 }, .aad_size = { - .min = 8, - .max = 12, - .increment = 4 + .min = 0, + .max = 64, + .increment = 1 }, .iv_size = { .min = 12, @@ -804,7 +804,7 @@ MRVL_LOG(ERR, "Error while destroying session!"); } - memset(sess, 0, sizeof(struct mrvl_crypto_session)); + memset(mrvl_sess, 0, sizeof(struct mrvl_crypto_session)); struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv); set_sym_session_private_data(sess, index, NULL); rte_mempool_put(sess_mp, sess_priv); diff -Nru dpdk-19.11.7/drivers/crypto/octeontx/otx_cryptodev.c dpdk-19.11.10~rc1/drivers/crypto/octeontx/otx_cryptodev.c --- dpdk-19.11.7/drivers/crypto/octeontx/otx_cryptodev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/octeontx/otx_cryptodev.c 2021-08-18 14:45:29.000000000 +0000 @@ -72,6 +72,7 @@ { struct rte_cryptodev *cryptodev; char name[RTE_CRYPTODEV_NAME_MAX_LEN]; + void *dev_priv; if (pci_dev == NULL) return -EINVAL; @@ -85,11 +86,13 @@ if (pci_dev->driver == NULL) return -ENODEV; + dev_priv = cryptodev->data->dev_private; + /* free crypto device */ rte_cryptodev_pmd_release_device(cryptodev); if (rte_eal_process_type() == RTE_PROC_PRIMARY) - rte_free(cryptodev->data->dev_private); + rte_free(dev_priv); cryptodev->device->driver = NULL; cryptodev->device = NULL; diff -Nru dpdk-19.11.7/drivers/crypto/qat/qat_sym.c dpdk-19.11.10~rc1/drivers/crypto/qat/qat_sym.c --- dpdk-19.11.7/drivers/crypto/qat/qat_sym.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/qat/qat_sym.c 2021-08-18 14:45:29.000000000 +0000 @@ -161,6 +161,7 @@ uint8_t do_sgl = 0; uint8_t in_place = 1; int alignment_adjustment = 0; + int oop_shift = 0; struct rte_crypto_op *op = (struct rte_crypto_op *)in_op; struct qat_sym_op_cookie *cookie = (struct qat_sym_op_cookie *)op_cookie; @@ -309,8 +310,10 @@ } min_ofs = auth_ofs; - auth_param->auth_res_addr = - op->sym->auth.digest.phys_addr; + if (ctx->qat_hash_alg != ICP_QAT_HW_AUTH_ALGO_NULL || + ctx->auth_op == ICP_QAT_HW_AUTH_VERIFY) + auth_param->auth_res_addr = + op->sym->auth.digest.phys_addr; } @@ -447,6 +450,7 @@ rte_pktmbuf_iova_offset(op->sym->m_src, min_ofs); dst_buf_start = rte_pktmbuf_iova_offset(op->sym->m_dst, min_ofs); + oop_shift = min_ofs; } else { /* In-place operation @@ -507,7 +511,7 @@ /* First find the end of the data */ if (do_sgl) { uint32_t remaining_off = auth_param->auth_off + - auth_param->auth_len + alignment_adjustment; + auth_param->auth_len + alignment_adjustment + oop_shift; struct rte_mbuf *sgl_buf = (in_place ? op->sym->m_src : op->sym->m_dst); diff -Nru dpdk-19.11.7/drivers/crypto/qat/qat_sym_session.c dpdk-19.11.10~rc1/drivers/crypto/qat/qat_sym_session.c --- dpdk-19.11.7/drivers/crypto/qat/qat_sym_session.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/crypto/qat/qat_sym_session.c 2021-08-18 14:45:29.000000000 +0000 @@ -1164,6 +1164,9 @@ uint64_t *hash_state_out_be64; int i; + /* Initialize to avoid gcc warning */ + memset(digest, 0, sizeof(digest)); + digest_size = qat_hash_get_digest_size(hash_alg); if (digest_size <= 0) return -EFAULT; diff -Nru dpdk-19.11.7/drivers/event/dpaa2/dpaa2_eventdev_logs.h dpdk-19.11.10~rc1/drivers/event/dpaa2/dpaa2_eventdev_logs.h --- dpdk-19.11.7/drivers/event/dpaa2/dpaa2_eventdev_logs.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/event/dpaa2/dpaa2_eventdev_logs.h 2021-08-18 14:45:29.000000000 +0000 @@ -38,7 +38,5 @@ #define dpaa2_evdev_info(fmt, ...) DPAA2_EVENTDEV_LOG(INFO, fmt, ##__VA_ARGS__) #define dpaa2_evdev_dbg(fmt, ...) DPAA2_EVENTDEV_LOG(DEBUG, fmt, ##__VA_ARGS__) #define dpaa2_evdev_err(fmt, ...) DPAA2_EVENTDEV_LOG(ERR, fmt, ##__VA_ARGS__) -#define dpaa2_evdev__func_trace dpaa2_evdev_dbg -#define dpaa2_evdev_selftest dpaa2_evdev_info #endif /* _DPAA2_EVENTDEV_LOGS_H_ */ diff -Nru dpdk-19.11.7/drivers/event/octeontx2/otx2_evdev.c dpdk-19.11.10~rc1/drivers/event/octeontx2/otx2_evdev.c --- dpdk-19.11.7/drivers/event/octeontx2/otx2_evdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/event/octeontx2/otx2_evdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -842,29 +842,27 @@ struct otx2_ssogws *ws; uintptr_t base; - /* Free memory prior to re-allocation if needed */ if (event_dev->data->ports[i] != NULL) { ws = event_dev->data->ports[i]; - rte_free(ssogws_get_cookie(ws)); - ws = NULL; - } + } else { + /* Allocate event port memory */ + ws = rte_zmalloc_socket("otx2_sso_ws", + sizeof(struct otx2_ssogws) + + RTE_CACHE_LINE_SIZE, + RTE_CACHE_LINE_SIZE, + event_dev->data->socket_id); + if (ws == NULL) { + otx2_err("Failed to alloc memory for port=%d", + i); + rc = -ENOMEM; + break; + } - /* Allocate event port memory */ - ws = rte_zmalloc_socket("otx2_sso_ws", - sizeof(struct otx2_ssogws) + - RTE_CACHE_LINE_SIZE, - RTE_CACHE_LINE_SIZE, - event_dev->data->socket_id); - if (ws == NULL) { - otx2_err("Failed to alloc memory for port=%d", i); - rc = -ENOMEM; - break; + /* First cache line is reserved for cookie */ + ws = (struct otx2_ssogws *) + ((uint8_t *)ws + RTE_CACHE_LINE_SIZE); } - /* First cache line is reserved for cookie */ - ws = (struct otx2_ssogws *) - ((uint8_t *)ws + RTE_CACHE_LINE_SIZE); - ws->port = i; base = dev->bar2 + (RVU_BLOCK_ADDR_SSOW << 20 | i << 12); sso_set_port_ops(ws, base); diff -Nru dpdk-19.11.7/drivers/event/octeontx2/otx2_worker.h dpdk-19.11.10~rc1/drivers/event/octeontx2/otx2_worker.h --- dpdk-19.11.7/drivers/event/octeontx2/otx2_worker.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/event/octeontx2/otx2_worker.h 2021-08-18 14:45:29.000000000 +0000 @@ -270,7 +270,7 @@ uint64_t *cmd, const uint32_t flags) { otx2_lmt_mov(cmd, txq->cmd, otx2_nix_tx_ext_subs(flags)); - otx2_nix_xmit_prepare(m, cmd, flags); + otx2_nix_xmit_prepare(m, cmd, flags, txq->lso_tun_fmt); } static __rte_always_inline uint16_t diff -Nru dpdk-19.11.7/drivers/mempool/octeontx2/otx2_mempool_ops.c dpdk-19.11.10~rc1/drivers/mempool/octeontx2/otx2_mempool_ops.c --- dpdk-19.11.7/drivers/mempool/octeontx2/otx2_mempool_ops.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/mempool/octeontx2/otx2_mempool_ops.c 2021-08-18 14:45:29.000000000 +0000 @@ -533,7 +533,8 @@ /* Update aura fields */ aura->pool_addr = pool_id;/* AF will translate to associated poolctx */ aura->ena = 1; - aura->shift = __builtin_clz(block_count) - 8; + aura->shift = rte_log2_u32(block_count); + aura->shift = aura->shift < 8 ? 0 : aura->shift - 8; aura->limit = block_count; aura->pool_caching = 1; aura->err_int_ena = BIT(NPA_AURA_ERR_INT_AURA_ADD_OVER); @@ -548,7 +549,8 @@ pool->ena = 1; pool->buf_size = block_size / OTX2_ALIGN; pool->stack_max_pages = stack_size; - pool->shift = __builtin_clz(block_count) - 8; + pool->shift = rte_log2_u32(block_count); + pool->shift = pool->shift < 8 ? 0 : pool->shift - 8; pool->ptr_start = 0; pool->ptr_end = ~0; pool->stack_caching = 1; diff -Nru dpdk-19.11.7/drivers/meson.build dpdk-19.11.10~rc1/drivers/meson.build --- dpdk-19.11.7/drivers/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -198,7 +198,7 @@ shared_dep = declare_dependency(link_with: shared_lib, include_directories: includes, dependencies: shared_deps) - static_dep = declare_dependency( + static_dep = declare_dependency(link_with: static_lib, include_directories: includes, dependencies: static_deps) diff -Nru dpdk-19.11.7/drivers/net/af_xdp/rte_eth_af_xdp.c dpdk-19.11.10~rc1/drivers/net/af_xdp/rte_eth_af_xdp.c --- dpdk-19.11.7/drivers/net/af_xdp/rte_eth_af_xdp.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/af_xdp/rte_eth_af_xdp.c 2021-08-18 14:45:29.000000000 +0000 @@ -705,6 +705,9 @@ struct pkt_rx_queue *rxq; int i; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + AF_XDP_LOG(INFO, "Closing AF_XDP ethdev on numa socket %u\n", rte_socket_id()); @@ -899,7 +902,8 @@ } #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG) - if (rte_pktmbuf_alloc_bulk(rxq->umem->mb_pool, fq_bufs, reserve_size)) { + ret = rte_pktmbuf_alloc_bulk(rxq->umem->mb_pool, fq_bufs, reserve_size); + if (ret) { AF_XDP_LOG(DEBUG, "Failed to get enough buffers for fq.\n"); goto err; } diff -Nru dpdk-19.11.7/drivers/net/ark/ark_ethdev.c dpdk-19.11.10~rc1/drivers/net/ark/ark_ethdev.c --- dpdk-19.11.7/drivers/net/ark/ark_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ark/ark_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -283,6 +283,7 @@ ark->rqpacing = (struct ark_rqpace_t *)(ark->bar0 + ARK_RCPACING_BASE); ark->started = 0; + ark->pkt_dir_v = ARK_PKT_DIR_INIT_VAL; PMD_DEBUG_LOG(INFO, "Sys Ctrl Const = 0x%x HW Commit_ID: %08x\n", ark->sysctrl.t32[4], @@ -689,6 +690,9 @@ struct ark_adapter *ark = dev->data->dev_private; uint16_t i; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + if (ark->user_ext.dev_close) ark->user_ext.dev_close(dev, ark->user_data[dev->data->port_id]); diff -Nru dpdk-19.11.7/drivers/net/ark/ark_ethdev_rx.c dpdk-19.11.10~rc1/drivers/net/ark/ark_ethdev_rx.c --- dpdk-19.11.7/drivers/net/ark/ark_ethdev_rx.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ark/ark_ethdev_rx.c 2021-08-18 14:45:29.000000000 +0000 @@ -25,9 +25,6 @@ struct rte_mbuf *mbuf0, uint32_t cons_index); static inline int eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue); -static int eth_ark_rx_seed_recovery(struct ark_rx_queue *queue, - uint32_t *pnb, - struct rte_mbuf **mbufs); /* ************************************************************************* */ struct ark_rx_queue { @@ -53,7 +50,7 @@ /* The queue Index is used within the dpdk device structures */ uint16_t queue_index; - uint32_t last_cons; + uint32_t unused; /* separate cache line */ /* second cache line - fields only used in slow path */ @@ -104,9 +101,8 @@ eth_ark_rx_update_cons_index(struct ark_rx_queue *queue, uint32_t cons_index) { queue->cons_index = cons_index; - eth_ark_rx_seed_mbufs(queue); - if (((cons_index - queue->last_cons) >= 64U)) { - queue->last_cons = cons_index; + if ((cons_index + queue->queue_size - queue->seed_index) >= 64U) { + eth_ark_rx_seed_mbufs(queue); ark_mpu_set_producer(queue->mpu, queue->seed_index); } } @@ -317,9 +313,7 @@ break; } - if (unlikely(nb != 0)) - /* report next free to FPGA */ - eth_ark_rx_update_cons_index(queue, cons_index); + eth_ark_rx_update_cons_index(queue, cons_index); return nb; } @@ -456,11 +450,13 @@ int status = rte_pktmbuf_alloc_bulk(queue->mb_pool, mbufs, nb); if (unlikely(status != 0)) { - /* Try to recover from lack of mbufs in pool */ - status = eth_ark_rx_seed_recovery(queue, &nb, mbufs); - if (unlikely(status != 0)) { - return -1; - } + PMD_DRV_LOG(NOTICE, + "Could not allocate %u mbufs from pool" + " for RX queue %u;" + " %u free buffers remaining in queue\n", + nb, queue->queue_index, + queue->seed_index - queue->cons_index); + return -1; } if (ARK_RX_DEBUG) { /* DEBUG */ @@ -509,29 +505,6 @@ return 0; } -int -eth_ark_rx_seed_recovery(struct ark_rx_queue *queue, - uint32_t *pnb, - struct rte_mbuf **mbufs) -{ - int status = -1; - - /* Ignore small allocation failures */ - if (*pnb <= 64) - return -1; - - *pnb = 64U; - status = rte_pktmbuf_alloc_bulk(queue->mb_pool, mbufs, *pnb); - if (status != 0) { - PMD_DRV_LOG(ERR, - "ARK: Could not allocate %u mbufs from pool for RX queue %u;" - " %u free buffers remaining in queue\n", - *pnb, queue->queue_index, - queue->seed_index - queue->cons_index); - } - return status; -} - void eth_ark_rx_dump_queue(struct rte_eth_dev *dev, uint16_t queue_id, const char *msg) diff -Nru dpdk-19.11.7/drivers/net/ark/ark_pktdir.c dpdk-19.11.10~rc1/drivers/net/ark/ark_pktdir.c --- dpdk-19.11.7/drivers/net/ark/ark_pktdir.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ark/ark_pktdir.c 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ return inst; } inst->regs = (struct ark_pkt_dir_regs *)base; - inst->regs->ctrl = 0x00110110; /* POR state */ + inst->regs->ctrl = ARK_PKT_DIR_INIT_VAL; /* POR state */ return inst; } diff -Nru dpdk-19.11.7/drivers/net/ark/ark_pktdir.h dpdk-19.11.10~rc1/drivers/net/ark/ark_pktdir.h --- dpdk-19.11.7/drivers/net/ark/ark_pktdir.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ark/ark_pktdir.h 2021-08-18 14:45:29.000000000 +0000 @@ -7,7 +7,7 @@ #include -#define ARK_PKTDIR_BASE_ADR 0xa0000 +#define ARK_PKT_DIR_INIT_VAL 0x0110 typedef void *ark_pkt_dir_t; diff -Nru dpdk-19.11.7/drivers/net/avp/avp_ethdev.c dpdk-19.11.10~rc1/drivers/net/avp/avp_ethdev.c --- dpdk-19.11.7/drivers/net/avp/avp_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/avp/avp_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -2111,6 +2111,9 @@ struct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); int ret; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + rte_spinlock_lock(&avp->lock); if (avp->flags & AVP_F_DETACHED) { PMD_DRV_LOG(ERR, "Operation not supported during VM live migration\n"); diff -Nru dpdk-19.11.7/drivers/net/bnx2x/bnx2x.h dpdk-19.11.10~rc1/drivers/net/bnx2x/bnx2x.h --- dpdk-19.11.7/drivers/net/bnx2x/bnx2x.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnx2x/bnx2x.h 2021-08-18 14:45:29.000000000 +0000 @@ -1902,18 +1902,19 @@ { uint32_t hc_addr = (HC_REG_COMMAND_REG + SC_PORT(sc) * 32 + COMMAND_REG_INT_ACK); - struct igu_ack_register igu_ack; - uint32_t *val = NULL; + union { + struct igu_ack_register igu_ack; + uint32_t val; + } val; - igu_ack.status_block_index = index; - igu_ack.sb_id_and_flags = + val.igu_ack.status_block_index = index; + val.igu_ack.sb_id_and_flags = ((sb_id << IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT) | (storm << IGU_ACK_REGISTER_STORM_ID_SHIFT) | (update << IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT) | (op << IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT)); - val = (uint32_t *)&igu_ack; - REG_WR(sc, hc_addr, *val); + REG_WR(sc, hc_addr, val.val); /* Make sure that ACK is written */ mb(); diff -Nru dpdk-19.11.7/drivers/net/bnx2x/bnx2x_rxtx.c dpdk-19.11.10~rc1/drivers/net/bnx2x/bnx2x_rxtx.c --- dpdk-19.11.7/drivers/net/bnx2x/bnx2x_rxtx.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnx2x/bnx2x_rxtx.c 2021-08-18 14:45:29.000000000 +0000 @@ -321,14 +321,15 @@ bnx2x_upd_rx_prod_fast(struct bnx2x_softc *sc, struct bnx2x_fastpath *fp, uint16_t rx_bd_prod, uint16_t rx_cq_prod) { - struct ustorm_eth_rx_producers rx_prods = { 0 }; - uint32_t *val = NULL; + union { + struct ustorm_eth_rx_producers rx_prods; + uint32_t val; + } val = { {0} }; - rx_prods.bd_prod = rx_bd_prod; - rx_prods.cqe_prod = rx_cq_prod; + val.rx_prods.bd_prod = rx_bd_prod; + val.rx_prods.cqe_prod = rx_cq_prod; - val = (uint32_t *)&rx_prods; - REG_WR(sc, fp->ustorm_rx_prods_offset, val[0]); + REG_WR(sc, fp->ustorm_rx_prods_offset, val.val); } static uint16_t diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_cpr.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_cpr.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_cpr.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_cpr.c 2021-08-18 14:45:29.000000000 +0000 @@ -64,6 +64,8 @@ case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE: /* FALLTHROUGH */ bnxt_link_update_op(bp->eth_dev, 0); + _rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_INTR_LSC, NULL); break; case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD: PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n"); diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_cpr.h dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_cpr.h --- dpdk-19.11.7/drivers/net/bnxt/bnxt_cpr.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_cpr.h 2021-08-18 14:45:29.000000000 +0000 @@ -8,17 +8,10 @@ #include #include +#include "hsi_struct_def_dpdk.h" struct bnxt_db_info; -#define CMP_VALID(cmp, raw_cons, ring) \ - (!!(rte_le_to_cpu_32(((struct cmpl_base *)(cmp))->info3_v) & \ - CMPL_BASE_V) == !((raw_cons) & ((ring)->ring_size))) - -#define CMPL_VALID(cmp, v) \ - (!!(rte_le_to_cpu_32(((struct cmpl_base *)(cmp))->info3_v) & \ - CMPL_BASE_V) == !(v)) - #define NQ_CMP_VALID(nqcmp, raw_cons, ring) \ (!!((nqcmp)->v & rte_cpu_to_le_32(NQ_CN_V)) == \ !((raw_cons) & ((ring)->ring_size))) @@ -26,6 +19,10 @@ #define CMP_TYPE(cmp) \ (((struct cmpl_base *)cmp)->type & CMPL_BASE_TYPE_MASK) +/* Get completion length from completion type, in 16-byte units. */ +#define CMP_LEN(cmp_type) (((cmp_type) & 1) + 1) + + #define ADV_RAW_CMP(idx, n) ((idx) + (n)) #define NEXT_RAW_CMP(idx) ADV_RAW_CMP(idx, 1) #define RING_CMP(ring, idx) ((idx) & (ring)->ring_mask) @@ -127,4 +124,35 @@ bool bnxt_is_master_func(struct bnxt *bp); void bnxt_stop_rxtx(struct bnxt *bp); + +/** + * Check validity of a completion ring entry. If the entry is valid, include a + * C11 __ATOMIC_ACQUIRE fence to ensure that subsequent loads of fields in the + * completion are not hoisted by the compiler or by the CPU to come before the + * loading of the "valid" field. + * + * Note: the caller must not access any fields in the specified completion + * entry prior to calling this function. + * + * @param cmpl + * Pointer to an entry in the completion ring. + * @param raw_cons + * Raw consumer index of entry in completion ring. + * @param ring_size + * Size of completion ring. + */ +static __rte_always_inline bool +bnxt_cpr_cmp_valid(const void *cmpl, uint32_t raw_cons, uint32_t ring_size) +{ + const struct cmpl_base *c = cmpl; + bool expected, valid; + + expected = !(raw_cons & ring_size); + valid = !!(rte_le_to_cpu_32(c->info3_v) & CMPL_BASE_V); + if (valid == expected) { + rte_smp_rmb(); + return true; + } + return false; +} #endif diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_ethdev.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_ethdev.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -258,12 +258,13 @@ if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS) { int j, nr_ctxs = bnxt_rss_ctxts(bp); + /* RSS table size in Thor is 512. + * Cap max Rx rings to same value + */ if (bp->rx_nr_rings > BNXT_RSS_TBL_SIZE_THOR) { PMD_DRV_LOG(ERR, "RxQ cnt %d > reta_size %d\n", bp->rx_nr_rings, BNXT_RSS_TBL_SIZE_THOR); - PMD_DRV_LOG(ERR, - "Only queues 0-%d will be in RSS table\n", - BNXT_RSS_TBL_SIZE_THOR - 1); + goto err_out; } rc = 0; @@ -320,10 +321,11 @@ bnxt_hwrm_vnic_plcmode_cfg(bp, vnic); - if (rx_offloads & DEV_RX_OFFLOAD_TCP_LRO) - bnxt_hwrm_vnic_tpa_cfg(bp, vnic, 1); - else - bnxt_hwrm_vnic_tpa_cfg(bp, vnic, 0); + rc = bnxt_hwrm_vnic_tpa_cfg(bp, vnic, + (rx_offloads & DEV_RX_OFFLOAD_TCP_LRO) ? + true : false); + if (rc) + goto err_out; return 0; err_out: @@ -332,6 +334,39 @@ return rc; } +static void bnxt_free_prev_ring_stats(struct bnxt *bp) +{ + rte_free(bp->prev_rx_ring_stats); + rte_free(bp->prev_tx_ring_stats); + + bp->prev_rx_ring_stats = NULL; + bp->prev_tx_ring_stats = NULL; +} + +static int bnxt_alloc_prev_ring_stats(struct bnxt *bp) +{ + bp->prev_rx_ring_stats = rte_zmalloc("bnxt_prev_rx_ring_stats", + sizeof(struct bnxt_ring_stats) * + bp->rx_cp_nr_rings, + 0); + if (bp->prev_rx_ring_stats == NULL) + return -ENOMEM; + + bp->prev_tx_ring_stats = rte_zmalloc("bnxt_prev_tx_ring_stats", + sizeof(struct bnxt_ring_stats) * + bp->tx_cp_nr_rings, + 0); + if (bp->prev_tx_ring_stats == NULL) + goto error; + + return 0; + +error: + bnxt_free_prev_ring_stats(bp); + return -ENOMEM; +} + + static int bnxt_init_chip(struct bnxt *bp) { struct rte_eth_link new; @@ -441,7 +476,7 @@ PMD_DRV_LOG(ERR, "Failed to allocate %d rx_queues" " intr_vec", bp->eth_dev->data->nb_rx_queues); rc = -ENOMEM; - goto err_disable; + goto err_out; } PMD_DRV_LOG(DEBUG, "intr_handle->intr_vec = %p " "intr_handle->nb_efd = %d intr_handle->max_intr = %d\n", @@ -461,13 +496,13 @@ #ifndef RTE_EXEC_ENV_FREEBSD /* In FreeBSD OS, nic_uio driver does not support interrupts */ if (rc) - goto err_free; + goto err_out; #endif rc = bnxt_get_hwrm_link_config(bp, &new); if (rc) { PMD_DRV_LOG(ERR, "HWRM Get link config failure rc: %x\n", rc); - goto err_free; + goto err_out; } if (!bp->link_info.link_up) { @@ -475,17 +510,13 @@ if (rc) { PMD_DRV_LOG(ERR, "HWRM link config failure rc: %x\n", rc); - goto err_free; + goto err_out; } } bnxt_print_link_info(bp->eth_dev); return 0; -err_free: - rte_free(intr_handle->intr_vec); -err_disable: - rte_intr_efd_disable(intr_handle); err_out: /* Some of the error status returned by FW may not be from errno.h */ if (rc > 0) @@ -532,7 +563,7 @@ dev_info->max_rx_queues = max_rx_rings; dev_info->max_tx_queues = max_rx_rings; dev_info->reta_size = bnxt_rss_hash_tbl_size(bp); - dev_info->hash_key_size = 40; + dev_info->hash_key_size = HW_HASH_KEY_SIZE; max_vnics = bp->max_vnics; /* MTU specifics */ @@ -549,7 +580,6 @@ dev_info->tx_offload_capa = BNXT_DEV_TX_OFFLOAD_SUPPORT; dev_info->flow_type_rss_offloads = BNXT_ETH_RSS_SUPPORT; - /* *INDENT-OFF* */ dev_info->default_rxconf = (struct rte_eth_rxconf) { .rx_thresh = { .pthresh = 8, @@ -571,14 +601,11 @@ }; eth_dev->data->dev_conf.intr_conf.lsc = 1; - eth_dev->data->dev_conf.intr_conf.rxq = 1; dev_info->rx_desc_lim.nb_min = BNXT_MIN_RING_DESC; dev_info->rx_desc_lim.nb_max = BNXT_MAX_RX_RING_DESC; dev_info->tx_desc_lim.nb_min = BNXT_MIN_RING_DESC; dev_info->tx_desc_lim.nb_max = BNXT_MAX_TX_RING_DESC; - /* *INDENT-ON* */ - /* * TODO: default_rxconf, default_txconf, rx_desc_lim, and tx_desc_lim * need further investigation. @@ -885,6 +912,10 @@ if (rc) goto error; + rc = bnxt_alloc_prev_ring_stats(bp); + if (rc) + goto error; + eth_dev->data->scattered_rx = bnxt_scattered_rx(eth_dev); eth_dev->data->dev_started = 1; @@ -910,6 +941,7 @@ bnxt_free_tx_mbufs(bp); bnxt_free_rx_mbufs(bp); bnxt_hwrm_if_change(bp, false); + bnxt_free_prev_ring_stats(bp); eth_dev->data->dev_started = 0; return rc; } @@ -919,6 +951,9 @@ struct bnxt *bp = eth_dev->data->dev_private; int rc = 0; + if (!BNXT_SINGLE_PF(bp)) + return -ENOTSUP; + if (!bp->link_info.link_up) rc = bnxt_set_hwrm_link_config(bp, true); if (!rc) @@ -932,6 +967,9 @@ { struct bnxt *bp = eth_dev->data->dev_private; + if (!BNXT_SINGLE_PF(bp)) + return -ENOTSUP; + eth_dev->data->dev_link.link_status = 0; bnxt_set_hwrm_link_config(bp, false); bp->link_info.link_up = 0; @@ -939,6 +977,73 @@ return 0; } +static void bnxt_ptp_get_current_time(void *arg) +{ + struct bnxt *bp = arg; + struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; + int rc; + + rc = is_bnxt_in_error(bp); + if (rc) + return; + + if (!ptp) + return; + + bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_CURRENT_TIME, + &ptp->current_time); + + rc = rte_eal_alarm_set(US_PER_S, bnxt_ptp_get_current_time, (void *)bp); + if (rc != 0) { + PMD_DRV_LOG(ERR, "Failed to re-schedule PTP alarm\n"); + bp->flags &= ~BNXT_FLAGS_PTP_ALARM_SCHEDULED; + } +} + +static int bnxt_schedule_ptp_alarm(struct bnxt *bp) +{ + struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; + int rc; + + if (bp->flags & BNXT_FLAGS_PTP_ALARM_SCHEDULED) + return 0; + + bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_CURRENT_TIME, + &ptp->current_time); + + rc = rte_eal_alarm_set(US_PER_S, bnxt_ptp_get_current_time, (void *)bp); + return rc; +} + +static void bnxt_cancel_ptp_alarm(struct bnxt *bp) +{ + if (bp->flags & BNXT_FLAGS_PTP_ALARM_SCHEDULED) { + rte_eal_alarm_cancel(bnxt_ptp_get_current_time, (void *)bp); + bp->flags &= ~BNXT_FLAGS_PTP_ALARM_SCHEDULED; + } +} + +static void bnxt_ptp_stop(struct bnxt *bp) +{ + bnxt_cancel_ptp_alarm(bp); + bp->flags &= ~BNXT_FLAGS_PTP_TIMESYNC_ENABLED; +} + +static int bnxt_ptp_start(struct bnxt *bp) +{ + int rc; + + rc = bnxt_schedule_ptp_alarm(bp); + if (rc != 0) { + PMD_DRV_LOG(ERR, "Failed to schedule PTP alarm\n"); + } else { + bp->flags |= BNXT_FLAGS_PTP_TIMESYNC_ENABLED; + bp->flags |= BNXT_FLAGS_PTP_ALARM_SCHEDULED; + } + + return rc; +} + /* Unload the driver, release resources */ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) { @@ -959,6 +1064,9 @@ bnxt_cancel_fw_health_check(bp); + if (BNXT_THOR_PTP_TIMESYNC_ENABLED(bp)) + bnxt_cancel_ptp_alarm(bp); + /* Do not bring link down during reset recovery */ if (!is_bnxt_in_error(bp)) { bnxt_dev_set_link_down_op(eth_dev); @@ -984,6 +1092,7 @@ bnxt_int_handler(eth_dev); bnxt_shutdown_nic(bp); bnxt_hwrm_if_change(bp, false); + bnxt_free_prev_ring_stats(bp); bp->rx_cosq_cnt = 0; } @@ -991,6 +1100,9 @@ { struct bnxt *bp = eth_dev->data->dev_private; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + /* cancel the recovery handler before remove dev */ rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp); rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp); @@ -1038,8 +1150,6 @@ STAILQ_REMOVE(&vnic->filter, filter, bnxt_filter_info, next); bnxt_hwrm_clear_l2_filter(bp, filter); - filter->mac_index = INVALID_MAC_INDEX; - memset(&filter->l2_addr, 0, RTE_ETHER_ADDR_LEN); bnxt_free_filter(bp, filter); } filter = temp_filter; @@ -1086,7 +1196,6 @@ else STAILQ_INSERT_TAIL(&vnic->filter, filter, next); } else { - memset(&filter->l2_addr, 0, RTE_ETHER_ADDR_LEN); bnxt_free_filter(bp, filter); } @@ -1165,11 +1274,6 @@ if (new.link_status != eth_dev->data->dev_link.link_status || new.link_speed != eth_dev->data->dev_link.link_speed) { rte_eth_linkstatus_set(eth_dev, &new); - - _rte_eth_dev_callback_process(eth_dev, - RTE_ETH_EVENT_INTR_LSC, - NULL); - bnxt_print_link_info(eth_dev); } @@ -1395,7 +1499,6 @@ if (rc) return rc; - /* Retrieve from the default VNIC */ if (!vnic) return -EINVAL; if (!vnic->rss_table) @@ -1429,6 +1532,9 @@ } } + if (BNXT_THOR_PTP_TIMESYNC_ENABLED(bp)) + bnxt_schedule_ptp_alarm(bp); + return 0; } @@ -1474,7 +1580,8 @@ if (rss_conf->rss_key_len != HW_HASH_KEY_SIZE) { PMD_DRV_LOG(ERR, - "Invalid hashkey length, should be 16 bytes\n"); + "Invalid hashkey length, should be %d bytes\n", + HW_HASH_KEY_SIZE); return -EINVAL; } memcpy(vnic->rss_hash_key, rss_conf->rss_key, rss_conf->rss_key_len); @@ -1592,8 +1699,9 @@ if (rc) return rc; - if (!BNXT_SINGLE_PF(bp) || BNXT_VF(bp)) { - PMD_DRV_LOG(ERR, "Flow Control Settings cannot be modified\n"); + if (!BNXT_SINGLE_PF(bp)) { + PMD_DRV_LOG(ERR, + "Flow Control Settings cannot be modified on VF or on shared PF\n"); return -ENOTSUP; } @@ -1841,7 +1949,6 @@ /* Free the newly allocated filter as we were * not able to create the filter in hardware. */ - filter->fw_l2_filter_id = UINT64_MAX; bnxt_free_filter(bp, filter); return rc; } @@ -1896,7 +2003,6 @@ STAILQ_REMOVE(&vnic->filter, filter, bnxt_filter_info, next); bnxt_free_filter(bp, filter); - filter->fw_l2_filter_id = UINT64_MAX; } return rc; } @@ -1952,6 +2058,10 @@ } bnxt_del_dflt_mac_filter(bp, vnic); + rc = bnxt_hwrm_vnic_ctx_free(bp, vnic); + if (rc) + return rc; + rc = bnxt_hwrm_vnic_free(bp, vnic); if (rc) return rc; @@ -2336,9 +2446,8 @@ if (rc) return rc; - if (!BNXT_SINGLE_PF(bp) || BNXT_VF(bp)) { - PMD_DRV_LOG(ERR, - "PVID cannot be modified for this function\n"); + if (!BNXT_SINGLE_PF(bp)) { + PMD_DRV_LOG(ERR, "PVID cannot be modified on VF or on shared PF\n"); return -ENOTSUP; } bp->vlan = on ? pvid : 0; @@ -2379,8 +2488,8 @@ bnxt_rx_queue_count_op(struct rte_eth_dev *dev, uint16_t rx_queue_id) { struct bnxt *bp = (struct bnxt *)dev->data->dev_private; - uint32_t desc = 0, raw_cons = 0, cons; struct bnxt_cp_ring_info *cpr; + uint32_t desc = 0, raw_cons, cp_ring_size; struct bnxt_rx_queue *rxq; struct rx_pkt_cmpl *rxcmp; int rc; @@ -2392,17 +2501,45 @@ rxq = dev->data->rx_queues[rx_queue_id]; cpr = rxq->cp_ring; raw_cons = cpr->cp_raw_cons; + cp_ring_size = cpr->cp_ring_struct->ring_size; while (1) { + uint32_t agg_cnt, cons, cmpl_type; + cons = RING_CMP(cpr->cp_ring_struct, raw_cons); - rte_prefetch0(&cpr->cp_desc_ring[cons]); rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons]; - if (!CMP_VALID(rxcmp, raw_cons, cpr->cp_ring_struct)) { + if (!bnxt_cpr_cmp_valid(rxcmp, raw_cons, cp_ring_size)) break; - } else { - raw_cons++; + + cmpl_type = CMP_TYPE(rxcmp); + + switch (cmpl_type) { + case CMPL_BASE_TYPE_RX_L2: + agg_cnt = BNXT_RX_L2_AGG_BUFS(rxcmp); + raw_cons = raw_cons + CMP_LEN(cmpl_type) + agg_cnt; + desc++; + break; + + case CMPL_BASE_TYPE_RX_TPA_END: + if (BNXT_CHIP_THOR(rxq->bp)) { + struct rx_tpa_v2_end_cmpl_hi *p5_tpa_end; + + p5_tpa_end = (void *)rxcmp; + agg_cnt = BNXT_TPA_END_AGG_BUFS_TH(p5_tpa_end); + } else { + struct rx_tpa_end_cmpl *tpa_end; + + tpa_end = (void *)rxcmp; + agg_cnt = BNXT_TPA_END_AGG_BUFS(tpa_end); + } + + raw_cons = raw_cons + CMP_LEN(cmpl_type) + agg_cnt; desc++; + break; + + default: + raw_cons += CMP_LEN(cmpl_type); } } @@ -2412,42 +2549,78 @@ static int bnxt_rx_descriptor_status_op(void *rx_queue, uint16_t offset) { - struct bnxt_rx_queue *rxq = (struct bnxt_rx_queue *)rx_queue; - struct bnxt_rx_ring_info *rxr; + struct bnxt_rx_queue *rxq = rx_queue; struct bnxt_cp_ring_info *cpr; struct bnxt_sw_rx_bd *rx_buf; + struct bnxt_rx_ring_info *rxr; + uint32_t desc, raw_cons, cp_ring_size; + struct bnxt *bp = rxq->bp; struct rx_pkt_cmpl *rxcmp; - uint32_t cons, cp_cons; int rc; - if (!rxq) - return -EINVAL; - - rc = is_bnxt_in_error(rxq->bp); + rc = is_bnxt_in_error(bp); if (rc) return rc; - cpr = rxq->cp_ring; - rxr = rxq->rx_ring; - if (offset >= rxq->nb_rx_desc) return -EINVAL; - cons = RING_CMP(cpr->cp_ring_struct, offset); - cp_cons = cpr->cp_raw_cons; - rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons]; - - if (cons > cp_cons) { - if (CMPL_VALID(rxcmp, cpr->valid)) - return RTE_ETH_RX_DESC_DONE; - } else { - if (CMPL_VALID(rxcmp, !cpr->valid)) - return RTE_ETH_RX_DESC_DONE; - } - rx_buf = &rxr->rx_buf_ring[cons]; - if (rx_buf->mbuf == NULL) - return RTE_ETH_RX_DESC_UNAVAIL; + rxr = rxq->rx_ring; + cpr = rxq->cp_ring; + cp_ring_size = cpr->cp_ring_struct->ring_size; + + raw_cons = cpr->cp_raw_cons; + desc = 0; + while (1) { + uint32_t agg_cnt, cons, cmpl_type; + + cons = RING_CMP(cpr->cp_ring_struct, raw_cons); + rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons]; + + if (!bnxt_cpr_cmp_valid(rxcmp, raw_cons, cp_ring_size)) + break; + + cmpl_type = CMP_TYPE(rxcmp); + + switch (cmpl_type) { + case CMPL_BASE_TYPE_RX_L2: + if (desc == offset) { + cons = rxcmp->opaque; + rx_buf = &rxr->rx_buf_ring[cons]; + if (rx_buf->mbuf != NULL) + return RTE_ETH_RX_DESC_DONE; + else + return RTE_ETH_RX_DESC_UNAVAIL; + } + agg_cnt = BNXT_RX_L2_AGG_BUFS(rxcmp); + raw_cons = raw_cons + CMP_LEN(cmpl_type) + agg_cnt; + desc++; + break; + + case CMPL_BASE_TYPE_RX_TPA_END: + if (desc == offset) + return RTE_ETH_RX_DESC_DONE; + + if (BNXT_CHIP_THOR(rxq->bp)) { + struct rx_tpa_v2_end_cmpl_hi *p5_tpa_end; + + p5_tpa_end = (void *)rxcmp; + agg_cnt = BNXT_TPA_END_AGG_BUFS_TH(p5_tpa_end); + } else { + struct rx_tpa_end_cmpl *tpa_end; + + tpa_end = (void *)rxcmp; + agg_cnt = BNXT_TPA_END_AGG_BUFS(tpa_end); + } + + raw_cons = raw_cons + CMP_LEN(cmpl_type) + agg_cnt; + desc++; + break; + default: + raw_cons += CMP_LEN(cmpl_type); + } + } return RTE_ETH_RX_DESC_AVAIL; } @@ -2456,41 +2629,47 @@ bnxt_tx_descriptor_status_op(void *tx_queue, uint16_t offset) { struct bnxt_tx_queue *txq = (struct bnxt_tx_queue *)tx_queue; - struct bnxt_tx_ring_info *txr; - struct bnxt_cp_ring_info *cpr; - struct bnxt_sw_tx_bd *tx_buf; - struct tx_pkt_cmpl *txcmp; - uint32_t cons, cp_cons; + struct bnxt_cp_ring_info *cpr = txq->cp_ring; + uint32_t ring_mask, raw_cons, nb_tx_pkts = 0; + struct cmpl_base *cp_desc_ring; int rc; - if (!txq) - return -EINVAL; - rc = is_bnxt_in_error(txq->bp); if (rc) return rc; - cpr = txq->cp_ring; - txr = txq->tx_ring; - if (offset >= txq->nb_tx_desc) return -EINVAL; - cons = RING_CMP(cpr->cp_ring_struct, offset); - txcmp = (struct tx_pkt_cmpl *)&cpr->cp_desc_ring[cons]; - cp_cons = cpr->cp_raw_cons; - - if (cons > cp_cons) { - if (CMPL_VALID(txcmp, cpr->valid)) - return RTE_ETH_TX_DESC_UNAVAIL; - } else { - if (CMPL_VALID(txcmp, !cpr->valid)) - return RTE_ETH_TX_DESC_UNAVAIL; - } - tx_buf = &txr->tx_buf_ring[cons]; - if (tx_buf->mbuf == NULL) + /* Return "desc done" if descriptor is available for use. */ + if (bnxt_tx_bds_in_hw(txq) <= offset) return RTE_ETH_TX_DESC_DONE; + raw_cons = cpr->cp_raw_cons; + cp_desc_ring = cpr->cp_desc_ring; + ring_mask = cpr->cp_ring_struct->ring_mask; + + /* Check to see if hw has posted a completion for the descriptor. */ + while (1) { + struct tx_cmpl *txcmp; + uint32_t cons; + + cons = RING_CMPL(ring_mask, raw_cons); + txcmp = (struct tx_cmpl *)&cp_desc_ring[cons]; + + if (!bnxt_cpr_cmp_valid(txcmp, raw_cons, ring_mask + 1)) + break; + + if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2) + nb_tx_pkts += rte_le_to_cpu_32(txcmp->opaque); + + if (nb_tx_pkts > offset) + return RTE_ETH_TX_DESC_DONE; + + raw_cons = NEXT_RAW_CMP(raw_cons); + } + + /* Descriptor is pending transmit, not yet completed by hardware. */ return RTE_ETH_TX_DESC_FULL; } @@ -2845,14 +3024,11 @@ STAILQ_REMOVE(&vnic->filter, mfilter, bnxt_filter_info, next); bnxt_free_filter(bp, mfilter); - mfilter->fw_l2_filter_id = -1; bnxt_free_filter(bp, bfilter); - bfilter->fw_l2_filter_id = -1; } return 0; free_filter: - bfilter->fw_l2_filter_id = -1; bnxt_free_filter(bp, bfilter); return ret; } @@ -3250,7 +3426,6 @@ STAILQ_REMOVE(&vnic->filter, match, bnxt_filter_info, next); bnxt_free_filter(bp, match); - filter->fw_l2_filter_id = -1; bnxt_free_filter(bp, filter); } break; @@ -3283,7 +3458,6 @@ return ret; free_filter: - filter->fw_l2_filter_id = -1; bnxt_free_filter(bp, filter); return ret; } @@ -3427,19 +3601,49 @@ ptp->tx_mapped_regs[BNXT_PTP_TX_TS_L])); *ts |= (uint64_t)rte_le_to_cpu_32(rte_read32((uint8_t *)bp->bar0 + ptp->tx_mapped_regs[BNXT_PTP_TX_TS_H])) << 32; + rte_read32((uint8_t *)bp->bar0 + ptp->tx_mapped_regs[BNXT_PTP_TX_SEQ]); return 0; } -static int bnxt_get_rx_ts(struct bnxt *bp, uint64_t *ts) +static int bnxt_clr_rx_ts(struct bnxt *bp, uint64_t *last_ts) { struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; struct bnxt_pf_info *pf = &bp->pf; uint16_t port_id; + int i = 0; uint32_t fifo; - if (!ptp) - return -ENODEV; + if (!ptp || BNXT_CHIP_THOR(bp)) + return -EINVAL; + + port_id = pf->port_id; + fifo = rte_le_to_cpu_32(rte_read32((uint8_t *)bp->bar0 + + ptp->rx_mapped_regs[BNXT_PTP_RX_FIFO])); + while ((fifo & BNXT_PTP_RX_FIFO_PENDING) && (i < BNXT_PTP_RX_PND_CNT)) { + rte_write32(1 << port_id, (uint8_t *)bp->bar0 + + ptp->rx_mapped_regs[BNXT_PTP_RX_FIFO_ADV]); + fifo = rte_le_to_cpu_32(rte_read32((uint8_t *)bp->bar0 + + ptp->rx_mapped_regs[BNXT_PTP_RX_FIFO])); + *last_ts = rte_le_to_cpu_32(rte_read32((uint8_t *)bp->bar0 + + ptp->rx_mapped_regs[BNXT_PTP_RX_TS_L])); + *last_ts |= (uint64_t)rte_le_to_cpu_32(rte_read32((uint8_t *)bp->bar0 + + ptp->rx_mapped_regs[BNXT_PTP_RX_TS_H])) << 32; + i++; + } + + if (i >= BNXT_PTP_RX_PND_CNT) + return -EBUSY; + + return 0; +} + +static int bnxt_get_rx_ts(struct bnxt *bp, uint64_t *ts) +{ + struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; + struct bnxt_pf_info *pf = &bp->pf; + uint16_t port_id; + uint32_t fifo; fifo = rte_le_to_cpu_32(rte_read32((uint8_t *)bp->bar0 + ptp->rx_mapped_regs[BNXT_PTP_RX_FIFO])); @@ -3452,10 +3656,8 @@ fifo = rte_le_to_cpu_32(rte_read32((uint8_t *)bp->bar0 + ptp->rx_mapped_regs[BNXT_PTP_RX_FIFO])); - if (fifo & BNXT_PTP_RX_FIFO_PENDING) { -/* bnxt_clr_rx_ts(bp); TBD */ - return -EBUSY; - } + if (fifo & BNXT_PTP_RX_FIFO_PENDING) + return bnxt_clr_rx_ts(bp, ts); *ts = rte_le_to_cpu_32(rte_read32((uint8_t *)bp->bar0 + ptp->rx_mapped_regs[BNXT_PTP_RX_TS_L])); @@ -3473,11 +3675,13 @@ struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; if (!ptp) - return 0; + return -ENOTSUP; ns = rte_timespec_to_ns(ts); /* Set the timecounters to a new value. */ ptp->tc.nsec = ns; + ptp->tx_tstamp_tc.nsec = ns; + ptp->rx_tstamp_tc.nsec = ns; return 0; } @@ -3491,7 +3695,7 @@ int rc = 0; if (!ptp) - return 0; + return -ENOTSUP; if (BNXT_CHIP_THOR(bp)) rc = bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_CURRENT_TIME, @@ -3513,7 +3717,7 @@ int rc; if (!ptp) - return 0; + return -ENOTSUP; ptp->rx_filter = 1; ptp->tx_tstamp_en = 1; @@ -3541,8 +3745,10 @@ if (!BNXT_CHIP_THOR(bp)) bnxt_map_ptp_regs(bp); + else + rc = bnxt_ptp_start(bp); - return 0; + return rc; } static int @@ -3552,7 +3758,7 @@ struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; if (!ptp) - return 0; + return -ENOTSUP; ptp->rx_filter = 0; ptp->tx_tstamp_en = 0; @@ -3562,6 +3768,8 @@ if (!BNXT_CHIP_THOR(bp)) bnxt_unmap_ptp_regs(bp); + else + bnxt_ptp_stop(bp); return 0; } @@ -3577,7 +3785,7 @@ uint64_t ns; if (!ptp) - return 0; + return -ENOTSUP; if (BNXT_CHIP_THOR(bp)) rx_tstamp_cycles = ptp->rx_timestamp; @@ -3600,7 +3808,7 @@ int rc = 0; if (!ptp) - return 0; + return -ENOTSUP; if (BNXT_CHIP_THOR(bp)) rc = bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_PATH_TX, @@ -3621,9 +3829,11 @@ struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; if (!ptp) - return 0; + return -ENOTSUP; ptp->tc.nsec += delta; + ptp->tx_tstamp_tc.nsec += delta; + ptp->rx_tstamp_tc.nsec += delta; return 0; } @@ -3903,13 +4113,19 @@ uint32_t val = info->reset_reg_val[index]; uint32_t reg = info->reset_reg[index]; uint32_t type, offset; + int ret; type = BNXT_FW_STATUS_REG_TYPE(reg); offset = BNXT_FW_STATUS_REG_OFF(reg); switch (type) { case BNXT_FW_STATUS_REG_TYPE_CFG: - rte_pci_write_config(bp->pdev, &val, sizeof(val), offset); + ret = rte_pci_write_config(bp->pdev, &val, sizeof(val), offset); + if (ret < 0) { + PMD_DRV_LOG(ERR, "Failed to write %#x at PCI offset %#x", + val, offset); + return; + } break; case BNXT_FW_STATUS_REG_TYPE_GRC: offset = bnxt_map_reset_regs(bp, offset); @@ -3934,6 +4150,32 @@ bnxt_uninit_resources(bp, true); } +static int +bnxt_check_fw_reset_done(struct bnxt *bp) +{ + int timeout = bp->fw_reset_max_msecs; + uint16_t val = 0; + int rc; + + do { + rc = rte_pci_read_config(bp->pdev, &val, sizeof(val), PCI_SUBSYSTEM_ID_OFFSET); + if (rc < 0) { + PMD_DRV_LOG(ERR, "Failed to read PCI offset 0x%x", PCI_SUBSYSTEM_ID_OFFSET); + return rc; + } + if (val != 0xffff) + break; + rte_delay_ms(1); + } while (timeout--); + + if (val == 0xffff) { + PMD_DRV_LOG(ERR, "Firmware reset aborted, PCI config space invalid\n"); + return -1; + } + + return 0; +} + static int bnxt_restore_vlan_filters(struct bnxt *bp) { struct rte_eth_dev *dev = bp->eth_dev; @@ -3964,7 +4206,7 @@ struct rte_ether_addr *addr; uint64_t pool_mask; uint32_t pool = 0; - uint16_t i; + uint32_t i; int rc; if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp)) @@ -4024,28 +4266,43 @@ return ret; } -static void bnxt_dev_recover(void *arg) +static int bnxt_check_fw_ready(struct bnxt *bp) { - struct bnxt *bp = arg; int timeout = bp->fw_reset_max_msecs; int rc = 0; - /* Clear Error flag so that device re-init should happen */ - bp->flags &= ~BNXT_FLAG_FATAL_ERROR; - do { - rc = bnxt_hwrm_ver_get(bp, SHORT_HWRM_CMD_TIMEOUT); + rc = bnxt_hwrm_poll_ver_get(bp); if (rc == 0) break; rte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL); timeout -= BNXT_FW_READY_WAIT_INTERVAL; - } while (rc && timeout); + } while (rc && timeout > 0); - if (rc) { + if (rc) PMD_DRV_LOG(ERR, "FW is not Ready after reset\n"); - goto err; + + return rc; +} + +static void bnxt_dev_recover(void *arg) +{ + struct bnxt *bp = arg; + int rc = 0; + + if (!bp->fw_reset_min_msecs) { + rc = bnxt_check_fw_reset_done(bp); + if (rc) + goto err; } + /* Clear Error flag so that device re-init should happen */ + bp->flags &= ~BNXT_FLAG_FATAL_ERROR; + + rc = bnxt_check_fw_ready(bp); + if (rc) + goto err; + rc = bnxt_init_resources(bp, true); if (rc) { PMD_DRV_LOG(ERR, @@ -4072,20 +4329,43 @@ err: bp->flags |= BNXT_FLAG_FATAL_ERROR; bnxt_uninit_resources(bp, false); + if (bp->eth_dev->data->dev_conf.intr_conf.rmv) + _rte_eth_dev_callback_process(bp->eth_dev, + RTE_ETH_EVENT_INTR_RMV, + NULL); PMD_DRV_LOG(ERR, "Failed to recover from FW reset\n"); } void bnxt_dev_reset_and_resume(void *arg) { struct bnxt *bp = arg; + uint32_t us = US_PER_MS * bp->fw_reset_min_msecs; + uint16_t val = 0; int rc; bnxt_dev_cleanup(bp); bnxt_wait_for_device_shutdown(bp); - rc = rte_eal_alarm_set(US_PER_MS * bp->fw_reset_min_msecs, - bnxt_dev_recover, (void *)bp); + /* During some fatal firmware error conditions, the PCI config space + * register 0x2e which normally contains the subsystem ID will become + * 0xffff. This register will revert back to the normal value after + * the chip has completed core reset. If we detect this condition, + * we can poll this config register immediately for the value to revert. + */ + if (bp->flags & BNXT_FLAG_FATAL_ERROR) { + rc = rte_pci_read_config(bp->pdev, &val, sizeof(val), PCI_SUBSYSTEM_ID_OFFSET); + if (rc < 0) { + PMD_DRV_LOG(ERR, "Failed to read PCI offset 0x%x", PCI_SUBSYSTEM_ID_OFFSET); + return; + } + if (val == 0xffff) { + bp->fw_reset_min_msecs = 0; + us = 1; + } + } + + rc = rte_eal_alarm_set(us, bnxt_dev_recover, (void *)bp); if (rc) PMD_DRV_LOG(ERR, "Error setting recovery alarm"); } @@ -4095,13 +4375,17 @@ struct bnxt_error_recovery_info *info = bp->recovery_info; uint32_t reg = info->status_regs[index]; uint32_t type, offset, val = 0; + int ret = 0; type = BNXT_FW_STATUS_REG_TYPE(reg); offset = BNXT_FW_STATUS_REG_OFF(reg); switch (type) { case BNXT_FW_STATUS_REG_TYPE_CFG: - rte_pci_read_config(bp->pdev, &val, sizeof(val), offset); + ret = rte_pci_read_config(bp->pdev, &val, sizeof(val), offset); + if (ret < 0) + PMD_DRV_LOG(ERR, "Failed to read PCI offset %#x", + offset); break; case BNXT_FW_STATUS_REG_TYPE_GRC: offset = info->mapped_status_regs[index]; @@ -4207,6 +4491,8 @@ bp->flags |= BNXT_FLAG_FATAL_ERROR; bp->flags |= BNXT_FLAG_FW_RESET; + bnxt_stop_rxtx(bp); + PMD_DRV_LOG(ERR, "Detected FW dead condition\n"); if (bnxt_is_master_func(bp)) @@ -4242,9 +4528,6 @@ static void bnxt_cancel_fw_health_check(struct bnxt *bp) { - if (!bnxt_is_recovery_enabled(bp)) - return; - rte_eal_alarm_cancel(bnxt_check_fw_health, (void *)bp); bp->flags &= ~BNXT_FLAG_FW_HEALTH_CHECK_SCHEDULED; } @@ -4348,7 +4631,7 @@ if (!mz) { mz = rte_memzone_reserve_aligned(mz_name, rmem->nr_pages * 8, - SOCKET_ID_ANY, + bp->eth_dev->device->numa_node, RTE_MEMZONE_2MB | RTE_MEMZONE_SIZE_HINT_ONLY | RTE_MEMZONE_IOVA_CONTIG, @@ -4371,7 +4654,7 @@ if (!mz) { mz = rte_memzone_reserve_aligned(mz_name, mem_size, - SOCKET_ID_ANY, + bp->eth_dev->device->numa_node, RTE_MEMZONE_1GB | RTE_MEMZONE_SIZE_HINT_ONLY | RTE_MEMZONE_IOVA_CONTIG, @@ -4752,6 +5035,8 @@ bnxt_hwrm_port_led_qcaps(bp); + bnxt_hwrm_port_phy_qcaps(bp); + return 0; } @@ -4888,7 +5173,7 @@ rc = bnxt_alloc_hwrm_resources(bp); if (rc) { PMD_DRV_LOG(ERR, - "Failed to allocate hwrm resource rc: %x\n", rc); + "Failed to allocate response buffer rc: %x\n", rc); goto error_free; } rc = bnxt_init_resources(bp, false); @@ -4900,7 +5185,8 @@ goto error_free; PMD_DRV_LOG(INFO, - DRV_MODULE_NAME "found at mem %" PRIX64 ", node addr %pM\n", + "Found %s device at mem %" PRIX64 ", node addr %pM\n", + DRV_MODULE_NAME, pci_dev->mem_resource[0].phys_addr, pci_dev->mem_resource[0].addr); @@ -4970,7 +5256,7 @@ if (eth_dev->data->dev_started) bnxt_dev_close_op(eth_dev); - bnxt_hwrm_free_vf_info(bp); + bnxt_free_vf_info(bp); eth_dev->dev_ops = NULL; eth_dev->rx_pkt_burst = NULL; eth_dev->tx_pkt_burst = NULL; @@ -4996,7 +5282,8 @@ static struct rte_pci_driver bnxt_rte_pmd = { .id_table = bnxt_pci_id_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | + RTE_PCI_DRV_INTR_RMV, .probe = bnxt_pci_probe, .remove = bnxt_pci_remove, }; diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_filter.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_filter.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_filter.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_filter.c 2021-08-18 14:45:29.000000000 +0000 @@ -193,5 +193,10 @@ void bnxt_free_filter(struct bnxt *bp, struct bnxt_filter_info *filter) { + memset(filter, 0, sizeof(*filter)); + filter->mac_index = INVALID_MAC_INDEX; + filter->fw_l2_filter_id = UINT64_MAX; + filter->fw_ntuple_filter_id = UINT64_MAX; + filter->fw_em_filter_id = UINT64_MAX; STAILQ_INSERT_TAIL(&bp->free_filter_list, filter, next); } diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_flow.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_flow.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_flow.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_flow.c 2021-08-18 14:45:29.000000000 +0000 @@ -185,11 +185,15 @@ PMD_DRV_LOG(DEBUG, "Parse inner header\n"); break; case RTE_FLOW_ITEM_TYPE_ETH: - if (!item->spec || !item->mask) + if (!item->spec) break; eth_spec = item->spec; - eth_mask = item->mask; + + if (item->mask) + eth_mask = item->mask; + else + eth_mask = &rte_flow_item_eth_mask; /* Source MAC address mask cannot be partially set. * Should be All 0's or all 1's. @@ -278,7 +282,12 @@ break; case RTE_FLOW_ITEM_TYPE_VLAN: vlan_spec = item->spec; - vlan_mask = item->mask; + + if (item->mask) + vlan_mask = item->mask; + else + vlan_mask = &rte_flow_item_vlan_mask; + if (en & en_ethertype) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, @@ -321,11 +330,15 @@ case RTE_FLOW_ITEM_TYPE_IPV4: /* If mask is not involved, we could use EM filters. */ ipv4_spec = item->spec; - ipv4_mask = item->mask; - if (!item->spec || !item->mask) + if (!item->spec) break; + if (item->mask) + ipv4_mask = item->mask; + else + ipv4_mask = &rte_flow_item_ipv4_mask; + /* Only IP DST and SRC fields are maskable. */ if (ipv4_mask->hdr.version_ihl || ipv4_mask->hdr.type_of_service || @@ -382,11 +395,15 @@ break; case RTE_FLOW_ITEM_TYPE_IPV6: ipv6_spec = item->spec; - ipv6_mask = item->mask; - if (!item->spec || !item->mask) + if (!item->spec) break; + if (item->mask) + ipv6_mask = item->mask; + else + ipv6_mask = &rte_flow_item_ipv6_mask; + /* Only IP DST and SRC fields are maskable. */ if (ipv6_mask->hdr.vtc_flow || ipv6_mask->hdr.payload_len || @@ -434,11 +451,15 @@ break; case RTE_FLOW_ITEM_TYPE_TCP: tcp_spec = item->spec; - tcp_mask = item->mask; - if (!item->spec || !item->mask) + if (!item->spec) break; + if (item->mask) + tcp_mask = item->mask; + else + tcp_mask = &rte_flow_item_tcp_mask; + /* Check TCP mask. Only DST & SRC ports are maskable */ if (tcp_mask->hdr.sent_seq || tcp_mask->hdr.recv_ack || @@ -479,11 +500,15 @@ break; case RTE_FLOW_ITEM_TYPE_UDP: udp_spec = item->spec; - udp_mask = item->mask; - if (!item->spec || !item->mask) + if (!item->spec) break; + if (item->mask) + udp_mask = item->mask; + else + udp_mask = &rte_flow_item_udp_mask; + if (udp_mask->hdr.dgram_len || udp_mask->hdr.dgram_cksum) { rte_flow_error_set(error, @@ -891,33 +916,59 @@ return l2_filter; } -static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic) +static void bnxt_vnic_cleanup(struct bnxt *bp, struct bnxt_vnic_info *vnic) +{ + if (vnic->rx_queue_cnt > 1) + bnxt_hwrm_vnic_ctx_free(bp, vnic); + + bnxt_hwrm_vnic_free(bp, vnic); + + rte_free(vnic->fw_grp_ids); + vnic->fw_grp_ids = NULL; + + vnic->rx_queue_cnt = 0; +} + +static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic, + const struct rte_flow_action *act, + struct rte_flow_error *error) { struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf; uint64_t rx_offloads = dev_conf->rxmode.offloads; int rc; + if (bp->nr_vnics > bp->max_vnics - 1) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ATTR_GROUP, + NULL, + "Group id is invalid"); + rc = bnxt_vnic_grp_alloc(bp, vnic); if (rc) - goto ret; + return rte_flow_error_set(error, -rc, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "Failed to alloc VNIC group"); rc = bnxt_hwrm_vnic_alloc(bp, vnic); if (rc) { - PMD_DRV_LOG(ERR, "HWRM vnic alloc failure rc: %x\n", rc); + rte_flow_error_set(error, -rc, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "Failed to alloc VNIC"); goto ret; } - bp->nr_vnics++; /* RSS context is required only when there is more than one RSS ring */ if (vnic->rx_queue_cnt > 1) { - rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic, 0 /* ctx_idx 0 */); + rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic, 0); if (rc) { - PMD_DRV_LOG(ERR, - "HWRM vnic ctx alloc failure: %x\n", rc); + rte_flow_error_set(error, -rc, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "Failed to alloc VNIC context"); goto ret; } - } else { - PMD_DRV_LOG(DEBUG, "No RSS context required\n"); } if (rx_offloads & DEV_RX_OFFLOAD_VLAN_STRIP) @@ -926,12 +977,29 @@ vnic->vlan_strip = false; rc = bnxt_hwrm_vnic_cfg(bp, vnic); - if (rc) + if (rc) { + rte_flow_error_set(error, -rc, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "Failed to configure VNIC"); goto ret; + } - bnxt_hwrm_vnic_plcmode_cfg(bp, vnic); + rc = bnxt_hwrm_vnic_plcmode_cfg(bp, vnic); + if (rc) { + rte_flow_error_set(error, -rc, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "Failed to configure VNIC plcmode"); + goto ret; + } + + bp->nr_vnics++; + + return 0; ret: + bnxt_vnic_cleanup(bp, vnic); return rc; } @@ -1101,16 +1169,9 @@ PMD_DRV_LOG(DEBUG, "VNIC found\n"); - rc = bnxt_vnic_prep(bp, vnic); - if (rc) { - rte_flow_error_set(error, - EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, - act, - "VNIC prep fail"); - rc = -rte_errno; + rc = bnxt_vnic_prep(bp, vnic, act, error); + if (rc) goto ret; - } PMD_DRV_LOG(DEBUG, "vnic[%d] = %p vnic->fw_grp_ids = %p\n", @@ -1320,16 +1381,9 @@ vnic->end_grp_id = rss->queue[rss->queue_num - 1]; vnic->func_default = 0; //This is not a default VNIC. - rc = bnxt_vnic_prep(bp, vnic); - if (rc) { - rte_flow_error_set(error, - EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, - act, - "VNIC prep fail"); - rc = -rte_errno; + rc = bnxt_vnic_prep(bp, vnic, act, error); + if (rc) goto ret; - } PMD_DRV_LOG(DEBUG, "vnic[%d] = %p vnic->fw_grp_ids = %p\n", @@ -1363,8 +1417,8 @@ /* If hash key has not been specified, * use random hash key. */ - prandom_bytes(vnic->rss_hash_key, - HW_HASH_KEY_SIZE); + bnxt_prandom_bytes(vnic->rss_hash_key, + HW_HASH_KEY_SIZE); } else { if (rss->key_len > HW_HASH_KEY_SIZE) memcpy(vnic->rss_hash_key, @@ -1472,9 +1526,11 @@ filter = bnxt_get_unused_filter(bp); if (filter == NULL) { - PMD_DRV_LOG(ERR, "Not enough resources for a new flow.\n"); + rte_flow_error_set(error, ENOSPC, + RTE_FLOW_ERROR_TYPE_HANDLE, NULL, + "Not enough resources for a new flow"); bnxt_release_flow_lock(bp); - return -ENOMEM; + return -ENOSPC; } ret = bnxt_validate_and_parse_flow(dev, pattern, actions, attr, @@ -1485,10 +1541,8 @@ vnic = find_matching_vnic(bp, filter); if (vnic) { if (STAILQ_EMPTY(&vnic->filter)) { - rte_free(vnic->fw_grp_ids); - bnxt_hwrm_vnic_ctx_free(bp, vnic); - bnxt_hwrm_vnic_free(bp, vnic); - vnic->rx_queue_cnt = 0; + bnxt_vnic_cleanup(bp, vnic); + bp->nr_vnics--; PMD_DRV_LOG(DEBUG, "Free VNIC\n"); } } @@ -1502,7 +1556,6 @@ exit: /* No need to hold on to this filter if we are just validating flow */ - filter->fw_l2_filter_id = UINT64_MAX; bnxt_free_filter(bp, filter); bnxt_release_flow_lock(bp); @@ -1804,12 +1857,20 @@ /* Tunnel doesn't belong to this VF, so don't send HWRM * cmd, just delete the flow from driver */ - if (bp->fw_fid != (tun_dst_fid + bp->first_vf_id)) + if (bp->fw_fid != (tun_dst_fid + bp->first_vf_id)) { PMD_DRV_LOG(ERR, "Tunnel does not belong to this VF, skip hwrm_tunnel_redirect_free\n"); - else + } else { ret = bnxt_hwrm_tunnel_redirect_free(bp, filter->tunnel_type); + if (ret) { + rte_flow_error_set(error, -ret, + RTE_FLOW_ERROR_TYPE_HANDLE, + NULL, + "Unable to free tunnel redirection"); + return ret; + } + } } return ret; } @@ -1862,12 +1923,8 @@ */ if (vnic && !vnic->func_default && STAILQ_EMPTY(&vnic->flow_list)) { - rte_free(vnic->fw_grp_ids); - if (vnic->rx_queue_cnt > 1) - bnxt_hwrm_vnic_ctx_free(bp, vnic); - - bnxt_hwrm_vnic_free(bp, vnic); - vnic->rx_queue_cnt = 0; + bnxt_vnic_cleanup(bp, vnic); + bp->nr_vnics--; } } else { rte_flow_error_set(error, -ret, diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt.h dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt.h --- dpdk-19.11.7/drivers/net/bnxt/bnxt.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt.h 2021-08-18 14:45:29.000000000 +0000 @@ -251,6 +251,7 @@ uint8_t phy_ver[PHY_VER_LEN]; uint16_t link_speed; uint16_t support_speeds; + uint16_t support_auto_speeds; uint16_t auto_link_speed; uint16_t force_link_speed; uint16_t auto_link_speed_mask; @@ -271,9 +272,11 @@ struct bnxt_vnic_info *vnic; }; +#define BNXT_PTP_RX_PND_CNT 10 #define BNXT_PTP_FLAGS_PATH_TX 0x0 #define BNXT_PTP_FLAGS_PATH_RX 0x1 #define BNXT_PTP_FLAGS_CURRENT_TIME 0x2 +#define BNXT_PTP_CURRENT_TIME_MASK 0xFFFF00000000ULL struct bnxt_ptp_cfg { #define BNXT_GRCPF_REG_WINDOW_BASE_OUT 0x400 @@ -323,6 +326,7 @@ /* On Thor, the Rx timestamp is present in the Rx completion record */ uint64_t rx_timestamp; + uint64_t current_time; }; struct bnxt_coal { @@ -488,6 +492,50 @@ #define BNXT_FW_STATUS_SHUTDOWN 0x100000 #define BNXT_HWRM_SHORT_REQ_LEN sizeof(struct hwrm_short_input) + +struct bnxt_ring_stats { + /* Number of transmitted unicast packets */ + uint64_t tx_ucast_pkts; + /* Number of transmitted multicast packets */ + uint64_t tx_mcast_pkts; + /* Number of transmitted broadcast packets */ + uint64_t tx_bcast_pkts; + /* Number of packets discarded in transmit path */ + uint64_t tx_discard_pkts; + /* Number of packets in transmit path with error */ + uint64_t tx_error_pkts; + /* Number of transmitted bytes for unicast traffic */ + uint64_t tx_ucast_bytes; + /* Number of transmitted bytes for multicast traffic */ + uint64_t tx_mcast_bytes; + /* Number of transmitted bytes for broadcast traffic */ + uint64_t tx_bcast_bytes; + /* Number of received unicast packets */ + uint64_t rx_ucast_pkts; + /* Number of received multicast packets */ + uint64_t rx_mcast_pkts; + /* Number of received broadcast packets */ + uint64_t rx_bcast_pkts; + /* Number of packets discarded in receive path */ + uint64_t rx_discard_pkts; + /* Number of packets in receive path with errors */ + uint64_t rx_error_pkts; + /* Number of received bytes for unicast traffic */ + uint64_t rx_ucast_bytes; + /* Number of received bytes for multicast traffic */ + uint64_t rx_mcast_bytes; + /* Number of received bytes for broadcast traffic */ + uint64_t rx_bcast_bytes; + /* Number of aggregated unicast packets */ + uint64_t rx_agg_pkts; + /* Number of aggregated unicast bytes */ + uint64_t rx_agg_bytes; + /* Number of aggregation events */ + uint64_t rx_agg_events; + /* Number of aborted aggregations */ + uint64_t rx_agg_aborts; +}; + struct bnxt { void *bar0; @@ -521,6 +569,8 @@ #define BNXT_FLAG_ADV_FLOW_MGMT BIT(23) #define BNXT_FLAG_NPAR_PF BIT(24) #define BNXT_FLAG_DFLT_MAC_SET BIT(26) +#define BNXT_FLAGS_PTP_TIMESYNC_ENABLED BIT(27) +#define BNXT_FLAGS_PTP_ALARM_SCHEDULED BIT(28) #define BNXT_PF(bp) (!((bp)->flags & BNXT_FLAG_VF)) #define BNXT_VF(bp) ((bp)->flags & BNXT_FLAG_VF) #define BNXT_NPAR(bp) ((bp)->flags & BNXT_FLAG_NPAR_PF) @@ -534,6 +584,8 @@ #define BNXT_HAS_NQ(bp) BNXT_CHIP_THOR(bp) #define BNXT_HAS_RING_GRPS(bp) (!BNXT_CHIP_THOR(bp)) #define BNXT_HAS_DFLT_MAC_SET(bp) ((bp)->flags & BNXT_FLAG_DFLT_MAC_SET) +#define BNXT_THOR_PTP_TIMESYNC_ENABLED(bp) \ + ((bp)->flags & BNXT_FLAGS_PTP_TIMESYNC_ENABLED) uint32_t fw_cap; #define BNXT_FW_CAP_HOT_RESET BIT(0) @@ -572,7 +624,7 @@ uint32_t max_ring_grps; struct bnxt_ring_grp_info *grp_info; - unsigned int nr_vnics; + uint16_t nr_vnics; #define BNXT_GET_DEFAULT_VNIC(bp) (&(bp)->vnic_info[0]) struct bnxt_vnic_info *vnic_info; @@ -653,6 +705,8 @@ /* Struct to hold adapter error recovery related info */ struct bnxt_error_recovery_info *recovery_info; + struct bnxt_ring_stats *prev_rx_ring_stats; + struct bnxt_ring_stats *prev_tx_ring_stats; }; static @@ -675,6 +729,12 @@ bp->max_stat_ctx / 2U); } + /* RSS table size in Thor is 512. + * Cap max Rx rings to the same value for RSS. + */ + if (BNXT_CHIP_THOR(bp)) + max_rx_rings = RTE_MIN(max_rx_rings, BNXT_RSS_TBL_SIZE_THOR); + max_tx_rings = RTE_MIN(max_tx_rings, max_rx_rings); if (max_cp_rings > BNXT_NUM_ASYNC_CPR(bp)) max_cp_rings -= BNXT_NUM_ASYNC_CPR(bp); diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_hwrm.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_hwrm.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_hwrm.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_hwrm.c 2021-08-18 14:45:29.000000000 +0000 @@ -551,9 +551,13 @@ HWRM_CHECK_RESULT(); - if (!BNXT_CHIP_THOR(bp) && - !(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS)) - return 0; + if (BNXT_CHIP_THOR(bp)) { + if (!(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS)) + return 0; + } else { + if (!(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS)) + return 0; + } if (resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS) bp->flags |= BNXT_FLAG_FW_CAP_ONE_STEP_TX_TS; @@ -589,10 +593,13 @@ return 0; } -void bnxt_hwrm_free_vf_info(struct bnxt *bp) +void bnxt_free_vf_info(struct bnxt *bp) { uint16_t i; + if (bp->pf.vf_info == NULL) + return; + for (i = 0; i < bp->pf.max_vfs; i++) { rte_free(bp->pf.vf_info[i].vlan_table); bp->pf.vf_info[i].vlan_table = NULL; @@ -603,6 +610,50 @@ bp->pf.vf_info = NULL; } +static int bnxt_alloc_vf_info(struct bnxt *bp, uint16_t max_vfs) +{ + struct bnxt_child_vf_info *vf_info = bp->pf.vf_info; + int i; + + if (vf_info) + bnxt_free_vf_info(bp); + + vf_info = rte_zmalloc("bnxt_vf_info", sizeof(*vf_info) * max_vfs, 0); + if (vf_info == NULL) { + PMD_DRV_LOG(ERR, "Failed to alloc vf info\n"); + return -ENOMEM; + } + + bp->pf.max_vfs = max_vfs; + for (i = 0; i < max_vfs; i++) { + vf_info[i].fid = bp->pf.first_vf_id + i; + vf_info[i].vlan_table = rte_zmalloc("VF VLAN table", + getpagesize(), getpagesize()); + if (vf_info[i].vlan_table == NULL) { + PMD_DRV_LOG(ERR, "Failed to alloc VLAN table for VF %d\n", i); + goto err; + } + rte_mem_lock_page(vf_info[i].vlan_table); + + vf_info[i].vlan_as_table = rte_zmalloc("VF VLAN AS table", + getpagesize(), getpagesize()); + if (vf_info[i].vlan_as_table == NULL) { + PMD_DRV_LOG(ERR, "Failed to alloc VLAN AS table for VF %d\n", i); + goto err; + } + rte_mem_lock_page(vf_info[i].vlan_as_table); + + STAILQ_INIT(&vf_info[i].filter); + } + + bp->pf.vf_info = vf_info; + + return 0; +err: + bnxt_free_vf_info(bp); + return -ENOMEM; +} + static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) { int rc = 0; @@ -610,7 +661,6 @@ struct hwrm_func_qcaps_output *resp = bp->hwrm_cmd_resp_addr; uint16_t new_max_vfs; uint32_t flags; - int i; HWRM_PREP(req, FUNC_QCAPS, BNXT_USE_CHIMP_MB); @@ -628,42 +678,9 @@ bp->pf.total_vfs = rte_le_to_cpu_16(resp->max_vfs); new_max_vfs = bp->pdev->max_vfs; if (new_max_vfs != bp->pf.max_vfs) { - if (bp->pf.vf_info) - bnxt_hwrm_free_vf_info(bp); - bp->pf.vf_info = rte_zmalloc("bnxt_vf_info", - sizeof(bp->pf.vf_info[0]) * new_max_vfs, 0); - if (bp->pf.vf_info == NULL) { - PMD_DRV_LOG(ERR, "Alloc vf info fail\n"); - HWRM_UNLOCK(); - return -ENOMEM; - } - bp->pf.max_vfs = new_max_vfs; - for (i = 0; i < new_max_vfs; i++) { - bp->pf.vf_info[i].fid = bp->pf.first_vf_id + i; - bp->pf.vf_info[i].vlan_table = - rte_zmalloc("VF VLAN table", - getpagesize(), - getpagesize()); - if (bp->pf.vf_info[i].vlan_table == NULL) - PMD_DRV_LOG(ERR, - "Fail to alloc VLAN table for VF %d\n", - i); - else - rte_mem_lock_page( - bp->pf.vf_info[i].vlan_table); - bp->pf.vf_info[i].vlan_as_table = - rte_zmalloc("VF VLAN AS table", - getpagesize(), - getpagesize()); - if (bp->pf.vf_info[i].vlan_as_table == NULL) - PMD_DRV_LOG(ERR, - "Alloc VLAN AS table for VF %d fail\n", - i); - else - rte_mem_lock_page( - bp->pf.vf_info[i].vlan_as_table); - STAILQ_INIT(&bp->pf.vf_info[i].filter); - } + rc = bnxt_alloc_vf_info(bp, new_max_vfs); + if (rc) + goto unlock; } } @@ -717,6 +734,7 @@ if (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE) bp->fw_cap |= BNXT_FW_CAP_HOT_RESET; +unlock: HWRM_UNLOCK(); return rc; @@ -727,6 +745,9 @@ int rc; rc = __bnxt_hwrm_func_qcaps(bp); + if (rc == -ENOMEM) + return rc; + if (!rc && bp->hwrm_spec_code >= HWRM_SPEC_CODE_1_8_3) { rc = bnxt_alloc_ctx_mem(bp); if (rc) @@ -1005,6 +1026,11 @@ else HWRM_CHECK_RESULT(); + if (resp->flags & HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY) { + rc = -EAGAIN; + goto error; + } + PMD_DRV_LOG(INFO, "%d.%d.%d:%d.%d.%d.%d\n", resp->hwrm_intf_maj_8b, resp->hwrm_intf_min_8b, resp->hwrm_intf_upd_8b, resp->hwrm_fw_maj_8b, @@ -1038,6 +1064,7 @@ if (bp->max_req_len > resp->max_req_win_len) { PMD_DRV_LOG(ERR, "Unsupported request length\n"); rc = -EINVAL; + goto error; } bp->max_req_len = rte_le_to_cpu_16(resp->max_req_win_len); bp->hwrm_max_ext_req_len = rte_le_to_cpu_16(resp->max_ext_req_len); @@ -1047,28 +1074,8 @@ max_resp_len = rte_le_to_cpu_16(resp->max_resp_len); dev_caps_cfg = rte_le_to_cpu_32(resp->dev_caps_cfg); - if (bp->max_resp_len != max_resp_len) { - sprintf(type, "bnxt_hwrm_%04x:%02x:%02x:%02x", - bp->pdev->addr.domain, bp->pdev->addr.bus, - bp->pdev->addr.devid, bp->pdev->addr.function); - - rte_free(bp->hwrm_cmd_resp_addr); - - bp->hwrm_cmd_resp_addr = rte_malloc(type, max_resp_len, 0); - if (bp->hwrm_cmd_resp_addr == NULL) { - rc = -ENOMEM; - goto error; - } - bp->hwrm_cmd_resp_dma_addr = - rte_malloc_virt2iova(bp->hwrm_cmd_resp_addr); - if (bp->hwrm_cmd_resp_dma_addr == RTE_BAD_IOVA) { - PMD_DRV_LOG(ERR, - "Unable to map response buffer to physical memory.\n"); - rc = -ENOMEM; - goto error; - } - bp->max_resp_len = max_resp_len; - } + RTE_VERIFY(max_resp_len <= bp->max_resp_len); + bp->max_resp_len = max_resp_len; if ((dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED) && @@ -1236,6 +1243,7 @@ link_info->support_speeds = rte_le_to_cpu_16(resp->support_speeds); link_info->auto_link_speed = rte_le_to_cpu_16(resp->auto_link_speed); + link_info->auto_link_speed_mask = rte_le_to_cpu_16(resp->auto_link_speed_mask); link_info->preemphasis = rte_le_to_cpu_32(resp->preemphasis); link_info->force_link_speed = rte_le_to_cpu_16(resp->force_link_speed); link_info->phy_ver[0] = resp->phy_maj; @@ -1612,8 +1620,7 @@ return rc; } -int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, - unsigned int idx __rte_unused) +static int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp, struct bnxt_cp_ring_info *cpr) { int rc; struct hwrm_stat_ctx_alloc_input req = {.req_type = 0 }; @@ -1636,8 +1643,7 @@ return rc; } -int bnxt_hwrm_stat_ctx_free(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, - unsigned int idx __rte_unused) +static int bnxt_hwrm_stat_ctx_free(struct bnxt *bp, struct bnxt_cp_ring_info *cpr) { int rc; struct hwrm_stat_ctx_free_input req = {.req_type = 0 }; @@ -1845,12 +1851,6 @@ if (vnic->bd_stall) req.flags |= rte_cpu_to_le_32(HWRM_VNIC_CFG_INPUT_FLAGS_BD_STALL_MODE); - if (vnic->roce_dual) - req.flags |= rte_cpu_to_le_32( - HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE); - if (vnic->roce_only) - req.flags |= rte_cpu_to_le_32( - HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE); if (vnic->rss_dflt_cr) req.flags |= rte_cpu_to_le_32( HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE); @@ -1898,10 +1898,6 @@ HWRM_VNIC_QCFG_OUTPUT_FLAGS_VLAN_STRIP_MODE; vnic->bd_stall = rte_le_to_cpu_32(resp->flags) & HWRM_VNIC_QCFG_OUTPUT_FLAGS_BD_STALL_MODE; - vnic->roce_dual = rte_le_to_cpu_32(resp->flags) & - HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_DUAL_VNIC_MODE; - vnic->roce_only = rte_le_to_cpu_32(resp->flags) & - HWRM_VNIC_QCFG_OUTPUT_FLAGS_ROCE_ONLY_VNIC_MODE; vnic->rss_dflt_cr = rte_le_to_cpu_32(resp->flags) & HWRM_VNIC_QCFG_OUTPUT_FLAGS_RSS_DFLT_CR_MODE; @@ -2303,7 +2299,7 @@ bp->grp_info[i].fw_stats_ctx = -1; } if (cpr->hw_stats_ctx_id != HWRM_NA_SIGNATURE) { - rc = bnxt_hwrm_stat_ctx_free(bp, cpr, i); + rc = bnxt_hwrm_stat_ctx_free(bp, cpr); cpr->hw_stats_ctx_id = HWRM_NA_SIGNATURE; if (rc) return rc; @@ -2330,7 +2326,7 @@ cpr = rxq->cp_ring; } - rc = bnxt_hwrm_stat_ctx_alloc(bp, cpr, i); + rc = bnxt_hwrm_stat_ctx_alloc(bp, cpr); if (rc) return rc; @@ -2490,7 +2486,7 @@ sprintf(type, "bnxt_hwrm_%04x:%02x:%02x:%02x", pdev->addr.domain, pdev->addr.bus, pdev->addr.devid, pdev->addr.function); - bp->max_resp_len = HWRM_MAX_RESP_LEN; + bp->max_resp_len = BNXT_PAGE_SIZE; bp->hwrm_cmd_resp_addr = rte_malloc(type, bp->max_resp_len, 0); if (bp->hwrm_cmd_resp_addr == NULL) return -ENOMEM; @@ -2538,6 +2534,25 @@ return rc; } +int bnxt_hwrm_rx_ring_reset(struct bnxt *bp, int queue_index) +{ + int rc; + struct hwrm_ring_reset_input req = {.req_type = 0 }; + struct hwrm_ring_reset_output *resp = bp->hwrm_cmd_resp_addr; + + HWRM_PREP(req, RING_RESET, BNXT_USE_CHIMP_MB); + + req.ring_type = HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP; + req.ring_id = rte_cpu_to_le_16(bp->grp_info[queue_index].fw_grp_id); + rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); + + HWRM_CHECK_RESULT(); + + HWRM_UNLOCK(); + + return rc; +} + static int bnxt_clear_hwrm_vnic_flows(struct bnxt *bp, struct bnxt_vnic_info *vnic) { @@ -2894,15 +2909,8 @@ speed = bnxt_parse_eth_link_speed(dev_conf->link_speeds); link_req.phy_flags = HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY; - /* Autoneg can be done only when the FW allows. - * When user configures fixed speed of 40G and later changes to - * any other speed, auto_link_speed/force_link_speed is still set - * to 40G until link comes up at new speed. - */ - if (autoneg == 1 && - !(!BNXT_CHIP_THOR(bp) && - (bp->link_info.auto_link_speed || - bp->link_info.force_link_speed))) { + /* Autoneg can be done only when the FW allows. */ + if (autoneg == 1 && bp->link_info.support_auto_speeds) { link_req.phy_flags |= HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG; link_req.auto_link_speed_mask = @@ -2943,7 +2951,6 @@ return rc; } -/* JIRA 22088 */ int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu) { struct hwrm_func_qcfg_input req = {0}; @@ -2958,8 +2965,8 @@ HWRM_CHECK_RESULT(); - /* Hard Coded.. 0xfff VLAN ID mask */ - bp->vlan = rte_le_to_cpu_16(resp->vlan) & 0xfff; + bp->vlan = rte_le_to_cpu_16(resp->vlan) & ETH_VLAN_ID_MAX; + flags = rte_le_to_cpu_16(resp->flags); if (BNXT_PF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST)) bp->flags |= BNXT_FLAG_MULTI_HOST; @@ -3686,8 +3693,20 @@ return rc; } -int bnxt_hwrm_ctx_qstats(struct bnxt *bp, uint32_t cid, int idx, - struct rte_eth_stats *stats, uint8_t rx) +static void bnxt_update_prev_stat(uint64_t *cntr, uint64_t *prev_cntr) +{ + /* One of the HW stat values that make up this counter was zero as + * returned by HW in this iteration, so use the previous + * iteration's counter value + */ + if (*prev_cntr && *cntr == 0) + *cntr = *prev_cntr; + else + *prev_cntr = *cntr; +} + +int bnxt_hwrm_ring_stats(struct bnxt *bp, uint32_t cid, int idx, + struct bnxt_ring_stats *ring_stats, bool rx) { int rc = 0; struct hwrm_stat_ctx_query_input req = {.req_type = 0}; @@ -3702,21 +3721,82 @@ HWRM_CHECK_RESULT(); if (rx) { - stats->q_ipackets[idx] = rte_le_to_cpu_64(resp->rx_ucast_pkts); - stats->q_ipackets[idx] += rte_le_to_cpu_64(resp->rx_mcast_pkts); - stats->q_ipackets[idx] += rte_le_to_cpu_64(resp->rx_bcast_pkts); - stats->q_ibytes[idx] = rte_le_to_cpu_64(resp->rx_ucast_bytes); - stats->q_ibytes[idx] += rte_le_to_cpu_64(resp->rx_mcast_bytes); - stats->q_ibytes[idx] += rte_le_to_cpu_64(resp->rx_bcast_bytes); - stats->q_errors[idx] = rte_le_to_cpu_64(resp->rx_err_pkts); - stats->q_errors[idx] += rte_le_to_cpu_64(resp->rx_drop_pkts); + struct bnxt_ring_stats *prev_stats = &bp->prev_rx_ring_stats[idx]; + + ring_stats->rx_ucast_pkts = rte_le_to_cpu_64(resp->rx_ucast_pkts); + bnxt_update_prev_stat(&ring_stats->rx_ucast_pkts, + &prev_stats->rx_ucast_pkts); + + ring_stats->rx_mcast_pkts = rte_le_to_cpu_64(resp->rx_mcast_pkts); + bnxt_update_prev_stat(&ring_stats->rx_mcast_pkts, + &prev_stats->rx_mcast_pkts); + + ring_stats->rx_bcast_pkts = rte_le_to_cpu_64(resp->rx_bcast_pkts); + bnxt_update_prev_stat(&ring_stats->rx_bcast_pkts, + &prev_stats->rx_bcast_pkts); + + ring_stats->rx_ucast_bytes = rte_le_to_cpu_64(resp->rx_ucast_bytes); + bnxt_update_prev_stat(&ring_stats->rx_ucast_bytes, + &prev_stats->rx_ucast_bytes); + + ring_stats->rx_mcast_bytes = rte_le_to_cpu_64(resp->rx_mcast_bytes); + bnxt_update_prev_stat(&ring_stats->rx_mcast_bytes, + &prev_stats->rx_mcast_bytes); + + ring_stats->rx_bcast_bytes = rte_le_to_cpu_64(resp->rx_bcast_bytes); + bnxt_update_prev_stat(&ring_stats->rx_bcast_bytes, + &prev_stats->rx_bcast_bytes); + + ring_stats->rx_error_pkts = rte_le_to_cpu_64(resp->rx_err_pkts); + bnxt_update_prev_stat(&ring_stats->rx_error_pkts, + &prev_stats->rx_error_pkts); + + ring_stats->rx_discard_pkts = rte_le_to_cpu_64(resp->rx_drop_pkts); + bnxt_update_prev_stat(&ring_stats->rx_discard_pkts, + &prev_stats->rx_discard_pkts); + + ring_stats->rx_agg_pkts = rte_le_to_cpu_64(resp->rx_agg_pkts); + bnxt_update_prev_stat(&ring_stats->rx_agg_pkts, + &prev_stats->rx_agg_pkts); + + ring_stats->rx_agg_bytes = rte_le_to_cpu_64(resp->rx_agg_bytes); + bnxt_update_prev_stat(&ring_stats->rx_agg_bytes, + &prev_stats->rx_agg_bytes); + + ring_stats->rx_agg_events = rte_le_to_cpu_64(resp->rx_agg_events); + bnxt_update_prev_stat(&ring_stats->rx_agg_events, + &prev_stats->rx_agg_events); + + ring_stats->rx_agg_aborts = rte_le_to_cpu_64(resp->rx_agg_aborts); + bnxt_update_prev_stat(&ring_stats->rx_agg_aborts, + &prev_stats->rx_agg_aborts); } else { - stats->q_opackets[idx] = rte_le_to_cpu_64(resp->tx_ucast_pkts); - stats->q_opackets[idx] += rte_le_to_cpu_64(resp->tx_mcast_pkts); - stats->q_opackets[idx] += rte_le_to_cpu_64(resp->tx_bcast_pkts); - stats->q_obytes[idx] = rte_le_to_cpu_64(resp->tx_ucast_bytes); - stats->q_obytes[idx] += rte_le_to_cpu_64(resp->tx_mcast_bytes); - stats->q_obytes[idx] += rte_le_to_cpu_64(resp->tx_bcast_bytes); + struct bnxt_ring_stats *prev_stats = &bp->prev_tx_ring_stats[idx]; + + ring_stats->tx_ucast_pkts = rte_le_to_cpu_64(resp->tx_ucast_pkts); + bnxt_update_prev_stat(&ring_stats->tx_ucast_pkts, + &prev_stats->tx_ucast_pkts); + + ring_stats->tx_mcast_pkts = rte_le_to_cpu_64(resp->tx_mcast_pkts); + bnxt_update_prev_stat(&ring_stats->tx_mcast_pkts, + &prev_stats->tx_mcast_pkts); + + ring_stats->tx_bcast_pkts = rte_le_to_cpu_64(resp->tx_bcast_pkts); + bnxt_update_prev_stat(&ring_stats->tx_bcast_pkts, + &prev_stats->tx_bcast_pkts); + + ring_stats->tx_ucast_bytes = rte_le_to_cpu_64(resp->tx_ucast_bytes); + bnxt_update_prev_stat(&ring_stats->tx_ucast_bytes, + &prev_stats->tx_ucast_bytes); + + ring_stats->tx_mcast_bytes = rte_le_to_cpu_64(resp->tx_mcast_bytes); + bnxt_update_prev_stat(&ring_stats->tx_mcast_bytes, + &prev_stats->tx_mcast_bytes); + + ring_stats->tx_bcast_bytes = rte_le_to_cpu_64(resp->tx_bcast_bytes); + bnxt_update_prev_stat(&ring_stats->tx_bcast_bytes, + &prev_stats->tx_bcast_bytes); + } HWRM_UNLOCK(); @@ -5105,3 +5185,60 @@ return rc; } +int bnxt_hwrm_poll_ver_get(struct bnxt *bp) +{ + struct hwrm_ver_get_input req = {.req_type = 0 }; + struct hwrm_ver_get_output *resp = bp->hwrm_cmd_resp_addr; + int rc = 0; + + bp->max_req_len = HWRM_MAX_REQ_LEN; + bp->max_resp_len = BNXT_PAGE_SIZE; + bp->hwrm_cmd_timeout = SHORT_HWRM_CMD_TIMEOUT; + + HWRM_PREP(req, VER_GET, BNXT_USE_CHIMP_MB); + req.hwrm_intf_maj = HWRM_VERSION_MAJOR; + req.hwrm_intf_min = HWRM_VERSION_MINOR; + req.hwrm_intf_upd = HWRM_VERSION_UPDATE; + + rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); + + HWRM_CHECK_RESULT_SILENT(); + + if (resp->flags & HWRM_VER_GET_OUTPUT_FLAGS_DEV_NOT_RDY) + rc = -EAGAIN; + + HWRM_UNLOCK(); + + return rc; +} + +int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp) +{ + int rc = 0; + struct hwrm_port_phy_qcaps_input req = {0}; + struct hwrm_port_phy_qcaps_output *resp = bp->hwrm_cmd_resp_addr; + struct bnxt_link_info *link_info = &bp->link_info; + + if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp)) + return 0; + + HWRM_PREP(req, PORT_PHY_QCAPS, BNXT_USE_CHIMP_MB); + + rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); + + HWRM_CHECK_RESULT(); + + if (resp->supported_speeds_auto_mode) + link_info->support_auto_speeds = + rte_le_to_cpu_16(resp->supported_speeds_auto_mode); + + /* Older firmware does not have supported_auto_speeds, so assume + * that all supported speeds can be autonegotiated. + */ + if (link_info->auto_link_speed_mask && !link_info->support_auto_speeds) + link_info->support_auto_speeds = link_info->support_speeds; + + HWRM_UNLOCK(); + + return 0; +} diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_hwrm.h dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_hwrm.h --- dpdk-19.11.7/drivers/net/bnxt/bnxt_hwrm.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_hwrm.h 2021-08-18 14:45:29.000000000 +0000 @@ -13,7 +13,6 @@ struct bnxt_filter_info; struct bnxt_cp_ring_info; -#define HWRM_SEQ_ID_INVALID -1U /* Convert Bit field location to value */ #define ASYNC_CMPL_EVENT_ID_LINK_STATUS_CHANGE \ (1 << HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE) @@ -89,7 +88,7 @@ int bnxt_hwrm_func_buf_unrgtr(struct bnxt *bp); int bnxt_hwrm_func_driver_register(struct bnxt *bp); int bnxt_hwrm_func_qcaps(struct bnxt *bp); -void bnxt_hwrm_free_vf_info(struct bnxt *bp); +void bnxt_free_vf_info(struct bnxt *bp); int bnxt_hwrm_func_reset(struct bnxt *bp); int bnxt_hwrm_func_driver_unregister(struct bnxt *bp, uint32_t flags); int bnxt_hwrm_func_qstats(struct bnxt *bp, uint16_t fid, @@ -114,13 +113,6 @@ int bnxt_hwrm_ring_grp_free(struct bnxt *bp, unsigned int idx); int bnxt_hwrm_stat_clear(struct bnxt *bp, struct bnxt_cp_ring_info *cpr); -int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp, - struct bnxt_cp_ring_info *cpr, unsigned int idx); -int bnxt_hwrm_stat_ctx_free(struct bnxt *bp, - struct bnxt_cp_ring_info *cpr, unsigned int idx); -int bnxt_hwrm_ctx_qstats(struct bnxt *bp, uint32_t cid, int idx, - struct rte_eth_stats *stats, uint8_t rx); - int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout); int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic); @@ -232,4 +224,9 @@ uint64_t *timestamp); int bnxt_clear_one_vnic_filter(struct bnxt *bp, struct bnxt_filter_info *filter); +int bnxt_hwrm_poll_ver_get(struct bnxt *bp); +int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp); +int bnxt_hwrm_rx_ring_reset(struct bnxt *bp, int queue_index); +int bnxt_hwrm_ring_stats(struct bnxt *bp, uint32_t cid, int idx, + struct bnxt_ring_stats *stats, bool rx); #endif diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_irq.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_irq.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_irq.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_irq.c 2021-08-18 14:45:29.000000000 +0000 @@ -21,15 +21,18 @@ { struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param; struct bnxt *bp = eth_dev->data->dev_private; - struct bnxt_cp_ring_info *cpr = bp->async_cp_ring; + uint32_t cons, raw_cons, cp_ring_size; + struct bnxt_cp_ring_info *cpr; struct cmpl_base *cmp; - uint32_t raw_cons; - uint32_t cons; + if (bp == NULL) + return; + cpr = bp->async_cp_ring; if (cpr == NULL) return; raw_cons = cpr->cp_raw_cons; + cp_ring_size = cpr->cp_ring_struct->ring_size; pthread_mutex_lock(&bp->def_cp_lock); while (1) { if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.doorbell) { @@ -45,7 +48,7 @@ cons = RING_CMP(cpr->cp_ring_struct, raw_cons); cmp = &cpr->cp_desc_ring[cons]; - if (!CMP_VALID(cmp, raw_cons, cpr->cp_ring_struct)) + if (!bnxt_cpr_cmp_valid(cmp, raw_cons, cp_ring_size)) break; bnxt_event_hwrm_resp_handler(bp, cmp); diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_ring.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_ring.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_ring.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_ring.c 2021-08-18 14:45:29.000000000 +0000 @@ -94,7 +94,7 @@ * tx bd ring - Only non-zero length if tx_ring_info is not NULL * rx bd ring - Only non-zero length if rx_ring_info is not NULL */ -int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx, +int bnxt_alloc_rings(struct bnxt *bp, unsigned int socket_id, uint16_t qidx, struct bnxt_tx_queue *txq, struct bnxt_rx_queue *rxq, struct bnxt_cp_ring_info *cp_ring_info, @@ -203,7 +203,7 @@ mz = rte_memzone_lookup(mz_name); if (!mz) { mz = rte_memzone_reserve_aligned(mz_name, total_alloc_len, - SOCKET_ID_ANY, + socket_id, RTE_MEMZONE_2MB | RTE_MEMZONE_SIZE_HINT_ONLY | RTE_MEMZONE_IOVA_CONTIG, @@ -422,24 +422,23 @@ struct bnxt_cp_ring_info *nqr; struct bnxt_ring *ring; int ring_index = BNXT_NUM_ASYNC_CPR(bp); - unsigned int socket_id; uint8_t ring_type; int rc = 0; if (!BNXT_HAS_NQ(bp) || bp->rxtx_nq_ring) return 0; - socket_id = rte_lcore_to_socket_id(rte_get_master_lcore()); - nqr = rte_zmalloc_socket("nqr", sizeof(struct bnxt_cp_ring_info), - RTE_CACHE_LINE_SIZE, socket_id); + RTE_CACHE_LINE_SIZE, + bp->eth_dev->device->numa_node); if (nqr == NULL) return -ENOMEM; ring = rte_zmalloc_socket("bnxt_cp_ring_struct", sizeof(struct bnxt_ring), - RTE_CACHE_LINE_SIZE, socket_id); + RTE_CACHE_LINE_SIZE, + bp->eth_dev->device->numa_node); if (ring == NULL) { rte_free(nqr); return -ENOMEM; @@ -454,7 +453,8 @@ ring->fw_ring_id = INVALID_HW_RING_ID; nqr->cp_ring_struct = ring; - rc = bnxt_alloc_rings(bp, 0, NULL, NULL, nqr, NULL, "l2_nqr"); + rc = bnxt_alloc_rings(bp, bp->eth_dev->device->numa_node, 0, NULL, + NULL, nqr, NULL, "l2_nqr"); if (rc) { rte_free(ring); rte_free(nqr); @@ -815,22 +815,21 @@ { struct bnxt_cp_ring_info *cpr = NULL; struct bnxt_ring *ring = NULL; - unsigned int socket_id; if (BNXT_NUM_ASYNC_CPR(bp) == 0) return 0; - socket_id = rte_lcore_to_socket_id(rte_get_master_lcore()); - cpr = rte_zmalloc_socket("cpr", sizeof(struct bnxt_cp_ring_info), - RTE_CACHE_LINE_SIZE, socket_id); + RTE_CACHE_LINE_SIZE, + bp->eth_dev->device->numa_node); if (cpr == NULL) return -ENOMEM; ring = rte_zmalloc_socket("bnxt_cp_ring_struct", sizeof(struct bnxt_ring), - RTE_CACHE_LINE_SIZE, socket_id); + RTE_CACHE_LINE_SIZE, + bp->eth_dev->device->numa_node); if (ring == NULL) { rte_free(cpr); return -ENOMEM; @@ -846,7 +845,6 @@ bp->async_cp_ring = cpr; cpr->cp_ring_struct = ring; - return bnxt_alloc_rings(bp, 0, NULL, NULL, - bp->async_cp_ring, NULL, - "def_cp"); + return bnxt_alloc_rings(bp, bp->eth_dev->device->numa_node, 0, NULL, + NULL, bp->async_cp_ring, NULL, "def_cp"); } diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_ring.h dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_ring.h --- dpdk-19.11.7/drivers/net/bnxt/bnxt_ring.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_ring.h 2021-08-18 14:45:29.000000000 +0000 @@ -66,7 +66,7 @@ struct bnxt_cp_ring_info; void bnxt_free_ring(struct bnxt_ring *ring); int bnxt_alloc_ring_grps(struct bnxt *bp); -int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx, +int bnxt_alloc_rings(struct bnxt *bp, unsigned int socket_id, uint16_t qidx, struct bnxt_tx_queue *txq, struct bnxt_rx_queue *rxq, struct bnxt_cp_ring_info *cp_ring_info, diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_rxq.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_rxq.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_rxq.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_rxq.c 2021-08-18 14:45:29.000000000 +0000 @@ -40,35 +40,6 @@ bp->nr_vnics = 0; - /* Single queue mode */ - if (bp->rx_cp_nr_rings < 2) { - vnic = &bp->vnic_info[0]; - if (!vnic) { - PMD_DRV_LOG(ERR, "VNIC alloc failed\n"); - rc = -ENOMEM; - goto err_out; - } - vnic->flags |= BNXT_VNIC_INFO_BCAST; - bp->nr_vnics++; - - rxq = bp->eth_dev->data->rx_queues[0]; - rxq->vnic = vnic; - - vnic->func_default = true; - vnic->start_grp_id = 0; - vnic->end_grp_id = vnic->start_grp_id; - filter = bnxt_alloc_filter(bp); - if (!filter) { - PMD_DRV_LOG(ERR, "L2 filter alloc failed\n"); - rc = -ENOMEM; - goto err_out; - } - filter->mac_index = 0; - filter->flags |= HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_OUTERMOST; - STAILQ_INSERT_TAIL(&vnic->filter, filter, next); - goto out; - } - /* Multi-queue mode */ if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_VMDQ_DCB_RSS) { /* VMDq ONLY, VMDq+RSS, VMDq+DCB, VMDq+DCB+RSS */ @@ -106,7 +77,6 @@ pools = RTE_MIN(pools, bp->rx_cp_nr_rings); nb_q_per_grp = bp->rx_cp_nr_rings / pools; - bp->rx_num_qs_per_vnic = nb_q_per_grp; PMD_DRV_LOG(DEBUG, "pools = %u nb_q_per_grp = %u\n", pools, nb_q_per_grp); start_grp_id = 0; @@ -164,7 +134,8 @@ end_grp_id += nb_q_per_grp; } -out: + bp->rx_num_qs_per_vnic = nb_q_per_grp; + if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) { struct rte_eth_rss_conf *rss = &dev_conf->rx_adv_conf.rss_conf; @@ -356,8 +327,8 @@ eth_dev->data->rx_queues[queue_idx] = rxq; /* Allocate RX ring hardware descriptors */ - rc = bnxt_alloc_rings(bp, queue_idx, NULL, rxq, rxq->cp_ring, NULL, - "rxr"); + rc = bnxt_alloc_rings(bp, socket_id, queue_idx, NULL, rxq, rxq->cp_ring, + NULL, "rxr"); if (rc) { PMD_DRV_LOG(ERR, "ring_dma_zone_reserve for rx_ring failed!\n"); diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_rxq.h dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_rxq.h --- dpdk-19.11.7/drivers/net/bnxt/bnxt_rxq.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_rxq.h 2021-08-18 14:45:29.000000000 +0000 @@ -32,6 +32,7 @@ uint8_t rx_deferred_start; /* not in global dev start */ uint8_t rx_started; /* RX queue is started */ uint8_t drop_en; /* Drop when rx desc not available. */ + uint8_t in_reset; /* Rx ring is scheduled for reset */ struct bnxt *bp; int index; diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_rxr.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_rxr.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_rxr.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_rxr.c 2021-08-18 14:45:29.000000000 +0000 @@ -10,15 +10,14 @@ #include #include #include +#include #include "bnxt.h" #include "bnxt_ring.h" #include "bnxt_rxr.h" #include "bnxt_rxq.h" #include "hsi_struct_def_dpdk.h" -#ifdef RTE_LIBRTE_IEEE1588 #include "bnxt_hwrm.h" -#endif /* * RX Ring handling @@ -122,6 +121,50 @@ return mbuf; } +static void bnxt_rx_ring_reset(void *arg) +{ + struct bnxt *bp = arg; + int i, rc = 0; + struct bnxt_rx_queue *rxq; + + + for (i = 0; i < (int)bp->rx_nr_rings; i++) { + struct bnxt_rx_ring_info *rxr; + + rxq = bp->rx_queues[i]; + if (!rxq || !rxq->in_reset) + continue; + + rxr = rxq->rx_ring; + /* Disable and flush TPA before resetting the RX ring */ + if (rxr->tpa_info) + bnxt_hwrm_vnic_tpa_cfg(bp, rxq->vnic, false); + rc = bnxt_hwrm_rx_ring_reset(bp, i); + if (rc) { + PMD_DRV_LOG(ERR, "Rx ring%d reset failed\n", i); + continue; + } + + bnxt_rx_queue_release_mbufs(rxq); + rxr->rx_prod = 0; + rxr->ag_prod = 0; + rxr->rx_next_cons = 0; + bnxt_init_one_rx_ring(rxq); + bnxt_db_write(&rxr->rx_db, rxr->rx_prod); + bnxt_db_write(&rxr->ag_db, rxr->ag_prod); + if (rxr->tpa_info) + bnxt_hwrm_vnic_tpa_cfg(bp, rxq->vnic, true); + + rxq->in_reset = 0; + } +} + +static void bnxt_sched_ring_reset(struct bnxt_rx_queue *rxq) +{ + rxq->in_reset = 1; + rte_eal_alarm_set(1, bnxt_rx_ring_reset, (void *)rxq->bp); +} + static void bnxt_tpa_start(struct bnxt_rx_queue *rxq, struct rx_tpa_start_cmpl *tpa_start, struct rx_tpa_start_cmpl_hi *tpa_start1) @@ -136,6 +179,12 @@ data_cons = tpa_start->opaque; tpa_info = &rxr->tpa_info[agg_id]; + if (unlikely(data_cons != rxr->rx_next_cons)) { + PMD_DRV_LOG(ERR, "TPA cons %x, expected cons %x\n", + data_cons, rxr->rx_next_cons); + bnxt_sched_ring_reset(rxq); + return; + } mbuf = bnxt_consume_rx_buf(rxr, data_cons); @@ -172,6 +221,8 @@ /* recycle next mbuf */ data_cons = RING_NEXT(rxr->rx_ring_struct, data_cons); bnxt_reuse_rx_mbuf(rxr, bnxt_consume_rx_buf(rxr, data_cons)); + + rxr->rx_next_cons = RING_NEXT(rxr->rx_ring_struct, data_cons); } static int bnxt_agg_bufs_valid(struct bnxt_cp_ring_info *cpr, @@ -186,7 +237,8 @@ cpr->valid = FLIP_VALID(raw_cp_cons, cpr->cp_ring_struct->ring_mask, cpr->valid); - return CMP_VALID(agg_cmpl, raw_cp_cons, cpr->cp_ring_struct); + return bnxt_cpr_cmp_valid(agg_cmpl, raw_cp_cons, + cpr->cp_ring_struct->ring_size); } /* TPA consume agg buffer out of order, allocate connected data only */ @@ -267,6 +319,34 @@ return 0; } +static int bnxt_discard_rx(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, + uint32_t *raw_cons, void *cmp) +{ + struct rx_pkt_cmpl *rxcmp = cmp; + uint32_t tmp_raw_cons = *raw_cons; + uint8_t cmp_type, agg_bufs = 0; + + cmp_type = CMP_TYPE(rxcmp); + + if (cmp_type == CMPL_BASE_TYPE_RX_L2) { + agg_bufs = BNXT_RX_L2_AGG_BUFS(rxcmp); + } else if (cmp_type == RX_TPA_END_CMPL_TYPE_RX_TPA_END) { + struct rx_tpa_end_cmpl *tpa_end = cmp; + + if (BNXT_CHIP_THOR(bp)) + return 0; + + agg_bufs = BNXT_TPA_END_AGG_BUFS(tpa_end); + } + + if (agg_bufs) { + if (!bnxt_agg_bufs_valid(cpr, agg_bufs, tmp_raw_cons)) + return -EBUSY; + } + *raw_cons = tmp_raw_cons; + return 0; +} + static inline struct rte_mbuf *bnxt_tpa_end( struct bnxt_rx_queue *rxq, uint32_t *raw_cp_cons, @@ -281,6 +361,13 @@ uint8_t payload_offset; struct bnxt_tpa_info *tpa_info; + if (unlikely(rxq->in_reset)) { + PMD_DRV_LOG(ERR, "rxq->in_reset: raw_cp_cons:%d\n", + *raw_cp_cons); + bnxt_discard_rx(rxq->bp, cpr, raw_cp_cons, tpa_end); + return NULL; + } + if (BNXT_CHIP_THOR(rxq->bp)) { struct rx_tpa_v2_end_cmpl *th_tpa_end; struct rx_tpa_v2_end_cmpl_hi *th_tpa_end1; @@ -380,9 +467,11 @@ static void bnxt_get_rx_ts_thor(struct bnxt *bp, uint32_t rx_ts_cmpl) { - uint64_t systime_cycles = 0; + struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; + uint64_t last_hwrm_time; + uint64_t pkt_time = 0; - if (!BNXT_CHIP_THOR(bp)) + if (!BNXT_CHIP_THOR(bp) || !ptp) return; /* On Thor, Rx timestamps are provided directly in the @@ -393,10 +482,13 @@ * from the HWRM response with the lower 32 bits in the * Rx completion to produce the 48 bit timestamp for the Rx packet */ - bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_CURRENT_TIME, - &systime_cycles); - bp->ptp_cfg->rx_timestamp = (systime_cycles & 0xFFFF00000000); - bp->ptp_cfg->rx_timestamp |= rx_ts_cmpl; + last_hwrm_time = ptp->current_time; + pkt_time = (last_hwrm_time & BNXT_PTP_CURRENT_TIME_MASK) | rx_ts_cmpl; + if (rx_ts_cmpl < (uint32_t)last_hwrm_time) { + /* timer has rolled over */ + pkt_time += (1ULL << 32); + } + ptp->rx_timestamp = pkt_time; } #endif @@ -438,7 +530,8 @@ cp_cons = RING_CMP(cpr->cp_ring_struct, tmp_raw_cons); rxcmp1 = (struct rx_pkt_cmpl_hi *)&cpr->cp_desc_ring[cp_cons]; - if (!CMP_VALID(rxcmp1, tmp_raw_cons, cpr->cp_ring_struct)) + if (!bnxt_cpr_cmp_valid(rxcmp1, tmp_raw_cons, + cpr->cp_ring_struct->ring_size)) return -EBUSY; cpr->valid = FLIP_VALID(cp_cons, @@ -463,14 +556,21 @@ goto next_rx; } - agg_buf = (rxcmp->agg_bufs_v1 & RX_PKT_CMPL_AGG_BUFS_MASK) - >> RX_PKT_CMPL_AGG_BUFS_SFT; + agg_buf = BNXT_RX_L2_AGG_BUFS(rxcmp); if (agg_buf && !bnxt_agg_bufs_valid(cpr, agg_buf, tmp_raw_cons)) return -EBUSY; prod = rxr->rx_prod; cons = rxcmp->opaque; + if (unlikely(cons != rxr->rx_next_cons)) { + bnxt_discard_rx(rxq->bp, cpr, &tmp_raw_cons, rxcmp); + PMD_DRV_LOG(ERR, "RX cons %x != expected cons %x\n", + cons, rxr->rx_next_cons); + bnxt_sched_ring_reset(rxq); + rc = -EBUSY; + goto next_rx; + } mbuf = bnxt_consume_rx_buf(rxr, cons); if (mbuf == NULL) return -EBUSY; @@ -584,6 +684,7 @@ goto rx; } rxr->rx_prod = prod; + rxr->rx_next_cons = RING_NEXT(rxr->rx_ring_struct, cons); /* * All MBUFs are allocated with the same size under DPDK, * no optimization for rx_copy_thresh @@ -626,7 +727,8 @@ cons = RING_CMP(cpr->cp_ring_struct, raw_cons); rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons]; - if (!CMP_VALID(rxcmp, raw_cons, cpr->cp_ring_struct)) + if (!bnxt_cpr_cmp_valid(rxcmp, raw_cons, + cpr->cp_ring_struct->ring_size)) break; cpr->valid = FLIP_VALID(cons, cpr->cp_ring_struct->ring_mask, @@ -655,9 +757,6 @@ raw_cons = NEXT_RAW_CMP(raw_cons); if (nb_rx_pkts == nb_pkts || evt) break; - /* Post some Rx buf early in case of larger burst processing */ - if (nb_rx_pkts == BNXT_RX_POST_THRESH) - bnxt_db_write(&rxr->rx_db, rxr->rx_prod); } cpr->cp_raw_cons = raw_cons; @@ -906,5 +1005,8 @@ } PMD_DRV_LOG(DEBUG, "TPA alloc Done!\n"); + /* Explicitly reset this driver internal tracker on a ring init */ + rxr->rx_next_cons = 0; + return 0; } diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_rxr.h dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_rxr.h --- dpdk-19.11.7/drivers/net/bnxt/bnxt_rxr.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_rxr.h 2021-08-18 14:45:29.000000000 +0000 @@ -147,6 +147,10 @@ #define RX_CMP_L4_CS_UNKNOWN(rxcmp1) \ !((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS) +#define BNXT_RX_L2_AGG_BUFS(cmp) \ + (((cmp)->agg_bufs_v1 & RX_PKT_CMPL_AGG_BUFS_MASK) >> \ + RX_PKT_CMPL_AGG_BUFS_SFT) + #define RX_CMP_T_L4_CS_BITS \ rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC) @@ -165,8 +169,6 @@ ((rxcmp1)->errors_v2 & \ rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_L4_CS_ERROR)) -#define BNXT_RX_POST_THRESH 32 - enum pkt_hash_types { PKT_HASH_TYPE_NONE, /* Undefined type */ PKT_HASH_TYPE_L2, /* Input: src_MAC, dest_MAC */ @@ -188,6 +190,7 @@ struct bnxt_rx_ring_info { uint16_t rx_prod; uint16_t ag_prod; + uint16_t rx_next_cons; struct bnxt_db_info rx_db; struct bnxt_db_info ag_db; diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_rxtx_vec_sse.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_rxtx_vec_sse.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_rxtx_vec_sse.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_rxtx_vec_sse.c 2021-08-18 14:45:29.000000000 +0000 @@ -203,14 +203,14 @@ } } -uint16_t -bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, - uint16_t nb_pkts) +static uint16_t +recv_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) { struct bnxt_rx_queue *rxq = rx_queue; struct bnxt_cp_ring_info *cpr = rxq->cp_ring; struct bnxt_rx_ring_info *rxr = rxq->rx_ring; uint32_t raw_cons = cpr->cp_raw_cons; + uint32_t cp_ring_size; uint32_t cons; int nb_rx_pkts = 0; struct rx_pkt_cmpl *rxcmp; @@ -230,9 +230,6 @@ if (rxq->rxrearm_nb >= RTE_BNXT_RXQ_REARM_THRESH) bnxt_rxq_rearm(rxq, rxr); - /* Return no more than RTE_BNXT_MAX_RX_BURST per call. */ - nb_pkts = RTE_MIN(nb_pkts, RTE_BNXT_MAX_RX_BURST); - /* * Make nb_pkts an integer multiple of RTE_BNXT_DESCS_PER_LOOP. * nb_pkts < RTE_BNXT_DESCS_PER_LOOP, just return no packet @@ -241,13 +238,15 @@ if (!nb_pkts) return 0; + cp_ring_size = cpr->cp_ring_struct->ring_size; + /* Handle RX burst request */ while (1) { cons = RING_CMP(cpr->cp_ring_struct, raw_cons); rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons]; - if (!CMP_VALID(rxcmp, raw_cons, cpr->cp_ring_struct)) + if (!bnxt_cpr_cmp_valid(rxcmp, raw_cons, cp_ring_size)) break; if (likely(CMP_TYPE(rxcmp) == RX_PKT_CMPL_TYPE_RX_L2)) { @@ -262,8 +261,8 @@ rxcmp1 = (struct rx_pkt_cmpl_hi *) &cpr->cp_desc_ring[cp_cons]; - if (!CMP_VALID(rxcmp1, tmp_raw_cons, - cpr->cp_ring_struct)) + if (!bnxt_cpr_cmp_valid(rxcmp1, tmp_raw_cons, + cp_ring_size)) break; raw_cons = tmp_raw_cons; @@ -354,6 +353,27 @@ txr->tx_cons = cons; } +uint16_t +bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) +{ + uint16_t cnt = 0; + + while (nb_pkts > RTE_BNXT_MAX_RX_BURST) { + uint16_t burst; + + burst = recv_burst_vec_sse(rx_queue, rx_pkts + cnt, + RTE_BNXT_MAX_RX_BURST); + + cnt += burst; + nb_pkts -= burst; + + if (burst < RTE_BNXT_MAX_RX_BURST) + return cnt; + } + + return cnt + recv_burst_vec_sse(rx_queue, rx_pkts + cnt, nb_pkts); +} + static void bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq) { @@ -370,7 +390,7 @@ cons = RING_CMPL(ring_mask, raw_cons); txcmp = (struct tx_cmpl *)&cp_desc_ring[cons]; - if (!CMP_VALID(txcmp, raw_cons, cp_ring_struct)) + if (!bnxt_cpr_cmp_valid(txcmp, raw_cons, ring_mask + 1)) break; if (likely(CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2)) diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_stats.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_stats.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_stats.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_stats.c 2021-08-18 14:45:29.000000000 +0000 @@ -377,8 +377,48 @@ } } +static void bnxt_fill_rte_eth_stats(struct rte_eth_stats *stats, + struct bnxt_ring_stats *ring_stats, + unsigned int i, bool rx) +{ + if (rx) { + stats->q_ipackets[i] = ring_stats->rx_ucast_pkts; + stats->q_ipackets[i] += ring_stats->rx_mcast_pkts; + stats->q_ipackets[i] += ring_stats->rx_bcast_pkts; + + stats->ipackets += stats->q_ipackets[i]; + + stats->q_ibytes[i] = ring_stats->rx_ucast_bytes; + stats->q_ibytes[i] += ring_stats->rx_mcast_bytes; + stats->q_ibytes[i] += ring_stats->rx_bcast_bytes; + + stats->ibytes += stats->q_ibytes[i]; + + stats->q_errors[i] = ring_stats->rx_discard_pkts; + stats->q_errors[i] += ring_stats->rx_error_pkts; + + stats->imissed += ring_stats->rx_discard_pkts; + stats->ierrors += ring_stats->rx_error_pkts; + stats->ierrors += ring_stats->rx_discard_pkts; + } else { + stats->q_opackets[i] = ring_stats->tx_ucast_pkts; + stats->q_opackets[i] += ring_stats->tx_mcast_pkts; + stats->q_opackets[i] += ring_stats->tx_bcast_pkts; + + stats->opackets += stats->q_opackets[i]; + + stats->q_obytes[i] = ring_stats->tx_ucast_bytes; + stats->q_obytes[i] += ring_stats->tx_mcast_bytes; + stats->q_obytes[i] += ring_stats->tx_bcast_bytes; + + stats->obytes += stats->q_obytes[i]; + + stats->oerrors += ring_stats->tx_discard_pkts; + } +} + int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, - struct rte_eth_stats *bnxt_stats) + struct rte_eth_stats *bnxt_stats) { int rc = 0; unsigned int i; @@ -398,11 +438,17 @@ for (i = 0; i < num_q_stats; i++) { struct bnxt_rx_queue *rxq = bp->rx_queues[i]; struct bnxt_cp_ring_info *cpr = rxq->cp_ring; + struct bnxt_ring_stats ring_stats = {0}; + + if (!rxq->rx_started) + continue; - rc = bnxt_hwrm_ctx_qstats(bp, cpr->hw_stats_ctx_id, i, - bnxt_stats, 1); + rc = bnxt_hwrm_ring_stats(bp, cpr->hw_stats_ctx_id, i, + &ring_stats, true); if (unlikely(rc)) return rc; + + bnxt_fill_rte_eth_stats(bnxt_stats, &ring_stats, i, true); bnxt_stats->rx_nombuf += rte_atomic64_read(&rxq->rx_mbuf_alloc_fail); } @@ -413,17 +459,32 @@ for (i = 0; i < num_q_stats; i++) { struct bnxt_tx_queue *txq = bp->tx_queues[i]; struct bnxt_cp_ring_info *cpr = txq->cp_ring; + struct bnxt_ring_stats ring_stats = {0}; + + if (!txq->tx_started) + continue; - rc = bnxt_hwrm_ctx_qstats(bp, cpr->hw_stats_ctx_id, i, - bnxt_stats, 0); + rc = bnxt_hwrm_ring_stats(bp, cpr->hw_stats_ctx_id, i, + &ring_stats, false); if (unlikely(rc)) return rc; + + bnxt_fill_rte_eth_stats(bnxt_stats, &ring_stats, i, false); } - rc = bnxt_hwrm_func_qstats(bp, 0xffff, bnxt_stats); return rc; } +static void bnxt_clear_prev_stat(struct bnxt *bp) +{ + /* + * Clear the cached values of stats returned by HW in the previous + * get operation. + */ + memset(bp->prev_rx_ring_stats, 0, sizeof(struct bnxt_ring_stats) * bp->rx_cp_nr_rings); + memset(bp->prev_tx_ring_stats, 0, sizeof(struct bnxt_ring_stats) * bp->tx_cp_nr_rings); +} + int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev) { struct bnxt *bp = eth_dev->data->dev_private; @@ -446,6 +507,8 @@ rte_atomic64_clear(&rxq->rx_mbuf_alloc_fail); } + bnxt_clear_prev_stat(bp); + return ret; } @@ -465,10 +528,13 @@ if (rc) return rc; - if (xstats == NULL) - return 0; + stat_count = RTE_DIM(bnxt_rx_stats_strings) + + RTE_DIM(bnxt_tx_stats_strings) + 1/* For tx_drop_pkts */ + + RTE_DIM(bnxt_rx_ext_stats_strings) + + RTE_DIM(bnxt_tx_ext_stats_strings); - memset(xstats, 0, sizeof(*xstats)); + if (n < stat_count || xstats == NULL) + return stat_count; bnxt_hwrm_port_qstats(bp); bnxt_hwrm_func_qstats_tx_drop(bp, 0xffff, &tx_drop_pkts); @@ -480,14 +546,7 @@ (bp->fw_tx_port_stats_ext_size / stat_size)); - count = RTE_DIM(bnxt_rx_stats_strings) + - RTE_DIM(bnxt_tx_stats_strings) + 1/* For tx_drop_pkts */ + - RTE_DIM(bnxt_rx_ext_stats_strings) + - RTE_DIM(bnxt_tx_ext_stats_strings); - stat_count = count; - - if (n < count) - return count; + memset(xstats, 0, sizeof(*xstats)); count = 0; for (i = 0; i < RTE_DIM(bnxt_rx_stats_strings); i++) { @@ -615,5 +674,7 @@ PMD_DRV_LOG(ERR, "Failed to reset xstats: %s\n", strerror(-ret)); + bnxt_clear_prev_stat(bp); + return ret; } diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_stats.h dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_stats.h --- dpdk-19.11.7/drivers/net/bnxt/bnxt_stats.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_stats.h 2021-08-18 14:45:29.000000000 +0000 @@ -12,17 +12,12 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev, struct rte_eth_stats *bnxt_stats); int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev); -int bnxt_dev_xstats_get_names_op(__rte_unused struct rte_eth_dev *eth_dev, +int bnxt_dev_xstats_get_names_op(struct rte_eth_dev *eth_dev, struct rte_eth_xstat_name *xstats_names, __rte_unused unsigned int limit); int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, struct rte_eth_xstat *xstats, unsigned int n); int bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev); -int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids, - uint64_t *values, unsigned int limit); -int bnxt_dev_xstats_get_names_by_id_op(struct rte_eth_dev *dev, - struct rte_eth_xstat_name *xstats_names, - const uint64_t *ids, unsigned int limit); struct bnxt_xstats_name_off { char name[RTE_ETH_XSTATS_NAME_SIZE]; diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_txq.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_txq.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_txq.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_txq.c 2021-08-18 14:45:29.000000000 +0000 @@ -145,8 +145,8 @@ txq->port_id = eth_dev->data->port_id; /* Allocate TX ring hardware descriptors */ - if (bnxt_alloc_rings(bp, queue_idx, txq, NULL, txq->cp_ring, NULL, - "txr")) { + if (bnxt_alloc_rings(bp, socket_id, queue_idx, txq, NULL, txq->cp_ring, + NULL, "txr")) { PMD_DRV_LOG(ERR, "ring_dma_zone_reserve for tx_ring failed!"); rc = -ENOMEM; goto err; diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_txr.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_txr.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_txr.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_txr.c 2021-08-18 14:45:29.000000000 +0000 @@ -176,7 +176,7 @@ txbd->flags_type |= TX_BD_SHORT_FLAGS_COAL_NOW; txbd->flags_type |= TX_BD_LONG_FLAGS_NO_CMPL; txbd->len = tx_pkt->data_len; - if (tx_pkt->pkt_len >= 2014) + if (tx_pkt->pkt_len >= 2048) txbd->flags_type |= TX_BD_LONG_FLAGS_LHINT_GTE2K; else txbd->flags_type |= lhint_arr[tx_pkt->pkt_len >> 9]; @@ -398,30 +398,26 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq) { + uint32_t nb_tx_pkts = 0, cons, ring_mask, opaque; struct bnxt_cp_ring_info *cpr = txq->cp_ring; uint32_t raw_cons = cpr->cp_raw_cons; - uint32_t cons; - uint32_t nb_tx_pkts = 0; + struct bnxt_ring *cp_ring_struct; struct tx_cmpl *txcmp; - struct cmpl_base *cp_desc_ring = cpr->cp_desc_ring; - struct bnxt_ring *cp_ring_struct = cpr->cp_ring_struct; - uint32_t ring_mask = cp_ring_struct->ring_mask; - uint32_t opaque = 0; if (bnxt_tx_bds_in_hw(txq) < txq->tx_free_thresh) return 0; + cp_ring_struct = cpr->cp_ring_struct; + ring_mask = cp_ring_struct->ring_mask; + do { cons = RING_CMPL(ring_mask, raw_cons); txcmp = (struct tx_cmpl *)&cpr->cp_desc_ring[cons]; - rte_prefetch_non_temporal(&cp_desc_ring[(cons + 2) & - ring_mask]); - if (!CMPL_VALID(txcmp, cpr->valid)) + if (!bnxt_cpr_cmp_valid(txcmp, raw_cons, ring_mask + 1)) break; - opaque = rte_cpu_to_le_32(txcmp->opaque); - NEXT_CMPL(cpr, cons, cpr->valid, 1); - rte_prefetch0(&cp_desc_ring[cons]); + + opaque = rte_le_to_cpu_32(txcmp->opaque); if (CMP_TYPE(txcmp) == TX_CMPL_TYPE_TX_L2) nb_tx_pkts += opaque; @@ -429,9 +425,11 @@ RTE_LOG_DP(ERR, PMD, "Unhandled CMP type %02x\n", CMP_TYPE(txcmp)); - raw_cons = cons; + raw_cons = NEXT_RAW_CMP(raw_cons); } while (nb_tx_pkts < ring_mask); + cpr->valid = !!(raw_cons & cp_ring_struct->ring_size); + if (nb_tx_pkts) { bnxt_tx_cmp(txq, nb_tx_pkts); cpr->cp_raw_cons = raw_cons; diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_util.h dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_util.h --- dpdk-19.11.7/drivers/net/bnxt/bnxt_util.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_util.h 2021-08-18 14:45:29.000000000 +0000 @@ -10,6 +10,8 @@ #define BIT(n) (1UL << (n)) #endif /* BIT */ +#define PCI_SUBSYSTEM_ID_OFFSET 0x2e + int bnxt_check_zero_bytes(const uint8_t *bytes, int len); void bnxt_eth_hw_addr_random(uint8_t *mac_addr); diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_vnic.c dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_vnic.c --- dpdk-19.11.7/drivers/net/bnxt/bnxt_vnic.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_vnic.c 2021-08-18 14:45:29.000000000 +0000 @@ -16,7 +16,7 @@ * VNIC Functions */ -void prandom_bytes(void *dest_ptr, size_t len) +void bnxt_prandom_bytes(void *dest_ptr, size_t len) { char *dest = (char *)dest_ptr; uint64_t rb; @@ -145,7 +145,8 @@ mz = rte_memzone_lookup(mz_name); if (!mz) { mz = rte_memzone_reserve(mz_name, - entry_length * max_vnics, SOCKET_ID_ANY, + entry_length * max_vnics, + bp->eth_dev->device->numa_node, RTE_MEMZONE_2MB | RTE_MEMZONE_SIZE_HINT_ONLY | RTE_MEMZONE_IOVA_CONTIG); @@ -172,7 +173,7 @@ HW_HASH_KEY_SIZE); vnic->mc_list_dma_addr = vnic->rss_hash_key_dma_addr + HW_HASH_KEY_SIZE; - prandom_bytes(vnic->rss_hash_key, HW_HASH_KEY_SIZE); + bnxt_prandom_bytes(vnic->rss_hash_key, HW_HASH_KEY_SIZE); } return 0; diff -Nru dpdk-19.11.7/drivers/net/bnxt/bnxt_vnic.h dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_vnic.h --- dpdk-19.11.7/drivers/net/bnxt/bnxt_vnic.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/bnxt_vnic.h 2021-08-18 14:45:29.000000000 +0000 @@ -49,8 +49,6 @@ bool vlan_strip; bool func_default; bool bd_stall; - bool roce_dual; - bool roce_only; bool rss_dflt_cr; STAILQ_HEAD(, bnxt_filter_info) filter; @@ -67,6 +65,6 @@ void bnxt_free_vnic_mem(struct bnxt *bp); int bnxt_alloc_vnic_mem(struct bnxt *bp); int bnxt_vnic_grp_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic); -void prandom_bytes(void *dest_ptr, size_t len); +void bnxt_prandom_bytes(void *dest_ptr, size_t len); uint16_t bnxt_rte_to_hwrm_hash_types(uint64_t rte_type); #endif diff -Nru dpdk-19.11.7/drivers/net/bnxt/hsi_struct_def_dpdk.h dpdk-19.11.10~rc1/drivers/net/bnxt/hsi_struct_def_dpdk.h --- dpdk-19.11.7/drivers/net/bnxt/hsi_struct_def_dpdk.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bnxt/hsi_struct_def_dpdk.h 2021-08-18 14:45:29.000000000 +0000 @@ -24388,8 +24388,15 @@ #define HWRM_RING_RESET_INPUT_RING_TYPE_RX UINT32_C(0x2) /* RoCE Notification Completion Ring (ROCE_CR) */ #define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3) - #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \ - HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL + /* + * Rx Ring Group. This is to reset rx and aggregation in an atomic + * operation. Completion ring associated with this ring group is + * not reset. + */ + #define HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP UINT32_C(0x6) + #define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \ + HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP + uint8_t unused_0; /* Physical number of the ring. */ uint16_t ring_id; diff -Nru dpdk-19.11.7/drivers/net/bonding/eth_bond_private.h dpdk-19.11.10~rc1/drivers/net/bonding/eth_bond_private.h --- dpdk-19.11.7/drivers/net/bonding/eth_bond_private.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bonding/eth_bond_private.h 2021-08-18 14:45:29.000000000 +0000 @@ -212,7 +212,7 @@ valid_bonded_port_id(uint16_t port_id); int -valid_slave_port_id(uint16_t port_id, uint8_t mode); +valid_slave_port_id(struct bond_dev_private *internals, uint16_t port_id); void deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); diff -Nru dpdk-19.11.7/drivers/net/bonding/rte_eth_bond_8023ad.c dpdk-19.11.10~rc1/drivers/net/bonding/rte_eth_bond_8023ad.c --- dpdk-19.11.7/drivers/net/bonding/rte_eth_bond_8023ad.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bonding/rte_eth_bond_8023ad.c 2021-08-18 14:45:29.000000000 +0000 @@ -804,19 +804,34 @@ struct rte_mbuf *lacp_pkt) { struct lacpdu_header *lacp; struct lacpdu_actor_partner_params *partner; + struct port *port, *agg; if (lacp_pkt != NULL) { lacp = rte_pktmbuf_mtod(lacp_pkt, struct lacpdu_header *); RTE_ASSERT(lacp->lacpdu.subtype == SLOW_SUBTYPE_LACP); partner = &lacp->lacpdu.partner; + port = &bond_mode_8023ad_ports[slave_id]; + agg = &bond_mode_8023ad_ports[port->aggregator_port_id]; + if (rte_is_zero_ether_addr(&partner->port_params.system) || rte_is_same_ether_addr(&partner->port_params.system, - &internals->mode4.mac_addr)) { + &agg->actor.system)) { /* This LACP frame is sending to the bonding port * so pass it to rx_machine. */ rx_machine(internals, slave_id, &lacp->lacpdu); + } else { + char preferred_system_name[RTE_ETHER_ADDR_FMT_SIZE]; + char self_system_name[RTE_ETHER_ADDR_FMT_SIZE]; + + rte_ether_format_addr(preferred_system_name, + RTE_ETHER_ADDR_FMT_SIZE, &partner->port_params.system); + rte_ether_format_addr(self_system_name, + RTE_ETHER_ADDR_FMT_SIZE, &agg->actor.system); + MODE4_DEBUG("preferred partner system %s " + "is not equal with self system: %s\n", + preferred_system_name, self_system_name); } rte_pktmbuf_free(lacp_pkt); } else diff -Nru dpdk-19.11.7/drivers/net/bonding/rte_eth_bond_api.c dpdk-19.11.10~rc1/drivers/net/bonding/rte_eth_bond_api.c --- dpdk-19.11.7/drivers/net/bonding/rte_eth_bond_api.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bonding/rte_eth_bond_api.c 2021-08-18 14:45:29.000000000 +0000 @@ -56,19 +56,25 @@ } int -valid_slave_port_id(uint16_t port_id, uint8_t mode) +valid_slave_port_id(struct bond_dev_private *internals, uint16_t slave_port_id) { - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); + RTE_ETH_VALID_PORTID_OR_ERR_RET(slave_port_id, -1); - /* Verify that port_id refers to a non bonded port */ - if (check_for_bonded_ethdev(&rte_eth_devices[port_id]) == 0 && - mode == BONDING_MODE_8023AD) { + /* Verify that slave_port_id refers to a non bonded port */ + if (check_for_bonded_ethdev(&rte_eth_devices[slave_port_id]) == 0 && + internals->mode == BONDING_MODE_8023AD) { RTE_BOND_LOG(ERR, "Cannot add slave to bonded device in 802.3ad" " mode as slave is also a bonded device, only " "physical devices can be support in this mode."); return -1; } + if (internals->port_id == slave_port_id) { + RTE_BOND_LOG(ERR, + "Cannot add the bonded device itself as its slave."); + return -1; + } + return 0; } @@ -451,7 +457,7 @@ bonded_eth_dev = &rte_eth_devices[bonded_port_id]; internals = bonded_eth_dev->data->dev_private; - if (valid_slave_port_id(slave_port_id, internals->mode) != 0) + if (valid_slave_port_id(internals, slave_port_id) != 0) return -1; slave_eth_dev = &rte_eth_devices[slave_port_id]; @@ -600,13 +606,15 @@ int retval; - /* Verify that port id's are valid bonded and slave ports */ if (valid_bonded_port_id(bonded_port_id) != 0) return -1; bonded_eth_dev = &rte_eth_devices[bonded_port_id]; internals = bonded_eth_dev->data->dev_private; + if (valid_slave_port_id(internals, slave_port_id) != 0) + return -1; + rte_spinlock_lock(&internals->lock); retval = __eth_bond_slave_add_lock_free(bonded_port_id, slave_port_id); @@ -630,7 +638,7 @@ bonded_eth_dev = &rte_eth_devices[bonded_port_id]; internals = bonded_eth_dev->data->dev_private; - if (valid_slave_port_id(slave_port_id, internals->mode) < 0) + if (valid_slave_port_id(internals, slave_port_id) < 0) return -1; /* first remove from active slave list */ @@ -778,7 +786,7 @@ internals = rte_eth_devices[bonded_port_id].data->dev_private; - if (valid_slave_port_id(slave_port_id, internals->mode) != 0) + if (valid_slave_port_id(internals, slave_port_id) != 0) return -1; internals->user_defined_primary_port = 1; diff -Nru dpdk-19.11.7/drivers/net/bonding/rte_eth_bond_args.c dpdk-19.11.10~rc1/drivers/net/bonding/rte_eth_bond_args.c --- dpdk-19.11.7/drivers/net/bonding/rte_eth_bond_args.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bonding/rte_eth_bond_args.c 2021-08-18 14:45:29.000000000 +0000 @@ -200,20 +200,20 @@ bond_ethdev_parse_socket_id_kvarg(const char *key __rte_unused, const char *value, void *extra_args) { - int socket_id; + long socket_id; char *endptr; if (value == NULL || extra_args == NULL) return -1; errno = 0; - socket_id = (uint8_t)strtol(value, &endptr, 10); + socket_id = strtol(value, &endptr, 10); if (*endptr != 0 || errno != 0) return -1; /* validate socket id value */ - if (socket_id >= 0) { - *(uint8_t *)extra_args = (uint8_t)socket_id; + if (socket_id >= 0 && socket_id < RTE_MAX_NUMA_NODES) { + *(int *)extra_args = (int)socket_id; return 0; } return -1; diff -Nru dpdk-19.11.7/drivers/net/bonding/rte_eth_bond_pmd.c dpdk-19.11.10~rc1/drivers/net/bonding/rte_eth_bond_pmd.c --- dpdk-19.11.7/drivers/net/bonding/rte_eth_bond_pmd.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/bonding/rte_eth_bond_pmd.c 2021-08-18 14:45:29.000000000 +0000 @@ -1791,12 +1791,13 @@ != 0) return errval; - if (bond_ethdev_8023ad_flow_verify(bonded_eth_dev, - slave_eth_dev->data->port_id) != 0) { + errval = bond_ethdev_8023ad_flow_verify(bonded_eth_dev, + slave_eth_dev->data->port_id); + if (errval != 0) { RTE_BOND_LOG(ERR, - "rte_eth_tx_queue_setup: port=%d queue_id %d, err (%d)", - slave_eth_dev->data->port_id, q_id, errval); - return -1; + "bond_ethdev_8023ad_flow_verify: port=%d, err (%d)", + slave_eth_dev->data->port_id, errval); + return errval; } if (internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id] != NULL) @@ -1804,8 +1805,14 @@ internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id], &flow_error); - bond_ethdev_8023ad_flow_set(bonded_eth_dev, + errval = bond_ethdev_8023ad_flow_set(bonded_eth_dev, slave_eth_dev->data->port_id); + if (errval != 0) { + RTE_BOND_LOG(ERR, + "bond_ethdev_8023ad_flow_set: port=%d, err (%d)", + slave_eth_dev->data->port_id, errval); + return errval; + } } /* Start device */ @@ -3297,8 +3304,9 @@ const char *name; struct bond_dev_private *internals; struct rte_kvargs *kvlist; - uint8_t bonding_mode, socket_id/*, agg_mode*/; - int arg_count, port_id; + uint8_t bonding_mode; + int arg_count, port_id; + int socket_id; uint8_t agg_mode; struct rte_eth_dev *eth_dev; @@ -3447,6 +3455,8 @@ rte_bitmap_free(internals->vlan_filter_bmp); rte_free(internals->vlan_filter_bmpmem); + if (internals->kvlist != NULL) + rte_kvargs_free(internals->kvlist); rte_eth_dev_release_port(eth_dev); return 0; diff -Nru dpdk-19.11.7/drivers/net/cxgbe/base/common.h dpdk-19.11.10~rc1/drivers/net/cxgbe/base/common.h --- dpdk-19.11.7/drivers/net/cxgbe/base/common.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/cxgbe/base/common.h 2021-08-18 14:45:29.000000000 +0000 @@ -198,15 +198,15 @@ unsigned int mode; /* RSS mode */ union { struct { - uint synmapen:1; /* SYN Map Enable */ - uint syn4tupenipv6:1; /* en 4-tuple IPv6 SYNs hash */ - uint syn2tupenipv6:1; /* en 2-tuple IPv6 SYNs hash */ - uint syn4tupenipv4:1; /* en 4-tuple IPv4 SYNs hash */ - uint syn2tupenipv4:1; /* en 2-tuple IPv4 SYNs hash */ - uint ofdmapen:1; /* Offload Map Enable */ - uint tnlmapen:1; /* Tunnel Map Enable */ - uint tnlalllookup:1; /* Tunnel All Lookup */ - uint hashtoeplitz:1; /* use Toeplitz hash */ + unsigned int synmapen:1; /* SYN Map Enable */ + unsigned int syn4tupenipv6:1; /* en 4-tuple IPv6 SYNs hash */ + unsigned int syn2tupenipv6:1; /* en 2-tuple IPv6 SYNs hash */ + unsigned int syn4tupenipv4:1; /* en 4-tuple IPv4 SYNs hash */ + unsigned int syn2tupenipv4:1; /* en 2-tuple IPv4 SYNs hash */ + unsigned int ofdmapen:1; /* Offload Map Enable */ + unsigned int tnlmapen:1; /* Tunnel Map Enable */ + unsigned int tnlalllookup:1; /* Tunnel All Lookup */ + unsigned int hashtoeplitz:1; /* use Toeplitz hash */ } basicvirtual; } u; }; diff -Nru dpdk-19.11.7/drivers/net/cxgbe/cxgbe_ethdev.c dpdk-19.11.10~rc1/drivers/net/cxgbe/cxgbe_ethdev.c --- dpdk-19.11.7/drivers/net/cxgbe/cxgbe_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/cxgbe/cxgbe_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -329,6 +329,9 @@ CXGBE_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + if (!(adapter->flags & FULL_INIT_DONE)) return; diff -Nru dpdk-19.11.7/drivers/net/dpaa2/dpaa2_ethdev.c dpdk-19.11.10~rc1/drivers/net/dpaa2/dpaa2_ethdev.c --- dpdk-19.11.7/drivers/net/dpaa2/dpaa2_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/dpaa2/dpaa2_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -31,6 +31,8 @@ #define DRIVER_LOOPBACK_MODE "drv_loopback" #define DRIVER_NO_PREFETCH_MODE "drv_no_prefetch" +#define CHECK_INTERVAL 100 /* 100ms */ +#define MAX_REPEAT_TIME 90 /* 9s (90 * 100ms) in total */ /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = @@ -1662,23 +1664,32 @@ /* return 0 means link status changed, -1 means not changed */ static int dpaa2_dev_link_update(struct rte_eth_dev *dev, - int wait_to_complete __rte_unused) + int wait_to_complete) { int ret; struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private; struct rte_eth_link link; struct dpni_link_state state = {0}; + uint8_t count; if (dpni == NULL) { DPAA2_PMD_ERR("dpni is NULL"); return 0; } - ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, &state); - if (ret < 0) { - DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret); - return -1; + for (count = 0; count <= MAX_REPEAT_TIME; count++) { + ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, + &state); + if (ret < 0) { + DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret); + return -1; + } + if (state.up == ETH_LINK_DOWN && + wait_to_complete) + rte_delay_ms(CHECK_INTERVAL); + else + break; } memset(&link, 0, sizeof(struct rte_eth_link)); diff -Nru dpdk-19.11.7/drivers/net/e1000/base/e1000_i210.c dpdk-19.11.10~rc1/drivers/net/e1000/base/e1000_i210.c --- dpdk-19.11.7/drivers/net/e1000/base/e1000_i210.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/e1000/base/e1000_i210.c 2021-08-18 14:45:29.000000000 +0000 @@ -310,6 +310,8 @@ } for (i = 0; i < words; i++) { + ret_val = -E1000_ERR_NVM; + eewr = ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) | (data[i] << E1000_NVM_RW_REG_DATA) | E1000_NVM_RW_REG_START; diff -Nru dpdk-19.11.7/drivers/net/e1000/em_ethdev.c dpdk-19.11.10~rc1/drivers/net/e1000/em_ethdev.c --- dpdk-19.11.7/drivers/net/e1000/em_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/e1000/em_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -767,6 +767,9 @@ struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + eth_em_stop(dev); adapter->stopped = 1; em_dev_free_queues(dev); @@ -971,8 +974,7 @@ /* Rx Errors */ rte_stats->imissed = stats->mpc; - rte_stats->ierrors = stats->crcerrs + - stats->rlec + stats->ruc + stats->roc + + rte_stats->ierrors = stats->crcerrs + stats->rlec + stats->rxerrc + stats->algnerrc + stats->cexterr; /* Tx Errors */ @@ -1801,11 +1803,15 @@ if (mtu < RTE_ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) return -EINVAL; - /* refuse mtu that requires the support of scattered packets when this - * feature has not been enabled before. */ - if (!dev->data->scattered_rx && - frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) + /* + * If device is started, refuse mtu that requires the support of + * scattered packets when this feature has not been enabled before. + */ + if (dev->data->dev_started && !dev->data->scattered_rx && + frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) { + PMD_INIT_LOG(ERR, "Stop port first."); return -EINVAL; + } hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); rctl = E1000_READ_REG(hw, E1000_RCTL); diff -Nru dpdk-19.11.7/drivers/net/e1000/igb_ethdev.c dpdk-19.11.10~rc1/drivers/net/e1000/igb_ethdev.c --- dpdk-19.11.7/drivers/net/e1000/igb_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/e1000/igb_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -1544,6 +1544,9 @@ struct e1000_filter_info *filter_info = E1000_DEV_PRIVATE_TO_FILTER_INFO(dev->data->dev_private); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + eth_igb_stop(dev); e1000_phy_hw_reset(hw); @@ -1849,8 +1852,7 @@ /* Rx Errors */ rte_stats->imissed = stats->mpc; - rte_stats->ierrors = stats->crcerrs + - stats->rlec + stats->ruc + stats->roc + + rte_stats->ierrors = stats->crcerrs + stats->rlec + stats->rxerrc + stats->algnerrc + stats->cexterr; /* Tx Errors */ @@ -2711,8 +2713,7 @@ /* Update maximum packet length */ if (dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) E1000_WRITE_REG(hw, E1000_RLPML, - dev->data->dev_conf.rxmode.max_rx_pkt_len + - VLAN_TAG_SIZE); + dev->data->dev_conf.rxmode.max_rx_pkt_len); } static void @@ -2731,7 +2732,7 @@ if (dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) E1000_WRITE_REG(hw, E1000_RLPML, dev->data->dev_conf.rxmode.max_rx_pkt_len + - 2 * VLAN_TAG_SIZE); + VLAN_TAG_SIZE); } static int @@ -3424,6 +3425,9 @@ PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + e1000_reset_hw(hw); igbvf_dev_stop(dev); @@ -4568,11 +4572,15 @@ frame_size > dev_info.max_rx_pktlen) return -EINVAL; - /* refuse mtu that requires the support of scattered packets when this - * feature has not been enabled before. */ - if (!dev->data->scattered_rx && - frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) + /* + * If device is started, refuse mtu that requires the support of + * scattered packets when this feature has not been enabled before. + */ + if (dev->data->dev_started && !dev->data->scattered_rx && + frame_size > dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM) { + PMD_INIT_LOG(ERR, "Stop port first."); return -EINVAL; + } rctl = E1000_READ_REG(hw, E1000_RCTL); @@ -5515,9 +5523,6 @@ u16 first_word, last_word; int i = 0; - if (info->length == 0) - return -EINVAL; - first_word = info->offset >> 1; last_word = (info->offset + info->length - 1) >> 1; diff -Nru dpdk-19.11.7/drivers/net/e1000/igb_flow.c dpdk-19.11.10~rc1/drivers/net/e1000/igb_flow.c --- dpdk-19.11.7/drivers/net/e1000/igb_flow.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/e1000/igb_flow.c 2021-08-18 14:45:29.000000000 +0000 @@ -350,7 +350,7 @@ memset(filter, 0, sizeof(struct rte_eth_ntuple_filter)); rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, - item, "Not supported action."); + act, "Not supported action."); return -rte_errno; } filter->queue = diff -Nru dpdk-19.11.7/drivers/net/e1000/igb_rxtx.c dpdk-19.11.10~rc1/drivers/net/e1000/igb_rxtx.c --- dpdk-19.11.7/drivers/net/e1000/igb_rxtx.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/e1000/igb_rxtx.c 2021-08-18 14:45:29.000000000 +0000 @@ -2341,15 +2341,18 @@ * Configure support of jumbo frames, if any. */ if (dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { + uint32_t max_len = dev->data->dev_conf.rxmode.max_rx_pkt_len; + rctl |= E1000_RCTL_LPE; /* * Set maximum packet length by default, and might be updated * together with enabling/disabling dual VLAN. */ - E1000_WRITE_REG(hw, E1000_RLPML, - dev->data->dev_conf.rxmode.max_rx_pkt_len + - VLAN_TAG_SIZE); + if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_EXTEND) + max_len += VLAN_TAG_SIZE; + + E1000_WRITE_REG(hw, E1000_RLPML, max_len); } else rctl &= ~E1000_RCTL_LPE; diff -Nru dpdk-19.11.7/drivers/net/ena/base/ena_com.c dpdk-19.11.10~rc1/drivers/net/ena/base/ena_com.c --- dpdk-19.11.7/drivers/net/ena/base/ena_com.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ena/base/ena_com.c 2021-08-18 14:45:29.000000000 +0000 @@ -1340,7 +1340,7 @@ ena_trc_err("Failed to submit command [%ld]\n", PTR_ERR(comp_ctx)); - return PTR_ERR(comp_ctx); + return (int)PTR_ERR(comp_ctx); } ret = ena_com_wait_and_process_admin_cq(comp_ctx, admin_queue); @@ -1559,7 +1559,7 @@ int ena_com_get_dma_width(struct ena_com_dev *ena_dev) { u32 caps = ena_com_reg_bar_read32(ena_dev, ENA_REGS_CAPS_OFF); - int width; + u32 width; if (unlikely(caps == ENA_MMIO_READ_TIMEOUT)) { ena_trc_err("Reg read timeout occurred\n"); @@ -2263,7 +2263,7 @@ cmd.aq_common_descriptor.opcode = ENA_ADMIN_SET_FEATURE; cmd.aq_common_descriptor.flags = 0; cmd.feat_common.feature_id = ENA_ADMIN_MTU; - cmd.u.mtu.mtu = mtu; + cmd.u.mtu.mtu = (u32)mtu; ret = ena_com_execute_admin_command(admin_queue, (struct ena_admin_aq_entry *)&cmd, @@ -2665,7 +2665,7 @@ return ret; } - cmd.control_buffer.length = (1ULL << rss->tbl_log_size) * + cmd.control_buffer.length = (u32)(1ULL << rss->tbl_log_size) * sizeof(struct ena_admin_rss_ind_table_entry); ret = ena_com_execute_admin_command(admin_queue, @@ -2687,7 +2687,7 @@ u32 tbl_size; int i, rc; - tbl_size = (1ULL << rss->tbl_log_size) * + tbl_size = (u32)(1ULL << rss->tbl_log_size) * sizeof(struct ena_admin_rss_ind_table_entry); rc = ena_com_get_feature_ex(ena_dev, &get_resp, diff -Nru dpdk-19.11.7/drivers/net/ena/base/ena_plat_dpdk.h dpdk-19.11.10~rc1/drivers/net/ena/base/ena_plat_dpdk.h --- dpdk-19.11.7/drivers/net/ena/base/ena_plat_dpdk.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ena/base/ena_plat_dpdk.h 2021-08-18 14:45:29.000000000 +0000 @@ -24,6 +24,7 @@ #include #include +#include typedef uint64_t u64; typedef uint32_t u32; @@ -59,7 +60,11 @@ #define ENA_UDELAY(x) rte_delay_us_block(x) #define ENA_TOUCH(x) ((void)(x)) -#define memcpy_toio memcpy +/* Avoid nested declaration on arm64, as it may define rte_memcpy as memcpy. */ +#if defined(RTE_ARCH_X86) +#undef memcpy +#define memcpy rte_memcpy +#endif #define wmb rte_wmb #define rmb rte_rmb #define mb rte_mb diff -Nru dpdk-19.11.7/drivers/net/ena/ena_ethdev.c dpdk-19.11.10~rc1/drivers/net/ena/ena_ethdev.c --- dpdk-19.11.7/drivers/net/ena/ena_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ena/ena_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -472,6 +472,9 @@ struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; struct ena_adapter *adapter = dev->data->dev_private; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + if (adapter->state == ENA_ADAPTER_STATE_RUNNING) ena_stop(dev); adapter->state = ENA_ADAPTER_STATE_CLOSED; @@ -733,8 +736,10 @@ for (i = 0; i < ring->ring_size; ++i) { struct ena_tx_buffer *tx_buf = &ring->tx_buffer_info[i]; - if (tx_buf->mbuf) + if (tx_buf->mbuf) { rte_pktmbuf_free(tx_buf->mbuf); + tx_buf->mbuf = NULL; + } } } @@ -1376,7 +1381,7 @@ ena_assert_msg(((in_use + count) < ring_size), "bad ring state\n"); /* get resources for incoming packets */ - rc = rte_mempool_get_bulk(rxq->mb_pool, (void **)mbufs, count); + rc = rte_pktmbuf_alloc_bulk(rxq->mb_pool, mbufs, count); if (unlikely(rc < 0)) { rte_atomic64_inc(&rxq->adapter->drv_stats->rx_nombuf); ++rxq->rx_stats.mbuf_alloc_fail; @@ -1415,8 +1420,7 @@ if (unlikely(i < count)) { PMD_DRV_LOG(WARNING, "refilled rx qid %d with only %d " "buffers (from %d)\n", rxq->id, i, count); - rte_mempool_put_bulk(rxq->mb_pool, (void **)(&mbufs[i]), - count - i); + rte_pktmbuf_free_bulk(&mbufs[i], count - i); ++rxq->rx_stats.refill_partial; } @@ -1873,6 +1877,8 @@ adapter->state = ENA_ADAPTER_STATE_CONFIG; + dev->data->dev_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS; + adapter->tx_selected_offloads = dev->data->dev_conf.txmode.offloads; adapter->rx_selected_offloads = dev->data->dev_conf.rxmode.offloads; return 0; @@ -1944,6 +1950,7 @@ DEV_RX_OFFLOAD_TCP_CKSUM; rx_feat |= DEV_RX_OFFLOAD_JUMBO_FRAME; + tx_feat |= DEV_TX_OFFLOAD_MULTI_SEGS; /* Inform framework about available features */ dev_info->rx_offload_capa = rx_feat; @@ -2352,7 +2359,12 @@ rc = ena_com_prepare_tx(tx_ring->ena_com_io_sq, &ena_tx_ctx, &nb_hw_desc); if (unlikely(rc)) { + PMD_DRV_LOG(ERR, + "Failed to prepare Tx buffers, rc: %d\n", rc); ++tx_ring->tx_stats.prepare_ctx_err; + tx_ring->adapter->reset_reason = + ENA_REGS_RESET_DRIVER_INVALID_STATE; + tx_ring->adapter->trigger_reset = true; break; } tx_info->tx_descs = nb_hw_desc; diff -Nru dpdk-19.11.7/drivers/net/ena/ena_platform.h dpdk-19.11.10~rc1/drivers/net/ena/ena_platform.h --- dpdk-19.11.7/drivers/net/ena/ena_platform.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ena/ena_platform.h 2021-08-18 14:45:29.000000000 +0000 @@ -6,18 +6,6 @@ #ifndef __ENA_PLATFORM_H__ #define __ENA_PLATFORM_H__ -#define swap16_to_le(x) (x) - -#define swap32_to_le(x) (x) - -#define swap64_to_le(x) (x) - -#define swap16_from_le(x) (x) - -#define swap32_from_le(x) (x) - -#define swap64_from_le(x) (x) - #define ena_assert_msg(cond, msg) \ do { \ if (unlikely(!(cond))) { \ diff -Nru dpdk-19.11.7/drivers/net/enetc/enetc_ethdev.c dpdk-19.11.10~rc1/drivers/net/enetc/enetc_ethdev.c --- dpdk-19.11.7/drivers/net/enetc/enetc_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/enetc/enetc_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -547,6 +547,9 @@ uint16_t i; PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + enetc_dev_stop(dev); for (i = 0; i < dev->data->nb_rx_queues; i++) { diff -Nru dpdk-19.11.7/drivers/net/enic/enic_ethdev.c dpdk-19.11.10~rc1/drivers/net/enic/enic_ethdev.c --- dpdk-19.11.7/drivers/net/enic/enic_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/enic/enic_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -457,6 +457,9 @@ struct enic *enic = pmd_priv(eth_dev); ENICPMD_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + enic_remove(enic); } diff -Nru dpdk-19.11.7/drivers/net/failsafe/failsafe_ops.c dpdk-19.11.10~rc1/drivers/net/failsafe/failsafe_ops.c --- dpdk-19.11.7/drivers/net/failsafe/failsafe_ops.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/failsafe/failsafe_ops.c 2021-08-18 14:45:29.000000000 +0000 @@ -1051,6 +1051,8 @@ fs_dev_merge_info(struct rte_eth_dev_info *info, const struct rte_eth_dev_info *sinfo) { + info->min_mtu = RTE_MAX(info->min_mtu, sinfo->min_mtu); + info->max_mtu = RTE_MIN(info->max_mtu, sinfo->max_mtu); info->max_rx_pktlen = RTE_MIN(info->max_rx_pktlen, sinfo->max_rx_pktlen); info->max_rx_queues = RTE_MIN(info->max_rx_queues, sinfo->max_rx_queues); info->max_tx_queues = RTE_MIN(info->max_tx_queues, sinfo->max_tx_queues); @@ -1119,6 +1121,8 @@ int ret; /* Use maximum upper bounds by default */ + infos->min_mtu = RTE_ETHER_MIN_MTU; + infos->max_mtu = UINT16_MAX; infos->max_rx_pktlen = UINT32_MAX; infos->max_rx_queues = RTE_MAX_QUEUES_PER_PORT; infos->max_tx_queues = RTE_MAX_QUEUES_PER_PORT; @@ -1148,7 +1152,8 @@ DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_TIMESTAMP | - DEV_RX_OFFLOAD_SECURITY; + DEV_RX_OFFLOAD_SECURITY | + DEV_RX_OFFLOAD_RSS_HASH; infos->rx_queue_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP | @@ -1165,7 +1170,8 @@ DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_TIMESTAMP | - DEV_RX_OFFLOAD_SECURITY; + DEV_RX_OFFLOAD_SECURITY | + DEV_RX_OFFLOAD_RSS_HASH; infos->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS | diff -Nru dpdk-19.11.7/drivers/net/fm10k/fm10k_ethdev.c dpdk-19.11.10~rc1/drivers/net/fm10k/fm10k_ethdev.c --- dpdk-19.11.7/drivers/net/fm10k/fm10k_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/fm10k/fm10k_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -2803,6 +2803,8 @@ struct rte_intr_handle *intr_handle = &pdev->intr_handle; PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; fm10k_mbx_lock(hw); hw->mac.ops.update_lport_state(hw, hw->mac.dglort_map, @@ -3258,14 +3260,7 @@ eth_fm10k_dev_uninit(struct rte_eth_dev *dev) { PMD_INIT_FUNC_TRACE(); - - /* only uninitialize in the primary process */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return 0; - - /* safe to close dev here */ fm10k_dev_close(dev); - return 0; } diff -Nru dpdk-19.11.7/drivers/net/hinic/base/hinic_compat.h dpdk-19.11.10~rc1/drivers/net/hinic/base/hinic_compat.h --- dpdk-19.11.7/drivers/net/hinic/base/hinic_compat.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hinic/base/hinic_compat.h 2021-08-18 14:45:29.000000000 +0000 @@ -203,6 +203,7 @@ #else #define CLOCK_TYPE CLOCK_MONOTONIC #endif +#define HINIC_MUTEX_TIMEOUT 10 static inline unsigned long clock_gettime_ms(void) { @@ -257,24 +258,14 @@ static inline int hinic_mutex_lock(pthread_mutex_t *pthreadmutex) { int err; + struct timespec tout; - err = pthread_mutex_lock(pthreadmutex); - if (!err) { - return err; - } else if (err == EOWNERDEAD) { - PMD_DRV_LOG(ERR, "Mutex lock failed. (ErrorNo=%d)", errno); -#if defined(__GLIBC__) -#if __GLIBC_PREREQ(2, 12) - (void)pthread_mutex_consistent(pthreadmutex); -#else - (void)pthread_mutex_consistent_np(pthreadmutex); -#endif -#else - (void)pthread_mutex_consistent(pthreadmutex); -#endif - } else { - PMD_DRV_LOG(ERR, "Mutex lock failed. (ErrorNo=%d)", errno); - } + (void)clock_gettime(CLOCK_TYPE, &tout); + + tout.tv_sec += HINIC_MUTEX_TIMEOUT; + err = pthread_mutex_timedlock(pthreadmutex, &tout); + if (err) + PMD_DRV_LOG(ERR, "Mutex lock failed. (ErrorNo=%d)", err); return err; } diff -Nru dpdk-19.11.7/drivers/net/hinic/base/hinic_pmd_nicio.c dpdk-19.11.10~rc1/drivers/net/hinic/base/hinic_pmd_nicio.c --- dpdk-19.11.7/drivers/net/hinic/base/hinic_pmd_nicio.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hinic/base/hinic_pmd_nicio.c 2021-08-18 14:45:29.000000000 +0000 @@ -230,8 +230,8 @@ wq_block_pfn_hi = upper_32_bits(wq_block_pfn); wq_block_pfn_lo = lower_32_bits(wq_block_pfn); - /* must config as ceq enable but do not generate ceq */ - rq_ctxt->ceq_attr = RQ_CTXT_CEQ_ATTR_SET(1, EN) | + /* config as ceq disable, but must set msix state disable */ + rq_ctxt->ceq_attr = RQ_CTXT_CEQ_ATTR_SET(0, EN) | RQ_CTXT_CEQ_ATTR_SET(1, OWNER); rq_ctxt->pi_intr_attr = RQ_CTXT_PI_SET(pi_start, IDX) | diff -Nru dpdk-19.11.7/drivers/net/hinic/hinic_pmd_ethdev.c dpdk-19.11.10~rc1/drivers/net/hinic/hinic_pmd_ethdev.c --- dpdk-19.11.7/drivers/net/hinic/hinic_pmd_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hinic/hinic_pmd_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -1597,6 +1597,9 @@ if (vlan_id > RTE_ETHER_MAX_VLAN_ID) return -EINVAL; + if (vlan_id == 0) + return 0; + func_id = hinic_global_func_id(nic_dev->hwdev); if (enable) { @@ -2866,6 +2869,9 @@ { struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + if (hinic_test_and_set_bit(HINIC_DEV_CLOSE, &nic_dev->dev_status)) { PMD_DRV_LOG(WARNING, "Device %s already closed", dev->data->name); @@ -2972,6 +2978,10 @@ .filter_ctrl = hinic_dev_filter_ctrl, }; +static const struct eth_dev_ops hinic_dev_sec_ops = { + .dev_infos_get = hinic_dev_infos_get, +}; + static int hinic_func_init(struct rte_eth_dev *eth_dev) { struct rte_pci_device *pci_dev; @@ -2985,6 +2995,7 @@ /* EAL is SECONDARY and eth_dev is already created */ if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + eth_dev->dev_ops = &hinic_dev_sec_ops; PMD_DRV_LOG(INFO, "Initialize %s in secondary process", eth_dev->data->name); diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_cmd.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_cmd.c --- dpdk-19.11.7/drivers/net/hns3/hns3_cmd.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_cmd.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include @@ -25,10 +25,6 @@ #include "hns3_intr.h" #include "hns3_logs.h" -#define hns3_is_csq(ring) ((ring)->flag & HNS3_TYPE_CSQ) - -#define cmq_ring_to_dev(ring) (&(ring)->dev->pdev->dev) - static int hns3_ring_space(struct hns3_cmq_ring *ring) { @@ -63,10 +59,12 @@ hns3_allocate_dma_mem(struct hns3_hw *hw, struct hns3_cmq_ring *ring, uint64_t size, uint32_t alignment) { + static uint64_t hns3_dma_memzone_id; const struct rte_memzone *mz = NULL; char z_name[RTE_MEMZONE_NAMESIZE]; - snprintf(z_name, sizeof(z_name), "hns3_dma_%" PRIu64, rte_rand()); + snprintf(z_name, sizeof(z_name), "hns3_dma_%" PRIu64, + __atomic_fetch_add(&hns3_dma_memzone_id, 1, __ATOMIC_RELAXED)); mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY, RTE_MEMZONE_IOVA_CONTIG, alignment, RTE_PGSIZE_2M); @@ -210,13 +208,14 @@ { struct hns3_cmq_ring *csq = &hw->cmq.csq; uint32_t head; + uint32_t addr; int clean; head = hns3_read_dev(hw, HNS3_CMDQ_TX_HEAD_REG); - - if (!is_valid_csq_clean_head(csq, head)) { - hns3_err(hw, "wrong cmd head (%u, %u-%u)", head, - csq->next_to_use, csq->next_to_clean); + addr = hns3_read_dev(hw, HNS3_CMDQ_TX_ADDR_L_REG); + if (!is_valid_csq_clean_head(csq, head) || addr == 0) { + hns3_err(hw, "wrong cmd addr(%0x) head (%u, %u-%u)", addr, head, + csq->next_to_use, csq->next_to_clean); if (rte_eal_process_type() == RTE_PROC_PRIMARY) { rte_atomic16_set(&hw->reset.disable_cmd, 1); hns3_schedule_delayed_reset(HNS3_DEV_HW_TO_ADAPTER(hw)); diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_cmd.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_cmd.h --- dpdk-19.11.7/drivers/net/hns3/hns3_cmd.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_cmd.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_CMD_H_ @@ -381,8 +381,6 @@ #define HNS3_CFG_RD_LEN_BYTES 16 #define HNS3_CFG_RD_LEN_UNIT 4 -#define HNS3_CFG_VMDQ_S 0 -#define HNS3_CFG_VMDQ_M GENMASK(7, 0) #define HNS3_CFG_TC_NUM_S 8 #define HNS3_CFG_TC_NUM_M GENMASK(15, 8) #define HNS3_CFG_TQP_DESC_N_S 16 diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_dcb.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_dcb.c --- dpdk-19.11.7/drivers/net/hns3/hns3_dcb.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_dcb.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include @@ -1103,7 +1103,7 @@ static void hns3_get_rx_tx_en_status(struct hns3_hw *hw, bool *tx_en, bool *rx_en) { - switch (hw->current_mode) { + switch (hw->requested_fc_mode) { case HNS3_FC_NONE: *tx_en = false; *rx_en = false; @@ -1280,7 +1280,7 @@ * We ensure that dcb information can be reconfigured * after the hns3_priority_flow_ctrl_set function called. */ - if (hw->current_mode != HNS3_FC_FULL) + if (hw->requested_fc_mode != HNS3_FC_FULL) *changed = true; pfc_en = RTE_LEN2MASK((uint8_t)dcb_rx_conf->nb_tcs, uint8_t); if (hw->dcb_info.pfc_en != pfc_en) @@ -1390,9 +1390,10 @@ struct hns3_pf *pf = &hns->pf; struct hns3_hw *hw = &hns->hw; enum hns3_fc_status fc_status = hw->current_fc_status; - enum hns3_fc_mode current_mode = hw->current_mode; + enum hns3_fc_mode requested_fc_mode = hw->requested_fc_mode; uint8_t hw_pfc_map = hw->dcb_info.hw_pfc_map; - int ret, status; + uint8_t pfc_en = hw->dcb_info.pfc_en; + int ret; if (pf->tx_sch_mode != HNS3_FLAG_TC_BASE_SCH_MODE && pf->tx_sch_mode != HNS3_FLAG_VNET_BASE_SCH_MODE) @@ -1417,10 +1418,10 @@ ret = hns3_buffer_alloc(hw); if (ret) - return ret; + goto buffer_alloc_fail; hw->current_fc_status = HNS3_FC_STATUS_PFC; - hw->current_mode = HNS3_FC_FULL; + hw->requested_fc_mode = HNS3_FC_FULL; ret = hns3_dcb_pause_setup_hw(hw); if (ret) { hns3_err(hw, "setup pfc failed! ret = %d", ret); @@ -1441,12 +1442,12 @@ return 0; pfc_setup_fail: - hw->current_mode = current_mode; + hw->requested_fc_mode = requested_fc_mode; hw->current_fc_status = fc_status; + +buffer_alloc_fail: + hw->dcb_info.pfc_en = pfc_en; hw->dcb_info.hw_pfc_map = hw_pfc_map; - status = hns3_buffer_alloc(hw); - if (status) - hns3_err(hw, "recover packet buffer fail! status = %d", status); return ret; } @@ -1518,8 +1519,7 @@ * will be changed. */ if (hw->adapter_state == HNS3_NIC_UNINITIALIZED) { - hw->requested_mode = HNS3_FC_NONE; - hw->current_mode = hw->requested_mode; + hw->requested_fc_mode = HNS3_FC_NONE; pf->pause_time = HNS3_DEFAULT_PAUSE_TRANS_TIME; hw->current_fc_status = HNS3_FC_STATUS_NONE; @@ -1594,6 +1594,30 @@ return ret; } +static void +hns3_get_fc_mode(struct hns3_hw *hw, enum rte_eth_fc_mode mode) +{ + switch (mode) { + case RTE_FC_NONE: + hw->requested_fc_mode = HNS3_FC_NONE; + break; + case RTE_FC_RX_PAUSE: + hw->requested_fc_mode = HNS3_FC_RX_PAUSE; + break; + case RTE_FC_TX_PAUSE: + hw->requested_fc_mode = HNS3_FC_TX_PAUSE; + break; + case RTE_FC_FULL: + hw->requested_fc_mode = HNS3_FC_FULL; + break; + default: + hw->requested_fc_mode = HNS3_FC_NONE; + hns3_warn(hw, "fc_mode(%u) exceeds member scope and is " + "configured to RTE_FC_NONE", mode); + break; + } +} + /* * hns3_dcb_pfc_enable - Enable priority flow control * @dev: pointer to ethernet device @@ -1606,15 +1630,15 @@ struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct hns3_pf *pf = HNS3_DEV_PRIVATE_TO_PF(dev->data->dev_private); enum hns3_fc_status fc_status = hw->current_fc_status; - enum hns3_fc_mode current_mode = hw->current_mode; + enum hns3_fc_mode old_fc_mode = hw->requested_fc_mode; uint8_t hw_pfc_map = hw->dcb_info.hw_pfc_map; uint8_t pfc_en = hw->dcb_info.pfc_en; uint8_t priority = pfc_conf->priority; uint16_t pause_time = pf->pause_time; - int ret, status; + int ret; pf->pause_time = pfc_conf->fc.pause_time; - hw->current_mode = hw->requested_mode; + hns3_get_fc_mode(hw, pfc_conf->fc.mode); hw->current_fc_status = HNS3_FC_STATUS_PFC; hw->dcb_info.pfc_en |= BIT(priority); hw->dcb_info.hw_pfc_map = @@ -1625,7 +1649,7 @@ /* * The flow control mode of all UPs will be changed based on - * current_mode coming from user. + * requested_fc_mode coming from user. */ ret = hns3_dcb_pause_setup_hw(hw); if (ret) { @@ -1636,14 +1660,11 @@ return 0; pfc_setup_fail: - hw->current_mode = current_mode; + hw->requested_fc_mode = old_fc_mode; hw->current_fc_status = fc_status; pf->pause_time = pause_time; hw->dcb_info.pfc_en = pfc_en; hw->dcb_info.hw_pfc_map = hw_pfc_map; - status = hns3_buffer_alloc(hw); - if (status) - hns3_err(hw, "recover packet buffer fail: %d", status); return ret; } @@ -1659,19 +1680,19 @@ { struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct hns3_pf *pf = HNS3_DEV_PRIVATE_TO_PF(dev->data->dev_private); + enum hns3_fc_mode old_fc_mode = hw->requested_fc_mode; enum hns3_fc_status fc_status = hw->current_fc_status; - enum hns3_fc_mode current_mode = hw->current_mode; uint16_t pause_time = pf->pause_time; int ret; pf->pause_time = fc_conf->pause_time; - hw->current_mode = hw->requested_mode; + hns3_get_fc_mode(hw, fc_conf->mode); /* * In fact, current_fc_status is HNS3_FC_STATUS_NONE when mode * of flow control is configured to be HNS3_FC_NONE. */ - if (hw->current_mode == HNS3_FC_NONE) + if (hw->requested_fc_mode == HNS3_FC_NONE) hw->current_fc_status = HNS3_FC_STATUS_NONE; else hw->current_fc_status = HNS3_FC_STATUS_MAC_PAUSE; @@ -1685,7 +1706,7 @@ return 0; setup_fc_fail: - hw->current_mode = current_mode; + hw->requested_fc_mode = old_fc_mode; hw->current_fc_status = fc_status; pf->pause_time = pause_time; diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_dcb.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_dcb.h --- dpdk-19.11.7/drivers/net/hns3/hns3_dcb.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_dcb.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_DCB_H_ diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_ethdev.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_ethdev.c --- dpdk-19.11.7/drivers/net/hns3/hns3_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include @@ -349,7 +349,7 @@ * When port base vlan enabled, we use port base vlan as the vlan * filter condition. In this case, we don't update vlan filter table * when user add new vlan or remove exist vlan, just update the - * vlan list. The vlan id in vlan list will be writen in vlan filter + * vlan list. The vlan id in vlan list will be written in vlan filter * table until port base vlan disabled */ if (hw->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_DISABLE) { @@ -523,7 +523,8 @@ ret = hns3_set_vlan_rx_offload_cfg(hns, &rxvlan_cfg); if (ret) { - hns3_err(hw, "enable strip rx vtag failed, ret =%d", ret); + hns3_err(hw, "%s strip rx vtag failed, ret = %d.", + enable ? "enable" : "disable", ret); return ret; } @@ -849,7 +850,7 @@ { struct hns3_hw *hw = &hns->hw; uint16_t port_base_vlan_state; - int ret; + int ret, err; if (on == 0 && pvid != hw->port_base_vlan_cfg.pvid) { if (hw->port_base_vlan_cfg.pvid != HNS3_INVALID_PVID) @@ -872,7 +873,7 @@ if (ret) { hns3_err(hw, "failed to config rx vlan strip for pvid, " "ret = %d", ret); - return ret; + goto pvid_vlan_strip_fail; } if (pvid == HNS3_INVALID_PVID) @@ -881,13 +882,27 @@ if (ret) { hns3_err(hw, "failed to update vlan filter entries, ret = %d", ret); - return ret; + goto vlan_filter_set_fail; } out: hw->port_base_vlan_cfg.state = port_base_vlan_state; hw->port_base_vlan_cfg.pvid = on ? pvid : HNS3_INVALID_PVID; return ret; + +vlan_filter_set_fail: + err = hns3_en_pvid_strip(hns, hw->port_base_vlan_cfg.state == + HNS3_PORT_BASE_VLAN_ENABLE); + if (err) + hns3_err(hw, "fail to rollback pvid strip, ret = %d", err); + +pvid_vlan_strip_fail: + err = hns3_vlan_txvlan_cfg(hns, hw->port_base_vlan_cfg.state, + hw->port_base_vlan_cfg.pvid); + if (err) + hns3_err(hw, "fail to rollback txvlan status, ret = %d", err); + + return ret; } static int @@ -2101,24 +2116,17 @@ int max_tc = 0; int i; - dcb_rx_conf = &dev->data->dev_conf.rx_adv_conf.dcb_rx_conf; - dcb_tx_conf = &dev->data->dev_conf.tx_adv_conf.dcb_tx_conf; - - if (rx_mq_mode == ETH_MQ_RX_VMDQ_DCB_RSS) { - hns3_err(hw, "ETH_MQ_RX_VMDQ_DCB_RSS is not supported. " - "rx_mq_mode = %d", rx_mq_mode); - return -EINVAL; - } - - if (rx_mq_mode == ETH_MQ_RX_VMDQ_DCB || - tx_mq_mode == ETH_MQ_TX_VMDQ_DCB) { - hns3_err(hw, "ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB " - "is not supported. rx_mq_mode = %d, tx_mq_mode = %d", + if ((rx_mq_mode & ETH_MQ_RX_VMDQ_FLAG) || + (tx_mq_mode == ETH_MQ_TX_VMDQ_DCB || + tx_mq_mode == ETH_MQ_TX_VMDQ_ONLY)) { + hns3_err(hw, "VMDQ is not supported, rx_mq_mode = %d, tx_mq_mode = %d.", rx_mq_mode, tx_mq_mode); - return -EINVAL; + return -EOPNOTSUPP; } - if (rx_mq_mode == ETH_MQ_RX_DCB_RSS) { + dcb_rx_conf = &dev->data->dev_conf.rx_adv_conf.dcb_rx_conf; + dcb_tx_conf = &dev->data->dev_conf.tx_adv_conf.dcb_tx_conf; + if (rx_mq_mode & ETH_MQ_RX_DCB_FLAG) { if (dcb_rx_conf->nb_tcs > pf->tc_max) { hns3_err(hw, "nb_tcs(%u) > max_tc(%u) driver supported.", dcb_rx_conf->nb_tcs, pf->tc_max); @@ -2176,8 +2184,7 @@ return -EOPNOTSUPP; } - /* Check multiple queue mode */ - return hns3_check_mq_mode(dev); + return 0; } static int @@ -2280,6 +2287,41 @@ } static int +hns3_refresh_mtu(struct rte_eth_dev *dev, struct rte_eth_conf *conf) +{ + struct hns3_adapter *hns = dev->data->dev_private; + struct hns3_hw *hw = &hns->hw; + uint32_t max_rx_pkt_len; + uint16_t mtu; + int ret; + + if (!(conf->rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME)) + return 0; + + /* + * If jumbo frames are enabled, MTU needs to be refreshed + * according to the maximum RX packet length. + */ + max_rx_pkt_len = conf->rxmode.max_rx_pkt_len; + if (max_rx_pkt_len > HNS3_MAX_FRAME_LEN || + max_rx_pkt_len <= HNS3_DEFAULT_FRAME_LEN) { + hns3_err(hw, "maximum Rx packet length must be greater than %u " + "and no more than %u when jumbo frame enabled.", + (uint16_t)HNS3_DEFAULT_FRAME_LEN, + (uint16_t)HNS3_MAX_FRAME_LEN); + return -EINVAL; + } + + mtu = (uint16_t)HNS3_PKTLEN_TO_MTU(max_rx_pkt_len); + ret = hns3_dev_mtu_set(dev, mtu); + if (ret) + return ret; + dev->data->mtu = mtu; + + return 0; +} + +static int hns3_dev_configure(struct rte_eth_dev *dev) { struct hns3_adapter *hns = dev->data->dev_private; @@ -2290,8 +2332,6 @@ uint16_t nb_rx_q = dev->data->nb_rx_queues; uint16_t nb_tx_q = dev->data->nb_tx_queues; struct rte_eth_rss_conf rss_conf; - uint32_t max_rx_pkt_len; - uint16_t mtu; int ret; /* @@ -2317,6 +2357,10 @@ goto cfg_err; } + ret = hns3_check_mq_mode(dev); + if (ret) + goto cfg_err; + if ((uint32_t)mq_mode & ETH_MQ_RX_DCB_FLAG) { ret = hns3_check_dcb_cfg(dev); if (ret) @@ -2338,28 +2382,9 @@ goto cfg_err; } - /* - * If jumbo frames are enabled, MTU needs to be refreshed - * according to the maximum RX packet length. - */ - if (conf->rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { - max_rx_pkt_len = conf->rxmode.max_rx_pkt_len; - if (max_rx_pkt_len > HNS3_MAX_FRAME_LEN || - max_rx_pkt_len <= HNS3_DEFAULT_FRAME_LEN) { - hns3_err(hw, "maximum Rx packet length must be greater " - "than %u and less than %u when jumbo frame enabled.", - (uint16_t)HNS3_DEFAULT_FRAME_LEN, - (uint16_t)HNS3_MAX_FRAME_LEN); - ret = -EINVAL; - goto cfg_err; - } - - mtu = (uint16_t)HNS3_PKTLEN_TO_MTU(max_rx_pkt_len); - ret = hns3_dev_mtu_set(dev, mtu); - if (ret) - goto cfg_err; - dev->data->mtu = mtu; - } + ret = hns3_refresh_mtu(dev, conf); + if (ret) + goto cfg_err; ret = hns3_dev_configure_vlan(dev); if (ret) @@ -2394,21 +2419,35 @@ static int hns3_config_mtu(struct hns3_hw *hw, uint16_t mps) { + struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); + uint16_t original_mps = hns->pf.mps; + int err; int ret; ret = hns3_set_mac_mtu(hw, mps); if (ret) { - hns3_err(hw, "Failed to set mtu, ret = %d", ret); + hns3_err(hw, "failed to set mtu, ret = %d", ret); return ret; } + hns->pf.mps = mps; ret = hns3_buffer_alloc(hw); if (ret) { - hns3_err(hw, "Failed to allocate buffer, ret = %d", ret); - return ret; + hns3_err(hw, "failed to allocate buffer, ret = %d", ret); + goto rollback; } return 0; + +rollback: + err = hns3_set_mac_mtu(hw, original_mps); + if (err) { + hns3_err(hw, "fail to rollback MTU, err = %d", err); + return ret; + } + hns->pf.mps = original_mps; + + return ret; } static int @@ -2441,7 +2480,7 @@ dev->data->port_id, mtu, ret); return ret; } - hns->pf.mps = (uint16_t)frame_size; + if (is_jumbo_frame) dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; @@ -2519,8 +2558,6 @@ .offloads = 0, }; - info->vmdq_queue_num = 0; - info->reta_size = HNS3_RSS_IND_TBL_SIZE; info->hash_key_size = HNS3_RSS_KEY_SIZE; info->flow_type_rss_offloads = HNS3_ETH_RSS_SUPPORT; @@ -2691,8 +2728,6 @@ req = (struct hns3_cfg_param_cmd *)desc[0].data; /* get the configuration */ - cfg->vmdq_vport_num = hns3_get_field(rte_le_to_cpu_32(req->param[0]), - HNS3_CFG_VMDQ_M, HNS3_CFG_VMDQ_S); cfg->tc_num = hns3_get_field(rte_le_to_cpu_32(req->param[0]), HNS3_CFG_TC_NUM_M, HNS3_CFG_TC_NUM_S); cfg->tqp_desc_num = hns3_get_field(rte_le_to_cpu_32(req->param[0]), @@ -3435,8 +3470,8 @@ * For different application scenes, the enabled port number, TC number * and no_drop TC number are different. In order to obtain the better * performance, software could allocate the buffer size and configure - * the waterline by tring to decrease the private buffer size according - * to the order, namely, waterline of valided tc, pfc disabled tc, pfc + * the waterline by trying to decrease the private buffer size according + * to the order, namely, waterline of valid tc, pfc disabled tc, pfc * enabled tc. */ if (hns3_rx_buf_calc_all(hw, false, buf_alloc)) @@ -4708,7 +4743,7 @@ /* Disable datapath on secondary process. */ hns3_mp_req_stop_rxtx(dev); /* Prevent crashes when queues are still in use. */ - rte_delay_ms(hw->tqps_num); + rte_delay_ms(hw->cfg_max_queues); rte_spinlock_lock(&hw->lock); if (rte_atomic16_read(&hw->reset.resetting) == 0) { @@ -4760,8 +4795,11 @@ fc_conf->pause_time = pf->pause_time; - /* return fc current mode */ - switch (hw->current_mode) { + /* + * If fc auto-negotiation is not supported, the configured fc mode + * from user is the current fc mode. + */ + switch (hw->requested_fc_mode) { case HNS3_FC_FULL: fc_conf->mode = RTE_FC_FULL; break; @@ -4780,35 +4818,10 @@ return 0; } -static void -hns3_get_fc_mode(struct hns3_hw *hw, enum rte_eth_fc_mode mode) -{ - switch (mode) { - case RTE_FC_NONE: - hw->requested_mode = HNS3_FC_NONE; - break; - case RTE_FC_RX_PAUSE: - hw->requested_mode = HNS3_FC_RX_PAUSE; - break; - case RTE_FC_TX_PAUSE: - hw->requested_mode = HNS3_FC_TX_PAUSE; - break; - case RTE_FC_FULL: - hw->requested_mode = HNS3_FC_FULL; - break; - default: - hw->requested_mode = HNS3_FC_NONE; - hns3_warn(hw, "fc_mode(%u) exceeds member scope and is " - "configured to RTE_FC_NONE", mode); - break; - } -} - static int hns3_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) { struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); - struct hns3_pf *pf = HNS3_DEV_PRIVATE_TO_PF(dev->data->dev_private); int ret; if (fc_conf->high_water || fc_conf->low_water || @@ -4837,10 +4850,10 @@ return -EOPNOTSUPP; } - hns3_get_fc_mode(hw, fc_conf->mode); - if (hw->requested_mode == hw->current_mode && - pf->pause_time == fc_conf->pause_time) - return 0; + if (hw->num_tc > 1) { + hns3_err(hw, "in multi-TC scenarios, MAC pause is not supported."); + return -EOPNOTSUPP; + } rte_spinlock_lock(&hw->lock); ret = hns3_fc_enable(dev, fc_conf); @@ -4854,8 +4867,6 @@ struct rte_eth_pfc_conf *pfc_conf) { struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); - struct hns3_pf *pf = HNS3_DEV_PRIVATE_TO_PF(dev->data->dev_private); - uint8_t priority; int ret; if (!hns3_dev_dcb_supported(hw)) { @@ -4890,13 +4901,6 @@ return -EOPNOTSUPP; } - priority = pfc_conf->priority; - hns3_get_fc_mode(hw, pfc_conf->fc.mode); - if (hw->dcb_info.pfc_en & BIT(priority) && - hw->requested_mode == hw->current_mode && - pfc_conf->fc.pause_time == pf->pause_time) - return 0; - rte_spinlock_lock(&hw->lock); ret = hns3_dcb_pfc_enable(dev, pfc_conf); rte_spinlock_unlock(&hw->lock); @@ -5198,7 +5202,7 @@ rte_wmb(); /* Disable datapath on secondary process. */ hns3_mp_req_stop_rxtx(eth_dev); - rte_delay_ms(hw->tqps_num); + rte_delay_ms(hw->cfg_max_queues); rte_spinlock_lock(&hw->lock); if (hns->hw.adapter_state == HNS3_NIC_STARTED || @@ -5345,7 +5349,7 @@ msec = tv_delta.tv_sec * MSEC_PER_SEC + tv_delta.tv_usec / USEC_PER_MSEC; if (msec > HNS3_RESET_PROCESS_MS) - hns3_err(hw, "%d handle long time delta %" PRIx64 + hns3_err(hw, "%d handle long time delta %" PRIu64 " ms time=%ld.%.6ld", hw->reset.level, msec, tv.tv_sec, tv.tv_usec); diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_ethdev.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_ethdev.h --- dpdk-19.11.7/drivers/net/hns3/hns3_ethdev.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_ethdev.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_ETHDEV_H_ @@ -120,7 +120,6 @@ }; struct hns3_cfg { - uint8_t vmdq_vport_num; uint8_t tc_num; uint16_t tqp_desc_num; uint16_t rx_buf_len; @@ -382,8 +381,7 @@ uint8_t num_tc; /* Total number of enabled TCs */ uint8_t hw_tc_map; - enum hns3_fc_mode current_mode; - enum hns3_fc_mode requested_mode; + enum hns3_fc_mode requested_fc_mode; /* FC mode requested by user */ struct hns3_dcb_info dcb_info; enum hns3_fc_status current_fc_status; /* current flow control status */ struct hns3_tc_queue_info tc_queue[HNS3_MAX_TC_NUM]; diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_ethdev_vf.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_ethdev_vf.c --- dpdk-19.11.7/drivers/net/hns3/hns3_ethdev_vf.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_ethdev_vf.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include @@ -172,9 +172,12 @@ if (ret < 0) { PMD_INIT_LOG(ERR, "failed to write PCI offset 0x%x", (pos + PCI_MSIX_FLAGS)); + return -ENXIO; } + return 0; } + return -1; } @@ -886,8 +889,6 @@ .offloads = 0, }; - info->vmdq_queue_num = 0; - info->reta_size = HNS3_RSS_IND_TBL_SIZE; info->hash_key_size = HNS3_RSS_KEY_SIZE; info->flow_type_rss_offloads = HNS3_ETH_RSS_SUPPORT; @@ -926,7 +927,6 @@ /* Fetch the events from their corresponding regs */ cmdq_stat_reg = hns3_read_dev(hw, HNS3_VECTOR0_CMDQ_STAT_REG); - if (BIT(HNS3_VECTOR0_RST_INT_B) & cmdq_stat_reg) { rst_ing_reg = hns3_read_dev(hw, HNS3_FUN_RST_ING); hns3_warn(hw, "resetting reg: 0x%x", rst_ing_reg); @@ -1194,7 +1194,8 @@ ret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_VLAN, HNS3_MBX_VLAN_RX_OFF_CFG, &msg_data, sizeof(msg_data), false, NULL, 0); if (ret) - hns3_err(hw, "vf enable strip failed, ret =%d", ret); + hns3_err(hw, "vf %s strip failed, ret = %d.", + enable ? "enable" : "disable", ret); return ret; } @@ -1631,7 +1632,7 @@ /* Disable datapath on secondary process. */ hns3_mp_req_stop_rxtx(dev); /* Prevent crashes when queues are still in use. */ - rte_delay_ms(hw->tqps_num); + rte_delay_ms(hw->cfg_max_queues); rte_spinlock_lock(&hw->lock); if (rte_atomic16_read(&hw->reset.resetting) == 0) { @@ -2005,7 +2006,7 @@ rte_wmb(); /* Disable datapath on secondary process. */ hns3_mp_req_stop_rxtx(eth_dev); - rte_delay_ms(hw->tqps_num); + rte_delay_ms(hw->cfg_max_queues); rte_spinlock_lock(&hw->lock); if (hw->adapter_state == HNS3_NIC_STARTED || @@ -2155,7 +2156,7 @@ msec = tv_delta.tv_sec * MSEC_PER_SEC + tv_delta.tv_usec / USEC_PER_MSEC; if (msec > HNS3_RESET_PROCESS_MS) - hns3_err(hw, "%d handle long time delta %" PRIx64 + hns3_err(hw, "%d handle long time delta %" PRIu64 " ms time=%ld.%.6ld", hw->reset.level, msec, tv.tv_sec, tv.tv_usec); } diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_fdir.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_fdir.c --- dpdk-19.11.7/drivers/net/hns3/hns3_fdir.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_fdir.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include @@ -1012,6 +1012,10 @@ rte_hash_reset(fdir_info->hash_handle); rte_spinlock_unlock(&fdir_info->flows_lock); + memset(fdir_info->hash_map, 0, + sizeof(struct hns3_fdir_rule_ele *) * + fdir_info->fd_cfg.rule_num[HNS3_FD_STAGE_1]); + fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list); while (fdir_filter) { TAILQ_REMOVE(&fdir_info->fdir_list, fdir_filter, entries); diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_fdir.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_fdir.h --- dpdk-19.11.7/drivers/net/hns3/hns3_fdir.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_fdir.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_FDIR_H_ diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_flow.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_flow.c --- dpdk-19.11.7/drivers/net/hns3/hns3_flow.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_flow.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include @@ -120,7 +120,10 @@ { struct hns3_adapter *hns = dev->data->dev_private; struct hns3_pf *pf = &hns->pf; + struct hns3_hw *hw = &hns->hw; struct hns3_flow_counter *cnt; + uint64_t value; + int ret; cnt = hns3_counter_lookup(dev, id); if (cnt) { @@ -133,6 +136,13 @@ return 0; } + /* Clear the counter by read ops because the counter is read-clear */ + ret = hns3_get_count(hw, id, &value); + if (ret) + return rte_flow_error_set(error, EIO, + RTE_FLOW_ERROR_TYPE_HANDLE, NULL, + "Clear counter failed!"); + cnt = rte_zmalloc("hns3 counter", sizeof(*cnt), 0); if (cnt == NULL) return rte_flow_error_set(error, ENOMEM, @@ -176,6 +186,8 @@ } qc->hits_set = 1; qc->hits = value; + qc->bytes_set = 0; + qc->bytes = 0; return 0; } @@ -1063,42 +1075,29 @@ } /* - * Parse the rule to see if it is a IP or MAC VLAN flow director rule. - * And get the flow director filter info BTW. - * UDP/TCP/SCTP PATTERN: - * The first not void item can be ETH or IPV4 or IPV6 - * The second not void item must be IPV4 or IPV6 if the first one is ETH. - * The next not void item could be UDP or TCP or SCTP (optional) - * The next not void item could be RAW (for flexbyte, optional) - * The next not void item must be END. - * A Fuzzy Match pattern can appear at any place before END. - * Fuzzy Match is optional for IPV4 but is required for IPV6 - * MAC VLAN PATTERN: - * The first not void item must be ETH. - * The second not void item must be MAC VLAN. - * The next not void item must be END. - * ACTION: - * The first not void action should be QUEUE or DROP. - * The second not void optional action should be MARK, - * mark_id is a uint32_t number. - * The next not void action should be END. - * UDP/TCP/SCTP pattern example: - * ITEM Spec Mask - * ETH NULL NULL - * IPV4 src_addr 192.168.1.20 0xFFFFFFFF - * dst_addr 192.167.3.50 0xFFFFFFFF - * UDP/TCP/SCTP src_port 80 0xFFFF - * dst_port 80 0xFFFF - * END - * MAC VLAN pattern example: - * ITEM Spec Mask - * ETH dst_addr - {0xAC, 0x7B, 0xA1, {0xFF, 0xFF, 0xFF, - 0x2C, 0x6D, 0x36} 0xFF, 0xFF, 0xFF} - * MAC VLAN tci 0x2016 0xEFFF - * END - * Other members in mask and spec should set to 0x00. - * Item->last should be NULL. + * Parse the flow director rule. + * The supported PATTERN: + * case: non-tunnel packet: + * ETH : src-mac, dst-mac, ethertype + * VLAN: tag1, tag2 + * IPv4: src-ip, dst-ip, tos, proto + * IPv6: src-ip(last 32 bit addr), dst-ip(last 32 bit addr), proto + * UDP : src-port, dst-port + * TCP : src-port, dst-port + * SCTP: src-port, dst-port, tag + * case: tunnel packet: + * OUTER-ETH: ethertype + * OUTER-L3 : proto + * OUTER-L4 : src-port, dst-port + * TUNNEL : vni, flow-id(only valid when NVGRE) + * INNER-ETH/VLAN/IPv4/IPv6/UDP/TCP/SCTP: same as non-tunnel packet + * The supported ACTION: + * QUEUE + * DROP + * COUNT + * MARK: the id range [0, 4094] + * FLAG + * RSS: only valid if firmware support FD_QUEUE_REGION. */ static int hns3_parse_fdir_filter(struct rte_eth_dev *dev, diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_intr.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_intr.c --- dpdk-19.11.7/drivers/net/hns3/hns3_intr.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_intr.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include @@ -855,7 +855,7 @@ static bool hns3_reset_err_handle(struct hns3_adapter *hns) { -#define MAX_RESET_FAIL_CNT 5 +#define MAX_RESET_FAIL_CNT 30 struct hns3_hw *hw = &hns->hw; @@ -949,7 +949,7 @@ static int hns3_reset_post(struct hns3_adapter *hns) { -#define TIMEOUT_RETRIES_CNT 5 +#define TIMEOUT_RETRIES_CNT 30 struct hns3_hw *hw = &hns->hw; struct timeval tv_delta; struct timeval tv; diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_intr.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_intr.h --- dpdk-19.11.7/drivers/net/hns3/hns3_intr.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_intr.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_INTR_H_ diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_logs.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_logs.h --- dpdk-19.11.7/drivers/net/hns3/hns3_logs.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_logs.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_LOGS_H_ diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_mbx.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_mbx.c --- dpdk-19.11.7/drivers/net/hns3/hns3_mbx.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_mbx.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include @@ -184,6 +184,7 @@ hw->mbx_resp.head++; ret = hns3_cmd_send(hw, &desc, 1); if (ret) { + hw->mbx_resp.head--; rte_spinlock_unlock(&hw->mbx_resp.lock); hns3_err(hw, "VF failed(=%d) to send mbx message to PF", ret); @@ -314,8 +315,8 @@ } static void -hns3_handle_link_change_event(struct hns3_hw *hw, - struct hns3_mbx_pf_to_vf_cmd *req) +hns3pf_handle_link_change_event(struct hns3_hw *hw, + struct hns3_mbx_vf_to_pf_cmd *req) { #define LINK_STATUS_OFFSET 1 #define LINK_FAIL_CODE_OFFSET 2 @@ -382,11 +383,17 @@ hns3_mbx_handler(hw); break; case HNS3_MBX_PUSH_LINK_STATUS: - hns3_handle_link_change_event(hw, req); + /* + * This message is reported by the firmware and is + * reported in 'struct hns3_mbx_vf_to_pf_cmd' format. + * Therefore, we should cast the req variable to + * 'struct hns3_mbx_vf_to_pf_cmd' and then process it. + */ + hns3pf_handle_link_change_event(hw, + (struct hns3_mbx_vf_to_pf_cmd *)req); break; default: - hns3_err(hw, - "VF received unsupported(%d) mbx msg from PF", + hns3_err(hw, "received unsupported(%d) mbx msg", req->msg[0]); break; } diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_mbx.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_mbx.h --- dpdk-19.11.7/drivers/net/hns3/hns3_mbx.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_mbx.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,12 +1,10 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_MBX_H_ #define _HNS3_MBX_H_ -#define HNS3_MBX_VF_MSG_DATA_NUM 16 - enum HNS3_MBX_OPCODE { HNS3_MBX_RESET = 0x01, /* (VF -> PF) assert reset */ HNS3_MBX_ASSERTING_RESET, /* (PF -> VF) PF is asserting reset */ @@ -75,8 +73,6 @@ #define HNS3_MBX_MAX_MSG_SIZE 16 #define HNS3_MBX_MAX_RESP_DATA_SIZE 8 -#define HNS3_MBX_RING_MAP_BASIC_MSG_NUM 3 -#define HNS3_MBX_RING_NODE_VARIABLE_NUM 3 struct hns3_mbx_resp_status { rte_spinlock_t lock; /* protects against contending sync cmd resp */ @@ -126,12 +122,6 @@ struct hns3_ring_chain_param param[HNS3_MBX_MAX_RING_CHAIN_PARAM_NUM]; }; -struct hns3_vf_rst_cmd { - uint8_t dest_vfid; - uint8_t vf_rst; - uint8_t rsv[22]; -}; - struct hns3_pf_rst_done_cmd { uint8_t pf_rst_done; uint8_t rsv[23]; diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_mp.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_mp.c --- dpdk-19.11.7/drivers/net/hns3/hns3_mp.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_mp.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include @@ -88,8 +88,8 @@ case HNS3_MP_REQ_START_RXTX: PMD_INIT_LOG(INFO, "port %u starting datapath", dev->data->port_id); - rte_mb(); hns3_set_rxtx_function(dev); + rte_mb(); mp_init_msg(dev, &mp_res, param->type); res->result = 0; ret = rte_mp_reply(&mp_res, peer); @@ -132,7 +132,7 @@ int ret; int i; - if (!hw->secondary_cnt) + if (rte_eal_process_type() == RTE_PROC_SECONDARY || !hw->secondary_cnt) return; if (type != HNS3_MP_REQ_START_RXTX && type != HNS3_MP_REQ_STOP_RXTX) { hns3_err(hw, "port %u unknown request (req_type %d)", diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_mp.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_mp.h --- dpdk-19.11.7/drivers/net/hns3/hns3_mp.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_mp.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_MP_H_ diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_regs.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_regs.c --- dpdk-19.11.7/drivers/net/hns3/hns3_regs.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_regs.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include @@ -336,11 +336,6 @@ uint32_t *data; int ret; - if (regs == NULL) { - hns3_err(hw, "the input parameter regs is NULL!"); - return -EINVAL; - } - ret = hns3_get_regs_length(hw, &length); if (ret) return ret; @@ -356,6 +351,8 @@ if (regs->length && regs->length != length) return -ENOTSUP; + regs->version = hw->fw_version; + /* fetching per-PF registers values from PF PCIe register space */ data += hns3_direct_access_regs(hw, data); diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_regs.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_regs.h --- dpdk-19.11.7/drivers/net/hns3/hns3_regs.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_regs.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_REGS_H_ diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_rss.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_rss.c --- dpdk-19.11.7/drivers/net/hns3/hns3_rss.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_rss.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_rss.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_rss.h --- dpdk-19.11.7/drivers/net/hns3/hns3_rss.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_rss.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_RSS_H_ diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_rxtx.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_rxtx.c --- dpdk-19.11.7/drivers/net/hns3/hns3_rxtx.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_rxtx.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include @@ -2222,6 +2222,7 @@ uint32_t tmp; /* Enable L4 checksum offloads */ switch (ol_flags & PKT_TX_L4_MASK) { + case PKT_TX_TCP_CKSUM | PKT_TX_TCP_SEG: case PKT_TX_TCP_CKSUM: tmp = *type_cs_vlan_tso_len; tmp |= hns3_gen_field_val(HNS3_TXD_L4T_M, HNS3_TXD_L4T_S, @@ -2431,6 +2432,6 @@ } else { eth_dev->rx_pkt_burst = hns3_dummy_rxtx_burst; eth_dev->tx_pkt_burst = hns3_dummy_rxtx_burst; - eth_dev->tx_pkt_prepare = hns3_dummy_rxtx_burst; + eth_dev->tx_pkt_prepare = NULL; } } diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_rxtx.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_rxtx.h --- dpdk-19.11.7/drivers/net/hns3/hns3_rxtx.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_rxtx.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_RXTX_H_ @@ -78,9 +78,6 @@ #define HNS3_RXD_LUM_B 9 #define HNS3_RXD_CRCP_B 10 #define HNS3_RXD_L3L4P_B 11 -#define HNS3_RXD_TSIND_S 12 -#define HNS3_RXD_TSIND_M (0x7 << HNS3_RXD_TSIND_S) -#define HNS3_RXD_LKBK_B 15 #define HNS3_RXD_GRO_SIZE_S 16 #define HNS3_RXD_GRO_SIZE_M (0x3ff << HNS3_RXD_GRO_SIZE_S) diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_stats.c dpdk-19.11.10~rc1/drivers/net/hns3/hns3_stats.c --- dpdk-19.11.7/drivers/net/hns3/hns3_stats.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_stats.c 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #include diff -Nru dpdk-19.11.7/drivers/net/hns3/hns3_stats.h dpdk-19.11.10~rc1/drivers/net/hns3/hns3_stats.h --- dpdk-19.11.7/drivers/net/hns3/hns3_stats.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/hns3/hns3_stats.h 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2019 HiSilicon Limited. */ #ifndef _HNS3_STATS_H_ diff -Nru dpdk-19.11.7/drivers/net/i40e/base/virtchnl.h dpdk-19.11.10~rc1/drivers/net/i40e/base/virtchnl.h --- dpdk-19.11.7/drivers/net/i40e/base/virtchnl.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/i40e/base/virtchnl.h 2021-08-18 14:45:29.000000000 +0000 @@ -388,9 +388,36 @@ * PF removes the filters and returns status. */ +/* VIRTCHNL_ETHER_ADDR_LEGACY + * Prior to adding the @type member to virtchnl_ether_addr, there were 2 pad + * bytes. Moving forward all VF drivers should not set type to + * VIRTCHNL_ETHER_ADDR_LEGACY. This is only here to not break previous/legacy + * behavior. The control plane function (i.e. PF) can use a best effort method + * of tracking the primary/device unicast in this case, but there is no + * guarantee and functionality depends on the implementation of the PF. + */ + +/* VIRTCHNL_ETHER_ADDR_PRIMARY + * All VF drivers should set @type to VIRTCHNL_ETHER_ADDR_PRIMARY for the + * primary/device unicast MAC address filter for VIRTCHNL_OP_ADD_ETH_ADDR and + * VIRTCHNL_OP_DEL_ETH_ADDR. This allows for the underlying control plane + * function (i.e. PF) to accurately track and use this MAC address for + * displaying on the host and for VM/function reset. + */ + +/* VIRTCHNL_ETHER_ADDR_EXTRA + * All VF drivers should set @type to VIRTCHNL_ETHER_ADDR_EXTRA for any extra + * unicast and/or multicast filters that are being added/deleted via + * VIRTCHNL_OP_DEL_ETH_ADDR/VIRTCHNL_OP_ADD_ETH_ADDR respectively. + */ struct virtchnl_ether_addr { u8 addr[VIRTCHNL_ETH_LENGTH_OF_ADDRESS]; - u8 pad[2]; + u8 type; +#define VIRTCHNL_ETHER_ADDR_LEGACY 0 +#define VIRTCHNL_ETHER_ADDR_PRIMARY 1 +#define VIRTCHNL_ETHER_ADDR_EXTRA 2 +#define VIRTCHNL_ETHER_ADDR_TYPE_MASK 3 /* first two bits of type are valid */ + u8 pad; }; VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_ether_addr); diff -Nru dpdk-19.11.7/drivers/net/i40e/i40e_ethdev.c dpdk-19.11.10~rc1/drivers/net/i40e/i40e_ethdev.c --- dpdk-19.11.7/drivers/net/i40e/i40e_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/i40e/i40e_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -201,12 +201,12 @@ #define I40E_TRANSLATE_INSET 0 #define I40E_TRANSLATE_REG 1 -#define I40E_INSET_IPV4_TOS_MASK 0x0009FF00UL -#define I40E_INSET_IPv4_TTL_MASK 0x000D00FFUL -#define I40E_INSET_IPV4_PROTO_MASK 0x000DFF00UL -#define I40E_INSET_IPV6_TC_MASK 0x0009F00FUL -#define I40E_INSET_IPV6_HOP_LIMIT_MASK 0x000CFF00UL -#define I40E_INSET_IPV6_NEXT_HDR_MASK 0x000C00FFUL +#define I40E_INSET_IPV4_TOS_MASK 0x0000FF00UL +#define I40E_INSET_IPV4_TTL_MASK 0x000000FFUL +#define I40E_INSET_IPV4_PROTO_MASK 0x0000FF00UL +#define I40E_INSET_IPV6_TC_MASK 0x0000F00FUL +#define I40E_INSET_IPV6_HOP_LIMIT_MASK 0x0000FF00UL +#define I40E_INSET_IPV6_NEXT_HDR_MASK 0x000000FFUL /* PCI offset for querying capability */ #define PCI_DEV_CAP_REG 0xA4 @@ -219,6 +219,25 @@ /* Bit mask of Extended Tag enable/disable */ #define PCI_DEV_CTRL_EXT_TAG_MASK (1 << PCI_DEV_CTRL_EXT_TAG_SHIFT) +#define I40E_GLQF_PIT_IPV4_START 2 +#define I40E_GLQF_PIT_IPV4_COUNT 2 +#define I40E_GLQF_PIT_IPV6_START 4 +#define I40E_GLQF_PIT_IPV6_COUNT 2 + +#define I40E_GLQF_PIT_SOURCE_OFF_GET(a) \ + (((a) & I40E_GLQF_PIT_SOURCE_OFF_MASK) >> \ + I40E_GLQF_PIT_SOURCE_OFF_SHIFT) + +#define I40E_GLQF_PIT_DEST_OFF_GET(a) \ + (((a) & I40E_GLQF_PIT_DEST_OFF_MASK) >> \ + I40E_GLQF_PIT_DEST_OFF_SHIFT) + +#define I40E_GLQF_PIT_FSIZE_GET(a) (((a) & I40E_GLQF_PIT_FSIZE_MASK) >> \ + I40E_GLQF_PIT_FSIZE_SHIFT) + +#define I40E_GLQF_PIT_BUILD(off, mask) (((off) << 16) | (mask)) +#define I40E_FDIR_FIELD_OFFSET(a) ((a) >> 1) + static int eth_i40e_dev_init(struct rte_eth_dev *eth_dev, void *init_params); static int eth_i40e_dev_uninit(struct rte_eth_dev *eth_dev); static int i40e_dev_configure(struct rte_eth_dev *dev); @@ -722,10 +741,11 @@ uint32_t reg_val) { uint32_t ori_reg_val; - struct rte_eth_dev *dev; + struct rte_eth_dev_data *dev_data = + ((struct i40e_adapter *)hw->back)->pf.dev_data; + struct rte_eth_dev *dev = &rte_eth_devices[dev_data->port_id]; ori_reg_val = i40e_read_rx_ctl(hw, reg_addr); - dev = ((struct i40e_adapter *)hw->back)->eth_dev; i40e_write_rx_ctl(hw, reg_addr, reg_val); if (ori_reg_val != reg_val) PMD_DRV_LOG(WARNING, @@ -844,6 +864,8 @@ idx = strtoul(floating_veb_value, &end, 10); if (errno || end == NULL) return -1; + if (idx < 0) + return -1; while (isblank(*end)) end++; if (*end == '-') { @@ -1210,7 +1232,9 @@ struct i40e_asq_cmd_details *cmd_details) { uint64_t ori_reg_val; - struct rte_eth_dev *dev; + struct rte_eth_dev_data *dev_data = + ((struct i40e_adapter *)hw->back)->pf.dev_data; + struct rte_eth_dev *dev = &rte_eth_devices[dev_data->port_id]; int ret; ret = i40e_aq_debug_read_register(hw, reg_addr, &ori_reg_val, NULL); @@ -1220,7 +1244,6 @@ reg_addr); return -EIO; } - dev = ((struct i40e_adapter *)hw->back)->eth_dev; if (ori_reg_val != reg_val) PMD_DRV_LOG(WARNING, @@ -1390,7 +1413,6 @@ rte_eth_copy_pci_info(dev, pci_dev); pf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); - pf->adapter->eth_dev = dev; pf->dev_data = dev->data; hw->back = I40E_PF_TO_ADAPTER(pf); @@ -1910,7 +1932,7 @@ void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi) { - struct rte_eth_dev *dev = vsi->adapter->eth_dev; + struct rte_eth_dev *dev = I40E_VSI_TO_ETH_DEV(vsi); struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; struct i40e_hw *hw = I40E_VSI_TO_HW(vsi); @@ -2026,7 +2048,7 @@ int i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) { - struct rte_eth_dev *dev = vsi->adapter->eth_dev; + struct rte_eth_dev *dev = I40E_VSI_TO_ETH_DEV(vsi); struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; struct i40e_hw *hw = I40E_VSI_TO_HW(vsi); @@ -2102,7 +2124,7 @@ void i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi) { - struct rte_eth_dev *dev = vsi->adapter->eth_dev; + struct rte_eth_dev *dev = I40E_VSI_TO_ETH_DEV(vsi); struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; struct i40e_hw *hw = I40E_VSI_TO_HW(vsi); @@ -2129,7 +2151,7 @@ void i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi) { - struct rte_eth_dev *dev = vsi->adapter->eth_dev; + struct rte_eth_dev *dev = I40E_VSI_TO_ETH_DEV(vsi); struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; struct i40e_hw *hw = I40E_VSI_TO_HW(vsi); @@ -2531,6 +2553,8 @@ int retries = 0; PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; ret = rte_eth_switch_domain_free(pf->switch_domain_id); if (ret) @@ -4581,13 +4605,15 @@ u64 size, u32 alignment) { + static uint64_t i40e_dma_memzone_id; const struct rte_memzone *mz = NULL; char z_name[RTE_MEMZONE_NAMESIZE]; if (!mem) return I40E_ERR_PARAM; - snprintf(z_name, sizeof(z_name), "i40e_dma_%"PRIu64, rte_rand()); + snprintf(z_name, sizeof(z_name), "i40e_dma_%" PRIu64, + __atomic_fetch_add(&i40e_dma_memzone_id, 1, __ATOMIC_RELAXED)); mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY, RTE_MEMZONE_IOVA_CONTIG, alignment, RTE_PGSIZE_2M); if (!mz) @@ -6444,8 +6470,7 @@ break; } if (ret == I40E_SUCCESS) - i40e_set_tx_function(container_of(pf, struct i40e_adapter, pf) - ->eth_dev); + i40e_set_tx_function(&rte_eth_devices[pf->dev_data->port_id]); return ret; } @@ -6473,8 +6498,7 @@ } } if (ret == I40E_SUCCESS) - i40e_set_rx_function(container_of(pf, struct i40e_adapter, pf) - ->eth_dev); + i40e_set_rx_function(&rte_eth_devices[pf->dev_data->port_id]); return ret; } @@ -7955,7 +7979,7 @@ struct i40e_aqc_replace_cloud_filters_cmd filter_replace; struct i40e_aqc_replace_cloud_filters_cmd_buf filter_replace_buf; struct i40e_hw *hw = I40E_PF_TO_HW(pf); - struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev; + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; enum i40e_status_code status = I40E_SUCCESS; if (pf->support_multi_driver) { @@ -8016,7 +8040,7 @@ struct i40e_aqc_replace_cloud_filters_cmd filter_replace; struct i40e_aqc_replace_cloud_filters_cmd_buf filter_replace_buf; struct i40e_hw *hw = I40E_PF_TO_HW(pf); - struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev; + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; enum i40e_status_code status = I40E_SUCCESS; if (pf->support_multi_driver) { @@ -8091,7 +8115,7 @@ struct i40e_aqc_replace_cloud_filters_cmd filter_replace; struct i40e_aqc_replace_cloud_filters_cmd_buf filter_replace_buf; struct i40e_hw *hw = I40E_PF_TO_HW(pf); - struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev; + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; enum i40e_status_code status = I40E_SUCCESS; if (pf->support_multi_driver) { @@ -8179,7 +8203,7 @@ struct i40e_aqc_replace_cloud_filters_cmd filter_replace; struct i40e_aqc_replace_cloud_filters_cmd_buf filter_replace_buf; struct i40e_hw *hw = I40E_PF_TO_HW(pf); - struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev; + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; enum i40e_status_code status = I40E_SUCCESS; if (pf->support_multi_driver) { @@ -9628,49 +9652,116 @@ return val; } +static int +i40e_get_inset_field_offset(struct i40e_hw *hw, uint32_t pit_reg_start, + uint32_t pit_reg_count, uint32_t hdr_off) +{ + const uint32_t pit_reg_end = pit_reg_start + pit_reg_count; + uint32_t field_off = I40E_FDIR_FIELD_OFFSET(hdr_off); + uint32_t i, reg_val, src_off, count; + + for (i = pit_reg_start; i < pit_reg_end; i++) { + reg_val = i40e_read_rx_ctl(hw, I40E_GLQF_PIT(i)); + + src_off = I40E_GLQF_PIT_SOURCE_OFF_GET(reg_val); + count = I40E_GLQF_PIT_FSIZE_GET(reg_val); + + if (src_off <= field_off && (src_off + count) > field_off) + break; + } + + if (i >= pit_reg_end) { + PMD_DRV_LOG(ERR, + "Hardware GLQF_PIT configuration does not support this field mask"); + return -1; + } + + return I40E_GLQF_PIT_DEST_OFF_GET(reg_val) + field_off - src_off; +} + int -i40e_generate_inset_mask_reg(uint64_t inset, uint32_t *mask, uint8_t nb_elem) +i40e_generate_inset_mask_reg(struct i40e_hw *hw, uint64_t inset, + uint32_t *mask, uint8_t nb_elem) { - uint8_t i, idx = 0; - uint64_t inset_need_mask = inset; + static const uint64_t mask_inset[] = { + I40E_INSET_IPV4_PROTO | I40E_INSET_IPV4_TTL, + I40E_INSET_IPV6_NEXT_HDR | I40E_INSET_IPV6_HOP_LIMIT }; static const struct { uint64_t inset; uint32_t mask; - } inset_mask_map[] = { - {I40E_INSET_IPV4_TOS, I40E_INSET_IPV4_TOS_MASK}, - {I40E_INSET_IPV4_PROTO | I40E_INSET_IPV4_TTL, 0}, - {I40E_INSET_IPV4_PROTO, I40E_INSET_IPV4_PROTO_MASK}, - {I40E_INSET_IPV4_TTL, I40E_INSET_IPv4_TTL_MASK}, - {I40E_INSET_IPV6_TC, I40E_INSET_IPV6_TC_MASK}, - {I40E_INSET_IPV6_NEXT_HDR | I40E_INSET_IPV6_HOP_LIMIT, 0}, - {I40E_INSET_IPV6_NEXT_HDR, I40E_INSET_IPV6_NEXT_HDR_MASK}, - {I40E_INSET_IPV6_HOP_LIMIT, I40E_INSET_IPV6_HOP_LIMIT_MASK}, + uint32_t offset; + } inset_mask_offset_map[] = { + { I40E_INSET_IPV4_TOS, I40E_INSET_IPV4_TOS_MASK, + offsetof(struct rte_ipv4_hdr, type_of_service) }, + + { I40E_INSET_IPV4_PROTO, I40E_INSET_IPV4_PROTO_MASK, + offsetof(struct rte_ipv4_hdr, next_proto_id) }, + + { I40E_INSET_IPV4_TTL, I40E_INSET_IPV4_TTL_MASK, + offsetof(struct rte_ipv4_hdr, time_to_live) }, + + { I40E_INSET_IPV6_TC, I40E_INSET_IPV6_TC_MASK, + offsetof(struct rte_ipv6_hdr, vtc_flow) }, + + { I40E_INSET_IPV6_NEXT_HDR, I40E_INSET_IPV6_NEXT_HDR_MASK, + offsetof(struct rte_ipv6_hdr, proto) }, + + { I40E_INSET_IPV6_HOP_LIMIT, I40E_INSET_IPV6_HOP_LIMIT_MASK, + offsetof(struct rte_ipv6_hdr, hop_limits) }, }; - if (!inset || !mask || !nb_elem) + uint32_t i; + int idx = 0; + + assert(mask); + if (!inset) return 0; - for (i = 0, idx = 0; i < RTE_DIM(inset_mask_map); i++) { + for (i = 0; i < RTE_DIM(mask_inset); i++) { /* Clear the inset bit, if no MASK is required, * for example proto + ttl */ - if ((inset & inset_mask_map[i].inset) == - inset_mask_map[i].inset && inset_mask_map[i].mask == 0) - inset_need_mask &= ~inset_mask_map[i].inset; - if (!inset_need_mask) - return 0; + if ((mask_inset[i] & inset) == mask_inset[i]) { + inset &= ~mask_inset[i]; + if (!inset) + return 0; + } } - for (i = 0, idx = 0; i < RTE_DIM(inset_mask_map); i++) { - if ((inset_need_mask & inset_mask_map[i].inset) == - inset_mask_map[i].inset) { - if (idx >= nb_elem) { - PMD_DRV_LOG(ERR, "exceed maximal number of bitmasks"); - return -EINVAL; - } - mask[idx] = inset_mask_map[i].mask; - idx++; + + for (i = 0; i < RTE_DIM(inset_mask_offset_map); i++) { + uint32_t pit_start, pit_count; + int offset; + + if (!(inset_mask_offset_map[i].inset & inset)) + continue; + + if (inset_mask_offset_map[i].inset & + (I40E_INSET_IPV4_TOS | I40E_INSET_IPV4_PROTO | + I40E_INSET_IPV4_TTL)) { + pit_start = I40E_GLQF_PIT_IPV4_START; + pit_count = I40E_GLQF_PIT_IPV4_COUNT; + } else { + pit_start = I40E_GLQF_PIT_IPV6_START; + pit_count = I40E_GLQF_PIT_IPV6_COUNT; } + + offset = i40e_get_inset_field_offset(hw, pit_start, pit_count, + inset_mask_offset_map[i].offset); + + if (offset < 0) + return -EINVAL; + + if (idx >= nb_elem) { + PMD_DRV_LOG(ERR, + "Configuration of inset mask out of range %u", + nb_elem); + return -ERANGE; + } + + mask[idx] = I40E_GLQF_PIT_BUILD((uint32_t)offset, + inset_mask_offset_map[i].mask); + idx++; } return idx; @@ -9692,9 +9783,10 @@ i40e_check_write_global_reg(struct i40e_hw *hw, uint32_t addr, uint32_t val) { uint32_t reg = i40e_read_rx_ctl(hw, addr); - struct rte_eth_dev *dev; + struct rte_eth_dev_data *dev_data = + ((struct i40e_adapter *)hw->back)->pf.dev_data; + struct rte_eth_dev *dev = &rte_eth_devices[dev_data->port_id]; - dev = ((struct i40e_adapter *)hw->back)->eth_dev; if (reg != val) { i40e_write_rx_ctl(hw, addr, val); PMD_DRV_LOG(WARNING, @@ -9724,7 +9816,7 @@ input_set = i40e_get_default_input_set(pctype); - num = i40e_generate_inset_mask_reg(input_set, mask_reg, + num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg, I40E_INSET_MASK_NUM_REG); if (num < 0) return; @@ -9829,7 +9921,7 @@ inset_reg |= i40e_read_rx_ctl(hw, I40E_GLQF_HASH_INSET(0, pctype)); input_set |= pf->hash_input_set[pctype]; } - num = i40e_generate_inset_mask_reg(input_set, mask_reg, + num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg, I40E_INSET_MASK_NUM_REG); if (num < 0) return -EINVAL; @@ -9902,7 +9994,7 @@ inset_reg &= I40E_REG_INSET_FLEX_PAYLOAD_WORDS; else input_set |= pf->fdir.input_set[pctype]; - num = i40e_generate_inset_mask_reg(input_set, mask_reg, + num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg, I40E_INSET_MASK_NUM_REG); if (num < 0) return -EINVAL; @@ -12043,9 +12135,6 @@ uint32_t value = 0; uint32_t i; - if (!info || !info->length || !info->data) - return -EINVAL; - if (hw->phy.link_info.module_type[0] == I40E_MODULE_TYPE_SFP) is_sfp = true; @@ -12713,7 +12802,7 @@ struct i40e_aqc_replace_cloud_filters_cmd filter_replace; struct i40e_aqc_replace_cloud_filters_cmd_buf filter_replace_buf; struct i40e_hw *hw = I40E_PF_TO_HW(pf); - struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev; + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; if (pf->support_multi_driver) { PMD_DRV_LOG(ERR, "Replace cloud filter is not supported."); diff -Nru dpdk-19.11.7/drivers/net/i40e/i40e_ethdev.h dpdk-19.11.10~rc1/drivers/net/i40e/i40e_ethdev.h --- dpdk-19.11.7/drivers/net/i40e/i40e_ethdev.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/i40e/i40e_ethdev.h 2021-08-18 14:45:29.000000000 +0000 @@ -88,8 +88,10 @@ do { \ uint32_t ori_val; \ struct rte_eth_dev *dev; \ + struct rte_eth_dev_data *dev_data; \ ori_val = I40E_READ_REG((hw), (reg)); \ - dev = ((struct i40e_adapter *)hw->back)->eth_dev; \ + dev_data = ((struct i40e_adapter *)hw->back)->pf.dev_data; \ + dev = &rte_eth_devices[dev_data->port_id]; \ I40E_PCI_REG_WRITE(I40E_PCI_REG_ADDR((hw), \ (reg)), (value)); \ if (ori_val != value) \ @@ -1101,7 +1103,6 @@ struct i40e_adapter { /* Common for both PF and VF */ struct i40e_hw hw; - struct rte_eth_dev *eth_dev; /* Specific for PF or VF */ union { @@ -1276,8 +1277,8 @@ int i40e_validate_input_set(enum i40e_filter_pctype pctype, enum rte_filter_type filter, uint64_t inset); -int i40e_generate_inset_mask_reg(uint64_t inset, uint32_t *mask, - uint8_t nb_elem); +int i40e_generate_inset_mask_reg(struct i40e_hw *hw, uint64_t inset, + uint32_t *mask, uint8_t nb_elem); uint64_t i40e_translate_input_set_reg(enum i40e_mac_type type, uint64_t input); void i40e_check_write_reg(struct i40e_hw *hw, uint32_t addr, uint32_t val); void i40e_check_write_global_reg(struct i40e_hw *hw, @@ -1352,7 +1353,7 @@ #define I40E_VSI_TO_DEV_DATA(vsi) \ (((struct i40e_vsi *)vsi)->adapter->pf.dev_data) #define I40E_VSI_TO_ETH_DEV(vsi) \ - (((struct i40e_vsi *)vsi)->adapter->eth_dev) + (&rte_eth_devices[((struct i40e_vsi *)vsi)->adapter->pf.dev_data->port_id]) /* I40E_PF_TO */ #define I40E_PF_TO_HW(pf) \ diff -Nru dpdk-19.11.7/drivers/net/i40e/i40e_ethdev_vf.c dpdk-19.11.10~rc1/drivers/net/i40e/i40e_ethdev_vf.c --- dpdk-19.11.7/drivers/net/i40e/i40e_ethdev_vf.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/i40e/i40e_ethdev_vf.c 2021-08-18 14:45:29.000000000 +0000 @@ -106,6 +106,9 @@ uint16_t tx_queue_id); static int i40evf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); +static int i40evf_add_del_eth_addr(struct rte_eth_dev *dev, + struct rte_ether_addr *addr, + bool add, uint8_t type); static int i40evf_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *addr, uint32_t index, @@ -801,10 +804,9 @@ } static int -i40evf_add_mac_addr(struct rte_eth_dev *dev, - struct rte_ether_addr *addr, - __rte_unused uint32_t index, - __rte_unused uint32_t pool) +i40evf_add_del_eth_addr(struct rte_eth_dev *dev, + struct rte_ether_addr *addr, + bool add, uint8_t type) { struct virtchnl_ether_addr_list *list; struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); @@ -813,83 +815,70 @@ int err; struct vf_cmd_info args; - if (rte_is_zero_ether_addr(addr)) { - PMD_DRV_LOG(ERR, "Invalid mac:%x:%x:%x:%x:%x:%x", - addr->addr_bytes[0], addr->addr_bytes[1], - addr->addr_bytes[2], addr->addr_bytes[3], - addr->addr_bytes[4], addr->addr_bytes[5]); - return I40E_ERR_INVALID_MAC_ADDR; - } - list = (struct virtchnl_ether_addr_list *)cmd_buffer; list->vsi_id = vf->vsi_res->vsi_id; list->num_elements = 1; + list->list[0].type = type; rte_memcpy(list->list[0].addr, addr->addr_bytes, sizeof(addr->addr_bytes)); - args.ops = VIRTCHNL_OP_ADD_ETH_ADDR; + args.ops = add ? VIRTCHNL_OP_ADD_ETH_ADDR : VIRTCHNL_OP_DEL_ETH_ADDR; args.in_args = cmd_buffer; args.in_args_size = sizeof(cmd_buffer); args.out_buffer = vf->aq_resp; args.out_size = I40E_AQ_BUF_SZ; err = i40evf_execute_vf_cmd(dev, &args); if (err) - PMD_DRV_LOG(ERR, "fail to execute command " - "OP_ADD_ETHER_ADDRESS"); - else - vf->vsi.mac_num++; - + PMD_DRV_LOG(ERR, "fail to execute command %s", + add ? "OP_ADD_ETH_ADDR" : "OP_DEL_ETH_ADDR"); return err; } -static void -i40evf_del_mac_addr_by_addr(struct rte_eth_dev *dev, - struct rte_ether_addr *addr) +static int +i40evf_add_mac_addr(struct rte_eth_dev *dev, + struct rte_ether_addr *addr, + __rte_unused uint32_t index, + __rte_unused uint32_t pool) { - struct virtchnl_ether_addr_list *list; struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); - uint8_t cmd_buffer[sizeof(struct virtchnl_ether_addr_list) + \ - sizeof(struct virtchnl_ether_addr)]; int err; - struct vf_cmd_info args; - if (i40e_validate_mac_addr(addr->addr_bytes) != I40E_SUCCESS) { - PMD_DRV_LOG(ERR, "Invalid mac:%x-%x-%x-%x-%x-%x", + if (rte_is_zero_ether_addr(addr)) { + PMD_DRV_LOG(ERR, "Invalid mac:%x:%x:%x:%x:%x:%x", addr->addr_bytes[0], addr->addr_bytes[1], addr->addr_bytes[2], addr->addr_bytes[3], addr->addr_bytes[4], addr->addr_bytes[5]); - return; + return I40E_ERR_INVALID_MAC_ADDR; } - list = (struct virtchnl_ether_addr_list *)cmd_buffer; - list->vsi_id = vf->vsi_res->vsi_id; - list->num_elements = 1; - rte_memcpy(list->list[0].addr, addr->addr_bytes, - sizeof(addr->addr_bytes)); + err = i40evf_add_del_eth_addr(dev, addr, TRUE, VIRTCHNL_ETHER_ADDR_EXTRA); - args.ops = VIRTCHNL_OP_DEL_ETH_ADDR; - args.in_args = cmd_buffer; - args.in_args_size = sizeof(cmd_buffer); - args.out_buffer = vf->aq_resp; - args.out_size = I40E_AQ_BUF_SZ; - err = i40evf_execute_vf_cmd(dev, &args); if (err) - PMD_DRV_LOG(ERR, "fail to execute command " - "OP_DEL_ETHER_ADDRESS"); + PMD_DRV_LOG(ERR, "fail to add MAC address"); else - vf->vsi.mac_num--; - return; + vf->vsi.mac_num++; + + return err; } static void i40evf_del_mac_addr(struct rte_eth_dev *dev, uint32_t index) { + struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); struct rte_eth_dev_data *data = dev->data; struct rte_ether_addr *addr; + int err; addr = &data->mac_addrs[index]; - i40evf_del_mac_addr_by_addr(dev, addr); + err = i40evf_add_del_eth_addr(dev, addr, FALSE, VIRTCHNL_ETHER_ADDR_EXTRA); + + if (err) + PMD_DRV_LOG(ERR, "fail to delete MAC address"); + else + vf->vsi.mac_num--; + + return; } static int @@ -2066,6 +2055,9 @@ continue; rte_memcpy(list->list[j].addr, addr->addr_bytes, sizeof(addr->addr_bytes)); + list->list[j].type = (j == 0 ? + VIRTCHNL_ETHER_ADDR_PRIMARY : + VIRTCHNL_ETHER_ADDR_EXTRA); PMD_DRV_LOG(DEBUG, "add/rm mac:%x:%x:%x:%x:%x:%x", addr->addr_bytes[0], addr->addr_bytes[1], addr->addr_bytes[2], addr->addr_bytes[3], @@ -2402,6 +2394,9 @@ struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + i40evf_dev_stop(dev); i40e_dev_free_queues(dev); /* @@ -2715,7 +2710,7 @@ } for (i = 0; i < rss_lut_size; i++) - lut_info[i] = i % vf->num_queue_pairs; + lut_info[i] = i % num; ret = i40evf_set_rss_lut(&vf->vsi, lut_info, rss_lut_size); @@ -2823,6 +2818,10 @@ { struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct rte_ether_addr *old_addr; + int ret; + + old_addr = (struct rte_ether_addr *)hw->mac.addr; if (!rte_is_valid_assigned_ether_addr(mac_addr)) { PMD_DRV_LOG(ERR, "Tried to set invalid MAC address."); @@ -2832,9 +2831,13 @@ if (vf->flags & I40E_FLAG_VF_MAC_BY_PF) return -EPERM; - i40evf_del_mac_addr_by_addr(dev, (struct rte_ether_addr *)hw->mac.addr); + if (rte_is_same_ether_addr(old_addr, mac_addr)) + return 0; + + i40evf_add_del_eth_addr(dev, old_addr, FALSE, VIRTCHNL_ETHER_ADDR_PRIMARY); - if (i40evf_add_mac_addr(dev, mac_addr, 0, 0) != 0) + ret = i40evf_add_del_eth_addr(dev, mac_addr, TRUE, VIRTCHNL_ETHER_ADDR_PRIMARY); + if (ret) return -EIO; rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)hw->mac.addr); @@ -2878,6 +2881,7 @@ memcpy(list->list[i].addr, mc_addrs[i].addr_bytes, sizeof(list->list[i].addr)); + list->list[i].type = VIRTCHNL_ETHER_ADDR_EXTRA; } args.ops = add ? VIRTCHNL_OP_ADD_ETH_ADDR : VIRTCHNL_OP_DEL_ETH_ADDR; diff -Nru dpdk-19.11.7/drivers/net/i40e/i40e_fdir.c dpdk-19.11.10~rc1/drivers/net/i40e/i40e_fdir.c --- dpdk-19.11.7/drivers/net/i40e/i40e_fdir.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/i40e/i40e_fdir.c 2021-08-18 14:45:29.000000000 +0000 @@ -156,7 +156,7 @@ int err = I40E_SUCCESS; char z_name[RTE_MEMZONE_NAMESIZE]; const struct rte_memzone *mz = NULL; - struct rte_eth_dev *eth_dev = pf->adapter->eth_dev; + struct rte_eth_dev *eth_dev = &rte_eth_devices[pf->dev_data->port_id]; if ((pf->flags & I40E_FLAG_FDIR) == 0) { PMD_INIT_LOG(ERR, "HW doesn't support FDIR"); diff -Nru dpdk-19.11.7/drivers/net/i40e/i40e_flow.c dpdk-19.11.10~rc1/drivers/net/i40e/i40e_flow.c --- dpdk-19.11.7/drivers/net/i40e/i40e_flow.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/i40e/i40e_flow.c 2021-08-18 14:45:29.000000000 +0000 @@ -2201,7 +2201,7 @@ !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) return 0; - num = i40e_generate_inset_mask_reg(input_set, mask_reg, + num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg, I40E_INSET_MASK_NUM_REG); if (num < 0) return -EINVAL; @@ -2310,7 +2310,7 @@ const struct rte_flow_item *item = pattern; const struct rte_flow_item_eth *eth_spec, *eth_mask; const struct rte_flow_item_vlan *vlan_spec, *vlan_mask; - const struct rte_flow_item_ipv4 *ipv4_spec, *ipv4_mask; + const struct rte_flow_item_ipv4 *ipv4_spec, *ipv4_last, *ipv4_mask; const struct rte_flow_item_ipv6 *ipv6_spec, *ipv6_mask; const struct rte_flow_item_tcp *tcp_spec, *tcp_mask; const struct rte_flow_item_udp *udp_spec, *udp_mask; @@ -2321,7 +2321,6 @@ uint8_t pctype = 0; uint64_t input_set = I40E_INSET_NONE; - uint16_t frag_off; enum rte_flow_item_type item_type; enum rte_flow_item_type next_type; enum rte_flow_item_type l3 = RTE_FLOW_ITEM_TYPE_END; @@ -2349,7 +2348,7 @@ outer_tpid = i40e_get_outer_vlan(dev); filter->input.flow_ext.customized_pctype = false; for (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) { - if (item->last) { + if (item->last && item->type != RTE_FLOW_ITEM_TYPE_IPV4) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, @@ -2470,15 +2469,40 @@ l3 = RTE_FLOW_ITEM_TYPE_IPV4; ipv4_spec = item->spec; ipv4_mask = item->mask; + ipv4_last = item->last; pctype = I40E_FILTER_PCTYPE_NONF_IPV4_OTHER; layer_idx = I40E_FLXPLD_L3_IDX; + if (ipv4_last) { + if (!ipv4_spec || !ipv4_mask || !outer_ip) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Not support range"); + return -rte_errno; + } + /* Only fragment_offset supports range */ + if (ipv4_last->hdr.version_ihl || + ipv4_last->hdr.type_of_service || + ipv4_last->hdr.total_length || + ipv4_last->hdr.packet_id || + ipv4_last->hdr.time_to_live || + ipv4_last->hdr.next_proto_id || + ipv4_last->hdr.hdr_checksum || + ipv4_last->hdr.src_addr || + ipv4_last->hdr.dst_addr) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Not support range"); + return -rte_errno; + } + } if (ipv4_spec && ipv4_mask && outer_ip) { /* Check IPv4 mask and update input set */ if (ipv4_mask->hdr.version_ihl || ipv4_mask->hdr.total_length || ipv4_mask->hdr.packet_id || - ipv4_mask->hdr.fragment_offset || ipv4_mask->hdr.hdr_checksum) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, @@ -2499,11 +2523,56 @@ input_set |= I40E_INSET_IPV4_PROTO; /* Check if it is fragment. */ - frag_off = ipv4_spec->hdr.fragment_offset; - frag_off = rte_be_to_cpu_16(frag_off); - if (frag_off & RTE_IPV4_HDR_OFFSET_MASK || - frag_off & RTE_IPV4_HDR_MF_FLAG) - pctype = I40E_FILTER_PCTYPE_FRAG_IPV4; + uint16_t frag_mask = + ipv4_mask->hdr.fragment_offset; + uint16_t frag_spec = + ipv4_spec->hdr.fragment_offset; + uint16_t frag_last = 0; + if (ipv4_last) + frag_last = + ipv4_last->hdr.fragment_offset; + if (frag_mask) { + frag_mask = rte_be_to_cpu_16(frag_mask); + frag_spec = rte_be_to_cpu_16(frag_spec); + frag_last = rte_be_to_cpu_16(frag_last); + /* frag_off mask has to be 0x3fff */ + if (frag_mask != + (RTE_IPV4_HDR_OFFSET_MASK | + RTE_IPV4_HDR_MF_FLAG)) { + rte_flow_error_set(error, + EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Invalid IPv4 fragment_offset mask"); + return -rte_errno; + } + /* + * non-frag rule: + * mask=0x3fff,spec=0 + * frag rule: + * mask=0x3fff,spec=0x8,last=0x2000 + */ + if (frag_spec == + (1 << RTE_IPV4_HDR_FO_SHIFT) && + frag_last == RTE_IPV4_HDR_MF_FLAG) { + pctype = + I40E_FILTER_PCTYPE_FRAG_IPV4; + } else if (frag_spec || frag_last) { + rte_flow_error_set(error, + EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Invalid IPv4 fragment_offset rule"); + return -rte_errno; + } + } else if (frag_spec || frag_last) { + rte_flow_error_set(error, + EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Invalid fragment_offset"); + return -rte_errno; + } /* Get the filter info */ filter->input.flow.ip4_flow.proto = @@ -4848,7 +4917,7 @@ static int i40e_flow_flush_fdir_filter(struct i40e_pf *pf) { - struct rte_eth_dev *dev = pf->adapter->eth_dev; + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; struct i40e_fdir_info *fdir_info = &pf->fdir; struct i40e_fdir_filter *fdir_filter; enum i40e_filter_pctype pctype; diff -Nru dpdk-19.11.7/drivers/net/i40e/i40e_pf.c dpdk-19.11.10~rc1/drivers/net/i40e/i40e_pf.c --- dpdk-19.11.7/drivers/net/i40e/i40e_pf.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/i40e/i40e_pf.c 2021-08-18 14:45:29.000000000 +0000 @@ -29,6 +29,28 @@ #define I40E_CFG_CRCSTRIP_DEFAULT 1 +/* Supported RSS offloads */ +#define I40E_DEFAULT_RSS_HENA ( \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV4_SCTP) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV4_OTHER) | \ + BIT_ULL(I40E_FILTER_PCTYPE_FRAG_IPV4) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV6_UDP) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV6_TCP) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV6_SCTP) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV6_OTHER) | \ + BIT_ULL(I40E_FILTER_PCTYPE_FRAG_IPV6) | \ + BIT_ULL(I40E_FILTER_PCTYPE_L2_PAYLOAD)) + +#define I40E_DEFAULT_RSS_HENA_EXPANDED (I40E_DEFAULT_RSS_HENA | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN_NO_ACK) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN_NO_ACK) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP) | \ + BIT_ULL(I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP)) + static int i40e_pf_host_switch_queues(struct i40e_pf_vf *vf, struct virtchnl_queue_select *qsel, @@ -333,6 +355,10 @@ vf_res->vf_cap_flags = vf->request_caps & I40E_VIRTCHNL_OFFLOAD_CAPS; + + if (vf->request_caps & VIRTCHNL_VF_OFFLOAD_REQ_QUEUES) + vf_res->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_REQ_QUEUES; + /* For X722, it supports write back on ITR * without binding queue to interrupt vector. */ @@ -1284,6 +1310,37 @@ (u8 *)vfres, sizeof(*vfres)); } +static void +i40e_pf_host_process_cmd_get_rss_hena(struct i40e_pf_vf *vf) +{ + struct virtchnl_rss_hena vrh = {0}; + struct i40e_pf *pf = vf->pf; + + if (pf->adapter->hw.mac.type == I40E_MAC_X722) + vrh.hena = I40E_DEFAULT_RSS_HENA_EXPANDED; + else + vrh.hena = I40E_DEFAULT_RSS_HENA; + + i40e_pf_host_send_msg_to_vf(vf, VIRTCHNL_OP_GET_RSS_HENA_CAPS, + I40E_SUCCESS, (uint8_t *)&vrh, sizeof(vrh)); +} + +static void +i40e_pf_host_process_cmd_set_rss_hena(struct i40e_pf_vf *vf, uint8_t *msg) +{ + struct virtchnl_rss_hena *vrh = + (struct virtchnl_rss_hena *)msg; + struct i40e_hw *hw = &vf->pf->adapter->hw; + + i40e_write_rx_ctl(hw, I40E_VFQF_HENA1(0, vf->vf_idx), + (uint32_t)vrh->hena); + i40e_write_rx_ctl(hw, I40E_VFQF_HENA1(1, vf->vf_idx), + (uint32_t)(vrh->hena >> 32)); + + i40e_pf_host_send_msg_to_vf(vf, VIRTCHNL_OP_SET_RSS_HENA, + I40E_SUCCESS, NULL, 0); +} + void i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev, uint16_t abs_vf_id, uint32_t opcode, @@ -1454,6 +1511,14 @@ PMD_DRV_LOG(INFO, "OP_REQUEST_QUEUES received"); i40e_pf_host_process_cmd_request_queues(vf, msg); break; + case VIRTCHNL_OP_GET_RSS_HENA_CAPS: + PMD_DRV_LOG(INFO, "OP_GET_RSS_HENA_CAPS received"); + i40e_pf_host_process_cmd_get_rss_hena(vf); + break; + case VIRTCHNL_OP_SET_RSS_HENA: + PMD_DRV_LOG(INFO, "OP_SET_RSS_HENA received"); + i40e_pf_host_process_cmd_set_rss_hena(vf, msg); + break; /* Don't add command supported below, which will * return an error code. diff -Nru dpdk-19.11.7/drivers/net/i40e/i40e_rxtx.c dpdk-19.11.10~rc1/drivers/net/i40e/i40e_rxtx.c --- dpdk-19.11.7/drivers/net/i40e/i40e_rxtx.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/i40e/i40e_rxtx.c 2021-08-18 14:45:29.000000000 +0000 @@ -417,7 +417,7 @@ uint16_t pkt_len; uint64_t qword1; uint32_t rx_status; - int32_t s[I40E_LOOK_AHEAD], nb_dd; + int32_t s[I40E_LOOK_AHEAD], var, nb_dd; int32_t i, j, nb_rx = 0; uint64_t pkt_flags; uint32_t *ptype_tbl = rxq->vsi->adapter->ptype_tbl; @@ -450,8 +450,18 @@ rte_smp_rmb(); /* Compute how many status bits were set */ - for (j = 0, nb_dd = 0; j < I40E_LOOK_AHEAD; j++) - nb_dd += s[j] & (1 << I40E_RX_DESC_STATUS_DD_SHIFT); + for (j = 0, nb_dd = 0; j < I40E_LOOK_AHEAD; j++) { + var = s[j] & (1 << I40E_RX_DESC_STATUS_DD_SHIFT); +#ifdef RTE_ARCH_ARM + /* For Arm platforms, only compute continuous status bits */ + if (var) + nb_dd += 1; + else + break; +#else + nb_dd += var; +#endif + } nb_rx += nb_dd; @@ -2186,8 +2196,6 @@ if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF) { vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); vsi = &vf->vsi; - if (!vsi) - return -EINVAL; reg_idx = queue_idx; } else { pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); @@ -2847,7 +2855,7 @@ return I40E_ERR_BAD_PTR; } - dev = pf->adapter->eth_dev; + dev = &rte_eth_devices[pf->dev_data->port_id]; /* Allocate the TX queue data structure. */ txq = rte_zmalloc_socket("i40e fdir tx queue", @@ -2903,7 +2911,7 @@ return I40E_ERR_BAD_PTR; } - dev = pf->adapter->eth_dev; + dev = &rte_eth_devices[pf->dev_data->port_id]; /* Allocate the RX queue data structure. */ rxq = rte_zmalloc_socket("i40e fdir rx queue", diff -Nru dpdk-19.11.7/drivers/net/i40e/i40e_rxtx_vec_neon.c dpdk-19.11.10~rc1/drivers/net/i40e/i40e_rxtx_vec_neon.c --- dpdk-19.11.7/drivers/net/i40e/i40e_rxtx_vec_neon.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/i40e/i40e_rxtx_vec_neon.c 2021-08-18 14:45:29.000000000 +0000 @@ -309,10 +309,16 @@ /* pkt 3,4 shift the pktlen field to be 16-bit aligned*/ uint32x4_t len3 = vshlq_u32(vreinterpretq_u32_u64(descs[3]), len_shl); - descs[3] = vreinterpretq_u64_u32(len3); + descs[3] = vreinterpretq_u64_u16(vsetq_lane_u16 + (vgetq_lane_u16(vreinterpretq_u16_u32(len3), 7), + vreinterpretq_u16_u64(descs[3]), + 7)); uint32x4_t len2 = vshlq_u32(vreinterpretq_u32_u64(descs[2]), len_shl); - descs[2] = vreinterpretq_u64_u32(len2); + descs[2] = vreinterpretq_u64_u16(vsetq_lane_u16 + (vgetq_lane_u16(vreinterpretq_u16_u32(len2), 7), + vreinterpretq_u16_u64(descs[2]), + 7)); /* D.1 pkt 3,4 convert format from desc to pktmbuf */ pkt_mb4 = vqtbl1q_u8(vreinterpretq_u8_u64(descs[3]), shuf_msk); @@ -340,10 +346,16 @@ /* pkt 1,2 shift the pktlen field to be 16-bit aligned*/ uint32x4_t len1 = vshlq_u32(vreinterpretq_u32_u64(descs[1]), len_shl); - descs[1] = vreinterpretq_u64_u32(len1); + descs[1] = vreinterpretq_u64_u16(vsetq_lane_u16 + (vgetq_lane_u16(vreinterpretq_u16_u32(len1), 7), + vreinterpretq_u16_u64(descs[1]), + 7)); uint32x4_t len0 = vshlq_u32(vreinterpretq_u32_u64(descs[0]), len_shl); - descs[0] = vreinterpretq_u64_u32(len0); + descs[0] = vreinterpretq_u64_u16(vsetq_lane_u16 + (vgetq_lane_u16(vreinterpretq_u16_u32(len0), 7), + vreinterpretq_u16_u64(descs[0]), + 7)); /* D.1 pkt 1,2 convert format from desc to pktmbuf */ pkt_mb2 = vqtbl1q_u8(vreinterpretq_u8_u64(descs[1]), shuf_msk); diff -Nru dpdk-19.11.7/drivers/net/i40e/i40e_vf_representor.c dpdk-19.11.10~rc1/drivers/net/i40e/i40e_vf_representor.c --- dpdk-19.11.7/drivers/net/i40e/i40e_vf_representor.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/i40e/i40e_vf_representor.c 2021-08-18 14:45:29.000000000 +0000 @@ -18,15 +18,18 @@ int wait_to_complete) { struct i40e_vf_representor *representor = ethdev->data->dev_private; + struct rte_eth_dev *dev = + &rte_eth_devices[representor->adapter->pf.dev_data->port_id]; - return i40e_dev_link_update(representor->adapter->eth_dev, - wait_to_complete); + return i40e_dev_link_update(dev, wait_to_complete); } static int i40e_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev, struct rte_eth_dev_info *dev_info) { struct i40e_vf_representor *representor = ethdev->data->dev_private; + struct rte_eth_dev_data *pf_dev_data = + representor->adapter->pf.dev_data; /* get dev info for the vdev */ dev_info->device = ethdev->device; @@ -98,7 +101,7 @@ }; dev_info->switch_info.name = - representor->adapter->eth_dev->device->name; + rte_eth_devices[pf_dev_data->port_id].device->name; dev_info->switch_info.domain_id = representor->switch_domain_id; dev_info->switch_info.port_id = representor->vf_id; @@ -211,7 +214,7 @@ int ret; ret = rte_pmd_i40e_get_vf_native_stats( - representor->adapter->eth_dev->data->port_id, + representor->adapter->pf.dev_data->port_id, representor->vf_id, &native_stats); if (ret == 0) { i40evf_stat_update_48( @@ -271,7 +274,7 @@ struct i40e_vf_representor *representor = ethdev->data->dev_private; return rte_pmd_i40e_get_vf_native_stats( - representor->adapter->eth_dev->data->port_id, + representor->adapter->pf.dev_data->port_id, representor->vf_id, &representor->stats_offset); } @@ -281,7 +284,7 @@ struct i40e_vf_representor *representor = ethdev->data->dev_private; return rte_pmd_i40e_set_vf_unicast_promisc( - representor->adapter->eth_dev->data->port_id, + representor->adapter->pf.dev_data->port_id, representor->vf_id, 1); } @@ -291,7 +294,7 @@ struct i40e_vf_representor *representor = ethdev->data->dev_private; return rte_pmd_i40e_set_vf_unicast_promisc( - representor->adapter->eth_dev->data->port_id, + representor->adapter->pf.dev_data->port_id, representor->vf_id, 0); } @@ -301,7 +304,7 @@ struct i40e_vf_representor *representor = ethdev->data->dev_private; return rte_pmd_i40e_set_vf_multicast_promisc( - representor->adapter->eth_dev->data->port_id, + representor->adapter->pf.dev_data->port_id, representor->vf_id, 1); } @@ -311,7 +314,7 @@ struct i40e_vf_representor *representor = ethdev->data->dev_private; return rte_pmd_i40e_set_vf_multicast_promisc( - representor->adapter->eth_dev->data->port_id, + representor->adapter->pf.dev_data->port_id, representor->vf_id, 0); } @@ -321,7 +324,7 @@ struct i40e_vf_representor *representor = ethdev->data->dev_private; rte_pmd_i40e_remove_vf_mac_addr( - representor->adapter->eth_dev->data->port_id, + representor->adapter->pf.dev_data->port_id, representor->vf_id, ðdev->data->mac_addrs[index]); } @@ -332,7 +335,7 @@ struct i40e_vf_representor *representor = ethdev->data->dev_private; return rte_pmd_i40e_set_vf_mac_addr( - representor->adapter->eth_dev->data->port_id, + representor->adapter->pf.dev_data->port_id, representor->vf_id, mac_addr); } @@ -344,7 +347,7 @@ uint64_t vf_mask = 1ULL << representor->vf_id; return rte_pmd_i40e_set_vf_vlan_filter( - representor->adapter->eth_dev->data->port_id, + representor->adapter->pf.dev_data->port_id, vlan_id, vf_mask, on); } @@ -358,7 +361,7 @@ struct i40e_pf *pf; uint32_t vfid; - pdev = representor->adapter->eth_dev; + pdev = &rte_eth_devices[representor->adapter->pf.dev_data->port_id]; vfid = representor->vf_id; if (!is_i40e_supported(pdev)) { @@ -408,7 +411,7 @@ struct i40e_vf_representor *representor = ethdev->data->dev_private; rte_pmd_i40e_set_vf_vlan_stripq( - representor->adapter->eth_dev->data->port_id, + representor->adapter->pf.dev_data->port_id, representor->vf_id, on); } @@ -419,7 +422,7 @@ struct i40e_vf_representor *representor = ethdev->data->dev_private; return rte_pmd_i40e_set_vf_vlan_insert( - representor->adapter->eth_dev->data->port_id, + representor->adapter->pf.dev_data->port_id, representor->vf_id, vlan_id); } @@ -485,7 +488,7 @@ ((struct i40e_vf_representor *)init_params)->adapter; pf = I40E_DEV_PRIVATE_TO_PF( - representor->adapter->eth_dev->data->dev_private); + representor->adapter->pf.dev_data->dev_private); if (representor->vf_id >= pf->vf_num) return -ENODEV; @@ -516,7 +519,7 @@ ethdev->data->mac_addrs = &vf->mac_addr; /* Link state. Inherited from PF */ - link = &representor->adapter->eth_dev->data->dev_link; + link = &representor->adapter->pf.dev_data->dev_link; ethdev->data->dev_link.link_speed = link->link_speed; ethdev->data->dev_link.link_duplex = link->link_duplex; diff -Nru dpdk-19.11.7/drivers/net/iavf/base/virtchnl.h dpdk-19.11.10~rc1/drivers/net/iavf/base/virtchnl.h --- dpdk-19.11.7/drivers/net/iavf/base/virtchnl.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/iavf/base/virtchnl.h 2021-08-18 14:45:29.000000000 +0000 @@ -385,9 +385,36 @@ * PF removes the filters and returns status. */ +/* VIRTCHNL_ETHER_ADDR_LEGACY + * Prior to adding the @type member to virtchnl_ether_addr, there were 2 pad + * bytes. Moving forward all VF drivers should not set type to + * VIRTCHNL_ETHER_ADDR_LEGACY. This is only here to not break previous/legacy + * behavior. The control plane function (i.e. PF) can use a best effort method + * of tracking the primary/device unicast in this case, but there is no + * guarantee and functionality depends on the implementation of the PF. + */ + +/* VIRTCHNL_ETHER_ADDR_PRIMARY + * All VF drivers should set @type to VIRTCHNL_ETHER_ADDR_PRIMARY for the + * primary/device unicast MAC address filter for VIRTCHNL_OP_ADD_ETH_ADDR and + * VIRTCHNL_OP_DEL_ETH_ADDR. This allows for the underlying control plane + * function (i.e. PF) to accurately track and use this MAC address for + * displaying on the host and for VM/function reset. + */ + +/* VIRTCHNL_ETHER_ADDR_EXTRA + * All VF drivers should set @type to VIRTCHNL_ETHER_ADDR_EXTRA for any extra + * unicast and/or multicast filters that are being added/deleted via + * VIRTCHNL_OP_DEL_ETH_ADDR/VIRTCHNL_OP_ADD_ETH_ADDR respectively. + */ struct virtchnl_ether_addr { u8 addr[VIRTCHNL_ETH_LENGTH_OF_ADDRESS]; - u8 pad[2]; + u8 type; +#define VIRTCHNL_ETHER_ADDR_LEGACY 0 +#define VIRTCHNL_ETHER_ADDR_PRIMARY 1 +#define VIRTCHNL_ETHER_ADDR_EXTRA 2 +#define VIRTCHNL_ETHER_ADDR_TYPE_MASK 3 /* first two bits of type are valid */ + u8 pad; }; VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_ether_addr); diff -Nru dpdk-19.11.7/drivers/net/iavf/iavf_ethdev.c dpdk-19.11.10~rc1/drivers/net/iavf/iavf_ethdev.c --- dpdk-19.11.7/drivers/net/iavf/iavf_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/iavf/iavf_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -199,7 +199,7 @@ /* configure RSS key */ if (!rss_conf->rss_key) { /* Calculate the default hash key */ - for (i = 0; i <= vf->vf_res->rss_key_size; i++) + for (i = 0; i < vf->vf_res->rss_key_size; i++) vf->rss_key[i] = (uint8_t)rte_rand(); } else rte_memcpy(vf->rss_key, rss_conf->rss_key, @@ -792,7 +792,7 @@ return -EINVAL; } - err = iavf_add_del_eth_addr(adapter, addr, TRUE); + err = iavf_add_del_eth_addr(adapter, addr, TRUE, VIRTCHNL_ETHER_ADDR_EXTRA); if (err) { PMD_DRV_LOG(ERR, "fail to add MAC address"); return -EIO; @@ -814,7 +814,7 @@ addr = &dev->data->mac_addrs[index]; - err = iavf_add_del_eth_addr(adapter, addr, FALSE); + err = iavf_add_del_eth_addr(adapter, addr, FALSE, VIRTCHNL_ETHER_ADDR_EXTRA); if (err) PMD_DRV_LOG(ERR, "fail to delete MAC address"); @@ -1026,17 +1026,15 @@ struct iavf_adapter *adapter = IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(adapter); - struct rte_ether_addr *perm_addr, *old_addr; + struct rte_ether_addr *old_addr; int ret; old_addr = (struct rte_ether_addr *)hw->mac.addr; - perm_addr = (struct rte_ether_addr *)hw->mac.perm_addr; - /* If the MAC address is configured by host, skip the setting */ - if (rte_is_valid_assigned_ether_addr(perm_addr)) - return -EPERM; + if (rte_is_same_ether_addr(old_addr, mac_addr)) + return 0; - ret = iavf_add_del_eth_addr(adapter, old_addr, FALSE); + ret = iavf_add_del_eth_addr(adapter, old_addr, FALSE, VIRTCHNL_ETHER_ADDR_PRIMARY); if (ret) PMD_DRV_LOG(ERR, "Fail to delete old MAC:" " %02X:%02X:%02X:%02X:%02X:%02X", @@ -1047,7 +1045,7 @@ old_addr->addr_bytes[4], old_addr->addr_bytes[5]); - ret = iavf_add_del_eth_addr(adapter, mac_addr, TRUE); + ret = iavf_add_del_eth_addr(adapter, mac_addr, TRUE, VIRTCHNL_ETHER_ADDR_PRIMARY); if (ret) PMD_DRV_LOG(ERR, "Fail to add new MAC:" " %02X:%02X:%02X:%02X:%02X:%02X", @@ -1425,6 +1423,9 @@ struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + iavf_dev_stop(dev); iavf_shutdown_adminq(hw); /* disable uio intr before callback unregister */ @@ -1543,13 +1544,15 @@ u64 size, u32 alignment) { + static uint64_t iavf_dma_memzone_id; const struct rte_memzone *mz = NULL; char z_name[RTE_MEMZONE_NAMESIZE]; if (!mem) return IAVF_ERR_PARAM; - snprintf(z_name, sizeof(z_name), "iavf_dma_%"PRIu64, rte_rand()); + snprintf(z_name, sizeof(z_name), "iavf_dma_%" PRIu64, + __atomic_fetch_add(&iavf_dma_memzone_id, 1, __ATOMIC_RELAXED)); mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY, RTE_MEMZONE_IOVA_CONTIG, alignment, RTE_PGSIZE_2M); if (!mz) diff -Nru dpdk-19.11.7/drivers/net/iavf/iavf.h dpdk-19.11.10~rc1/drivers/net/iavf/iavf.h --- dpdk-19.11.7/drivers/net/iavf/iavf.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/iavf/iavf.h 2021-08-18 14:45:29.000000000 +0000 @@ -96,7 +96,7 @@ struct virtchnl_vsi_resource *vsi_res; /* LAN VSI */ volatile enum virtchnl_ops pend_cmd; /* pending command not finished */ - uint32_t cmd_retval; /* return value of the cmd response from PF */ + int cmd_retval; /* return value of the cmd response from PF */ uint8_t *aq_resp; /* buffer to store the adminq response from PF */ /* Event from pf */ @@ -182,7 +182,7 @@ * _atomic_set_cmd successfully. */ static inline void -_notify_cmd(struct iavf_info *vf, uint32_t msg_ret) +_notify_cmd(struct iavf_info *vf, int msg_ret) { vf->cmd_retval = msg_ret; rte_wmb(); @@ -233,7 +233,7 @@ int iavf_config_promisc(struct iavf_adapter *adapter, bool enable_unicast, bool enable_multicast); int iavf_add_del_eth_addr(struct iavf_adapter *adapter, - struct rte_ether_addr *addr, bool add); + struct rte_ether_addr *addr, bool add, uint8_t type); int iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool add); int iavf_add_del_mc_addr_list(struct iavf_adapter *adapter, struct rte_ether_addr *mc_addrs, diff -Nru dpdk-19.11.7/drivers/net/iavf/iavf_rxtx.c dpdk-19.11.10~rc1/drivers/net/iavf/iavf_rxtx.c --- dpdk-19.11.7/drivers/net/iavf/iavf_rxtx.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/iavf/iavf_rxtx.c 2021-08-18 14:45:29.000000000 +0000 @@ -449,7 +449,8 @@ tx_conf->tx_rs_thresh : DEFAULT_TX_RS_THRESH); tx_free_thresh = (uint16_t)((tx_conf->tx_free_thresh) ? tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH); - check_tx_thresh(nb_desc, tx_rs_thresh, tx_rs_thresh); + if (check_tx_thresh(nb_desc, tx_rs_thresh, tx_free_thresh) != 0) + return -EINVAL; /* Free memory if needed. */ if (dev->data->tx_queues[queue_idx]) { @@ -1583,6 +1584,11 @@ (volatile struct iavf_tx_context_desc *) &txr[tx_id]; + /* clear QW0 or the previous writeback value + * may impact next write + */ + *(volatile uint64_t *)ctx_txd = 0; + txn = &sw_ring[txe->next_id]; RTE_MBUF_PREFETCH_TO_FREE(txn->mbuf); if (txe->mbuf) { diff -Nru dpdk-19.11.7/drivers/net/iavf/iavf_rxtx.h dpdk-19.11.10~rc1/drivers/net/iavf/iavf_rxtx.h --- dpdk-19.11.7/drivers/net/iavf/iavf_rxtx.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/iavf/iavf_rxtx.h 2021-08-18 14:45:29.000000000 +0000 @@ -34,7 +34,7 @@ #define DEFAULT_TX_RS_THRESH 32 #define DEFAULT_TX_FREE_THRESH 32 -#define IAVF_MIN_TSO_MSS 256 +#define IAVF_MIN_TSO_MSS 88 #define IAVF_MAX_TSO_MSS 9668 #define IAVF_TSO_MAX_SEG UINT8_MAX #define IAVF_TX_MAX_MTU_SEG 8 diff -Nru dpdk-19.11.7/drivers/net/iavf/iavf_vchnl.c dpdk-19.11.10~rc1/drivers/net/iavf/iavf_vchnl.c --- dpdk-19.11.7/drivers/net/iavf/iavf_vchnl.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/iavf/iavf_vchnl.c 2021-08-18 14:45:29.000000000 +0000 @@ -121,13 +121,19 @@ rte_delay_ms(ASQ_DELAY_MS); /* If don't read msg or read sys event, continue */ } while (i++ < MAX_TRY_TIMES); - /* If there's no response is received, clear command */ - if (i >= MAX_TRY_TIMES || - vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) { - err = -1; - PMD_DRV_LOG(ERR, "No response or return failure (%d)" - " for cmd %d", vf->cmd_retval, args->ops); + + if (i >= MAX_TRY_TIMES) { + PMD_DRV_LOG(ERR, "No response for cmd %d", args->ops); _clear_cmd(vf); + err = -EIO; + } else if (vf->cmd_retval == + VIRTCHNL_STATUS_NOT_SUPPORTED) { + PMD_DRV_LOG(ERR, "Cmd %d not supported", args->ops); + err = -ENOTSUP; + } else if (vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) { + PMD_DRV_LOG(ERR, "Return failure %d for cmd %d", + vf->cmd_retval, args->ops); + err = -EINVAL; } break; } @@ -708,6 +714,9 @@ continue; rte_memcpy(list->list[j].addr, addr->addr_bytes, sizeof(addr->addr_bytes)); + list->list[j].type = (j == 0 ? + VIRTCHNL_ETHER_ADDR_PRIMARY : + VIRTCHNL_ETHER_ADDR_EXTRA); PMD_DRV_LOG(DEBUG, "add/rm mac:%x:%x:%x:%x:%x:%x", addr->addr_bytes[0], addr->addr_bytes[1], addr->addr_bytes[2], addr->addr_bytes[3], @@ -794,7 +803,7 @@ int iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr, - bool add) + bool add, uint8_t type) { struct virtchnl_ether_addr_list *list; struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); @@ -806,6 +815,7 @@ list = (struct virtchnl_ether_addr_list *)cmd_buffer; list->vsi_id = vf->vsi_res->vsi_id; list->num_elements = 1; + list->list[0].type = type; rte_memcpy(list->list[0].addr, addr->addr_bytes, sizeof(addr->addr_bytes)); @@ -886,6 +896,7 @@ memcpy(list->list[i].addr, mc_addrs[i].addr_bytes, sizeof(list->list[i].addr)); + list->list[i].type = VIRTCHNL_ETHER_ADDR_EXTRA; } args.ops = add ? VIRTCHNL_OP_ADD_ETH_ADDR : VIRTCHNL_OP_DEL_ETH_ADDR; diff -Nru dpdk-19.11.7/drivers/net/ice/base/ice_lan_tx_rx.h dpdk-19.11.10~rc1/drivers/net/ice/base/ice_lan_tx_rx.h --- dpdk-19.11.7/drivers/net/ice/base/ice_lan_tx_rx.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ice/base/ice_lan_tx_rx.h 2021-08-18 14:45:29.000000000 +0000 @@ -1307,7 +1307,7 @@ /* Non Tunneled IPv6 */ ICE_PTT(88, IP, IPV6, FRG, NONE, NONE, NOF, NONE, PAY3), ICE_PTT(89, IP, IPV6, NOF, NONE, NONE, NOF, NONE, PAY3), - ICE_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP, PAY3), + ICE_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP, PAY4), ICE_PTT_UNUSED_ENTRY(91), ICE_PTT(92, IP, IPV6, NOF, NONE, NONE, NOF, TCP, PAY4), ICE_PTT(93, IP, IPV6, NOF, NONE, NONE, NOF, SCTP, PAY4), diff -Nru dpdk-19.11.7/drivers/net/ice/base/ice_osdep.h dpdk-19.11.10~rc1/drivers/net/ice/base/ice_osdep.h --- dpdk-19.11.7/drivers/net/ice/base/ice_osdep.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ice/base/ice_osdep.h 2021-08-18 14:45:29.000000000 +0000 @@ -21,7 +21,6 @@ #include #include #include -#include #include #include "ice_alloc.h" @@ -173,7 +172,7 @@ } __attribute__((packed)); #define ice_malloc(h, s) rte_zmalloc(NULL, s, 0) -#define ice_calloc(h, c, s) rte_zmalloc(NULL, (c) * (s), 0) +#define ice_calloc(h, c, s) rte_calloc(NULL, c, s, 0) #define ice_free(h, m) rte_free(m) #define ice_memset(a, b, c, d) memset((a), (b), (c)) @@ -241,13 +240,15 @@ ice_alloc_dma_mem(__attribute__((unused)) struct ice_hw *hw, struct ice_dma_mem *mem, u64 size) { + static uint64_t ice_dma_memzone_id; const struct rte_memzone *mz = NULL; char z_name[RTE_MEMZONE_NAMESIZE]; if (!mem) return NULL; - snprintf(z_name, sizeof(z_name), "ice_dma_%"PRIu64, rte_rand()); + snprintf(z_name, sizeof(z_name), "ice_dma_%" PRIu64, + __atomic_fetch_add(&ice_dma_memzone_id, 1, __ATOMIC_RELAXED)); mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY, 0, 0, RTE_PGSIZE_2M); if (!mz) diff -Nru dpdk-19.11.7/drivers/net/ice/base/ice_switch.c dpdk-19.11.10~rc1/drivers/net/ice/base/ice_switch.c --- dpdk-19.11.7/drivers/net/ice/base/ice_switch.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ice/base/ice_switch.c 2021-08-18 14:45:29.000000000 +0000 @@ -4215,7 +4215,7 @@ &remove_list_head); ice_release_lock(rule_lock); if (status) - return; + goto free_fltr_list; switch (lkup) { case ICE_SW_LKUP_MAC: @@ -4244,6 +4244,7 @@ break; } +free_fltr_list: LIST_FOR_EACH_ENTRY_SAFE(fm_entry, tmp, &remove_list_head, ice_fltr_list_entry, list_entry) { LIST_DEL(&fm_entry->list_entry); diff -Nru dpdk-19.11.7/drivers/net/ice/base/meson.build dpdk-19.11.10~rc1/drivers/net/ice/base/meson.build --- dpdk-19.11.7/drivers/net/ice/base/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ice/base/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -18,6 +18,12 @@ '-Wno-unused-variable', '-Wno-unused-parameter', ] + +# Bugzilla ID: 678 +if (toolchain == 'gcc' and cc.version().version_compare('>=11.0.0')) + error_cflags += ['-Wno-array-bounds'] +endif + c_args = cflags foreach flag: error_cflags diff -Nru dpdk-19.11.7/drivers/net/ice/ice_ethdev.c dpdk-19.11.10~rc1/drivers/net/ice/ice_ethdev.c --- dpdk-19.11.7/drivers/net/ice/ice_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ice/ice_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -10,6 +10,8 @@ #include #include +#include + #include "base/ice_sched.h" #include "base/ice_flow.h" #include "base/ice_dcb.h" @@ -795,7 +797,7 @@ (struct rte_ether_addr *)hw->port_info[0].mac.perm_addr); dev->data->mac_addrs = - rte_zmalloc(NULL, sizeof(struct rte_ether_addr), 0); + rte_zmalloc(NULL, sizeof(struct rte_ether_addr) * ICE_NUM_MACADDR_MAX, 0); if (!dev->data->mac_addrs) { PMD_INIT_LOG(ERR, "Failed to allocate memory to store mac address"); @@ -1078,12 +1080,13 @@ { struct ice_mac_filter *m_f; struct ice_vlan_filter *v_f; + void *temp; int ret = 0; if (!vsi || !vsi->mac_num) return -EINVAL; - TAILQ_FOREACH(m_f, &vsi->mac_list, next) { + TAILQ_FOREACH_SAFE(m_f, &vsi->mac_list, next, temp) { ret = ice_remove_mac_filter(vsi, &m_f->mac_info.mac_addr); if (ret != ICE_SUCCESS) { ret = -EINVAL; @@ -1094,7 +1097,7 @@ if (vsi->vlan_num == 0) return 0; - TAILQ_FOREACH(v_f, &vsi->vlan_list, next) { + TAILQ_FOREACH_SAFE(v_f, &vsi->vlan_list, next, temp) { ret = ice_remove_vlan_filter(vsi, v_f->vlan_info.vlan_id); if (ret != ICE_SUCCESS) { ret = -EINVAL; @@ -1800,8 +1803,14 @@ pos = ice_pci_find_next_ext_capability(pci_dev, PCI_EXT_CAP_ID_DSN); if (pos) { - rte_pci_read_config(pci_dev, &dsn_low, 4, pos + 4); - rte_pci_read_config(pci_dev, &dsn_high, 4, pos + 8); + if (rte_pci_read_config(pci_dev, &dsn_low, 4, pos + 4) < 0) { + PMD_INIT_LOG(ERR, "Failed to read pci config space\n"); + return -1; + } + if (rte_pci_read_config(pci_dev, &dsn_high, 4, pos + 8) < 0) { + PMD_INIT_LOG(ERR, "Failed to read pci config space\n"); + return -1; + } snprintf(opt_ddp_filename, ICE_MAX_PKG_FILENAME_SIZE, "ice-%08x%08x.pkg", dsn_high, dsn_low); } else { @@ -1863,7 +1872,11 @@ struct ice_adapter *ad = ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); - ice_pkg_file_search_path(pci_dev, pkg_file); + err = ice_pkg_file_search_path(pci_dev, pkg_file); + if (err) { + PMD_INIT_LOG(ERR, "failed to search file path\n"); + return err; + } file = fopen(pkg_file, "rb"); if (!file) { @@ -2182,7 +2195,7 @@ if (ad->devargs.safe_mode_support == 0) { PMD_INIT_LOG(ERR, "Failed to load the DDP package," "Use safe-mode-support=1 to enter Safe Mode"); - return ret; + goto err_init_fw; } PMD_INIT_LOG(WARNING, "Failed to load the DDP package," @@ -2274,10 +2287,11 @@ rte_free(dev->data->mac_addrs); dev->data->mac_addrs = NULL; err_init_mac: - ice_sched_cleanup_all(hw); - rte_free(hw->port_info); - ice_shutdown_all_ctrlq(hw); rte_free(pf->proto_xtr); +#ifndef RTE_EXEC_ENV_WINDOWS +err_init_fw: +#endif + ice_deinit_hw(hw); return ret; } @@ -2394,6 +2408,9 @@ struct ice_adapter *ad = ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + /* Since stop will make link down, then the link event will be * triggered, disable the irq firstly to avoid the port_infoe etc * resources deallocation causing the interrupt service thread @@ -2442,6 +2459,31 @@ return 0; } +static void +ice_get_default_rss_key(uint8_t *rss_key, uint32_t rss_key_size) +{ + static struct ice_aqc_get_set_rss_keys default_key; + static bool default_key_done; + uint8_t *key = (uint8_t *)&default_key; + size_t i; + + if (rss_key_size > sizeof(default_key)) { + PMD_DRV_LOG(WARNING, + "requested size %u is larger than default %zu, " + "only %zu bytes are gotten for key\n", + rss_key_size, sizeof(default_key), + sizeof(default_key)); + } + + if (!default_key_done) { + /* Calculate the default hash key */ + for (i = 0; i < sizeof(default_key); i++) + key[i] = (uint8_t)rte_rand(); + default_key_done = true; + } + rte_memcpy(rss_key, key, RTE_MIN(rss_key_size, sizeof(default_key))); +} + static int ice_init_rss(struct ice_pf *pf) { struct ice_hw *hw = ICE_PF_TO_HW(pf); @@ -2489,15 +2531,13 @@ } } /* configure RSS key */ - if (!rss_conf->rss_key) { - /* Calculate the default hash key */ - for (i = 0; i <= vsi->rss_key_size; i++) - vsi->rss_key[i] = (uint8_t)rte_rand(); - } else { + if (!rss_conf->rss_key) + ice_get_default_rss_key(vsi->rss_key, vsi->rss_key_size); + else rte_memcpy(vsi->rss_key, rss_conf->rss_key, RTE_MIN(rss_conf->rss_key_len, vsi->rss_key_size)); - } + rte_memcpy(key.standard_rss_key, vsi->rss_key, vsi->rss_key_size); ret = ice_aq_set_rss_key(hw, vsi->idx, &key); if (ret) @@ -2967,7 +3007,7 @@ } dev_info->rx_queue_offload_capa = 0; - dev_info->tx_queue_offload_capa = 0; + dev_info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE; dev_info->reta_size = pf->hash_lut_size; dev_info->hash_key_size = (VSIQF_HKEY_MAX_INDEX + 1) * sizeof(uint32_t); @@ -3374,20 +3414,16 @@ { struct ice_hw *hw = ICE_VSI_TO_HW(vsi); struct ice_vsi_ctx ctxt; - uint8_t sec_flags, sw_flags2; + uint8_t sw_flags2; int ret = 0; - sec_flags = ICE_AQ_VSI_SEC_TX_VLAN_PRUNE_ENA << - ICE_AQ_VSI_SEC_TX_PRUNE_ENA_S; sw_flags2 = ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA; - if (on) { - vsi->info.sec_flags |= sec_flags; + if (on) vsi->info.sw_flags2 |= sw_flags2; - } else { - vsi->info.sec_flags &= ~sec_flags; + else vsi->info.sw_flags2 &= ~sw_flags2; - } + vsi->info.sw_id = hw->port_info->sw_id; (void)rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); ctxt.info.valid_sections = @@ -3769,8 +3805,11 @@ uint8_t pmask; int ret = 0; - pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX | - ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; + if (dev->data->all_multicast == 1) + pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX; + else + pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX | + ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; status = ice_clear_vsi_promisc(hw, vsi->idx, pmask, 0); if (status != ICE_SUCCESS) { diff -Nru dpdk-19.11.7/drivers/net/ifc/base/ifcvf.c dpdk-19.11.10~rc1/drivers/net/ifc/base/ifcvf.c --- dpdk-19.11.7/drivers/net/ifc/base/ifcvf.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ifc/base/ifcvf.c 2021-08-18 14:45:29.000000000 +0000 @@ -65,8 +65,13 @@ hw->common_cfg = get_cap_addr(hw, &cap); break; case IFCVF_PCI_CAP_NOTIFY_CFG: - PCI_READ_CONFIG_DWORD(dev, &hw->notify_off_multiplier, + ret = PCI_READ_CONFIG_DWORD(dev, + &hw->notify_off_multiplier, pos + sizeof(cap)); + if (ret < 0) { + DEBUGOUT("failed to read notify_off_multiplier\n"); + return -1; + } hw->notify_base = get_cap_addr(hw, &cap); hw->notify_region = cap.bar; break; diff -Nru dpdk-19.11.7/drivers/net/ipn3ke/ipn3ke_representor.c dpdk-19.11.10~rc1/drivers/net/ipn3ke/ipn3ke_representor.c --- dpdk-19.11.7/drivers/net/ipn3ke/ipn3ke_representor.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ipn3ke/ipn3ke_representor.c 2021-08-18 14:45:29.000000000 +0000 @@ -214,6 +214,9 @@ struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(dev); struct ipn3ke_rpst *rpst = IPN3KE_DEV_PRIVATE_TO_RPST(dev); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + if (hw->retimer.mac_type == IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI) { /* Disable the TX path */ ipn3ke_xmac_tx_disable(hw, rpst->port_id, 0); diff -Nru dpdk-19.11.7/drivers/net/ixgbe/ixgbe_ethdev.c dpdk-19.11.10~rc1/drivers/net/ixgbe/ixgbe_ethdev.c --- dpdk-19.11.7/drivers/net/ixgbe/ixgbe_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ixgbe/ixgbe_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -3022,6 +3022,8 @@ int ret; PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; ixgbe_pf_reset_hw(hw); @@ -3382,6 +3384,13 @@ hw_stats->fccrc + hw_stats->fclast; + /* + * 82599 errata, UDP frames with a 0 checksum can be marked as checksum + * errors. + */ + if (hw->mac.type != ixgbe_mac_82599EB) + stats->ierrors += hw_stats->xec; + /* Tx Errors */ stats->oerrors = 0; return 0; @@ -5056,11 +5065,19 @@ uint32_t reta, r; uint16_t idx, shift; struct ixgbe_adapter *adapter = dev->data->dev_private; + struct rte_eth_dev_data *dev_data = dev->data; struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); uint32_t reta_reg; PMD_INIT_FUNC_TRACE(); + if (!dev_data->dev_started) { + PMD_DRV_LOG(ERR, + "port %d must be started before rss reta update", + dev_data->port_id); + return -EIO; + } + if (!ixgbe_rss_update_sp(hw->mac.type)) { PMD_DRV_LOG(ERR, "RSS reta update is not supported on this " "NIC."); @@ -5479,6 +5496,8 @@ struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; ixgbe_reset_hw(hw); @@ -7620,9 +7639,6 @@ uint8_t *data = info->data; uint32_t i = 0; - if (info->length == 0) - return -EINVAL; - for (i = info->offset; i < info->offset + info->length; i++) { if (i < RTE_ETH_MODULE_SFF_8079_LEN) status = hw->phy.ops.read_i2c_eeprom(hw, i, &databyte); diff -Nru dpdk-19.11.7/drivers/net/ixgbe/ixgbe_flow.c dpdk-19.11.10~rc1/drivers/net/ixgbe/ixgbe_flow.c --- dpdk-19.11.7/drivers/net/ixgbe/ixgbe_flow.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/ixgbe/ixgbe_flow.c 2021-08-18 14:45:29.000000000 +0000 @@ -3437,6 +3437,7 @@ TAILQ_REMOVE(&ixgbe_flow_list, ixgbe_flow_mem_ptr, entries); rte_free(ixgbe_flow_mem_ptr); + break; } } rte_free(flow); diff -Nru dpdk-19.11.7/drivers/net/kni/rte_eth_kni.c dpdk-19.11.10~rc1/drivers/net/kni/rte_eth_kni.c --- dpdk-19.11.7/drivers/net/kni/rte_eth_kni.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/kni/rte_eth_kni.c 2021-08-18 14:45:29.000000000 +0000 @@ -204,6 +204,9 @@ struct pmd_internals *internals; int ret; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + eth_kni_dev_stop(eth_dev); /* mac_addrs must not be freed alone because part of dev_private */ @@ -399,8 +402,13 @@ static int kni_init(void) { - if (is_kni_initialized == 0) - rte_kni_init(MAX_KNI_PORTS); + int ret; + + if (is_kni_initialized == 0) { + ret = rte_kni_init(MAX_KNI_PORTS); + if (ret < 0) + return ret; + } is_kni_initialized++; diff -Nru dpdk-19.11.7/drivers/net/liquidio/lio_ethdev.c dpdk-19.11.10~rc1/drivers/net/liquidio/lio_ethdev.c --- dpdk-19.11.7/drivers/net/liquidio/lio_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/liquidio/lio_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -1558,6 +1558,9 @@ { struct lio_device *lio_dev = LIO_DEV(eth_dev); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + lio_dev_info(lio_dev, "closing port %d\n", eth_dev->data->port_id); if (lio_dev->intf_open) diff -Nru dpdk-19.11.7/drivers/net/memif/rte_eth_memif.c dpdk-19.11.10~rc1/drivers/net/memif/rte_eth_memif.c --- dpdk-19.11.7/drivers/net/memif/rte_eth_memif.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/memif/rte_eth_memif.c 2021-08-18 14:45:29.000000000 +0000 @@ -680,6 +680,7 @@ /* populate descriptor */ d0 = &ring->desc[slot & mask]; d0->length = rte_pktmbuf_data_len(mbuf); + mq->n_bytes += rte_pktmbuf_data_len(mbuf); /* FIXME: get region index */ d0->region = 1; d0->offset = rte_pktmbuf_mtod(mbuf, uint8_t *) - diff -Nru dpdk-19.11.7/drivers/net/mlx4/mlx4.c dpdk-19.11.10~rc1/drivers/net/mlx4/mlx4.c --- dpdk-19.11.7/drivers/net/mlx4/mlx4.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx4/mlx4.c 2021-08-18 14:45:29.000000000 +0000 @@ -204,6 +204,7 @@ struct mlx4_proc_priv *ppriv; size_t ppriv_size; + mlx4_proc_priv_uninit(dev); /* * UAR register table follows the process private structure. BlueFlame * registers for Tx queues are stored in the table. @@ -376,6 +377,8 @@ struct mlx4_priv *priv = dev->data->dev_private; unsigned int i; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; DEBUG("%p: closing device \"%s\"", (void *)dev, ((priv->ctx != NULL) ? priv->ctx->device->name : "")); diff -Nru dpdk-19.11.7/drivers/net/mlx4/mlx4_flow.c dpdk-19.11.10~rc1/drivers/net/mlx4/mlx4_flow.c --- dpdk-19.11.7/drivers/net/mlx4/mlx4_flow.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx4/mlx4_flow.c 2021-08-18 14:45:29.000000000 +0000 @@ -792,7 +792,8 @@ rss = action->conf; /* Default RSS configuration if none is provided. */ if (rss->key_len) { - rss_key = rss->key; + rss_key = rss->key ? + rss->key : mlx4_rss_hash_key_default; rss_key_len = rss->key_len; } else { rss_key = mlx4_rss_hash_key_default; diff -Nru dpdk-19.11.7/drivers/net/mlx4/mlx4_mp.c dpdk-19.11.10~rc1/drivers/net/mlx4/mlx4_mp.c --- dpdk-19.11.7/drivers/net/mlx4/mlx4_mp.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx4/mlx4_mp.c 2021-08-18 14:45:29.000000000 +0000 @@ -127,7 +127,6 @@ switch (param->type) { case MLX4_MP_REQ_START_RXTX: INFO("port %u starting datapath", dev->data->port_id); - rte_mb(); dev->tx_pkt_burst = mlx4_tx_burst; dev->rx_pkt_burst = mlx4_rx_burst; #ifdef HAVE_IBV_MLX4_UAR_MMAP_OFFSET @@ -145,6 +144,7 @@ } } #endif + rte_mb(); mp_init_msg(dev, &mp_res, param->type); res->result = 0; ret = rte_mp_reply(&mp_res, peer); diff -Nru dpdk-19.11.7/drivers/net/mlx4/mlx4_rxtx.c dpdk-19.11.10~rc1/drivers/net/mlx4/mlx4_rxtx.c --- dpdk-19.11.7/drivers/net/mlx4/mlx4_rxtx.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx4/mlx4_rxtx.c 2021-08-18 14:45:29.000000000 +0000 @@ -922,10 +922,6 @@ if (likely(elt->buf != NULL)) { struct rte_mbuf *tmp = elt->buf; -#ifndef NDEBUG - /* Poisoning. */ - memset(&elt->buf, 0x66, sizeof(struct rte_mbuf *)); -#endif /* Faster than rte_pktmbuf_free(). */ do { struct rte_mbuf *next = tmp->next; diff -Nru dpdk-19.11.7/drivers/net/mlx4/mlx4_txq.c dpdk-19.11.10~rc1/drivers/net/mlx4/mlx4_txq.c --- dpdk-19.11.7/drivers/net/mlx4/mlx4_txq.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx4/mlx4_txq.c 2021-08-18 14:45:29.000000000 +0000 @@ -207,19 +207,18 @@ static void mlx4_txq_free_elts(struct txq *txq) { - unsigned int elts_head = txq->elts_head; - unsigned int elts_tail = txq->elts_tail; struct txq_elt (*elts)[txq->elts_n] = txq->elts; - unsigned int elts_m = txq->elts_n - 1; + unsigned int n = txq->elts_n; - DEBUG("%p: freeing WRs", (void *)txq); - while (elts_tail != elts_head) { - struct txq_elt *elt = &(*elts)[elts_tail++ & elts_m]; + DEBUG("%p: freeing WRs, %u", (void *)txq, n); + while (n--) { + struct txq_elt *elt = &(*elts)[n]; - assert(elt->buf != NULL); - rte_pktmbuf_free(elt->buf); - elt->buf = NULL; - elt->wqe = NULL; + if (elt->buf) { + rte_pktmbuf_free(elt->buf); + elt->buf = NULL; + elt->wqe = NULL; + } } txq->elts_tail = txq->elts_head; } diff -Nru dpdk-19.11.7/drivers/net/mlx5/Makefile dpdk-19.11.10~rc1/drivers/net/mlx5/Makefile --- dpdk-19.11.7/drivers/net/mlx5/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -179,6 +179,16 @@ func mlx5dv_query_devx_port \ $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ + HAVE_MLX5DV_DR_DEVX_PORT_V35 \ + infiniband/mlx5dv.h \ + func mlx5dv_query_port \ + $(AUTOCONF_OUTPUT) + $Q sh -- '$<' '$@' \ + HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT \ + infiniband/mlx5dv.h \ + func mlx5dv_dr_action_create_dest_ib_port \ + $(AUTOCONF_OUTPUT) + $Q sh -- '$<' '$@' \ HAVE_IBV_DEVX_OBJ \ infiniband/mlx5dv.h \ func mlx5dv_devx_obj_create \ diff -Nru dpdk-19.11.7/drivers/net/mlx5/meson.build dpdk-19.11.10~rc1/drivers/net/mlx5/meson.build --- dpdk-19.11.7/drivers/net/mlx5/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -138,6 +138,10 @@ 'IBV_WQ_FLAG_RX_END_PADDING' ], [ 'HAVE_MLX5DV_DR_DEVX_PORT', 'infiniband/mlx5dv.h', 'mlx5dv_query_devx_port' ], + [ 'HAVE_MLX5DV_DR_DEVX_PORT_V35', 'infiniband/mlx5dv.h', + 'mlx5dv_query_port' ], + [ 'HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT', 'infiniband/mlx5dv.h', + 'mlx5dv_dr_action_create_dest_ib_port' ], [ 'HAVE_IBV_DEVX_OBJ', 'infiniband/mlx5dv.h', 'mlx5dv_devx_obj_create' ], [ 'HAVE_IBV_FLOW_DEVX_COUNTERS', 'infiniband/mlx5dv.h', diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5.c dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5.c --- dpdk-19.11.7/drivers/net/mlx5/mlx5.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5.c 2021-08-18 14:45:29.000000000 +0000 @@ -998,7 +998,17 @@ goto error; } sh->fdb_domain = domain; - sh->esw_drop_action = mlx5_glue->dr_create_flow_action_drop(); + } + /* + * The drop action is just some dummy placeholder in rdma-core. It + * does not belong to domains and has no any attributes, and, can be + * shared by the entire device. + */ + sh->dr_drop_action = mlx5_glue->dr_create_flow_action_drop(); + if (!sh->dr_drop_action) { + DRV_LOG(ERR, "FDB mlx5dv_dr_create_flow_action_drop"); + err = errno; + goto error; } #endif sh->pop_vlan_action = mlx5_glue->dr_create_flow_action_pop_vlan(); @@ -1018,9 +1028,9 @@ mlx5_glue->dr_destroy_domain(sh->fdb_domain); sh->fdb_domain = NULL; } - if (sh->esw_drop_action) { - mlx5_glue->destroy_flow_action(sh->esw_drop_action); - sh->esw_drop_action = NULL; + if (sh->dr_drop_action) { + mlx5_glue->destroy_flow_action(sh->dr_drop_action); + sh->dr_drop_action = NULL; } if (sh->pop_vlan_action) { mlx5_glue->destroy_flow_action(sh->pop_vlan_action); @@ -1063,9 +1073,9 @@ mlx5_glue->dr_destroy_domain(sh->fdb_domain); sh->fdb_domain = NULL; } - if (sh->esw_drop_action) { - mlx5_glue->destroy_flow_action(sh->esw_drop_action); - sh->esw_drop_action = NULL; + if (sh->dr_drop_action) { + mlx5_glue->destroy_flow_action(sh->dr_drop_action); + sh->dr_drop_action = NULL; } #endif if (sh->pop_vlan_action) { @@ -1245,6 +1255,7 @@ struct mlx5_proc_priv *ppriv; size_t ppriv_size; + mlx5_proc_priv_uninit(dev); /* * UAR register table follows the process private structure. BlueFlame * registers for Tx queues are stored in the table. @@ -1323,6 +1334,11 @@ priv->rxqs_n = 0; priv->rxqs = NULL; } + if (priv->representor) { + /* Each representor has a dedicated interrupts handler */ + rte_free(dev->intr_handle); + dev->intr_handle = NULL; + } if (priv->txqs != NULL) { /* XXX race condition if mlx5_tx_burst() is still running. */ usleep(1000); @@ -2118,6 +2134,33 @@ } return 0; } + +/** + * DR flow drop action support detect. + * + * @param dev + * Pointer to rte_eth_dev structure. + * + */ +static void +mlx5_flow_drop_action_config(struct rte_eth_dev *dev __rte_unused) +{ +#ifdef HAVE_MLX5DV_DR + struct mlx5_priv *priv = dev->data->dev_private; + + if (!priv->config.dv_flow_en || !priv->sh->dr_drop_action) + return; + /** + * DR supports drop action placeholder when it is supported; + * otherwise, use the queue drop action. + */ + if (mlx5_flow_discover_dr_action_support(dev)) + priv->root_verbs_drop_action = 1; + else + priv->root_verbs_drop_action = 0; +#endif +} + /** * Spawn an Ethernet device from Verbs information. * @@ -2164,9 +2207,7 @@ int own_domain_id = 0; uint16_t port_id; unsigned int i; -#ifdef HAVE_MLX5DV_DR_DEVX_PORT - struct mlx5dv_devx_port devx_port = { .comp_mask = 0 }; -#endif + struct mlx5_port_info vport_info = { .query_flags = 0 }; /* Determine if this port representor is supposed to be spawned. */ if (switch_info->representor && dpdk_dev->devargs) { @@ -2400,28 +2441,26 @@ priv->vport_meta_tag = 0; priv->vport_meta_mask = 0; priv->pf_bond = spawn->pf_bond; -#ifdef HAVE_MLX5DV_DR_DEVX_PORT /* - * The DevX port query API is implemented. E-Switch may use - * either vport or reg_c[0] metadata register to match on - * vport index. The engaged part of metadata register is - * defined by mask. + * If we have E-Switch we should determine the vport attributes. + * E-Switch may use either source vport field or reg_c[0] metadata + * register to match on vport index. The engaged part of metadata + * register is defined by mask. */ if (switch_info->representor || switch_info->master) { - devx_port.comp_mask = MLX5DV_DEVX_PORT_VPORT | - MLX5DV_DEVX_PORT_MATCH_REG_C_0; - err = mlx5_glue->devx_port_query(sh->ctx, spawn->ibv_port, - &devx_port); + err = mlx5_glue->devx_port_query(sh->ctx, + spawn->ibv_port, + &vport_info); if (err) { DRV_LOG(WARNING, "can't query devx port %d on device %s", spawn->ibv_port, spawn->ibv_dev->name); - devx_port.comp_mask = 0; + vport_info.query_flags = 0; } } - if (devx_port.comp_mask & MLX5DV_DEVX_PORT_MATCH_REG_C_0) { - priv->vport_meta_tag = devx_port.reg_c_0.value; - priv->vport_meta_mask = devx_port.reg_c_0.mask; + if (vport_info.query_flags & MLX5_PORT_QUERY_REG_C0) { + priv->vport_meta_tag = vport_info.vport_meta_tag; + priv->vport_meta_mask = vport_info.vport_meta_mask; if (!priv->vport_meta_mask) { DRV_LOG(ERR, "vport zero mask for port %d" " on bonding device %s", @@ -2437,34 +2476,31 @@ goto error; } } - if (devx_port.comp_mask & MLX5DV_DEVX_PORT_VPORT) { - priv->vport_id = devx_port.vport_num; - } else if (spawn->pf_bond >= 0) { + if (vport_info.query_flags & MLX5_PORT_QUERY_VPORT) { + priv->vport_id = vport_info.vport_id; + } else if (spawn->pf_bond >= 0 && + (switch_info->representor || switch_info->master)) { DRV_LOG(ERR, "can't deduce vport index for port %d" " on bonding device %s", spawn->ibv_port, spawn->ibv_dev->name); err = ENOTSUP; goto error; } else { - /* Suppose vport index in compatible way. */ + /* + * Suppose vport index in compatible way. Kernel/rdma_core + * support single E-Switch per PF configurations only and + * vport_id field contains the vport index for associated VF, + * which is deduced from representor port name. + * For example, let's have the IB device port 10, it has + * attached network device eth0, which has port name attribute + * pf0vf2, we can deduce the VF number as 2, and set vport index + * as 3 (2+1). This assigning schema should be changed if the + * multiple E-Switch instances per PF configurations or/and PCI + * subfunctions are added. + */ priv->vport_id = switch_info->representor ? switch_info->port_name + 1 : -1; } -#else - /* - * Kernel/rdma_core support single E-Switch per PF configurations - * only and vport_id field contains the vport index for - * associated VF, which is deduced from representor port name. - * For example, let's have the IB device port 10, it has - * attached network device eth0, which has port name attribute - * pf0vf2, we can deduce the VF number as 2, and set vport index - * as 3 (2+1). This assigning schema should be changed if the - * multiple E-Switch instances per PF configurations or/and PCI - * subfunctions are added. - */ - priv->vport_id = switch_info->representor ? - switch_info->port_name + 1 : -1; -#endif /* representor_id field keeps the unmodified VF index. */ priv->representor_id = switch_info->representor ? switch_info->port_name : -1; @@ -2832,6 +2868,7 @@ goto error; } } + mlx5_flow_drop_action_config(eth_dev); return eth_dev; error: if (priv) { @@ -3142,19 +3179,6 @@ goto exit; } } -#ifndef HAVE_MLX5DV_DR_DEVX_PORT - if (bd >= 0) { - /* - * This may happen if there is VF LAG kernel support and - * application is compiled with older rdma_core library. - */ - DRV_LOG(ERR, - "No kernel/verbs support for VF LAG bonding found."); - rte_errno = ENOTSUP; - ret = -rte_errno; - goto exit; - } -#endif /* * Now we can determine the maximal * amount of devices to be spawned. @@ -3218,6 +3242,15 @@ if (!ret && bd >= 0) { switch (list[ns].info.name_type) { case MLX5_PHYS_PORT_NAME_TYPE_UPLINK: + if (np == 1) { + /* + * Force standalone bonding + * device for ROCE LAG + * confgiurations. + */ + list[ns].info.master = 0; + list[ns].info.representor = 0; + } if (list[ns].info.port_name == bd) ns++; break; @@ -3352,6 +3385,18 @@ ret = -rte_errno; goto exit; } + /* + * New kernels may add the switch_id attribute for the case + * there is no E-Switch and we wrongly recognized the + * only device as master. Override this if there is the + * single device with single port and new device name + * format present. + */ + if (nd == 1 && + list[0].info.name_type == MLX5_PHYS_PORT_NAME_TYPE_UPLINK) { + list[0].info.master = 0; + list[0].info.representor = 0; + } } assert(ns); /* @@ -3409,6 +3454,31 @@ } restore = list[i].eth_dev->data->dev_flags; rte_eth_copy_pci_info(list[i].eth_dev, pci_dev); + /** + * Each representor has a dedicated interrupts vector. + * rte_eth_copy_pci_info() assigns PF interrupts handle to + * representor eth_dev object because representor and PF + * share the same PCI address. + * Override representor device with a dedicated + * interrupts handle here. + * Representor interrupts handle is released in + * mlx5_dev_stop(). + */ + if (list[i].info.representor) { + struct rte_intr_handle *intr_handle; + intr_handle = rte_zmalloc("representor interrupts", + sizeof(*intr_handle), 0); + if (!intr_handle) { + DRV_LOG(ERR, + "port %u failed to allocate memory for interrupt handler " + "Rx interrupts will not be supported", + i); + rte_errno = ENOMEM; + ret = -rte_errno; + goto exit; + } + list[i].eth_dev->intr_handle = intr_handle; + } /* Restore non-PCI flags cleared by the above call. */ list[i].eth_dev->data->dev_flags |= restore; rte_eth_dev_probing_finish(list[i].eth_dev); diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_ethdev.c dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_ethdev.c --- dpdk-19.11.7/drivers/net/mlx5/mlx5_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -1883,7 +1883,7 @@ }; int ret = 0; - if (!dev || !modinfo) { + if (!dev) { DRV_LOG(WARNING, "missing argument, cannot get module info"); rte_errno = EINVAL; return -rte_errno; @@ -1917,7 +1917,7 @@ struct ifreq ifr; int ret = 0; - if (!dev || !info) { + if (!dev) { DRV_LOG(WARNING, "missing argument, cannot get module eeprom"); rte_errno = EINVAL; return -rte_errno; diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_flow.c dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_flow.c --- dpdk-19.11.7/drivers/net/mlx5/mlx5_flow.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_flow.c 2021-08-18 14:45:29.000000000 +0000 @@ -72,6 +72,7 @@ MLX5_EXPANSION_VXLAN, MLX5_EXPANSION_VXLAN_GPE, MLX5_EXPANSION_GRE, + MLX5_EXPANSION_GRE_KEY, MLX5_EXPANSION_MPLS, MLX5_EXPANSION_ETH, MLX5_EXPANSION_ETH_VLAN, @@ -108,8 +109,7 @@ }, [MLX5_EXPANSION_OUTER_ETH] = { .next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_OUTER_IPV4, - MLX5_EXPANSION_OUTER_IPV6, - MLX5_EXPANSION_MPLS), + MLX5_EXPANSION_OUTER_IPV6), .type = RTE_FLOW_ITEM_TYPE_ETH, .rss_types = 0, }, @@ -136,7 +136,8 @@ }, [MLX5_EXPANSION_OUTER_IPV4_UDP] = { .next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_VXLAN, - MLX5_EXPANSION_VXLAN_GPE), + MLX5_EXPANSION_VXLAN_GPE, + MLX5_EXPANSION_MPLS), .type = RTE_FLOW_ITEM_TYPE_UDP, .rss_types = ETH_RSS_NONFRAG_IPV4_UDP, }, @@ -149,14 +150,16 @@ (MLX5_EXPANSION_OUTER_IPV6_UDP, MLX5_EXPANSION_OUTER_IPV6_TCP, MLX5_EXPANSION_IPV4, - MLX5_EXPANSION_IPV6), + MLX5_EXPANSION_IPV6, + MLX5_EXPANSION_GRE), .type = RTE_FLOW_ITEM_TYPE_IPV6, .rss_types = ETH_RSS_IPV6 | ETH_RSS_FRAG_IPV6 | ETH_RSS_NONFRAG_IPV6_OTHER, }, [MLX5_EXPANSION_OUTER_IPV6_UDP] = { .next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_VXLAN, - MLX5_EXPANSION_VXLAN_GPE), + MLX5_EXPANSION_VXLAN_GPE, + MLX5_EXPANSION_MPLS), .type = RTE_FLOW_ITEM_TYPE_UDP, .rss_types = ETH_RSS_NONFRAG_IPV6_UDP, }, @@ -177,13 +180,25 @@ .type = RTE_FLOW_ITEM_TYPE_VXLAN_GPE, }, [MLX5_EXPANSION_GRE] = { - .next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4), + .next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4, + MLX5_EXPANSION_IPV6, + MLX5_EXPANSION_GRE_KEY, + MLX5_EXPANSION_MPLS), .type = RTE_FLOW_ITEM_TYPE_GRE, }, + [MLX5_EXPANSION_GRE_KEY] = { + .next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4, + MLX5_EXPANSION_IPV6, + MLX5_EXPANSION_MPLS), + .type = RTE_FLOW_ITEM_TYPE_GRE_KEY, + .optional = 1, + }, [MLX5_EXPANSION_MPLS] = { .next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4, - MLX5_EXPANSION_IPV6), + MLX5_EXPANSION_IPV6, + MLX5_EXPANSION_ETH), .type = RTE_FLOW_ITEM_TYPE_MPLS, + .optional = 1, }, [MLX5_EXPANSION_ETH] = { .next = RTE_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4, @@ -894,10 +909,14 @@ data->dynf_meta = 0; data->flow_meta_mask = 0; data->flow_meta_offset = -1; + data->flow_meta_port_mask = 0; } else { data->dynf_meta = 1; data->flow_meta_mask = rte_flow_dynf_metadata_mask; data->flow_meta_offset = rte_flow_dynf_metadata_offs; + data->flow_meta_port_mask = (uint32_t)~0; + if (priv->config.dv_xmeta_en == MLX5_XMETA_MODE_META16) + data->flow_meta_port_mask >>= 16; } } } @@ -1211,6 +1230,13 @@ RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL, "inner RSS is not supported for " "non-tunnel flows"); + if ((item_flags & MLX5_FLOW_LAYER_MPLS) && + !(item_flags & + (MLX5_FLOW_LAYER_INNER_L2 | MLX5_FLOW_LAYER_INNER_L3)) && + rss->level > 1) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "MPLS inner RSS needs to specify inner L2/L3 items after MPLS in pattern"); return 0; } @@ -1583,7 +1609,7 @@ RTE_FLOW_ERROR_TYPE_ITEM, item, "IPv4 cannot follow L2/VLAN layer " "which ether type is not IPv4"); - if (item_flags & MLX5_FLOW_LAYER_IPIP) { + if (item_flags & MLX5_FLOW_LAYER_TUNNEL) { if (mask && spec) next_proto = mask->hdr.next_proto_id & spec->hdr.next_proto_id; @@ -1685,7 +1711,7 @@ RTE_FLOW_ERROR_TYPE_ITEM, item, "IPv6 cannot follow L2/VLAN layer " "which ether type is not IPv6"); - if (item_flags & MLX5_FLOW_LAYER_IPV6_ENCAP) { + if (item_flags & MLX5_FLOW_LAYER_TUNNEL) { if (mask && spec) next_proto = mask->hdr.proto & spec->hdr.proto; if (next_proto == IPPROTO_IPIP || next_proto == IPPROTO_IPV6) @@ -2218,9 +2244,8 @@ "MPLS not supported or" " disabled in firmware" " configuration."); - /* MPLS over IP, UDP, GRE is allowed */ - if (!(prev_layer & (MLX5_FLOW_LAYER_OUTER_L3 | - MLX5_FLOW_LAYER_OUTER_L4_UDP | + /* MPLS over UDP, GRE is allowed */ + if (!(prev_layer & (MLX5_FLOW_LAYER_OUTER_L4_UDP | MLX5_FLOW_LAYER_GRE | MLX5_FLOW_LAYER_GRE_KEY))) return rte_flow_error_set(error, EINVAL, diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_flow_dv.c dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_flow_dv.c --- dpdk-19.11.7/drivers/net/mlx5/mlx5_flow_dv.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_flow_dv.c 2021-08-18 14:45:29.000000000 +0000 @@ -1395,13 +1395,20 @@ "isn't supported"); if (reg != REG_A) nic_mask.data = priv->sh->dv_meta_mask; - } else if (attr->transfer) { - return rte_flow_error_set(error, ENOTSUP, + } else { + if (attr->transfer) + return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, "extended metadata feature " "should be enabled when " "meta item is requested " "with e-switch mode "); + if (attr->ingress) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ITEM, item, + "match on metadata for ingress " + "is not supported in legacy " + "metadata mode"); } if (!mask) mask = &rte_flow_item_meta_mask; @@ -6214,14 +6221,13 @@ MLX5_UDP_PORT_MPLS); break; case MLX5_FLOW_LAYER_GRE: + /* Fall-through. */ + case MLX5_FLOW_LAYER_GRE_KEY: MLX5_SET(fte_match_set_misc, misc_m, gre_protocol, 0xffff); MLX5_SET(fte_match_set_misc, misc_v, gre_protocol, RTE_ETHER_TYPE_MPLS); break; default: - MLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_protocol, 0xff); - MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, - IPPROTO_MPLS); break; } if (!in_mpls_v) @@ -7110,7 +7116,7 @@ RTE_FLOW_ERROR_TYPE_ACTION, NULL, "No eswitch info was found for port"); -#ifdef HAVE_MLX5DV_DR_DEVX_PORT +#ifdef HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT /* * This parameter is transferred to * mlx5dv_dr_action_create_dest_ib_port(). @@ -7370,12 +7376,13 @@ rte_errno = ENOTSUP; goto cnt_err; } - flow->counter = flow_dv_counter_alloc(dev, - count->shared, - count->id, - dev_flow->group); - if (flow->counter == NULL) - goto cnt_err; + if (!flow->counter) { + flow->counter = flow_dv_counter_alloc + (dev, count->shared, + count->id, dev_flow->group); + if (flow->counter == NULL) + goto cnt_err; + } dev_flow->dv.actions[actions_n++] = flow->counter->action; action_flags |= MLX5_FLOW_ACTION_COUNT; @@ -7911,8 +7918,17 @@ n = dv->actions_n; if (dev_flow->actions & MLX5_FLOW_ACTION_DROP) { if (dev_flow->transfer) { - dv->actions[n++] = priv->sh->esw_drop_action; + assert(priv->sh->dr_drop_action); + dv->actions[n++] = priv->sh->dr_drop_action; +#ifdef HAVE_MLX5DV_DR + } else if (dev_flow->group || + !priv->root_verbs_drop_action) { + /* DR supports drop action placeholder. */ + assert(priv->sh->dr_drop_action); + dv->actions[n++] = priv->sh->dr_drop_action; +#endif } else { + /* For DV we use the explicit drop queue. */ dv->hrxq = mlx5_hrxq_drop_new(dev); if (!dv->hrxq) { rte_flow_error_set @@ -8358,6 +8374,71 @@ return ret; } +/** + * Check whether the DR drop action is supported on the root table or not. + * + * Create a simple flow with DR drop action on root table to validate + * if DR drop action on root table is supported or not. + * + * @param[in] dev + * Pointer to rte_eth_dev structure. + * + * @return + * 0 on success, a negative errno value otherwise and rte_errno is set. + */ +int +mlx5_flow_discover_dr_action_support(struct rte_eth_dev *dev) +{ + struct mlx5_priv *priv = dev->data->dev_private; + struct mlx5_ibv_shared *sh = priv->sh; + struct mlx5_flow_dv_match_params mask = { + .size = sizeof(mask.buf), + }; + struct mlx5_flow_dv_match_params value = { + .size = sizeof(value.buf), + }; + struct mlx5dv_flow_matcher_attr dv_attr = { + .type = IBV_FLOW_ATTR_NORMAL, + .priority = 0, + .match_criteria_enable = 0, + .match_mask = (void *)&mask, + }; + struct mlx5_flow_tbl_resource *tbl = NULL; + void *matcher = NULL; + void *flow = NULL; + int ret = -1; + + tbl = flow_dv_tbl_resource_get(dev, 0, 0, 0, NULL); + if (!tbl) + goto err; + matcher = mlx5_glue->dv_create_flow_matcher(sh->ctx, &dv_attr, + tbl->obj); + if (!matcher) + goto err; + flow = mlx5_glue->dv_create_flow(matcher, (void *)&value, 1, + &sh->dr_drop_action); +err: + /* + * If DR drop action is not supported on root table, flow create will + * be failed with EOPNOTSUPP or EPROTONOSUPPORT. + */ + if (!flow) { + if (matcher && + (errno == EPROTONOSUPPORT || errno == EOPNOTSUPP)) + DRV_LOG(INFO, "DR drop action is not supported in root table."); + else + DRV_LOG(ERR, "Unexpected error in DR drop action support detection"); + ret = -1; + } else { + claim_zero(mlx5_glue->dv_destroy_flow(flow)); + } + if (matcher) + claim_zero(mlx5_glue->dv_destroy_flow_matcher(matcher)); + if (tbl) + flow_dv_tbl_resource_release(dev, tbl); + return ret; +} + /** * Destroy the meter table set. * Lock free, (mutex should be acquired by caller). diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_flow.h dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_flow.h --- dpdk-19.11.7/drivers/net/mlx5/mlx5_flow.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_flow.h 2021-08-18 14:45:29.000000000 +0000 @@ -893,4 +893,5 @@ const struct rte_flow_attr *attr); int mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error); +int mlx5_flow_discover_dr_action_support(struct rte_eth_dev *dev); #endif /* RTE_PMD_MLX5_FLOW_H_ */ diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_glue.c dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_glue.c --- dpdk-19.11.7/drivers/net/mlx5/mlx5_glue.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_glue.c 2021-08-18 14:45:29.000000000 +0000 @@ -393,7 +393,7 @@ static void * mlx5_glue_dr_create_flow_action_dest_port(void *domain, uint32_t port) { -#ifdef HAVE_MLX5DV_DR_DEVX_PORT +#ifdef HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT return mlx5dv_dr_action_create_dest_ib_port(domain, port); #else #ifdef HAVE_MLX5DV_DR_ESWITCH @@ -1025,17 +1025,54 @@ static int mlx5_glue_devx_port_query(struct ibv_context *ctx, uint32_t port_num, - struct mlx5dv_devx_port *mlx5_devx_port) + struct mlx5_port_info *info) { -#ifdef HAVE_MLX5DV_DR_DEVX_PORT - return mlx5dv_query_devx_port(ctx, port_num, mlx5_devx_port); + int err = 0; + + info->query_flags = 0; +#ifdef HAVE_MLX5DV_DR_DEVX_PORT_V35 + /* The DevX port query API is implemented (rdma-core v35 and above). */ + struct mlx5_ib_uapi_query_port devx_port; + + memset(&devx_port, 0, sizeof(devx_port)); + err = mlx5dv_query_port(ctx, port_num, &devx_port); + if (err) + return err; + if (devx_port.flags & MLX5DV_QUERY_PORT_VPORT_REG_C0) { + info->vport_meta_tag = devx_port.reg_c0.value; + info->vport_meta_mask = devx_port.reg_c0.mask; + info->query_flags |= MLX5_PORT_QUERY_REG_C0; + } + if (devx_port.flags & MLX5DV_QUERY_PORT_VPORT) { + info->vport_id = devx_port.vport; + info->query_flags |= MLX5_PORT_QUERY_VPORT; + } #else - (void)ctx; - (void)port_num; - (void)mlx5_devx_port; - errno = ENOTSUP; - return errno; -#endif +#ifdef HAVE_MLX5DV_DR_DEVX_PORT + /* The legacy DevX port query API is implemented (prior v35). */ + struct mlx5dv_devx_port devx_port = { + .comp_mask = MLX5DV_DEVX_PORT_VPORT | + MLX5DV_DEVX_PORT_MATCH_REG_C_0 + }; + + err = mlx5dv_query_devx_port(ctx, port_num, &devx_port); + if (err) + return err; + if (devx_port.comp_mask & MLX5DV_DEVX_PORT_MATCH_REG_C_0) { + info->vport_meta_tag = devx_port.reg_c_0.value; + info->vport_meta_mask = devx_port.reg_c_0.mask; + info->query_flags |= MLX5_PORT_QUERY_REG_C0; + } + if (devx_port.comp_mask & MLX5DV_DEVX_PORT_VPORT) { + info->vport_id = devx_port.vport_num; + info->query_flags |= MLX5_PORT_QUERY_VPORT; + } +#else + RTE_SET_USED(ctx); + RTE_SET_USED(port_num); +#endif /* HAVE_MLX5DV_DR_DEVX_PORT */ +#endif /* HAVE_MLX5DV_DR_DEVX_PORT_V35 */ + return err; } alignas(RTE_CACHE_LINE_SIZE) diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_glue.h dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_glue.h --- dpdk-19.11.7/drivers/net/mlx5/mlx5_glue.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_glue.h 2021-08-18 14:45:29.000000000 +0000 @@ -81,6 +81,20 @@ struct mlx5dv_devx_port; #endif +#ifndef HAVE_MLX5DV_DR_DEVX_PORT_V35 +struct mlx5dv_port; +#endif + +#define MLX5_PORT_QUERY_VPORT (1u << 0) +#define MLX5_PORT_QUERY_REG_C0 (1u << 1) + +struct mlx5_port_info { + uint16_t query_flags; + uint16_t vport_id; /* Associated VF vport index (if any). */ + uint32_t vport_meta_tag; /* Used for vport index match ove VF LAG. */ + uint32_t vport_meta_mask; /* Used for vport index field match mask. */ +}; + #ifndef HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER struct mlx5dv_dr_flow_meter_attr; #endif @@ -255,7 +269,7 @@ void *out, size_t outlen); int (*devx_port_query)(struct ibv_context *ctx, uint32_t port_num, - struct mlx5dv_devx_port *mlx5_devx_port); + struct mlx5_port_info *info); }; extern const struct mlx5_glue *mlx5_glue; diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5.h dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5.h --- dpdk-19.11.7/drivers/net/mlx5/mlx5.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5.h 2021-08-18 14:45:29.000000000 +0000 @@ -679,7 +679,7 @@ #endif struct mlx5_hlist *flow_tbls; /* Direct Rules tables for FDB, NIC TX+RX */ - void *esw_drop_action; /* Pointer to DR E-Switch drop action. */ + void *dr_drop_action; /* Pointer to DR drop action, any domain. */ void *pop_vlan_action; /* Pointer to DR pop VLAN action. */ LIST_HEAD(encap_decap, mlx5_flow_dv_encap_decap_resource) encaps_decaps; LIST_HEAD(modify_cmd, mlx5_flow_dv_modify_hdr_resource) modify_cmds; @@ -736,6 +736,7 @@ unsigned int counter_fallback:1; /* Use counter fallback management. */ unsigned int mtr_en:1; /* Whether support meter. */ unsigned int mtr_reg_share:1; /* Whether support meter REG_C share. */ + unsigned int root_verbs_drop_action; /* Root uses verbs drop action. */ uint16_t domain_id; /* Switch domain identifier. */ uint16_t vport_id; /* Associated VF vport index (if any). */ uint32_t vport_meta_tag; /* Used for vport index match ove VF LAG. */ @@ -966,8 +967,6 @@ struct rte_flow_item_eth *eth_spec, struct rte_flow_item_eth *eth_mask); struct rte_flow *mlx5_flow_create_esw_table_zero_flow(struct rte_eth_dev *dev); -int mlx5_flow_create_drop_queue(struct rte_eth_dev *dev); -void mlx5_flow_delete_drop_queue(struct rte_eth_dev *dev); void mlx5_flow_async_pool_query_handle(struct mlx5_ibv_shared *sh, uint64_t async_id, int status); void mlx5_set_query_alarm(struct mlx5_ibv_shared *sh); diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_mp.c dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_mp.c --- dpdk-19.11.7/drivers/net/mlx5/mlx5_mp.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_mp.c 2021-08-18 14:45:29.000000000 +0000 @@ -134,7 +134,6 @@ switch (param->type) { case MLX5_MP_REQ_START_RXTX: DRV_LOG(INFO, "port %u starting datapath", dev->data->port_id); - rte_mb(); dev->rx_pkt_burst = mlx5_select_rx_function(dev); dev->tx_pkt_burst = mlx5_select_tx_function(dev); ppriv = (struct mlx5_proc_priv *)dev->process_private; @@ -151,6 +150,7 @@ return -rte_errno; } } + rte_mb(); mp_init_msg(dev, &mp_res, param->type); res->result = 0; ret = rte_mp_reply(&mp_res, peer); diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_mr.c dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_mr.c --- dpdk-19.11.7/drivers/net/mlx5/mlx5_mr.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_mr.c 2021-08-18 14:45:29.000000000 +0000 @@ -1397,10 +1397,10 @@ } priv = dev->data->dev_private; sh = priv->sh; - rte_rwlock_read_lock(&sh->mr.rwlock); + rte_rwlock_write_lock(&sh->mr.rwlock); mr = mr_lookup_dev_list(sh, &entry, (uintptr_t)addr); if (!mr) { - rte_rwlock_read_unlock(&sh->mr.rwlock); + rte_rwlock_write_unlock(&sh->mr.rwlock); DRV_LOG(WARNING, "address 0x%" PRIxPTR " wasn't registered " "to PCI device %p", (uintptr_t)addr, (void *)pdev); @@ -1424,7 +1424,7 @@ ++sh->mr.dev_gen; DEBUG("broadcasting local cache flush, gen=%d", sh->mr.dev_gen); rte_smp_wmb(); - rte_rwlock_read_unlock(&sh->mr.rwlock); + rte_rwlock_write_unlock(&sh->mr.rwlock); return 0; } diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_nl.c dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_nl.c --- dpdk-19.11.7/drivers/net/mlx5/mlx5_nl.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_nl.c 2021-08-18 14:45:29.000000000 +0000 @@ -30,6 +30,8 @@ #define MLX5_SEND_BUF_SIZE 32768 /* Receive buffer size for the Netlink socket */ #define MLX5_RECV_BUF_SIZE 32768 +/* Maximal physical port name length. */ +#define MLX5_PHYS_PORT_NAME_MAX 128 /** Parameters of VLAN devices created by driver. */ #define MLX5_VMWA_VLAN_DEVICE_PFX "evmlx" @@ -1029,6 +1031,7 @@ size_t off = NLMSG_LENGTH(sizeof(struct ifinfomsg)); bool switch_id_set = false; bool num_vf_set = false; + int len; if (nh->nlmsg_type != RTM_NEWLINK) goto error; @@ -1044,7 +1047,24 @@ num_vf_set = true; break; case IFLA_PHYS_PORT_NAME: - mlx5_translate_port_name((char *)payload, &info); + len = RTA_PAYLOAD(ra); + /* Some kernels do not pad attributes with zero. */ + if (len > 0 && len < MLX5_PHYS_PORT_NAME_MAX) { + char name[MLX5_PHYS_PORT_NAME_MAX]; + + /* + * We can't just patch the message with padding + * zero - it might corrupt the following items + * in the message, we have to copy the string + * by attribute length and pad the copied one. + */ + memcpy(name, payload, len); + name[len] = 0; + mlx5_translate_port_name(name, &info); + } else { + info.name_type = + MLX5_PHYS_PORT_NAME_TYPE_UNKNOWN; + } break; case IFLA_PHYS_SWITCH_ID: info.switch_id = 0; diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_rxq.c dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxq.c --- dpdk-19.11.7/drivers/net/mlx5/mlx5_rxq.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxq.c 2021-08-18 14:45:29.000000000 +0000 @@ -723,9 +723,6 @@ unsigned int count = 0; struct rte_intr_handle *intr_handle = dev->intr_handle; - /* Representor shares dev->intr_handle with PF. */ - if (priv->representor) - return 0; if (!dev->data->dev_conf.intr_conf.rxq) return 0; mlx5_rx_intr_vec_disable(dev); @@ -803,9 +800,6 @@ unsigned int rxqs_n = priv->rxqs_n; unsigned int n = RTE_MIN(rxqs_n, (uint32_t)RTE_MAX_RXTX_INTR_VEC_ID); - /* Representor shares dev->intr_handle with PF. */ - if (priv->representor) - return; if (!dev->data->dev_conf.intr_conf.rxq) return; if (!intr_handle->intr_vec) @@ -1683,7 +1677,7 @@ snprintf(name, sizeof(name), "port-%u-mprq", dev->data->port_id); mp = rte_mempool_create(name, obj_num, obj_size, MLX5_MPRQ_MP_CACHE_SZ, 0, NULL, NULL, mlx5_mprq_buf_init, - (void *)(uintptr_t)(1 << strd_num_n), + (void *)((uintptr_t)1 << strd_num_n), dev->device->numa_node, 0); if (mp == NULL) { DRV_LOG(ERR, @@ -2074,7 +2068,7 @@ struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_rxq_ctrl *rxq_ctrl; - if (!(*priv->rxqs)[idx]) + if (priv->rxqs == NULL || (*priv->rxqs)[idx] == NULL) return 0; rxq_ctrl = container_of((*priv->rxqs)[idx], struct mlx5_rxq_ctrl, rxq); assert(rxq_ctrl->priv); diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_rxtx.c dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxtx.c --- dpdk-19.11.7/drivers/net/mlx5/mlx5_rxtx.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxtx.c 2021-08-18 14:45:29.000000000 +0000 @@ -1259,10 +1259,15 @@ pkt->hash.fdir.hi = mlx5_flow_mark_get(mark); } } - if (rxq->dynf_meta && cqe->flow_table_metadata) { - pkt->ol_flags |= rxq->flow_meta_mask; - *RTE_MBUF_DYNFIELD(pkt, rxq->flow_meta_offset, uint32_t *) = - cqe->flow_table_metadata; + if (rxq->dynf_meta) { + uint32_t meta = cqe->flow_table_metadata & + rxq->flow_meta_port_mask; + + if (meta) { + pkt->ol_flags |= rxq->flow_meta_mask; + *RTE_MBUF_DYNFIELD(pkt, rxq->flow_meta_offset, + uint32_t *) = meta; + } } if (rxq->csum) pkt->ol_flags |= rxq_cq_to_ol_flags(cqe); @@ -1337,6 +1342,9 @@ rte_mbuf_raw_free(pkt); pkt = rep; } + rq_ci >>= sges_n; + ++rq_ci; + rq_ci <<= sges_n; break; } if (!pkt) { diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_rxtx.h dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxtx.h --- dpdk-19.11.7/drivers/net/mlx5/mlx5_rxtx.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxtx.h 2021-08-18 14:45:29.000000000 +0000 @@ -156,6 +156,7 @@ uint32_t tunnel; /* Tunnel information. */ uint64_t flow_meta_mask; int32_t flow_meta_offset; + uint32_t flow_meta_port_mask; } __rte_cache_aligned; enum mlx5_rxq_obj_type { diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h --- dpdk-19.11.7/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h 2021-08-18 14:45:29.000000000 +0000 @@ -674,7 +674,7 @@ /* * A. load first Qword (8bytes) in one loop. - * B. copy 4 mbuf pointers from elts ring to returing pkts. + * B. copy 4 mbuf pointers from elts ring to returning pkts. * C. load remaining CQE data and extract necessary fields. * Final 16bytes cqes[] extracted from original 64bytes CQE has the * following structure: @@ -1036,22 +1036,23 @@ if (rxq->dynf_meta) { uint64_t flag = rxq->flow_meta_mask; int32_t offs = rxq->flow_meta_offset; - uint32_t metadata; + uint32_t metadata, mask; + mask = rxq->flow_meta_port_mask; /* This code is subject for futher optimization. */ - metadata = cq[pos].flow_table_metadata; + metadata = cq[pos].flow_table_metadata & mask; *RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t *) = metadata; pkts[pos]->ol_flags |= metadata ? flag : 0ULL; - metadata = cq[pos + 1].flow_table_metadata; + metadata = cq[pos + 1].flow_table_metadata & mask; *RTE_MBUF_DYNFIELD(pkts[pos + 1], offs, uint32_t *) = metadata; pkts[pos + 1]->ol_flags |= metadata ? flag : 0ULL; - metadata = cq[pos + 2].flow_table_metadata; + metadata = cq[pos + 2].flow_table_metadata & mask; *RTE_MBUF_DYNFIELD(pkts[pos + 2], offs, uint32_t *) = metadata; pkts[pos + 2]->ol_flags |= metadata ? flag : 0ULL; - metadata = cq[pos + 3].flow_table_metadata; + metadata = cq[pos + 3].flow_table_metadata & mask; *RTE_MBUF_DYNFIELD(pkts[pos + 3], offs, uint32_t *) = metadata; pkts[pos + 3]->ol_flags |= metadata ? flag : 0ULL; diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_rxtx_vec_neon.h dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxtx_vec_neon.h --- dpdk-19.11.7/drivers/net/mlx5/mlx5_rxtx_vec_neon.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxtx_vec_neon.h 2021-08-18 14:45:29.000000000 +0000 @@ -497,7 +497,7 @@ * there's no instruction to count trailing zeros. __builtin_clzl() is * used instead. * - * A. copy 4 mbuf pointers from elts ring to returing pkts. + * A. copy 4 mbuf pointers from elts ring to returning pkts. * B. load 64B CQE and extract necessary fields * Final 16bytes cqes[] extracted from original 64bytes CQE has the * following structure: @@ -671,16 +671,15 @@ comp_idx = __builtin_clzl(vget_lane_u64(vreinterpret_u64_u16( comp_mask), 0)) / (sizeof(uint16_t) * 8); - /* D.6 mask out entries after the compressed CQE. */ - mask = vcreate_u16(comp_idx < MLX5_VPMD_DESCS_PER_LOOP ? - -1UL >> (comp_idx * sizeof(uint16_t) * 8) : - 0); - invalid_mask = vorr_u16(invalid_mask, mask); + invalid_mask = vorr_u16(invalid_mask, comp_mask); /* D.7 count non-compressed valid CQEs. */ n = __builtin_clzl(vget_lane_u64(vreinterpret_u64_u16( invalid_mask), 0)) / (sizeof(uint16_t) * 8); nocmp_n += n; - /* D.2 get the final invalid mask. */ + /* + * D.2 mask out entries after the compressed CQE. + * get the final invalid mask. + */ mask = vcreate_u16(n < MLX5_VPMD_DESCS_PER_LOOP ? -1UL >> (n * sizeof(uint16_t) * 8) : 0); invalid_mask = vorr_u16(invalid_mask, mask); @@ -713,19 +712,24 @@ if (rxq->dynf_meta) { /* This code is subject for futher optimization. */ int32_t offs = rxq->flow_meta_offset; + uint32_t mask = rxq->flow_meta_port_mask; *RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t *) = container_of(p0, struct mlx5_cqe, - pkt_info)->flow_table_metadata; + pkt_info)->flow_table_metadata & + mask; *RTE_MBUF_DYNFIELD(pkts[pos + 1], offs, uint32_t *) = container_of(p1, struct mlx5_cqe, - pkt_info)->flow_table_metadata; + pkt_info)->flow_table_metadata & + mask; *RTE_MBUF_DYNFIELD(pkts[pos + 2], offs, uint32_t *) = container_of(p2, struct mlx5_cqe, - pkt_info)->flow_table_metadata; + pkt_info)->flow_table_metadata & + mask; *RTE_MBUF_DYNFIELD(pkts[pos + 3], offs, uint32_t *) = container_of(p3, struct mlx5_cqe, - pkt_info)->flow_table_metadata; + pkt_info)->flow_table_metadata & + mask; if (*RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t *)) elts[pos]->ol_flags |= rxq->flow_meta_mask; if (*RTE_MBUF_DYNFIELD(pkts[pos + 1], offs, uint32_t *)) diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_rxtx_vec_sse.h dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxtx_vec_sse.h --- dpdk-19.11.7/drivers/net/mlx5/mlx5_rxtx_vec_sse.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_rxtx_vec_sse.h 2021-08-18 14:45:29.000000000 +0000 @@ -481,7 +481,7 @@ assert(rxq->decompressed == 0); /* * A. load first Qword (8bytes) in one loop. - * B. copy 4 mbuf pointers from elts ring to returing pkts. + * B. copy 4 mbuf pointers from elts ring to returning pkts. * C. load remained CQE data and extract necessary fields. * Final 16bytes cqes[] extracted from original 64bytes CQE has the * following structure: @@ -665,15 +665,16 @@ if (rxq->dynf_meta) { /* This code is subject for futher optimization. */ int32_t offs = rxq->flow_meta_offset; + uint32_t mask = rxq->flow_meta_port_mask; *RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t *) = - cq[pos].flow_table_metadata; + cq[pos].flow_table_metadata & mask; *RTE_MBUF_DYNFIELD(pkts[pos + 1], offs, uint32_t *) = - cq[pos + p1].flow_table_metadata; + cq[pos + p1].flow_table_metadata & mask; *RTE_MBUF_DYNFIELD(pkts[pos + 2], offs, uint32_t *) = - cq[pos + p2].flow_table_metadata; + cq[pos + p2].flow_table_metadata & mask; *RTE_MBUF_DYNFIELD(pkts[pos + 3], offs, uint32_t *) = - cq[pos + p3].flow_table_metadata; + cq[pos + p3].flow_table_metadata & mask; if (*RTE_MBUF_DYNFIELD(pkts[pos], offs, uint32_t *)) pkts[pos]->ol_flags |= rxq->flow_meta_mask; if (*RTE_MBUF_DYNFIELD(pkts[pos + 1], offs, uint32_t *)) diff -Nru dpdk-19.11.7/drivers/net/mlx5/mlx5_txq.c dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_txq.c --- dpdk-19.11.7/drivers/net/mlx5/mlx5_txq.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mlx5/mlx5_txq.c 2021-08-18 14:45:29.000000000 +0000 @@ -1410,7 +1410,7 @@ struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_txq_ctrl *txq; - if (!(*priv->txqs)[idx]) + if (priv->txqs == NULL || (*priv->txqs)[idx] == NULL) return 0; txq = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq); if (txq->obj && !mlx5_txq_obj_release(txq->obj)) diff -Nru dpdk-19.11.7/drivers/net/mvneta/mvneta_ethdev.c dpdk-19.11.10~rc1/drivers/net/mvneta/mvneta_ethdev.c --- dpdk-19.11.7/drivers/net/mvneta/mvneta_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mvneta/mvneta_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -437,6 +437,9 @@ struct mvneta_priv *priv = dev->data->dev_private; int i; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + if (priv->ppio) mvneta_dev_stop(dev); diff -Nru dpdk-19.11.7/drivers/net/mvpp2/mrvl_ethdev.c dpdk-19.11.10~rc1/drivers/net/mvpp2/mrvl_ethdev.c --- dpdk-19.11.7/drivers/net/mvpp2/mrvl_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mvpp2/mrvl_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -400,12 +400,18 @@ dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) { MRVL_LOG(WARNING, "Disabling hash for 1 rx queue"); priv->ppio_params.inqs_params.hash_type = PP2_PPIO_HASH_T_NONE; - + priv->configured = 1; return 0; } - return mrvl_configure_rss(priv, - &dev->data->dev_conf.rx_adv_conf.rss_conf); + ret = mrvl_configure_rss(priv, + &dev->data->dev_conf.rx_adv_conf.rss_conf); + if (ret < 0) + return ret; + + priv->configured = 1; + + return 0; } /** @@ -851,6 +857,9 @@ struct mrvl_priv *priv = dev->data->dev_private; size_t i; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + mrvl_flush_rx_queues(dev); mrvl_flush_tx_shadow_queues(dev); mrvl_flow_deinit(dev); diff -Nru dpdk-19.11.7/drivers/net/mvpp2/mrvl_ethdev.h dpdk-19.11.10~rc1/drivers/net/mvpp2/mrvl_ethdev.h --- dpdk-19.11.7/drivers/net/mvpp2/mrvl_ethdev.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mvpp2/mrvl_ethdev.h 2021-08-18 14:45:29.000000000 +0000 @@ -208,6 +208,8 @@ LIST_HEAD(shaper_profiles, mrvl_tm_shaper_profile) shaper_profiles; LIST_HEAD(nodes, mrvl_tm_node) nodes; uint64_t rate_max; + + uint8_t configured; /** indicates if device has been configured */ }; /** Flow operations forward declaration. */ diff -Nru dpdk-19.11.7/drivers/net/mvpp2/mrvl_tm.c dpdk-19.11.10~rc1/drivers/net/mvpp2/mrvl_tm.c --- dpdk-19.11.7/drivers/net/mvpp2/mrvl_tm.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/mvpp2/mrvl_tm.c 2021-08-18 14:45:29.000000000 +0000 @@ -57,7 +57,7 @@ close(fd); - *rate = ethtool_cmd_speed(&edata) * 1000 * 1000 / 8; + *rate = (uint64_t)ethtool_cmd_speed(&edata) * 1000 * 1000 / 8; return 0; } @@ -146,6 +146,11 @@ struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_node *node; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!is_leaf) return -rte_tm_error_set(error, EINVAL, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -177,6 +182,11 @@ { struct mrvl_priv *priv = dev->data->dev_private; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!cap) return -rte_tm_error_set(error, EINVAL, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -224,6 +234,11 @@ { struct mrvl_priv *priv = dev->data->dev_private; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!cap) return -rte_tm_error_set(error, EINVAL, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -284,6 +299,11 @@ struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_node *node; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!cap) return -rte_tm_error_set(error, EINVAL, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -352,6 +372,11 @@ struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_shaper_profile *profile; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!params) return -rte_tm_error_set(error, EINVAL, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -420,6 +445,11 @@ struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_shaper_profile *profile; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + profile = mrvl_shaper_profile_from_id(priv, shaper_profile_id); if (!profile) return -rte_tm_error_set(error, ENODEV, @@ -566,6 +596,11 @@ struct mrvl_tm_node *node, *parent = NULL; int ret; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (priv->ppio) return -rte_tm_error_set(error, EPERM, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -651,6 +686,11 @@ struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_node *node; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (priv->ppio) { return -rte_tm_error_set(error, EPERM, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -715,6 +755,11 @@ struct mrvl_tm_node *node, *tmp; int ret; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + node = mrvl_node_from_id(priv, node_id); if (!node) return -rte_tm_error_set(error, ENODEV, @@ -756,6 +801,11 @@ struct mrvl_tm_node *node; int ret; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + node = mrvl_node_from_id(priv, node_id); if (!node) return -rte_tm_error_set(error, ENODEV, @@ -792,6 +842,11 @@ struct mrvl_tm_node *node; int ret; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (priv->ppio) { ret = -rte_tm_error_set(error, EPERM, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -898,6 +953,11 @@ struct mrvl_tm_node *node; int ret; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + if (!priv->ppio) { return -rte_tm_error_set(error, EPERM, RTE_TM_ERROR_TYPE_UNSPECIFIED, @@ -967,6 +1027,11 @@ struct mrvl_priv *priv = dev->data->dev_private; struct mrvl_tm_node *node; + if (!priv->configured) + return -rte_tm_error_set(error, ENODEV, + RTE_TM_ERROR_TYPE_UNSPECIFIED, + NULL, "Port didn't configured\n"); + node = mrvl_node_from_id(priv, node_id); if (!node) return -rte_tm_error_set(error, ENODEV, diff -Nru dpdk-19.11.7/drivers/net/netvsc/hn_ethdev.c dpdk-19.11.10~rc1/drivers/net/netvsc/hn_ethdev.c --- dpdk-19.11.7/drivers/net/netvsc/hn_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/netvsc/hn_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -847,6 +847,8 @@ hn_dev_close(struct rte_eth_dev *dev) { PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; hn_vf_close(dev); hn_dev_free_queues(dev); diff -Nru dpdk-19.11.7/drivers/net/nfb/nfb_ethdev.c dpdk-19.11.10~rc1/drivers/net/nfb/nfb_ethdev.c --- dpdk-19.11.7/drivers/net/nfb/nfb_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/nfb/nfb_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -217,6 +217,9 @@ uint16_t nb_rx = dev->data->nb_rx_queues; uint16_t nb_tx = dev->data->nb_tx_queues; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + nfb_eth_dev_stop(dev); nfb_nc_rxmac_deinit(internals->rxmac, internals->max_rxmac); diff -Nru dpdk-19.11.7/drivers/net/nfp/nfp_net.c dpdk-19.11.10~rc1/drivers/net/nfp/nfp_net.c --- dpdk-19.11.7/drivers/net/nfp/nfp_net.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/nfp/nfp_net.c 2021-08-18 14:45:29.000000000 +0000 @@ -871,6 +871,9 @@ struct rte_pci_device *pci_dev; int i; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + PMD_INIT_LOG(DEBUG, "Close"); hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1213,9 +1216,6 @@ DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM; - dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME | - DEV_RX_OFFLOAD_RSS_HASH; - if (hw->cap & NFP_NET_CFG_CTRL_TXVLAN) dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT; @@ -1264,15 +1264,22 @@ .nb_mtu_seg_max = NFP_TX_MAX_MTU_SEG, }; - dev_info->flow_type_rss_offloads = ETH_RSS_IPV4 | - ETH_RSS_NONFRAG_IPV4_TCP | - ETH_RSS_NONFRAG_IPV4_UDP | - ETH_RSS_IPV6 | - ETH_RSS_NONFRAG_IPV6_TCP | - ETH_RSS_NONFRAG_IPV6_UDP; + /* All NFP devices support jumbo frames */ + dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_JUMBO_FRAME; + + if (hw->cap & NFP_NET_CFG_CTRL_RSS) { + dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_RSS_HASH; - dev_info->reta_size = NFP_NET_CFG_RSS_ITBL_SZ; - dev_info->hash_key_size = NFP_NET_CFG_RSS_KEY_SZ; + dev_info->flow_type_rss_offloads = ETH_RSS_IPV4 | + ETH_RSS_NONFRAG_IPV4_TCP | + ETH_RSS_NONFRAG_IPV4_UDP | + ETH_RSS_IPV6 | + ETH_RSS_NONFRAG_IPV6_TCP | + ETH_RSS_NONFRAG_IPV6_UDP; + + dev_info->reta_size = NFP_NET_CFG_RSS_ITBL_SZ; + dev_info->hash_key_size = NFP_NET_CFG_RSS_KEY_SZ; + } dev_info->speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G | ETH_LINK_SPEED_25G | ETH_LINK_SPEED_40G | diff -Nru dpdk-19.11.7/drivers/net/octeontx/base/octeontx_pkivf.h dpdk-19.11.10~rc1/drivers/net/octeontx/base/octeontx_pkivf.h --- dpdk-19.11.7/drivers/net/octeontx/base/octeontx_pkivf.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/octeontx/base/octeontx_pkivf.h 2021-08-18 14:45:29.000000000 +0000 @@ -346,7 +346,6 @@ int octeontx_pki_port_hash_config(int port, pki_hash_cfg_t *hash_cfg); int octeontx_pki_port_pktbuf_config(int port, pki_pktbuf_cfg_t *buf_cfg); int octeontx_pki_port_create_qos(int port, pki_qos_cfg_t *qos_cfg); -int octeontx_pki_port_close(int port); int octeontx_pki_port_errchk_config(int port, pki_errchk_cfg_t *cfg); #endif /* __OCTEONTX_PKI_H__ */ diff -Nru dpdk-19.11.7/drivers/net/octeontx/octeontx_ethdev.c dpdk-19.11.10~rc1/drivers/net/octeontx/octeontx_ethdev.c --- dpdk-19.11.7/drivers/net/octeontx/octeontx_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/octeontx/octeontx_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -333,6 +333,8 @@ int ret; PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; rte_event_dev_close(nic->evdev); diff -Nru dpdk-19.11.7/drivers/net/octeontx2/otx2_ethdev.c dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_ethdev.c --- dpdk-19.11.7/drivers/net/octeontx2/otx2_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -1098,6 +1098,7 @@ txq->qconf.nb_desc = nb_desc; memcpy(&txq->qconf.conf.tx, tx_conf, sizeof(struct rte_eth_txconf)); + txq->lso_tun_fmt = dev->lso_tun_fmt; otx2_nix_form_default_desc(txq); otx2_nix_dbg("sq=%d fc=%p offload=0x%" PRIx64 " sqb=0x%" PRIx64 "" @@ -1448,7 +1449,7 @@ struct otx2_mbox *mbox = dev->mbox; struct nix_lso_format_cfg_rsp *rsp; struct nix_lso_format_cfg *req; - uint8_t base; + uint8_t *fmt; int rc; /* Skip if TSO was not requested */ @@ -1463,11 +1464,9 @@ if (rc) return rc; - base = rsp->lso_format_idx; - if (base != NIX_LSO_FORMAT_IDX_TSOV4) + if (rsp->lso_format_idx != NIX_LSO_FORMAT_IDX_TSOV4) return -EFAULT; - dev->lso_base_idx = base; - otx2_nix_dbg("tcpv4 lso fmt=%u", base); + otx2_nix_dbg("tcpv4 lso fmt=%u", rsp->lso_format_idx); /* @@ -1479,9 +1478,9 @@ if (rc) return rc; - if (rsp->lso_format_idx != base + 1) + if (rsp->lso_format_idx != NIX_LSO_FORMAT_IDX_TSOV6) return -EFAULT; - otx2_nix_dbg("tcpv6 lso fmt=%u\n", base + 1); + otx2_nix_dbg("tcpv6 lso fmt=%u\n", rsp->lso_format_idx); /* * IPv4/UDP/TUN HDR/IPv4/TCP LSO @@ -1492,9 +1491,8 @@ if (rc) return rc; - if (rsp->lso_format_idx != base + 2) - return -EFAULT; - otx2_nix_dbg("udp tun v4v4 fmt=%u\n", base + 2); + dev->lso_udp_tun_idx[NIX_LSO_TUN_V4V4] = rsp->lso_format_idx; + otx2_nix_dbg("udp tun v4v4 fmt=%u\n", rsp->lso_format_idx); /* * IPv4/UDP/TUN HDR/IPv6/TCP LSO @@ -1505,9 +1503,8 @@ if (rc) return rc; - if (rsp->lso_format_idx != base + 3) - return -EFAULT; - otx2_nix_dbg("udp tun v4v6 fmt=%u\n", base + 3); + dev->lso_udp_tun_idx[NIX_LSO_TUN_V4V6] = rsp->lso_format_idx; + otx2_nix_dbg("udp tun v4v6 fmt=%u\n", rsp->lso_format_idx); /* * IPv6/UDP/TUN HDR/IPv4/TCP LSO @@ -1518,9 +1515,8 @@ if (rc) return rc; - if (rsp->lso_format_idx != base + 4) - return -EFAULT; - otx2_nix_dbg("udp tun v6v4 fmt=%u\n", base + 4); + dev->lso_udp_tun_idx[NIX_LSO_TUN_V6V4] = rsp->lso_format_idx; + otx2_nix_dbg("udp tun v6v4 fmt=%u\n", rsp->lso_format_idx); /* * IPv6/UDP/TUN HDR/IPv6/TCP LSO @@ -1530,9 +1526,9 @@ rc = otx2_mbox_process_msg(mbox, (void *)&rsp); if (rc) return rc; - if (rsp->lso_format_idx != base + 5) - return -EFAULT; - otx2_nix_dbg("udp tun v6v6 fmt=%u\n", base + 5); + + dev->lso_udp_tun_idx[NIX_LSO_TUN_V6V6] = rsp->lso_format_idx; + otx2_nix_dbg("udp tun v6v6 fmt=%u\n", rsp->lso_format_idx); /* * IPv4/TUN HDR/IPv4/TCP LSO @@ -1543,9 +1539,8 @@ if (rc) return rc; - if (rsp->lso_format_idx != base + 6) - return -EFAULT; - otx2_nix_dbg("tun v4v4 fmt=%u\n", base + 6); + dev->lso_tun_idx[NIX_LSO_TUN_V4V4] = rsp->lso_format_idx; + otx2_nix_dbg("tun v4v4 fmt=%u\n", rsp->lso_format_idx); /* * IPv4/TUN HDR/IPv6/TCP LSO @@ -1556,9 +1551,8 @@ if (rc) return rc; - if (rsp->lso_format_idx != base + 7) - return -EFAULT; - otx2_nix_dbg("tun v4v6 fmt=%u\n", base + 7); + dev->lso_tun_idx[NIX_LSO_TUN_V4V6] = rsp->lso_format_idx; + otx2_nix_dbg("tun v4v6 fmt=%u\n", rsp->lso_format_idx); /* * IPv6/TUN HDR/IPv4/TCP LSO @@ -1569,9 +1563,8 @@ if (rc) return rc; - if (rsp->lso_format_idx != base + 8) - return -EFAULT; - otx2_nix_dbg("tun v6v4 fmt=%u\n", base + 8); + dev->lso_tun_idx[NIX_LSO_TUN_V6V4] = rsp->lso_format_idx; + otx2_nix_dbg("tun v6v4 fmt=%u\n", rsp->lso_format_idx); /* * IPv6/TUN HDR/IPv6/TCP LSO @@ -1581,9 +1574,26 @@ rc = otx2_mbox_process_msg(mbox, (void *)&rsp); if (rc) return rc; - if (rsp->lso_format_idx != base + 9) - return -EFAULT; - otx2_nix_dbg("tun v6v6 fmt=%u\n", base + 9); + + dev->lso_tun_idx[NIX_LSO_TUN_V6V6] = rsp->lso_format_idx; + otx2_nix_dbg("tun v6v6 fmt=%u\n", rsp->lso_format_idx); + + /* Save all tun formats into u64 for fast path. + * Lower 32bit has non-udp tunnel formats. + * Upper 32bit has udp tunnel formats. + */ + fmt = dev->lso_tun_idx; + dev->lso_tun_fmt = ((uint64_t)fmt[NIX_LSO_TUN_V4V4] | + (uint64_t)fmt[NIX_LSO_TUN_V4V6] << 8 | + (uint64_t)fmt[NIX_LSO_TUN_V6V4] << 16 | + (uint64_t)fmt[NIX_LSO_TUN_V6V6] << 24); + + fmt = dev->lso_udp_tun_idx; + dev->lso_tun_fmt |= ((uint64_t)fmt[NIX_LSO_TUN_V4V4] << 32 | + (uint64_t)fmt[NIX_LSO_TUN_V4V6] << 40 | + (uint64_t)fmt[NIX_LSO_TUN_V6V4] << 48 | + (uint64_t)fmt[NIX_LSO_TUN_V6V6] << 56); + return 0; } diff -Nru dpdk-19.11.7/drivers/net/octeontx2/otx2_ethdev_devargs.c dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_ethdev_devargs.c --- dpdk-19.11.7/drivers/net/octeontx2/otx2_ethdev_devargs.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_ethdev_devargs.c 2021-08-18 14:45:29.000000000 +0000 @@ -115,7 +115,7 @@ { uint16_t rss_size = NIX_RSS_RETA_SIZE; uint16_t sqb_count = NIX_MAX_SQB; - uint16_t flow_prealloc_size = 8; + uint16_t flow_prealloc_size = 1; uint16_t switch_header_type = 0; uint16_t flow_max_priority = 3; uint16_t scalar_enable = 0; diff -Nru dpdk-19.11.7/drivers/net/octeontx2/otx2_ethdev.h dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_ethdev.h --- dpdk-19.11.7/drivers/net/octeontx2/otx2_ethdev.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_ethdev.h 2021-08-18 14:45:29.000000000 +0000 @@ -171,6 +171,14 @@ nix_q_size_max }; +enum nix_lso_tun_type { + NIX_LSO_TUN_V4V4, + NIX_LSO_TUN_V4V6, + NIX_LSO_TUN_V6V4, + NIX_LSO_TUN_V6V6, + NIX_LSO_TUN_MAX, +}; + struct otx2_qint { struct rte_eth_dev *eth_dev; uint8_t qintx; @@ -265,7 +273,9 @@ uint8_t tx_chan_cnt; uint8_t lso_tsov4_idx; uint8_t lso_tsov6_idx; - uint8_t lso_base_idx; + uint8_t lso_udp_tun_idx[NIX_LSO_TUN_MAX]; + uint8_t lso_tun_idx[NIX_LSO_TUN_MAX]; + uint64_t lso_tun_fmt; uint8_t mac_addr[RTE_ETHER_ADDR_LEN]; uint8_t mkex_pfl_name[MKEX_NAME_LEN]; uint8_t max_mac_entries; @@ -339,6 +349,7 @@ rte_iova_t fc_iova; uint16_t sqes_per_sqb_log2; int16_t nb_sqb_bufs_adj; + uint64_t lso_tun_fmt; MARKER slow_path_start; uint16_t nb_sqb_bufs; uint16_t sq; diff -Nru dpdk-19.11.7/drivers/net/octeontx2/otx2_ethdev_ops.c dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_ethdev_ops.c --- dpdk-19.11.7/drivers/net/octeontx2/otx2_ethdev_ops.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_ethdev_ops.c 2021-08-18 14:45:29.000000000 +0000 @@ -533,8 +533,7 @@ struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); struct cgx_fw_data *rsp; - if (!info->data || !info->length || - (info->offset + info->length > SFP_EEPROM_SIZE)) + if (info->offset + info->length > SFP_EEPROM_SIZE) return -EINVAL; rsp = nix_get_fwdata(dev); diff -Nru dpdk-19.11.7/drivers/net/octeontx2/otx2_flow.c dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_flow.c --- dpdk-19.11.7/drivers/net/octeontx2/otx2_flow.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_flow.c 2021-08-18 14:45:29.000000000 +0000 @@ -810,12 +810,23 @@ return rc; } +#define OTX2_MCAM_TOT_ENTRIES_96XX (4096) +#define OTX2_MCAM_TOT_ENTRIES_98XX (16384) + +static int otx2_mcam_tot_entries(struct otx2_eth_dev *dev) +{ + if (otx2_dev_is_98xx(dev)) + return OTX2_MCAM_TOT_ENTRIES_98XX; + else + return OTX2_MCAM_TOT_ENTRIES_96XX; +} + int otx2_flow_init(struct otx2_eth_dev *hw) { uint8_t *mem = NULL, *nix_mem = NULL, *npc_mem = NULL; struct otx2_npc_flow_info *npc = &hw->npc_flow; - uint32_t bmap_sz; + uint32_t bmap_sz, tot_mcam_entries = 0; int rc = 0, idx; rc = flow_fetch_kex_cfg(hw); @@ -826,7 +837,8 @@ rte_atomic32_init(&npc->mark_actions); - npc->mcam_entries = NPC_MCAM_TOT_ENTRIES >> npc->keyw[NPC_MCAM_RX]; + tot_mcam_entries = otx2_mcam_tot_entries(hw); + npc->mcam_entries = tot_mcam_entries >> npc->keyw[NPC_MCAM_RX]; /* Free, free_rev, live and live_rev entries */ bmap_sz = rte_bitmap_get_memory_footprint(npc->mcam_entries); mem = rte_zmalloc(NULL, 4 * bmap_sz * npc->flow_max_priority, diff -Nru dpdk-19.11.7/drivers/net/octeontx2/otx2_flow.h dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_flow.h --- dpdk-19.11.7/drivers/net/octeontx2/otx2_flow.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_flow.h 2021-08-18 14:45:29.000000000 +0000 @@ -34,7 +34,6 @@ /* 32 bytes from LDATA_CFG & 32 bytes from FLAGS_CFG */ #define NPC_MAX_EXTRACT_DATA_LEN (64) #define NPC_LDATA_LFLAG_LEN (16) -#define NPC_MCAM_TOT_ENTRIES (4096) #define NPC_MAX_KEY_NIBBLES (31) /* Nibble offsets */ #define NPC_LAYER_KEYX_SZ (3) diff -Nru dpdk-19.11.7/drivers/net/octeontx2/otx2_tx.c dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_tx.c --- dpdk-19.11.7/drivers/net/octeontx2/otx2_tx.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_tx.c 2021-08-18 14:45:29.000000000 +0000 @@ -27,6 +27,7 @@ struct otx2_eth_txq *txq = tx_queue; uint16_t i; const rte_iova_t io_addr = txq->io_addr; void *lmt_addr = txq->lmt_addr; + uint64_t lso_tun_fmt; NIX_XMIT_FC_OR_RETURN(txq, pkts); @@ -34,6 +35,7 @@ /* Perform header writes before barrier for TSO */ if (flags & NIX_TX_OFFLOAD_TSO_F) { + lso_tun_fmt = txq->lso_tun_fmt; for (i = 0; i < pkts; i++) otx2_nix_xmit_prepare_tso(tx_pkts[i], flags); } @@ -42,7 +44,7 @@ rte_cio_wmb(); for (i = 0; i < pkts; i++) { - otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags); + otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags, lso_tun_fmt); /* Passing no of segdw as 4: HDR + EXT + SG + SMEM */ otx2_nix_xmit_prepare_tstamp(cmd, &txq->cmd[0], tx_pkts[i]->ol_flags, 4, flags); @@ -62,6 +64,7 @@ struct otx2_eth_txq *txq = tx_queue; uint64_t i; const rte_iova_t io_addr = txq->io_addr; void *lmt_addr = txq->lmt_addr; + uint64_t lso_tun_fmt; uint16_t segdw; NIX_XMIT_FC_OR_RETURN(txq, pkts); @@ -70,6 +73,7 @@ /* Perform header writes before barrier for TSO */ if (flags & NIX_TX_OFFLOAD_TSO_F) { + lso_tun_fmt = txq->lso_tun_fmt; for (i = 0; i < pkts; i++) otx2_nix_xmit_prepare_tso(tx_pkts[i], flags); } @@ -78,7 +82,7 @@ rte_cio_wmb(); for (i = 0; i < pkts; i++) { - otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags); + otx2_nix_xmit_prepare(tx_pkts[i], cmd, flags, lso_tun_fmt); segdw = otx2_nix_prepare_mseg(tx_pkts[i], cmd, flags); otx2_nix_xmit_prepare_tstamp(cmd, &txq->cmd[0], tx_pkts[i]->ol_flags, segdw, diff -Nru dpdk-19.11.7/drivers/net/octeontx2/otx2_tx.h dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_tx.h --- dpdk-19.11.7/drivers/net/octeontx2/otx2_tx.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_tx.h 2021-08-18 14:45:29.000000000 +0000 @@ -196,7 +196,8 @@ } static __rte_always_inline void -otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags) +otx2_nix_xmit_prepare(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags, + const uint64_t lso_tun_fmt) { struct nix_send_ext_s *send_hdr_ext; struct nix_send_hdr_s *send_hdr; @@ -338,14 +339,15 @@ (ol_flags & PKT_TX_TUNNEL_MASK)) { const uint8_t is_udp_tun = (NIX_UDP_TUN_BITMASK >> ((ol_flags & PKT_TX_TUNNEL_MASK) >> 45)) & 0x1; + uint8_t shift = is_udp_tun ? 32 : 0; + + shift += (!!(ol_flags & PKT_TX_OUTER_IPV6) << 4); + shift += (!!(ol_flags & PKT_TX_IPV6) << 3); w1.il4type = NIX_SENDL4TYPE_TCP_CKSUM; w1.ol4type = is_udp_tun ? NIX_SENDL4TYPE_UDP_CKSUM : 0; /* Update format for UDP tunneled packet */ - send_hdr_ext->w0.lso_format += is_udp_tun ? 2 : 6; - - send_hdr_ext->w0.lso_format += - !!(ol_flags & PKT_TX_OUTER_IPV6) << 1; + send_hdr_ext->w0.lso_format = (lso_tun_fmt >> shift); } } diff -Nru dpdk-19.11.7/drivers/net/octeontx2/otx2_vlan.c dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_vlan.c --- dpdk-19.11.7/drivers/net/octeontx2/otx2_vlan.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/octeontx2/otx2_vlan.c 2021-08-18 14:45:29.000000000 +0000 @@ -306,12 +306,12 @@ (0xF & ~(NPC_LT_LB_CTAG ^ NPC_LT_LB_STAG_QINQ)) << mkex->lb_lt_offset; - mcam_data = ((uint32_t)vlan_id << 16); - mcam_mask = (BIT_ULL(16) - 1) << 16; + mcam_data = (uint16_t)vlan_id; + mcam_mask = (BIT_ULL(16) - 1); otx2_mbox_memcpy(key_data + mkex->lb_xtract.key_off, - &mcam_data, mkex->lb_xtract.len + 1); + &mcam_data, mkex->lb_xtract.len); otx2_mbox_memcpy(key_mask + mkex->lb_xtract.key_off, - &mcam_mask, mkex->lb_xtract.len + 1); + &mcam_mask, mkex->lb_xtract.len); } /* Adds LB STAG flag to MCAM KW */ diff -Nru dpdk-19.11.7/drivers/net/pcap/rte_eth_pcap.c dpdk-19.11.10~rc1/drivers/net/pcap/rte_eth_pcap.c --- dpdk-19.11.7/drivers/net/pcap/rte_eth_pcap.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/pcap/rte_eth_pcap.c 2021-08-18 14:45:29.000000000 +0000 @@ -802,7 +802,7 @@ pcap_pkt_count = count_packets_in_pcap(pcap, pcap_q); - snprintf(ring_name, sizeof(ring_name), "PCAP_RING%" PRIu16, + snprintf(ring_name, sizeof(ring_name), "PCAP_RING%" PRIu32, ring_number); pcap_q->pkts = rte_ring_create(ring_name, diff -Nru dpdk-19.11.7/drivers/net/pfe/pfe_ethdev.c dpdk-19.11.10~rc1/drivers/net/pfe/pfe_ethdev.c --- dpdk-19.11.7/drivers/net/pfe/pfe_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/pfe/pfe_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -392,6 +392,9 @@ { PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + pfe_eth_stop(dev); /* Close the device file for link status */ pfe_eth_close_cdev(dev->data->dev_private); @@ -580,11 +583,6 @@ struct rte_eth_link link, old; unsigned int lstatus = 1; - if (dev == NULL) { - PFE_PMD_ERR("Invalid device in link_update.\n"); - return 0; - } - memset(&old, 0, sizeof(old)); memset(&link, 0, sizeof(struct rte_eth_link)); diff -Nru dpdk-19.11.7/drivers/net/qede/base/ecore_int.c dpdk-19.11.10~rc1/drivers/net/qede/base/ecore_int.c --- dpdk-19.11.7/drivers/net/qede/base/ecore_int.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/qede/base/ecore_int.c 2021-08-18 14:45:29.000000000 +0000 @@ -928,7 +928,7 @@ bool b_clear) { /* @DPDK */ - DP_NOTICE(p_hwfn->p_dev, false, "[block_id %d type %d]\n", id, type); + DP_VERBOSE(p_hwfn, ECORE_MSG_INTR, "[block_id %d type %d]\n", id, type); } /** diff -Nru dpdk-19.11.7/drivers/net/qede/qede_ethdev.c dpdk-19.11.10~rc1/drivers/net/qede/qede_ethdev.c --- dpdk-19.11.7/drivers/net/qede/qede_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/qede/qede_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -2049,8 +2049,10 @@ /* RSS hash key */ if (key) { if (len > (ECORE_RSS_KEY_SIZE * sizeof(uint32_t))) { - DP_ERR(edev, "RSS key length exceeds limit\n"); - return -EINVAL; + len = ECORE_RSS_KEY_SIZE * sizeof(uint32_t); + DP_NOTICE(edev, false, + "RSS key length too big, trimmed to %d\n", + len); } DP_INFO(edev, "Applying user supplied hash key\n"); rss_params.update_rss_key = 1; diff -Nru dpdk-19.11.7/drivers/net/sfc/base/efx_mcdi.c dpdk-19.11.10~rc1/drivers/net/sfc/base/efx_mcdi.c --- dpdk-19.11.7/drivers/net/sfc/base/efx_mcdi.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/sfc/base/efx_mcdi.c 2021-08-18 14:45:29.000000000 +0000 @@ -495,6 +495,9 @@ bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length); efx_mcdi_read_response(enp, emrp->emr_out_buf, resp_off, bytes); + /* Report bytes copied to caller (response message may be larger) */ + emrp->emr_out_length_used = bytes; + #if EFSYS_OPT_MCDI_LOGGING if (emtp->emt_logger != NULL) { emtp->emt_logger(emtp->emt_context, diff -Nru dpdk-19.11.7/drivers/net/sfc/sfc_ethdev.c dpdk-19.11.10~rc1/drivers/net/sfc/sfc_ethdev.c --- dpdk-19.11.7/drivers/net/sfc/sfc_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/sfc/sfc_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -319,12 +319,28 @@ } static void +sfc_eth_dev_secondary_clear_ops(struct rte_eth_dev *dev) +{ + free(dev->process_private); + dev->process_private = NULL; + dev->dev_ops = NULL; + dev->tx_pkt_prepare = NULL; + dev->tx_pkt_burst = NULL; + dev->rx_pkt_burst = NULL; +} + +static void sfc_dev_close(struct rte_eth_dev *dev) { struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev); sfc_log_init(sa, "entry"); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + sfc_eth_dev_secondary_clear_ops(dev); + return; + } + sfc_adapter_lock(sa); switch (sa->state) { case SFC_ADAPTER_STARTED: @@ -580,9 +596,9 @@ uint64_t *mac_stats; int ret; - rte_spinlock_lock(&port->mac_stats_lock); + sfc_adapter_lock(sa); - ret = sfc_port_update_mac_stats(sa); + ret = sfc_port_update_mac_stats(sa, B_FALSE); if (ret != 0) goto unlock; @@ -653,7 +669,7 @@ } unlock: - rte_spinlock_unlock(&port->mac_stats_lock); + sfc_adapter_unlock(sa); SFC_ASSERT(ret >= 0); return -ret; } @@ -665,12 +681,15 @@ struct sfc_port *port = &sa->port; int rc; + sfc_adapter_lock(sa); + if (sa->state != SFC_ADAPTER_STARTED) { /* * The operation cannot be done if port is not started; it * will be scheduled to be done during the next port start */ port->mac_stats_reset_pending = B_TRUE; + sfc_adapter_unlock(sa); return 0; } @@ -678,6 +697,8 @@ if (rc != 0) sfc_err(sa, "failed to reset statistics (rc = %d)", rc); + sfc_adapter_unlock(sa); + SFC_ASSERT(rc >= 0); return -rc; } @@ -693,9 +714,9 @@ unsigned int i; int nstats = 0; - rte_spinlock_lock(&port->mac_stats_lock); + sfc_adapter_lock(sa); - rc = sfc_port_update_mac_stats(sa); + rc = sfc_port_update_mac_stats(sa, B_FALSE); if (rc != 0) { SFC_ASSERT(rc > 0); nstats = -rc; @@ -715,7 +736,7 @@ } unlock: - rte_spinlock_unlock(&port->mac_stats_lock); + sfc_adapter_unlock(sa); return nstats; } @@ -750,19 +771,16 @@ struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev); struct sfc_port *port = &sa->port; uint64_t *mac_stats; - unsigned int nb_supported = 0; - unsigned int nb_written = 0; unsigned int i; int ret; int rc; - if (unlikely(values == NULL) || - unlikely((ids == NULL) && (n < port->mac_stats_nb_supported))) - return port->mac_stats_nb_supported; + if (unlikely(ids == NULL || values == NULL)) + return -EINVAL; - rte_spinlock_lock(&port->mac_stats_lock); + sfc_adapter_lock(sa); - rc = sfc_port_update_mac_stats(sa); + rc = sfc_port_update_mac_stats(sa, B_FALSE); if (rc != 0) { SFC_ASSERT(rc > 0); ret = -rc; @@ -771,20 +789,22 @@ mac_stats = port->mac_stats_buf; - for (i = 0; (i < EFX_MAC_NSTATS) && (nb_written < n); ++i) { - if (!EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, i)) - continue; - - if ((ids == NULL) || (ids[nb_written] == nb_supported)) - values[nb_written++] = mac_stats[i]; + SFC_ASSERT(port->mac_stats_nb_supported <= + RTE_DIM(port->mac_stats_by_id)); - ++nb_supported; + for (i = 0; i < n; i++) { + if (ids[i] < port->mac_stats_nb_supported) { + values[i] = mac_stats[port->mac_stats_by_id[ids[i]]]; + } else { + ret = i; + goto unlock; + } } - ret = nb_written; + ret = n; unlock: - rte_spinlock_unlock(&port->mac_stats_lock); + sfc_adapter_unlock(sa); return ret; } @@ -796,29 +816,39 @@ { struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev); struct sfc_port *port = &sa->port; - unsigned int nb_supported = 0; - unsigned int nb_written = 0; + unsigned int nb_supported; unsigned int i; - if (unlikely(xstats_names == NULL) || - unlikely((ids == NULL) && (size < port->mac_stats_nb_supported))) - return port->mac_stats_nb_supported; + if (unlikely(xstats_names == NULL && ids != NULL) || + unlikely(xstats_names != NULL && ids == NULL)) + return -EINVAL; - for (i = 0; (i < EFX_MAC_NSTATS) && (nb_written < size); ++i) { - if (!EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, i)) - continue; + sfc_adapter_lock(sa); - if ((ids == NULL) || (ids[nb_written] == nb_supported)) { - char *name = xstats_names[nb_written++].name; + if (unlikely(xstats_names == NULL && ids == NULL)) { + nb_supported = port->mac_stats_nb_supported; + sfc_adapter_unlock(sa); + return nb_supported; + } - strlcpy(name, efx_mac_stat_name(sa->nic, i), + SFC_ASSERT(port->mac_stats_nb_supported <= + RTE_DIM(port->mac_stats_by_id)); + + for (i = 0; i < size; i++) { + if (ids[i] < port->mac_stats_nb_supported) { + strlcpy(xstats_names[i].name, + efx_mac_stat_name(sa->nic, + port->mac_stats_by_id[ids[i]]), sizeof(xstats_names[0].name)); + } else { + sfc_adapter_unlock(sa); + return i; } - - ++nb_supported; } - return nb_written; + sfc_adapter_unlock(sa); + + return size; } static int @@ -2118,17 +2148,6 @@ } static void -sfc_eth_dev_secondary_clear_ops(struct rte_eth_dev *dev) -{ - free(dev->process_private); - dev->process_private = NULL; - dev->dev_ops = NULL; - dev->tx_pkt_prepare = NULL; - dev->tx_pkt_burst = NULL; - dev->rx_pkt_burst = NULL; -} - -static void sfc_register_dp(void) { /* Register once */ @@ -2263,11 +2282,6 @@ static int sfc_eth_dev_uninit(struct rte_eth_dev *dev) { - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { - sfc_eth_dev_secondary_clear_ops(dev); - return 0; - } - sfc_dev_close(dev); return 0; diff -Nru dpdk-19.11.7/drivers/net/sfc/sfc.h dpdk-19.11.10~rc1/drivers/net/sfc/sfc.h --- dpdk-19.11.7/drivers/net/sfc/sfc.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/sfc/sfc.h 2021-08-18 14:45:29.000000000 +0000 @@ -141,7 +141,6 @@ unsigned int nb_mcast_addrs; uint8_t *mcast_addrs; - rte_spinlock_t mac_stats_lock; uint64_t *mac_stats_buf; unsigned int mac_stats_nb_supported; efsys_mem_t mac_stats_dma_mem; @@ -153,6 +152,8 @@ uint32_t mac_stats_mask[EFX_MAC_STATS_MASK_NPAGES]; + unsigned int mac_stats_by_id[EFX_MAC_NSTATS]; + uint64_t ipackets; }; @@ -404,7 +405,7 @@ void sfc_port_stop(struct sfc_adapter *sa); void sfc_port_link_mode_to_info(efx_link_mode_t link_mode, struct rte_eth_link *link_info); -int sfc_port_update_mac_stats(struct sfc_adapter *sa); +int sfc_port_update_mac_stats(struct sfc_adapter *sa, boolean_t manual_update); int sfc_port_reset_mac_stats(struct sfc_adapter *sa); int sfc_set_rx_mode(struct sfc_adapter *sa); diff -Nru dpdk-19.11.7/drivers/net/sfc/sfc_port.c dpdk-19.11.10~rc1/drivers/net/sfc/sfc_port.c --- dpdk-19.11.7/drivers/net/sfc/sfc_port.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/sfc/sfc_port.c 2021-08-18 14:45:29.000000000 +0000 @@ -25,7 +25,8 @@ /** * Update MAC statistics in the buffer. * - * @param sa Adapter + * @param sa Adapter + * @param force_upload Flag to upload MAC stats in any case * * @return Status code * @retval 0 Success @@ -33,7 +34,7 @@ * @retval ENOMEM Memory allocation failure */ int -sfc_port_update_mac_stats(struct sfc_adapter *sa) +sfc_port_update_mac_stats(struct sfc_adapter *sa, boolean_t force_upload) { struct sfc_port *port = &sa->port; efsys_mem_t *esmp = &port->mac_stats_dma_mem; @@ -42,17 +43,17 @@ unsigned int nb_attempts = 0; int rc; - SFC_ASSERT(rte_spinlock_is_locked(&port->mac_stats_lock)); + SFC_ASSERT(sfc_adapter_is_locked(sa)); if (sa->state != SFC_ADAPTER_STARTED) - return EINVAL; + return 0; /* * If periodic statistics DMA'ing is off or if not supported, * make a manual request and keep an eye on timer if need be */ if (!port->mac_stats_periodic_dma_supported || - (port->mac_stats_update_period_ms == 0)) { + (port->mac_stats_update_period_ms == 0) || force_upload) { if (port->mac_stats_update_period_ms != 0) { uint64_t timestamp = sfc_get_system_msecs(); @@ -102,14 +103,13 @@ int sfc_port_reset_mac_stats(struct sfc_adapter *sa) { - struct sfc_port *port = &sa->port; int rc; - rte_spinlock_lock(&port->mac_stats_lock); + SFC_ASSERT(sfc_adapter_is_locked(sa)); + rc = efx_mac_stats_clear(sa->nic); if (rc == 0) sfc_port_reset_sw_stats(sa); - rte_spinlock_unlock(&port->mac_stats_lock); return rc; } @@ -157,6 +157,27 @@ #endif +static void +sfc_port_fill_mac_stats_info(struct sfc_adapter *sa) +{ + unsigned int mac_stats_nb_supported = 0; + struct sfc_port *port = &sa->port; + unsigned int stat_idx; + + efx_mac_stats_get_mask(sa->nic, port->mac_stats_mask, + sizeof(port->mac_stats_mask)); + + for (stat_idx = 0; stat_idx < EFX_MAC_NSTATS; ++stat_idx) { + if (!EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, stat_idx)) + continue; + + port->mac_stats_by_id[mac_stats_nb_supported] = stat_idx; + mac_stats_nb_supported++; + } + + port->mac_stats_nb_supported = mac_stats_nb_supported; +} + int sfc_port_start(struct sfc_adapter *sa) { @@ -165,7 +186,6 @@ uint32_t phy_adv_cap; const uint32_t phy_pause_caps = ((1u << EFX_PHY_CAP_PAUSE) | (1u << EFX_PHY_CAP_ASYM)); - unsigned int i; sfc_log_init(sa, "entry"); @@ -259,12 +279,7 @@ port->mac_stats_reset_pending = B_FALSE; } - efx_mac_stats_get_mask(sa->nic, port->mac_stats_mask, - sizeof(port->mac_stats_mask)); - - for (i = 0, port->mac_stats_nb_supported = 0; i < EFX_MAC_NSTATS; ++i) - if (EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, i)) - port->mac_stats_nb_supported++; + sfc_port_fill_mac_stats_info(sa); port->mac_stats_update_generation = 0; @@ -352,6 +367,8 @@ (void)efx_mac_stats_periodic(sa->nic, &sa->port.mac_stats_dma_mem, 0, B_FALSE); + sfc_port_update_mac_stats(sa, B_TRUE); + efx_port_fini(sa->nic); efx_filter_fini(sa->nic); @@ -415,8 +432,6 @@ goto fail_mcast_addr_list_buf_alloc; } - rte_spinlock_init(&port->mac_stats_lock); - rc = ENOMEM; port->mac_stats_buf = rte_calloc_socket("mac_stats_buf", EFX_MAC_NSTATS, sizeof(uint64_t), 0, diff -Nru dpdk-19.11.7/drivers/net/softnic/conn.c dpdk-19.11.10~rc1/drivers/net/softnic/conn.c --- dpdk-19.11.7/drivers/net/softnic/conn.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/softnic/conn.c 2021-08-18 14:45:29.000000000 +0000 @@ -144,6 +144,7 @@ free(conn->msg_out); free(conn->msg_in); + free(conn->buf); free(conn->prompt); free(conn->welcome); free(conn); diff -Nru dpdk-19.11.7/drivers/net/softnic/rte_eth_softnic_action.c dpdk-19.11.10~rc1/drivers/net/softnic/rte_eth_softnic_action.c --- dpdk-19.11.7/drivers/net/softnic/rte_eth_softnic_action.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/softnic/rte_eth_softnic_action.c 2021-08-18 14:45:29.000000000 +0000 @@ -183,6 +183,7 @@ break; TAILQ_REMOVE(&p->table_action_profile_list, profile, node); + rte_table_action_profile_free(profile->ap); free(profile); } } diff -Nru dpdk-19.11.7/drivers/net/szedata2/rte_eth_szedata2.c dpdk-19.11.10~rc1/drivers/net/szedata2/rte_eth_szedata2.c --- dpdk-19.11.7/drivers/net/szedata2/rte_eth_szedata2.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/szedata2/rte_eth_szedata2.c 2021-08-18 14:45:29.000000000 +0000 @@ -1166,6 +1166,9 @@ uint16_t nb_rx = dev->data->nb_rx_queues; uint16_t nb_tx = dev->data->nb_tx_queues; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + eth_dev_stop(dev); free(internals->sze_dev_path); diff -Nru dpdk-19.11.7/drivers/net/tap/rte_eth_tap.c dpdk-19.11.10~rc1/drivers/net/tap/rte_eth_tap.c --- dpdk-19.11.7/drivers/net/tap/rte_eth_tap.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/tap/rte_eth_tap.c 2021-08-18 14:45:29.000000000 +0000 @@ -1066,8 +1066,11 @@ if (internals->remote_if_index) { /* Restore initial remote state */ - ioctl(internals->ioctl_sock, SIOCSIFFLAGS, + int ret = ioctl(internals->ioctl_sock, SIOCSIFFLAGS, &internals->remote_initial_flags); + if (ret) + TAP_LOG(ERR, "restore remote state failed: %d", ret); + } rte_mempool_free(internals->gso_ctx_mp); diff -Nru dpdk-19.11.7/drivers/net/tap/tap_flow.c dpdk-19.11.10~rc1/drivers/net/tap/tap_flow.c --- dpdk-19.11.7/drivers/net/tap/tap_flow.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/tap/tap_flow.c 2021-08-18 14:45:29.000000000 +0000 @@ -1300,10 +1300,16 @@ static void tap_flow_set_handle(struct rte_flow *flow) { + union { + struct rte_flow *flow; + const void *key; + } tmp; uint32_t handle = 0; + tmp.flow = flow; + if (sizeof(flow) > 4) - handle = rte_jhash(&flow, sizeof(flow), 1); + handle = rte_jhash(tmp.key, sizeof(flow), 1); else handle = (uintptr_t)flow; /* must be at least 1 to avoid letting the kernel choose one for us */ diff -Nru dpdk-19.11.7/drivers/net/tap/tap_intr.c dpdk-19.11.10~rc1/drivers/net/tap/tap_intr.c --- dpdk-19.11.7/drivers/net/tap/tap_intr.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/tap/tap_intr.c 2021-08-18 14:45:29.000000000 +0000 @@ -59,7 +59,7 @@ if (!dev->data->dev_conf.intr_conf.rxq) return 0; - intr_handle->intr_vec = malloc(sizeof(intr_handle->intr_vec[rxqs_n])); + intr_handle->intr_vec = malloc(sizeof(int) * rxqs_n); if (intr_handle->intr_vec == NULL) { rte_errno = ENOMEM; TAP_LOG(ERR, diff -Nru dpdk-19.11.7/drivers/net/thunderx/nicvf_ethdev.c dpdk-19.11.10~rc1/drivers/net/thunderx/nicvf_ethdev.c --- dpdk-19.11.7/drivers/net/thunderx/nicvf_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/thunderx/nicvf_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -1875,6 +1875,8 @@ struct nicvf *nic = nicvf_pmd_priv(dev); PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; nicvf_dev_stop_cleanup(dev, true); nicvf_periodic_alarm_stop(nicvf_interrupt, dev); @@ -2101,10 +2103,7 @@ nicvf_eth_dev_uninit(struct rte_eth_dev *dev) { PMD_INIT_FUNC_TRACE(); - - if (rte_eal_process_type() == RTE_PROC_PRIMARY) - nicvf_dev_close(dev); - + nicvf_dev_close(dev); return 0; } static int diff -Nru dpdk-19.11.7/drivers/net/vhost/rte_eth_vhost.c dpdk-19.11.10~rc1/drivers/net/vhost/rte_eth_vhost.c --- dpdk-19.11.7/drivers/net/vhost/rte_eth_vhost.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/vhost/rte_eth_vhost.c 2021-08-18 14:45:29.000000000 +0000 @@ -1060,6 +1060,9 @@ struct internal_list *list; unsigned int i; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + internal = dev->data->dev_private; if (!internal) return; @@ -1520,11 +1523,7 @@ if (eth_dev == NULL) return 0; - if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return rte_eth_dev_release_port(eth_dev); - eth_dev_close(eth_dev); - rte_eth_dev_release_port(eth_dev); return 0; diff -Nru dpdk-19.11.7/drivers/net/virtio/meson.build dpdk-19.11.10~rc1/drivers/net/virtio/meson.build --- dpdk-19.11.7/drivers/net/virtio/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/virtio/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -13,7 +13,7 @@ sources += files('virtio_rxtx_simple_sse.c') elif arch_subdir == 'ppc_64' sources += files('virtio_rxtx_simple_altivec.c') -elif arch_subdir == 'arm' and host_machine.cpu_family().startswith('aarch64') +elif arch_subdir == 'arm' and dpdk_conf.get('RTE_ARCH_64') sources += files('virtio_rxtx_simple_neon.c') endif diff -Nru dpdk-19.11.7/drivers/net/virtio/virtio_ethdev.c dpdk-19.11.10~rc1/drivers/net/virtio/virtio_ethdev.c --- dpdk-19.11.7/drivers/net/virtio/virtio_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/virtio/virtio_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -721,6 +721,8 @@ struct rte_intr_conf *intr_conf = &dev->data->dev_conf.intr_conf; PMD_INIT_LOG(DEBUG, "virtio_dev_close"); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; if (!hw->opened) return; @@ -2445,6 +2447,7 @@ dev_info->min_rx_bufsize = VIRTIO_MIN_RX_BUFSIZE; dev_info->max_rx_pktlen = VIRTIO_MAX_RX_PKTLEN; dev_info->max_mac_addrs = VIRTIO_MAX_MAC_ADDRS; + dev_info->max_mtu = hw->max_mtu; host_features = VTPCI_OPS(hw)->get_features(hw); dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP; diff -Nru dpdk-19.11.7/drivers/net/virtio/virtio_rxtx.c dpdk-19.11.10~rc1/drivers/net/virtio/virtio_rxtx.c --- dpdk-19.11.7/drivers/net/virtio/virtio_rxtx.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/virtio/virtio_rxtx.c 2021-08-18 14:45:29.000000000 +0000 @@ -474,13 +474,35 @@ return 0; } +static inline void +virtqueue_refill_single_packed(struct virtqueue *vq, + struct vring_packed_desc *dp, + struct rte_mbuf *cookie) +{ + uint16_t flags = vq->vq_packed.cached_flags; + struct virtio_hw *hw = vq->hw; + + dp->addr = VIRTIO_MBUF_ADDR(cookie, vq) + + RTE_PKTMBUF_HEADROOM - hw->vtnet_hdr_size; + dp->len = cookie->buf_len - + RTE_PKTMBUF_HEADROOM + hw->vtnet_hdr_size; + + virtqueue_store_flags_packed(dp, flags, + hw->weak_barriers); + + if (++vq->vq_avail_idx >= vq->vq_nentries) { + vq->vq_avail_idx -= vq->vq_nentries; + vq->vq_packed.cached_flags ^= + VRING_PACKED_DESC_F_AVAIL_USED; + flags = vq->vq_packed.cached_flags; + } +} + static inline int -virtqueue_enqueue_recv_refill_packed(struct virtqueue *vq, +virtqueue_enqueue_recv_refill_packed_init(struct virtqueue *vq, struct rte_mbuf **cookie, uint16_t num) { struct vring_packed_desc *start_dp = vq->vq_packed.ring.desc; - uint16_t flags = vq->vq_packed.cached_flags; - struct virtio_hw *hw = vq->hw; struct vq_desc_extra *dxp; uint16_t idx; int i; @@ -496,24 +518,34 @@ dxp->cookie = (void *)cookie[i]; dxp->ndescs = 1; - start_dp[idx].addr = VIRTIO_MBUF_ADDR(cookie[i], vq) + - RTE_PKTMBUF_HEADROOM - hw->vtnet_hdr_size; - start_dp[idx].len = cookie[i]->buf_len - RTE_PKTMBUF_HEADROOM - + hw->vtnet_hdr_size; + virtqueue_refill_single_packed(vq, &start_dp[idx], cookie[i]); + } + vq->vq_free_cnt = (uint16_t)(vq->vq_free_cnt - num); + return 0; +} - vq->vq_desc_head_idx = dxp->next; - if (vq->vq_desc_head_idx == VQ_RING_DESC_CHAIN_END) - vq->vq_desc_tail_idx = vq->vq_desc_head_idx; +static inline int +virtqueue_enqueue_recv_refill_packed(struct virtqueue *vq, + struct rte_mbuf **cookie, uint16_t num) +{ + struct vring_packed_desc *start_dp = vq->vq_packed.ring.desc; + struct vq_desc_extra *dxp; + uint16_t idx, did; + int i; + + if (unlikely(vq->vq_free_cnt == 0)) + return -ENOSPC; + if (unlikely(vq->vq_free_cnt < num)) + return -EMSGSIZE; - virtqueue_store_flags_packed(&start_dp[idx], flags, - hw->weak_barriers); + for (i = 0; i < num; i++) { + idx = vq->vq_avail_idx; + did = start_dp[idx].id; + dxp = &vq->vq_descx[did]; + dxp->cookie = (void *)cookie[i]; + dxp->ndescs = 1; - if (++vq->vq_avail_idx >= vq->vq_nentries) { - vq->vq_avail_idx -= vq->vq_nentries; - vq->vq_packed.cached_flags ^= - VRING_PACKED_DESC_F_AVAIL_USED; - flags = vq->vq_packed.cached_flags; - } + virtqueue_refill_single_packed(vq, &start_dp[idx], cookie[i]); } vq->vq_free_cnt = (uint16_t)(vq->vq_free_cnt - num); return 0; @@ -1022,7 +1054,7 @@ /* Enqueue allocated buffers */ if (vtpci_packed_queue(vq->hw)) - error = virtqueue_enqueue_recv_refill_packed(vq, + error = virtqueue_enqueue_recv_refill_packed_init(vq, &m, 1); else error = virtqueue_enqueue_recv_refill(vq, diff -Nru dpdk-19.11.7/drivers/net/virtio/virtio_rxtx_simple_altivec.c dpdk-19.11.10~rc1/drivers/net/virtio/virtio_rxtx_simple_altivec.c --- dpdk-19.11.7/drivers/net/virtio/virtio_rxtx_simple_altivec.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/virtio/virtio_rxtx_simple_altivec.c 2021-08-18 14:45:29.000000000 +0000 @@ -85,6 +85,12 @@ if (unlikely(nb_pkts < RTE_VIRTIO_DESC_PER_LOOP)) return 0; + if (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { + virtio_rxq_rearm_vec(rxvq); + if (unlikely(virtqueue_kick_prepare(vq))) + virtqueue_notify(vq); + } + nb_used = VIRTQUEUE_NUSED(vq); rte_compiler_barrier(); @@ -102,12 +108,6 @@ rte_prefetch0(rused); - if (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { - virtio_rxq_rearm_vec(rxvq); - if (unlikely(virtqueue_kick_prepare(vq))) - virtqueue_notify(vq); - } - nb_total = nb_used; ref_rx_pkts = rx_pkts; for (nb_pkts_received = 0; diff -Nru dpdk-19.11.7/drivers/net/virtio/virtio_rxtx_simple_neon.c dpdk-19.11.10~rc1/drivers/net/virtio/virtio_rxtx_simple_neon.c --- dpdk-19.11.7/drivers/net/virtio/virtio_rxtx_simple_neon.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/virtio/virtio_rxtx_simple_neon.c 2021-08-18 14:45:29.000000000 +0000 @@ -83,6 +83,12 @@ if (unlikely(nb_pkts < RTE_VIRTIO_DESC_PER_LOOP)) return 0; + if (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { + virtio_rxq_rearm_vec(rxvq); + if (unlikely(virtqueue_kick_prepare(vq))) + virtqueue_notify(vq); + } + nb_used = VIRTQUEUE_NUSED(vq); rte_rmb(); @@ -100,12 +106,6 @@ rte_prefetch_non_temporal(rused); - if (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { - virtio_rxq_rearm_vec(rxvq); - if (unlikely(virtqueue_kick_prepare(vq))) - virtqueue_notify(vq); - } - nb_total = nb_used; ref_rx_pkts = rx_pkts; for (nb_pkts_received = 0; diff -Nru dpdk-19.11.7/drivers/net/virtio/virtio_rxtx_simple_sse.c dpdk-19.11.10~rc1/drivers/net/virtio/virtio_rxtx_simple_sse.c --- dpdk-19.11.7/drivers/net/virtio/virtio_rxtx_simple_sse.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/virtio/virtio_rxtx_simple_sse.c 2021-08-18 14:45:29.000000000 +0000 @@ -85,6 +85,12 @@ if (unlikely(nb_pkts < RTE_VIRTIO_DESC_PER_LOOP)) return 0; + if (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { + virtio_rxq_rearm_vec(rxvq); + if (unlikely(virtqueue_kick_prepare(vq))) + virtqueue_notify(vq); + } + nb_used = VIRTQUEUE_NUSED(vq); rte_compiler_barrier(); @@ -102,12 +108,6 @@ rte_prefetch0(rused); - if (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) { - virtio_rxq_rearm_vec(rxvq); - if (unlikely(virtqueue_kick_prepare(vq))) - virtqueue_notify(vq); - } - nb_total = nb_used; ref_rx_pkts = rx_pkts; for (nb_pkts_received = 0; diff -Nru dpdk-19.11.7/drivers/net/virtio/virtio_user_ethdev.c dpdk-19.11.10~rc1/drivers/net/virtio/virtio_user_ethdev.c --- dpdk-19.11.7/drivers/net/virtio/virtio_user_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/virtio/virtio_user_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -60,6 +60,32 @@ rte_spinlock_unlock(&hw->state_lock); } +static void +virtio_user_delayed_intr_reconfig_handler(void *param) +{ + struct virtio_hw *hw = (struct virtio_hw *)param; + struct rte_eth_dev *eth_dev = &rte_eth_devices[hw->port_id]; + struct virtio_user_dev *dev = virtio_user_get_dev(hw); + + PMD_DRV_LOG(DEBUG, "Unregistering intr fd: %d", + eth_dev->intr_handle->fd); + + if (rte_intr_callback_unregister(eth_dev->intr_handle, + virtio_interrupt_handler, + eth_dev) != 1) + PMD_DRV_LOG(ERR, "interrupt unregister failed"); + + eth_dev->intr_handle->fd = dev->vhostfd; + + PMD_DRV_LOG(DEBUG, "Registering intr fd: %d", eth_dev->intr_handle->fd); + + if (rte_intr_callback_register(eth_dev->intr_handle, + virtio_interrupt_handler, eth_dev)) + PMD_DRV_LOG(ERR, "interrupt register failed"); + + if (rte_intr_enable(eth_dev->intr_handle) < 0) + PMD_DRV_LOG(ERR, "interrupt enable failed"); +} static int virtio_user_server_reconnect(struct virtio_user_dev *dev) @@ -112,24 +138,21 @@ PMD_DRV_LOG(ERR, "interrupt disable failed"); return -1; } - rte_intr_callback_unregister(eth_dev->intr_handle, - virtio_interrupt_handler, - eth_dev); - eth_dev->intr_handle->fd = connectfd; - rte_intr_callback_register(eth_dev->intr_handle, - virtio_interrupt_handler, eth_dev); - - if (rte_intr_enable(eth_dev->intr_handle) < 0) { - PMD_DRV_LOG(ERR, "interrupt enable failed"); - return -1; - } + /* + * This function can be called from the interrupt handler, so + * we can't unregister interrupt handler here. Setting + * alarm to do that later. + */ + rte_eal_alarm_set(1, + virtio_user_delayed_intr_reconfig_handler, + (void *)hw); } PMD_INIT_LOG(NOTICE, "server mode virtio-user reconnection succeeds!"); return 0; } static void -virtio_user_delayed_handler(void *param) +virtio_user_delayed_disconnect_handler(void *param) { struct virtio_hw *hw = (struct virtio_hw *)param; struct rte_eth_dev *eth_dev = &rte_eth_devices[hw->port_id]; @@ -139,16 +162,29 @@ PMD_DRV_LOG(ERR, "interrupt disable failed"); return; } - rte_intr_callback_unregister(eth_dev->intr_handle, - virtio_interrupt_handler, eth_dev); + + PMD_DRV_LOG(DEBUG, "Unregistering intr fd: %d", + eth_dev->intr_handle->fd); + if (rte_intr_callback_unregister(eth_dev->intr_handle, + virtio_interrupt_handler, + eth_dev) != 1) + PMD_DRV_LOG(ERR, "interrupt unregister failed"); + if (dev->is_server) { if (dev->vhostfd >= 0) { close(dev->vhostfd); dev->vhostfd = -1; } eth_dev->intr_handle->fd = dev->listenfd; - rte_intr_callback_register(eth_dev->intr_handle, - virtio_interrupt_handler, eth_dev); + + PMD_DRV_LOG(DEBUG, "Registering intr fd: %d", + eth_dev->intr_handle->fd); + + if (rte_intr_callback_register(eth_dev->intr_handle, + virtio_interrupt_handler, + eth_dev)) + PMD_DRV_LOG(ERR, "interrupt register failed"); + if (rte_intr_enable(eth_dev->intr_handle) < 0) { PMD_DRV_LOG(ERR, "interrupt enable failed"); return; @@ -194,8 +230,8 @@ * unregistered here, set an alarm to do it. */ rte_eal_alarm_set(1, - virtio_user_delayed_handler, - (void *)hw); + virtio_user_delayed_disconnect_handler, + (void *)hw); } else { dev->net_status |= VIRTIO_NET_S_LINK_UP; } diff -Nru dpdk-19.11.7/drivers/net/vmxnet3/vmxnet3_ethdev.c dpdk-19.11.10~rc1/drivers/net/vmxnet3/vmxnet3_ethdev.c --- dpdk-19.11.7/drivers/net/vmxnet3/vmxnet3_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/net/vmxnet3/vmxnet3_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -893,6 +893,8 @@ vmxnet3_dev_close(struct rte_eth_dev *dev) { PMD_INIT_FUNC_TRACE(); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; vmxnet3_dev_stop(dev); vmxnet3_free_queues(dev); diff -Nru dpdk-19.11.7/drivers/raw/ntb/ntb.c dpdk-19.11.10~rc1/drivers/raw/ntb/ntb.c --- dpdk-19.11.7/drivers/raw/ntb/ntb.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/raw/ntb/ntb.c 2021-08-18 14:45:29.000000000 +0000 @@ -894,6 +894,11 @@ hw->peer_mw_base = rte_zmalloc("ntb_peer_mw_base", hw->mw_cnt * sizeof(uint64_t), 0); + if (hw->peer_mw_base == NULL) { + NTB_LOG(ERR, "Cannot allocate memory for peer mw base."); + ret = -ENOMEM; + goto err_q_init; + } if (hw->ntb_ops->spad_read == NULL) { ret = -ENOTSUP; @@ -1051,6 +1056,10 @@ if (hw->ntb_ops->spad_write == NULL) return -ENOTSUP; index = atoi(&attr_name[NTB_SPAD_USER_LEN]); + if (index < 0 || index >= NTB_SPAD_USER_MAX_NUM) { + NTB_LOG(ERR, "Invalid attribute (%s)", attr_name); + return -EINVAL; + } (*hw->ntb_ops->spad_write)(dev, hw->spad_user_list[index], 1, attr_value); NTB_LOG(DEBUG, "Set attribute (%s) Value (%" PRIu64 ")", @@ -1145,6 +1154,10 @@ if (hw->ntb_ops->spad_read == NULL) return -ENOTSUP; index = atoi(&attr_name[NTB_SPAD_USER_LEN]); + if (index < 0 || index >= NTB_SPAD_USER_MAX_NUM) { + NTB_LOG(ERR, "Attribute (%s) out of range", attr_name); + return -EINVAL; + } *attr_value = (*hw->ntb_ops->spad_read)(dev, hw->spad_user_list[index], 0); NTB_LOG(DEBUG, "Attribute (%s) Value (%" PRIu64 ")", diff -Nru dpdk-19.11.7/drivers/raw/ntb/ntb_hw_intel.c dpdk-19.11.10~rc1/drivers/raw/ntb/ntb_hw_intel.c --- dpdk-19.11.7/drivers/raw/ntb/ntb_hw_intel.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/raw/ntb/ntb_hw_intel.c 2021-08-18 14:45:29.000000000 +0000 @@ -79,6 +79,11 @@ hw->mw_size = rte_zmalloc("ntb_mw_size", hw->mw_cnt * sizeof(uint64_t), 0); + if (hw->mw_size == NULL) { + NTB_LOG(ERR, "Cannot allocate memory for mw size."); + return -ENOMEM; + } + for (i = 0; i < hw->mw_cnt; i++) { bar = intel_ntb_bar[i]; hw->mw_size[i] = hw->pci_dev->mem_resource[bar].len; diff -Nru dpdk-19.11.7/drivers/raw/skeleton/skeleton_rawdev_test.c dpdk-19.11.10~rc1/drivers/raw/skeleton/skeleton_rawdev_test.c --- dpdk-19.11.7/drivers/raw/skeleton/skeleton_rawdev_test.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/drivers/raw/skeleton/skeleton_rawdev_test.c 2021-08-18 14:45:29.000000000 +0000 @@ -291,6 +291,7 @@ dummy_value = &set_value; *dummy_value = 200; ret = rte_rawdev_set_attr(test_dev_id, "Test2", (uintptr_t)dummy_value); + RTE_TEST_ASSERT(!ret, "Unable to set an attribute (Test2)"); /* Check if attributes have been set */ ret = rte_rawdev_get_attr(test_dev_id, "Test1", &ret_value); diff -Nru dpdk-19.11.7/examples/bbdev_app/main.c dpdk-19.11.10~rc1/examples/bbdev_app/main.c --- dpdk-19.11.7/examples/bbdev_app/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/bbdev_app/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -1171,5 +1171,8 @@ ret |= rte_eal_wait_lcore(lcore_id); } + /* clean up the EAL */ + rte_eal_cleanup(); + return ret; } diff -Nru dpdk-19.11.7/examples/bbdev_app/Makefile dpdk-19.11.10~rc1/examples/bbdev_app/Makefile --- dpdk-19.11.7/examples/bbdev_app/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/bbdev_app/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-19.11.7/examples/bond/main.c dpdk-19.11.10~rc1/examples/bond/main.c --- dpdk-19.11.7/examples/bond/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/bond/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -879,5 +879,9 @@ prompt(NULL); rte_delay_ms(100); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/bond/Makefile dpdk-19.11.10~rc1/examples/bond/Makefile --- dpdk-19.11.7/examples/bond/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/bond/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -24,7 +24,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-19.11.7/examples/cmdline/main.c dpdk-19.11.10~rc1/examples/cmdline/main.c --- dpdk-19.11.7/examples/cmdline/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/cmdline/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -37,5 +37,8 @@ cmdline_interact(cl); cmdline_stdin_exit(cl); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/cmdline/Makefile dpdk-19.11.10~rc1/examples/cmdline/Makefile --- dpdk-19.11.7/examples/cmdline/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/cmdline/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/distributor/main.c dpdk-19.11.10~rc1/examples/distributor/main.c --- dpdk-19.11.7/examples/distributor/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/distributor/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -935,5 +935,8 @@ rte_free(pd); rte_free(pr); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/distributor/Makefile dpdk-19.11.10~rc1/examples/distributor/Makefile --- dpdk-19.11.7/examples/distributor/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/distributor/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/ethtool/ethtool-app/ethapp.c dpdk-19.11.10~rc1/examples/ethtool/ethtool-app/ethapp.c --- dpdk-19.11.7/examples/ethtool/ethtool-app/ethapp.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ethtool/ethtool-app/ethapp.c 2021-08-18 14:45:29.000000000 +0000 @@ -527,7 +527,6 @@ printf("Error: Invalid port number %i\n", params->port); return; } - new_mtu = atoi(params->opt); new_mtu = strtoul(params->opt, &ptr_parse_end, 10); if (*ptr_parse_end != '\0' || new_mtu < RTE_ETHER_MIN_MTU || diff -Nru dpdk-19.11.7/examples/ethtool/ethtool-app/main.c dpdk-19.11.10~rc1/examples/ethtool/ethtool-app/main.c --- dpdk-19.11.7/examples/ethtool/ethtool-app/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ethtool/ethtool-app/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -298,5 +298,8 @@ return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/eventdev_pipeline/Makefile dpdk-19.11.10~rc1/examples/eventdev_pipeline/Makefile --- dpdk-19.11.7/examples/eventdev_pipeline/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/eventdev_pipeline/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -24,7 +24,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/fips_validation/main.c dpdk-19.11.10~rc1/examples/fips_validation/main.c --- dpdk-19.11.7/examples/fips_validation/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/fips_validation/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -433,6 +433,9 @@ fips_test_clear(); cryptodev_fips_validate_app_uninit(); + /* clean up the EAL */ + rte_eal_cleanup(); + return ret; } diff -Nru dpdk-19.11.7/examples/fips_validation/Makefile dpdk-19.11.10~rc1/examples/fips_validation/Makefile --- dpdk-19.11.7/examples/fips_validation/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/fips_validation/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -31,7 +31,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-19.11.7/examples/flow_classify/flow_classify.c dpdk-19.11.10~rc1/examples/flow_classify/flow_classify.c --- dpdk-19.11.7/examples/flow_classify/flow_classify.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/flow_classify/flow_classify.c 2021-08-18 14:45:29.000000000 +0000 @@ -284,7 +284,7 @@ * for best performance. */ RTE_ETH_FOREACH_DEV(port) - if (rte_eth_dev_socket_id(port) > 0 && + if (rte_eth_dev_socket_id(port) >= 0 && rte_eth_dev_socket_id(port) != (int)rte_socket_id()) { printf("\n\n"); printf("WARNING: port %u is on remote NUMA node\n", @@ -853,5 +853,8 @@ /* Call lcore_main on the master core only. */ lcore_main(cls_app); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/flow_classify/Makefile dpdk-19.11.10~rc1/examples/flow_classify/Makefile --- dpdk-19.11.7/examples/flow_classify/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/flow_classify/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-19.11.7/examples/flow_filtering/main.c dpdk-19.11.10~rc1/examples/flow_filtering/main.c --- dpdk-19.11.7/examples/flow_filtering/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/flow_filtering/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -256,5 +256,8 @@ main_loop(); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/flow_filtering/Makefile dpdk-19.11.10~rc1/examples/flow_filtering/Makefile --- dpdk-19.11.7/examples/flow_filtering/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/flow_filtering/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -20,7 +20,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/helloworld/main.c dpdk-19.11.10~rc1/examples/helloworld/main.c --- dpdk-19.11.7/examples/helloworld/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/helloworld/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -43,5 +43,9 @@ lcore_hello(NULL); rte_eal_mp_wait_lcore(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/helloworld/Makefile dpdk-19.11.10~rc1/examples/helloworld/Makefile --- dpdk-19.11.7/examples/helloworld/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/helloworld/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/ioat/ioatfwd.c dpdk-19.11.10~rc1/examples/ioat/ioatfwd.c --- dpdk-19.11.7/examples/ioat/ioatfwd.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ioat/ioatfwd.c 2021-08-18 14:45:29.000000000 +0000 @@ -1013,6 +1013,9 @@ rte_ring_free(cfg.ports[i].rx_to_tx_ring); } + /* clean up the EAL */ + rte_eal_cleanup(); + printf("Bye...\n"); return 0; } diff -Nru dpdk-19.11.7/examples/ioat/Makefile dpdk-19.11.10~rc1/examples/ioat/Makefile --- dpdk-19.11.7/examples/ioat/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ioat/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/ip_fragmentation/main.c dpdk-19.11.10~rc1/examples/ip_fragmentation/main.c --- dpdk-19.11.7/examples/ip_fragmentation/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ip_fragmentation/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -1078,5 +1078,8 @@ return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/ip_fragmentation/Makefile dpdk-19.11.10~rc1/examples/ip_fragmentation/Makefile --- dpdk-19.11.7/examples/ip_fragmentation/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ip_fragmentation/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -23,7 +23,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/ip_pipeline/main.c dpdk-19.11.10~rc1/examples/ip_pipeline/main.c --- dpdk-19.11.7/examples/ip_pipeline/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ip_pipeline/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -266,4 +266,7 @@ kni_handle_request(); } + + /* clean up the EAL */ + rte_eal_cleanup(); } diff -Nru dpdk-19.11.7/examples/ip_pipeline/Makefile dpdk-19.11.10~rc1/examples/ip_pipeline/Makefile --- dpdk-19.11.7/examples/ip_pipeline/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ip_pipeline/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -35,7 +35,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -I. -DALLOW_EXPERIMENTAL_API -D_GNU_SOURCE diff -Nru dpdk-19.11.7/examples/ip_reassembly/main.c dpdk-19.11.10~rc1/examples/ip_reassembly/main.c --- dpdk-19.11.7/examples/ip_reassembly/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ip_reassembly/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -1207,5 +1207,8 @@ return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/ip_reassembly/Makefile dpdk-19.11.10~rc1/examples/ip_reassembly/Makefile --- dpdk-19.11.7/examples/ip_reassembly/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ip_reassembly/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -23,7 +23,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/ipsec-secgw/ipsec-secgw.c dpdk-19.11.10~rc1/examples/ipsec-secgw/ipsec-secgw.c --- dpdk-19.11.7/examples/ipsec-secgw/ipsec-secgw.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ipsec-secgw/ipsec-secgw.c 2021-08-18 14:45:29.000000000 +0000 @@ -2543,5 +2543,7 @@ return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); return 0; } diff -Nru dpdk-19.11.7/examples/ipsec-secgw/Makefile dpdk-19.11.10~rc1/examples/ipsec-secgw/Makefile --- dpdk-19.11.7/examples/ipsec-secgw/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ipsec-secgw/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -33,7 +33,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-19.11.7/examples/ipv4_multicast/main.c dpdk-19.11.10~rc1/examples/ipv4_multicast/main.c --- dpdk-19.11.7/examples/ipv4_multicast/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ipv4_multicast/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -811,5 +811,8 @@ return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/ipv4_multicast/Makefile dpdk-19.11.10~rc1/examples/ipv4_multicast/Makefile --- dpdk-19.11.7/examples/ipv4_multicast/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ipv4_multicast/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -23,7 +23,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/kni/main.c dpdk-19.11.10~rc1/examples/kni/main.c --- dpdk-19.11.7/examples/kni/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/kni/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -1120,5 +1120,8 @@ kni_port_params_array[i] = NULL; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/kni/Makefile dpdk-19.11.10~rc1/examples/kni/Makefile --- dpdk-19.11.7/examples/kni/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/kni/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -23,7 +23,7 @@ CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) LDFLAGS += -pthread diff -Nru dpdk-19.11.7/examples/l2fwd/main.c dpdk-19.11.10~rc1/examples/l2fwd/main.c --- dpdk-19.11.7/examples/l2fwd/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -772,6 +772,9 @@ rte_eth_dev_close(portid); printf(" Done\n"); } + + /* clean up the EAL */ + rte_eal_cleanup(); printf("Bye...\n"); return ret; diff -Nru dpdk-19.11.7/examples/l2fwd/Makefile dpdk-19.11.10~rc1/examples/l2fwd/Makefile --- dpdk-19.11.7/examples/l2fwd/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -24,7 +24,7 @@ # Add flag to allow experimental API as l2fwd uses rte_ethdev_set_ptype API CFLAGS += -DALLOW_EXPERIMENTAL_API LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/l2fwd-cat/l2fwd-cat.c dpdk-19.11.10~rc1/examples/l2fwd-cat/l2fwd-cat.c --- dpdk-19.11.7/examples/l2fwd-cat/l2fwd-cat.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd-cat/l2fwd-cat.c 2021-08-18 14:45:29.000000000 +0000 @@ -107,7 +107,7 @@ * for best performance. */ RTE_ETH_FOREACH_DEV(port) - if (rte_eth_dev_socket_id(port) > 0 && + if (rte_eth_dev_socket_id(port) >= 0 && rte_eth_dev_socket_id(port) != (int)rte_socket_id()) printf("WARNING, port %u is on remote NUMA node to " @@ -201,5 +201,8 @@ /* Call lcore_main on the master core only. */ lcore_main(); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/l2fwd-cat/Makefile dpdk-19.11.10~rc1/examples/l2fwd-cat/Makefile --- dpdk-19.11.7/examples/l2fwd-cat/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd-cat/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) LDFLAGS += -lpqos diff -Nru dpdk-19.11.7/examples/l2fwd-crypto/main.c dpdk-19.11.10~rc1/examples/l2fwd-crypto/main.c --- dpdk-19.11.7/examples/l2fwd-crypto/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd-crypto/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -616,12 +616,26 @@ struct l2fwd_crypto_options *options) { uint16_t dst_port; + uint32_t pad_len; + struct rte_ipv4_hdr *ip_hdr; + uint32_t ipdata_offset = sizeof(struct rte_ether_hdr); + ip_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(m, char *) + + ipdata_offset); dst_port = l2fwd_dst_ports[portid]; if (options->mac_updating) l2fwd_mac_updating(m, dst_port); + if (options->auth_xform.auth.op == RTE_CRYPTO_AUTH_OP_VERIFY) + rte_pktmbuf_trim(m, options->auth_xform.auth.digest_length); + + if (options->cipher_xform.cipher.op == RTE_CRYPTO_CIPHER_OP_DECRYPT) { + pad_len = m->pkt_len - rte_be_to_cpu_16(ip_hdr->total_length) - + ipdata_offset; + rte_pktmbuf_trim(m, pad_len); + } + l2fwd_send_packet(m, dst_port); } @@ -2254,6 +2268,12 @@ if (enabled_cdevs[cdev_id] == 0) continue; + if (check_cryptodev_mask(options, cdev_id) < 0) + continue; + + if (check_capabilities(options, cdev_id) < 0) + continue; + retval = rte_cryptodev_socket_id(cdev_id); if (retval < 0) { @@ -2808,5 +2828,8 @@ return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/l2fwd-crypto/Makefile dpdk-19.11.10~rc1/examples/l2fwd-crypto/Makefile --- dpdk-19.11.7/examples/l2fwd-crypto/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd-crypto/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API CONFIG_DEFINES = $(shell $(CC) $(CFLAGS) -dM -E - < /dev/null) diff -Nru dpdk-19.11.7/examples/l2fwd-event/main.c dpdk-19.11.10~rc1/examples/l2fwd-event/main.c --- dpdk-19.11.7/examples/l2fwd-event/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd-event/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -583,6 +583,9 @@ printf(" Done\n"); } } + + /* clean up the EAL */ + rte_eal_cleanup(); printf("Bye...\n"); return 0; diff -Nru dpdk-19.11.7/examples/l2fwd-event/Makefile dpdk-19.11.10~rc1/examples/l2fwd-event/Makefile --- dpdk-19.11.7/examples/l2fwd-event/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd-event/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -28,7 +28,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/l2fwd-jobstats/main.c dpdk-19.11.10~rc1/examples/l2fwd-jobstats/main.c --- dpdk-19.11.7/examples/l2fwd-jobstats/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd-jobstats/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -1028,5 +1028,8 @@ return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/l2fwd-jobstats/Makefile dpdk-19.11.10~rc1/examples/l2fwd-jobstats/Makefile --- dpdk-19.11.7/examples/l2fwd-jobstats/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd-jobstats/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/l2fwd-keepalive/main.c dpdk-19.11.10~rc1/examples/l2fwd-keepalive/main.c --- dpdk-19.11.7/examples/l2fwd-keepalive/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd-keepalive/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -823,5 +823,9 @@ if (ka_shm != NULL) rte_keepalive_shm_cleanup(ka_shm); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/l2fwd-keepalive/Makefile dpdk-19.11.10~rc1/examples/l2fwd-keepalive/Makefile --- dpdk-19.11.7/examples/l2fwd-keepalive/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l2fwd-keepalive/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -24,7 +24,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/l3fwd/l3fwd_lpm.c dpdk-19.11.10~rc1/examples/l3fwd/l3fwd_lpm.c --- dpdk-19.11.7/examples/l3fwd/l3fwd_lpm.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l3fwd/l3fwd_lpm.c 2021-08-18 14:45:29.000000000 +0000 @@ -41,7 +41,10 @@ uint8_t if_out; }; -/* 198.18.0.0/16 are set aside for RFC2544 benchmarking (RFC5735). */ +/* + * 198.18.0.0/16 are set aside for RFC2544 benchmarking (RFC5735). + * 198.18.{0-7}.0/24 = Port {0-7} + */ static struct ipv4_l3fwd_lpm_route ipv4_l3fwd_lpm_route_array[] = { {RTE_IPV4(198, 18, 0, 0), 24, 0}, {RTE_IPV4(198, 18, 1, 0), 24, 1}, @@ -53,16 +56,19 @@ {RTE_IPV4(198, 18, 7, 0), 24, 7}, }; -/* 2001:0200::/48 is IANA reserved range for IPv6 benchmarking (RFC5180) */ +/* + * 2001:200::/48 is IANA reserved range for IPv6 benchmarking (RFC5180). + * 2001:200:0:{0-7}::/64 = Port {0-7} + */ static struct ipv6_l3fwd_lpm_route ipv6_l3fwd_lpm_route_array[] = { - {{32, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 48, 0}, - {{32, 1, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, 48, 1}, - {{32, 1, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0}, 48, 2}, - {{32, 1, 2, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0}, 48, 3}, - {{32, 1, 2, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0}, 48, 4}, - {{32, 1, 2, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0}, 48, 5}, - {{32, 1, 2, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0}, 48, 6}, - {{32, 1, 2, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0}, 48, 7}, + {{32, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 0}, + {{32, 1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 1}, + {{32, 1, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 2}, + {{32, 1, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 3}, + {{32, 1, 2, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 4}, + {{32, 1, 2, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 5}, + {{32, 1, 2, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 6}, + {{32, 1, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0}, 64, 7}, }; #define IPV4_L3FWD_LPM_NUM_ROUTES \ diff -Nru dpdk-19.11.7/examples/l3fwd/main.c dpdk-19.11.10~rc1/examples/l3fwd/main.c --- dpdk-19.11.7/examples/l3fwd/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l3fwd/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -1093,6 +1093,10 @@ rte_eth_dev_close(portid); printf(" Done\n"); } + + /* clean up the EAL */ + rte_eal_cleanup(); + printf("Bye...\n"); return ret; diff -Nru dpdk-19.11.7/examples/l3fwd/Makefile dpdk-19.11.10~rc1/examples/l3fwd/Makefile --- dpdk-19.11.7/examples/l3fwd/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l3fwd/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/l3fwd-acl/main.c dpdk-19.11.10~rc1/examples/l3fwd-acl/main.c --- dpdk-19.11.7/examples/l3fwd-acl/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l3fwd-acl/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -2116,5 +2116,8 @@ return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/l3fwd-acl/Makefile dpdk-19.11.10~rc1/examples/l3fwd-acl/Makefile --- dpdk-19.11.7/examples/l3fwd-acl/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l3fwd-acl/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/l3fwd-power/main.c dpdk-19.11.10~rc1/examples/l3fwd-power/main.c --- dpdk-19.11.7/examples/l3fwd-power/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l3fwd-power/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -1578,7 +1578,7 @@ int hgh_edpi; ep_med_edpi = EMPTY_POLL_MED_THRESHOLD; - ep_hgh_edpi = EMPTY_POLL_MED_THRESHOLD; + ep_hgh_edpi = EMPTY_POLL_HGH_THRESHOLD; strlcpy(s, p, sizeof(s)); @@ -1601,7 +1601,7 @@ if (med_edpi > 0) ep_med_edpi = med_edpi; - if (med_edpi > 0) + if (hgh_edpi > 0) ep_hgh_edpi = hgh_edpi; } else { diff -Nru dpdk-19.11.7/examples/l3fwd-power/Makefile dpdk-19.11.10~rc1/examples/l3fwd-power/Makefile --- dpdk-19.11.7/examples/l3fwd-power/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/l3fwd-power/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-19.11.7/examples/link_status_interrupt/main.c dpdk-19.11.10~rc1/examples/link_status_interrupt/main.c --- dpdk-19.11.7/examples/link_status_interrupt/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/link_status_interrupt/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -741,5 +741,8 @@ return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/link_status_interrupt/Makefile dpdk-19.11.10~rc1/examples/link_status_interrupt/Makefile --- dpdk-19.11.7/examples/link_status_interrupt/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/link_status_interrupt/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/meson.build dpdk-19.11.10~rc1/examples/meson.build --- dpdk-19.11.7/examples/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -1,13 +1,11 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017-2019 Intel Corporation -link_whole_libs = [] +driver_libs = [] if get_option('default_library') == 'static' - link_whole_libs = dpdk_static_libraries + dpdk_drivers + driver_libs = dpdk_drivers endif -execinfo = cc.find_library('execinfo', required: false) - # list of all example apps. Keep 1-3 per line, in alphabetical order. all_examples = [ 'bbdev_app', 'bond', @@ -47,6 +45,12 @@ 'vmdq', 'vmdq_dcb', ] +# on install, skip copying all meson.build files +ex_file_excludes = ['meson.build'] +foreach ex:all_examples + ex_file_excludes += [ex + '/meson.build'] +endforeach + if get_option('examples') == '' subdir_done() endif @@ -75,7 +79,7 @@ cflags = default_cflags ldflags = default_ldflags - ext_deps = [execinfo] + ext_deps = [] includes = [include_directories(example)] deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline'] if is_windows @@ -97,7 +101,7 @@ endif executable('dpdk-' + name, sources, include_directories: includes, - link_whole: link_whole_libs, + link_whole: driver_libs, link_args: ldflags, c_args: cflags, dependencies: dep_objs) diff -Nru dpdk-19.11.7/examples/multi_process/client_server_mp/mp_client/client.c dpdk-19.11.10~rc1/examples/multi_process/client_server_mp/mp_client/client.c --- dpdk-19.11.7/examples/multi_process/client_server_mp/mp_client/client.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/multi_process/client_server_mp/mp_client/client.c 2021-08-18 14:45:29.000000000 +0000 @@ -268,4 +268,7 @@ need_flush = 1; } + + /* clean up the EAL */ + rte_eal_cleanup(); } diff -Nru dpdk-19.11.7/examples/multi_process/client_server_mp/mp_server/main.c dpdk-19.11.10~rc1/examples/multi_process/client_server_mp/mp_server/main.c --- dpdk-19.11.7/examples/multi_process/client_server_mp/mp_server/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/multi_process/client_server_mp/mp_server/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -304,5 +304,9 @@ rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MASTER); do_packet_forwarding(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/multi_process/simple_mp/main.c dpdk-19.11.10~rc1/examples/multi_process/simple_mp/main.c --- dpdk-19.11.7/examples/multi_process/simple_mp/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/multi_process/simple_mp/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -121,5 +121,9 @@ cmdline_stdin_exit(cl); rte_eal_mp_wait_lcore(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/multi_process/symmetric_mp/main.c dpdk-19.11.10~rc1/examples/multi_process/symmetric_mp/main.c --- dpdk-19.11.7/examples/multi_process/symmetric_mp/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/multi_process/symmetric_mp/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -475,5 +475,8 @@ rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MASTER); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/ntb/Makefile dpdk-19.11.10~rc1/examples/ntb/Makefile --- dpdk-19.11.7/examples/ntb/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ntb/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -26,7 +26,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/ntb/ntb_fwd.c dpdk-19.11.10~rc1/examples/ntb/ntb_fwd.c --- dpdk-19.11.7/examples/ntb/ntb_fwd.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ntb/ntb_fwd.c 2021-08-18 14:45:29.000000000 +0000 @@ -1496,5 +1496,8 @@ start_pkt_fwd(); } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/packet_ordering/main.c dpdk-19.11.10~rc1/examples/packet_ordering/main.c --- dpdk-19.11.7/examples/packet_ordering/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/packet_ordering/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -293,7 +293,7 @@ if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; - ret = rte_eth_dev_configure(port_id, rxRings, txRings, &port_conf_default); + ret = rte_eth_dev_configure(port_id, rxRings, txRings, &port_conf); if (ret != 0) return ret; @@ -779,5 +779,9 @@ } print_stats(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/packet_ordering/Makefile dpdk-19.11.10~rc1/examples/packet_ordering/Makefile --- dpdk-19.11.7/examples/packet_ordering/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/packet_ordering/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/performance-thread/l3fwd-thread/main.c dpdk-19.11.10~rc1/examples/performance-thread/l3fwd-thread/main.c --- dpdk-19.11.7/examples/performance-thread/l3fwd-thread/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/performance-thread/l3fwd-thread/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -3783,5 +3783,8 @@ } } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/performance-thread/pthread_shim/main.c dpdk-19.11.10~rc1/examples/performance-thread/pthread_shim/main.c --- dpdk-19.11.7/examples/performance-thread/pthread_shim/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/performance-thread/pthread_shim/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -258,5 +258,9 @@ RTE_LCORE_FOREACH_SLAVE(lcore_id) { rte_eal_wait_lcore(lcore_id); } + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/ptpclient/Makefile dpdk-19.11.10~rc1/examples/ptpclient/Makefile --- dpdk-19.11.7/examples/ptpclient/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ptpclient/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/ptpclient/ptpclient.c dpdk-19.11.10~rc1/examples/ptpclient/ptpclient.c --- dpdk-19.11.7/examples/ptpclient/ptpclient.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/ptpclient/ptpclient.c 2021-08-18 14:45:29.000000000 +0000 @@ -603,10 +603,6 @@ unsigned nb_rx; struct rte_mbuf *m; - /* - * Check that the port is on the same NUMA node as the polling thread - * for best performance. - */ printf("\nCore %u Waiting for SYNC packets. [Ctrl+C to quit]\n", rte_lcore_id()); @@ -788,5 +784,8 @@ /* Call lcore_main on the master core only. */ lcore_main(); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/qos_meter/main.c dpdk-19.11.10~rc1/examples/qos_meter/main.c --- dpdk-19.11.7/examples/qos_meter/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/qos_meter/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -463,5 +463,8 @@ return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/qos_meter/Makefile dpdk-19.11.10~rc1/examples/qos_meter/Makefile --- dpdk-19.11.7/examples/qos_meter/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/qos_meter/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-19.11.7/examples/qos_sched/main.c dpdk-19.11.10~rc1/examples/qos_sched/main.c --- dpdk-19.11.7/examples/qos_sched/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/qos_sched/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -218,5 +218,8 @@ } } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/qos_sched/Makefile dpdk-19.11.10~rc1/examples/qos_sched/Makefile --- dpdk-19.11.7/examples/qos_sched/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/qos_sched/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/rxtx_callbacks/main.c dpdk-19.11.10~rc1/examples/rxtx_callbacks/main.c --- dpdk-19.11.7/examples/rxtx_callbacks/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/rxtx_callbacks/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -295,7 +295,7 @@ /* initialize all ports */ RTE_ETH_FOREACH_DEV(portid) if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8"\n", + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16"\n", portid); if (rte_lcore_count() > 1) @@ -304,5 +304,9 @@ /* call lcore_main on master core only */ lcore_main(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/rxtx_callbacks/Makefile dpdk-19.11.10~rc1/examples/rxtx_callbacks/Makefile --- dpdk-19.11.7/examples/rxtx_callbacks/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/rxtx_callbacks/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-19.11.7/examples/server_node_efd/node/node.c dpdk-19.11.10~rc1/examples/server_node_efd/node/node.c --- dpdk-19.11.7/examples/server_node_efd/node/node.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/server_node_efd/node/node.c 2021-08-18 14:45:29.000000000 +0000 @@ -383,4 +383,7 @@ need_flush = 1; } + + /* clean up the EAL */ + rte_eal_cleanup(); } diff -Nru dpdk-19.11.7/examples/server_node_efd/server/main.c dpdk-19.11.10~rc1/examples/server_node_efd/server/main.c --- dpdk-19.11.7/examples/server_node_efd/server/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/server_node_efd/server/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -334,5 +334,9 @@ rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MASTER); do_packet_forwarding(); + + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/service_cores/main.c dpdk-19.11.10~rc1/examples/service_cores/main.c --- dpdk-19.11.7/examples/service_cores/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/service_cores/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -220,5 +220,8 @@ i = 0; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/service_cores/Makefile dpdk-19.11.10~rc1/examples/service_cores/Makefile --- dpdk-19.11.7/examples/service_cores/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/service_cores/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/skeleton/basicfwd.c dpdk-19.11.10~rc1/examples/skeleton/basicfwd.c --- dpdk-19.11.7/examples/skeleton/basicfwd.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/skeleton/basicfwd.c 2021-08-18 14:45:29.000000000 +0000 @@ -122,7 +122,7 @@ * for best performance. */ RTE_ETH_FOREACH_DEV(port) - if (rte_eth_dev_socket_id(port) > 0 && + if (rte_eth_dev_socket_id(port) >= 0 && rte_eth_dev_socket_id(port) != (int)rte_socket_id()) printf("WARNING, port %u is on remote NUMA node to " @@ -205,5 +205,8 @@ /* Call lcore_main on the master core only. */ lcore_main(); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/skeleton/Makefile dpdk-19.11.10~rc1/examples/skeleton/Makefile --- dpdk-19.11.7/examples/skeleton/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/skeleton/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/tep_termination/Makefile dpdk-19.11.10~rc1/examples/tep_termination/Makefile --- dpdk-19.11.7/examples/tep_termination/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/tep_termination/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -24,7 +24,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -Wno-deprecated-declarations diff -Nru dpdk-19.11.7/examples/timer/main.c dpdk-19.11.10~rc1/examples/timer/main.c --- dpdk-19.11.7/examples/timer/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/timer/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -18,8 +18,7 @@ #include #include -#define TIMER_RESOLUTION_CYCLES 20000000ULL /* around 10ms at 2 Ghz */ - +static uint64_t timer_resolution_cycles; static struct rte_timer timer0; static struct rte_timer timer1; @@ -66,15 +65,14 @@ while (1) { /* - * Call the timer handler on each core: as we don't - * need a very precise timer, so only call - * rte_timer_manage() every ~10ms (at 2Ghz). In a real - * application, this will enhance performances as - * reading the HPET timer is not efficient. + * Call the timer handler on each core: as we don't need a + * very precise timer, so only call rte_timer_manage() + * every ~10ms. In a real application, this will enhance + * performances as reading the HPET timer is not efficient. */ - cur_tsc = rte_rdtsc(); + cur_tsc = rte_get_timer_cycles(); diff_tsc = cur_tsc - prev_tsc; - if (diff_tsc > TIMER_RESOLUTION_CYCLES) { + if (diff_tsc > timer_resolution_cycles) { rte_timer_manage(); prev_tsc = cur_tsc; } @@ -100,8 +98,10 @@ rte_timer_init(&timer0); rte_timer_init(&timer1); - /* load timer0, every second, on master lcore, reloaded automatically */ hz = rte_get_timer_hz(); + timer_resolution_cycles = hz * 10 / 1000; /* around 10ms */ + + /* load timer0, every second, on main lcore, reloaded automatically */ lcore_id = rte_lcore_id(); rte_timer_reset(&timer0, hz, PERIODICAL, lcore_id, timer0_cb, NULL); @@ -117,5 +117,8 @@ /* call it on master lcore too */ (void) lcore_mainloop(NULL); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/timer/Makefile dpdk-19.11.10~rc1/examples/timer/Makefile --- dpdk-19.11.7/examples/timer/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/timer/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/vdpa/main.c dpdk-19.11.10~rc1/examples/vdpa/main.c --- dpdk-19.11.7/examples/vdpa/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vdpa/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -450,5 +450,8 @@ vdpa_sample_quit(); } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/vdpa/Makefile dpdk-19.11.10~rc1/examples/vdpa/Makefile --- dpdk-19.11.7/examples/vdpa/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vdpa/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -23,7 +23,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/vhost/main.c dpdk-19.11.10~rc1/examples/vhost/main.c --- dpdk-19.11.7/examples/vhost/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vhost/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -1571,6 +1571,8 @@ RTE_LCORE_FOREACH_SLAVE(lcore_id) rte_eal_wait_lcore(lcore_id); - return 0; + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/vhost/Makefile dpdk-19.11.10~rc1/examples/vhost/Makefile --- dpdk-19.11.7/examples/vhost/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vhost/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -24,7 +24,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-19.11.7/examples/vhost/virtio_net.c dpdk-19.11.10~rc1/examples/vhost/virtio_net.c --- dpdk-19.11.7/examples/vhost/virtio_net.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vhost/virtio_net.c 2021-08-18 14:45:29.000000000 +0000 @@ -23,6 +23,7 @@ uint16_t i; int vid = dev->vid; struct vhost_queue *queue; + int ret; RTE_LOG(INFO, VHOST_CONFIG, "setting builtin vhost-user net driver\n"); @@ -33,7 +34,12 @@ else dev->hdr_len = sizeof(struct virtio_net_hdr); - rte_vhost_get_mem_table(vid, &dev->mem); + ret = rte_vhost_get_mem_table(vid, &dev->mem); + if (ret < 0) { + RTE_LOG(ERR, VHOST_CONFIG, "Failed to get " + "VM memory layout for device(%d)\n", vid); + return; + } dev->nr_vrings = rte_vhost_get_vring_num(vid); for (i = 0; i < dev->nr_vrings; i++) { diff -Nru dpdk-19.11.7/examples/vhost_blk/Makefile dpdk-19.11.10~rc1/examples/vhost_blk/Makefile --- dpdk-19.11.7/examples/vhost_blk/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vhost_blk/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -25,7 +25,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-19.11.7/examples/vhost_blk/vhost_blk.c dpdk-19.11.10~rc1/examples/vhost_blk/vhost_blk.c --- dpdk-19.11.7/examples/vhost_blk/vhost_blk.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vhost_blk/vhost_blk.c 2021-08-18 14:45:29.000000000 +0000 @@ -1098,5 +1098,8 @@ while (1) sleep(1); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/vhost_crypto/main.c dpdk-19.11.10~rc1/examples/vhost_crypto/main.c --- dpdk-19.11.7/examples/vhost_crypto/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vhost_crypto/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -219,7 +219,7 @@ argvopt = argv; - while ((opt = getopt_long(argc, argvopt, "s:", + while ((opt = getopt_long(argc, argvopt, "", lgopts, &option_index)) != EOF) { switch (opt) { @@ -455,6 +455,9 @@ } memset(&options, 0, sizeof(options)); + + /* clean up the EAL */ + rte_eal_cleanup(); } int diff -Nru dpdk-19.11.7/examples/vhost_crypto/Makefile dpdk-19.11.10~rc1/examples/vhost_crypto/Makefile --- dpdk-19.11.7/examples/vhost_crypto/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vhost_crypto/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -23,7 +23,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/vmdq/main.c dpdk-19.11.10~rc1/examples/vmdq/main.c --- dpdk-19.11.7/examples/vmdq/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vmdq/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -662,5 +662,8 @@ return -1; } + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/vmdq/Makefile dpdk-19.11.10~rc1/examples/vmdq/Makefile --- dpdk-19.11.7/examples/vmdq/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vmdq/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/vmdq_dcb/main.c dpdk-19.11.10~rc1/examples/vmdq_dcb/main.c --- dpdk-19.11.7/examples/vmdq_dcb/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vmdq_dcb/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -710,5 +710,8 @@ /* call on master too */ (void) lcore_main((void*)i); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/vmdq_dcb/Makefile dpdk-19.11.10~rc1/examples/vmdq_dcb/Makefile --- dpdk-19.11.7/examples/vmdq_dcb/Makefile 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vmdq_dcb/Makefile 2021-08-18 14:45:29.000000000 +0000 @@ -22,7 +22,7 @@ PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-19.11.7/examples/vm_power_manager/guest_cli/main.c dpdk-19.11.10~rc1/examples/vm_power_manager/guest_cli/main.c --- dpdk-19.11.7/examples/vm_power_manager/guest_cli/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vm_power_manager/guest_cli/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -200,5 +200,8 @@ } run_cli(NULL); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/examples/vm_power_manager/main.c dpdk-19.11.10~rc1/examples/vm_power_manager/main.c --- dpdk-19.11.7/examples/vm_power_manager/main.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/examples/vm_power_manager/main.c 2021-08-18 14:45:29.000000000 +0000 @@ -469,5 +469,8 @@ free(ci->cd); + /* clean up the EAL */ + rte_eal_cleanup(); + return 0; } diff -Nru dpdk-19.11.7/kernel/linux/kni/kni_net.c dpdk-19.11.10~rc1/kernel/linux/kni/kni_net.c --- dpdk-19.11.7/kernel/linux/kni/kni_net.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/kernel/linux/kni/kni_net.c 2021-08-18 14:45:29.000000000 +0000 @@ -223,7 +223,7 @@ break; prev_kva = kva; - kva = pa2kva(kva->next); + kva = get_kva(kni, kva->next); /* Convert physical address to virtual address */ prev_kva->next = pa2va(prev_kva->next, kva); } @@ -400,7 +400,7 @@ break; prev_kva = kva; - kva = pa2kva(kva->next); + kva = get_kva(kni, kva->next); data_kva = kva2data_kva(kva); /* Convert physical address to virtual address */ prev_kva->next = pa2va(prev_kva->next, kva); @@ -479,7 +479,7 @@ kni->va[i] = pa2va(kni->pa[i], kva); while (kva->next) { - next_kva = pa2kva(kva->next); + next_kva = get_kva(kni, kva->next); /* Convert physical address to virtual address */ kva->next = pa2va(kva->next, next_kva); kva = next_kva; diff -Nru dpdk-19.11.7/lib/librte_bpf/bpf_validate.c dpdk-19.11.10~rc1/lib/librte_bpf/bpf_validate.c --- dpdk-19.11.7/lib/librte_bpf/bpf_validate.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_bpf/bpf_validate.c 2021-08-18 14:45:29.000000000 +0000 @@ -1075,7 +1075,7 @@ eval_jsgt_jsle(trd, trs, frd, frs); else if (op == EBPF_JSLE) eval_jsgt_jsle(frd, frs, trd, trs); - else if (op == EBPF_JLT) + else if (op == EBPF_JSLT) eval_jslt_jsge(trd, trs, frd, frs); else if (op == EBPF_JSGE) eval_jslt_jsge(frd, frs, trd, trs); diff -Nru dpdk-19.11.7/lib/librte_cryptodev/rte_cryptodev_pmd.c dpdk-19.11.10~rc1/lib/librte_cryptodev/rte_cryptodev_pmd.c --- dpdk-19.11.7/lib/librte_cryptodev/rte_cryptodev_pmd.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_cryptodev/rte_cryptodev_pmd.c 2021-08-18 14:45:29.000000000 +0000 @@ -140,6 +140,7 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev) { int retval; + void *dev_priv = cryptodev->data->dev_private; CDEV_LOG_INFO("Closing crypto device %s", cryptodev->device->name); @@ -149,7 +150,7 @@ return retval; if (rte_eal_process_type() == RTE_PROC_PRIMARY) - rte_free(cryptodev->data->dev_private); + rte_free(dev_priv); cryptodev->device = NULL; diff -Nru dpdk-19.11.7/lib/librte_distributor/rte_distributor.c dpdk-19.11.10~rc1/lib/librte_distributor/rte_distributor.c --- dpdk-19.11.7/lib/librte_distributor/rte_distributor.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_distributor/rte_distributor.c 2021-08-18 14:45:29.000000000 +0000 @@ -477,7 +477,7 @@ return 0; while (next_idx < num_mbufs) { - uint16_t matches[RTE_DIST_BURST_SIZE]; + uint16_t matches[RTE_DIST_BURST_SIZE] __rte_aligned(128); unsigned int pkts; if ((num_mbufs - next_idx) < RTE_DIST_BURST_SIZE) diff -Nru dpdk-19.11.7/lib/librte_eal/common/arch/arm/rte_cpuflags.c dpdk-19.11.10~rc1/lib/librte_eal/common/arch/arm/rte_cpuflags.c --- dpdk-19.11.7/lib/librte_eal/common/arch/arm/rte_cpuflags.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/common/arch/arm/rte_cpuflags.c 2021-08-18 14:45:29.000000000 +0000 @@ -95,7 +95,7 @@ FEAT_DEF(SHA2, REG_HWCAP, 6) FEAT_DEF(CRC32, REG_HWCAP, 7) FEAT_DEF(ATOMICS, REG_HWCAP, 8) - FEAT_DEF(AARCH64, REG_PLATFORM, 1) + FEAT_DEF(AARCH64, REG_PLATFORM, 0) }; #endif /* RTE_ARCH */ diff -Nru dpdk-19.11.7/lib/librte_eal/common/eal_common_fbarray.c dpdk-19.11.10~rc1/lib/librte_eal/common/eal_common_fbarray.c --- dpdk-19.11.7/lib/librte_eal/common/eal_common_fbarray.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/common/eal_common_fbarray.c 2021-08-18 14:45:29.000000000 +0000 @@ -80,9 +80,8 @@ } static int -resize_and_map(int fd, void *addr, size_t len) +resize_and_map(int fd, const char *path, void *addr, size_t len) { - char path[PATH_MAX]; void *map_addr; if (ftruncate(fd, len)) { @@ -794,7 +793,7 @@ goto fail; } - if (resize_and_map(fd, data, mmap_len)) + if (resize_and_map(fd, path, data, mmap_len)) goto fail; } ma->addr = data; @@ -900,7 +899,7 @@ goto fail; } - if (resize_and_map(fd, data, mmap_len)) + if (resize_and_map(fd, path, data, mmap_len)) goto fail; /* store our new memory area */ diff -Nru dpdk-19.11.7/lib/librte_eal/common/eal_common_options.c dpdk-19.11.10~rc1/lib/librte_eal/common/eal_common_options.c --- dpdk-19.11.7/lib/librte_eal/common/eal_common_options.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/common/eal_common_options.c 2021-08-18 14:45:29.000000000 +0000 @@ -499,10 +499,10 @@ eal_parse_service_corelist(const char *corelist) { struct rte_config *cfg = rte_eal_get_configuration(); - int i, idx = 0; + int i; unsigned count = 0; char *end = NULL; - int min, max; + uint32_t min, max, idx; uint32_t taken_lcore_count = 0; if (corelist == NULL) @@ -526,6 +526,8 @@ idx = strtoul(corelist, &end, 10); if (errno || end == NULL) return -1; + if (idx >= RTE_MAX_LCORE) + return -1; while (isblank(*end)) end++; if (*end == '-') { diff -Nru dpdk-19.11.7/lib/librte_eal/common/eal_common_proc.c dpdk-19.11.10~rc1/lib/librte_eal/common/eal_common_proc.c --- dpdk-19.11.7/lib/librte_eal/common/eal_common_proc.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/common/eal_common_proc.c 2021-08-18 14:45:29.000000000 +0000 @@ -34,6 +34,7 @@ #include "eal_internal_cfg.h" static int mp_fd = -1; +static pthread_t mp_handle_tid; static char mp_filter[PATH_MAX]; /* Filter for secondary process sockets */ static char mp_dir_path[PATH_MAX]; /* The directory path for all mp sockets */ static pthread_mutex_t mp_mutex_action = PTHREAD_MUTEX_INITIALIZER; @@ -376,7 +377,7 @@ struct mp_msg_internal msg; struct sockaddr_un sa; - while (1) { + while (mp_fd >= 0) { if (read_msg(&msg, &sa) == 0) process_msg(&msg, &sa); } @@ -483,14 +484,11 @@ struct pending_request *req = (struct pending_request *)arg; enum async_action action; struct timespec ts_now; - struct timeval now; - if (gettimeofday(&now, NULL) < 0) { + if (clock_gettime(CLOCK_MONOTONIC, &ts_now) < 0) { RTE_LOG(ERR, EAL, "Cannot get current time\n"); goto no_trigger; } - ts_now.tv_nsec = now.tv_usec * 1000; - ts_now.tv_sec = now.tv_sec; action = process_async_request(req, &ts_now); @@ -563,14 +561,11 @@ } static void -close_socket_fd(void) +close_socket_fd(int fd) { char path[PATH_MAX]; - if (mp_fd < 0) - return; - - close(mp_fd); + close(fd); create_socket_path(peer_name, path, sizeof(path)); unlink(path); } @@ -580,7 +575,6 @@ { char path[PATH_MAX]; int dir_fd; - pthread_t mp_handle_tid; /* in no shared files mode, we do not have secondary processes support, * so no need to initialize IPC. @@ -639,7 +633,16 @@ void rte_mp_channel_cleanup(void) { - close_socket_fd(); + int fd; + + if (mp_fd < 0) + return; + + fd = mp_fd; + mp_fd = -1; + pthread_cancel(mp_handle_tid); + pthread_join(mp_handle_tid, NULL); + close_socket_fd(fd); } /** @@ -884,6 +887,7 @@ struct rte_mp_reply *reply, const struct timespec *ts) { int ret; + pthread_condattr_t attr; struct rte_mp_msg msg, *tmp; struct pending_request pending_req, *exist; @@ -892,7 +896,9 @@ strlcpy(pending_req.dst, dst, sizeof(pending_req.dst)); pending_req.request = req; pending_req.reply = &msg; - pthread_cond_init(&pending_req.sync.cond, NULL); + pthread_condattr_init(&attr); + pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); + pthread_cond_init(&pending_req.sync.cond, &attr); exist = find_pending_request(dst, req->name); if (exist) { @@ -955,8 +961,7 @@ int dir_fd, ret = -1; DIR *mp_dir; struct dirent *ent; - struct timeval now; - struct timespec end; + struct timespec now, end; RTE_LOG(DEBUG, EAL, "request: %s\n", req->name); @@ -973,15 +978,15 @@ return -1; } - if (gettimeofday(&now, NULL) < 0) { + if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) { RTE_LOG(ERR, EAL, "Failed to get current time\n"); rte_errno = errno; goto end; } - end.tv_nsec = (now.tv_usec * 1000 + ts->tv_nsec) % 1000000000; + end.tv_nsec = (now.tv_nsec + ts->tv_nsec) % 1000000000; end.tv_sec = now.tv_sec + ts->tv_sec + - (now.tv_usec * 1000 + ts->tv_nsec) / 1000000000; + (now.tv_nsec + ts->tv_nsec) / 1000000000; /* for secondary process, send request to the primary process only */ if (rte_eal_process_type() == RTE_PROC_SECONDARY) { @@ -1055,7 +1060,7 @@ int dir_fd, ret = 0; DIR *mp_dir; struct dirent *ent; - struct timeval now; + struct timespec now; struct timespec *end; bool dummy_used = false; @@ -1070,7 +1075,7 @@ return -1; } - if (gettimeofday(&now, NULL) < 0) { + if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) { RTE_LOG(ERR, EAL, "Failed to get current time\n"); rte_errno = errno; return -1; @@ -1092,9 +1097,9 @@ end = ¶m->end; reply = ¶m->user_reply; - end->tv_nsec = (now.tv_usec * 1000 + ts->tv_nsec) % 1000000000; + end->tv_nsec = (now.tv_nsec + ts->tv_nsec) % 1000000000; end->tv_sec = now.tv_sec + ts->tv_sec + - (now.tv_usec * 1000 + ts->tv_nsec) / 1000000000; + (now.tv_nsec + ts->tv_nsec) / 1000000000; reply->nb_sent = 0; reply->nb_received = 0; reply->msgs = NULL; diff -Nru dpdk-19.11.7/lib/librte_eal/common/eal_common_thread.c dpdk-19.11.10~rc1/lib/librte_eal/common/eal_common_thread.c --- dpdk-19.11.7/lib/librte_eal/common/eal_common_thread.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/common/eal_common_thread.c 2021-08-18 14:45:29.000000000 +0000 @@ -147,20 +147,29 @@ void *(*start_routine)(void *); void *arg; pthread_barrier_t configured; + unsigned int refcnt; }; +static void ctrl_params_free(struct rte_thread_ctrl_params *params) +{ + if (__atomic_sub_fetch(¶ms->refcnt, 1, __ATOMIC_ACQ_REL) == 0) { + (void)pthread_barrier_destroy(¶ms->configured); + free(params); + } +} + static void *rte_thread_init(void *arg) { - int ret; struct rte_thread_ctrl_params *params = arg; - void *(*start_routine)(void *) = params->start_routine; + void *(*start_routine)(void *); void *routine_arg = params->arg; - ret = pthread_barrier_wait(¶ms->configured); - if (ret == PTHREAD_BARRIER_SERIAL_THREAD) { - pthread_barrier_destroy(¶ms->configured); - free(params); - } + pthread_barrier_wait(¶ms->configured); + start_routine = params->start_routine; + ctrl_params_free(params); + + if (start_routine == NULL) + return NULL; return start_routine(routine_arg); } @@ -180,14 +189,15 @@ params->start_routine = start_routine; params->arg = arg; + params->refcnt = 2; - pthread_barrier_init(¶ms->configured, NULL, 2); + ret = pthread_barrier_init(¶ms->configured, NULL, 2); + if (ret != 0) + goto fail_no_barrier; ret = pthread_create(thread, attr, rte_thread_init, (void *)params); - if (ret != 0) { - free(params); - return -ret; - } + if (ret != 0) + goto fail_with_barrier; if (name != NULL) { ret = rte_thread_setname(*thread, name); @@ -197,24 +207,24 @@ } ret = pthread_setaffinity_np(*thread, sizeof(*cpuset), cpuset); - if (ret) - goto fail; + if (ret != 0) + params->start_routine = NULL; - ret = pthread_barrier_wait(¶ms->configured); - if (ret == PTHREAD_BARRIER_SERIAL_THREAD) { - pthread_barrier_destroy(¶ms->configured); - free(params); - } + pthread_barrier_wait(¶ms->configured); + ctrl_params_free(params); - return 0; + if (ret != 0) + /* start_routine has been set to NULL above; */ + /* ctrl thread will exit immediately */ + pthread_join(*thread, NULL); + + return -ret; + +fail_with_barrier: + (void)pthread_barrier_destroy(¶ms->configured); + +fail_no_barrier: + free(params); -fail: - if (PTHREAD_BARRIER_SERIAL_THREAD == - pthread_barrier_wait(¶ms->configured)) { - pthread_barrier_destroy(¶ms->configured); - free(params); - } - pthread_cancel(*thread); - pthread_join(*thread, NULL); return -ret; } diff -Nru dpdk-19.11.7/lib/librte_eal/common/include/rte_bitmap.h dpdk-19.11.10~rc1/lib/librte_eal/common/include/rte_bitmap.h --- dpdk-19.11.7/lib/librte_eal/common/include/rte_bitmap.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/common/include/rte_bitmap.h 2021-08-18 14:45:29.000000000 +0000 @@ -185,9 +185,8 @@ size = __rte_bitmap_get_memory_footprint(n_bits, &array1_byte_offset, &array1_slabs, &array2_byte_offset, &array2_slabs); - if (size < mem_size) { + if (size > mem_size) return NULL; - } /* Setup bitmap */ memset(mem, 0, size); diff -Nru dpdk-19.11.7/lib/librte_eal/common/include/rte_reciprocal.h dpdk-19.11.10~rc1/lib/librte_eal/common/include/rte_reciprocal.h --- dpdk-19.11.7/lib/librte_eal/common/include/rte_reciprocal.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/common/include/rte_reciprocal.h 2021-08-18 14:45:29.000000000 +0000 @@ -29,6 +29,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + struct rte_reciprocal { uint32_t m; uint8_t sh1, sh2; @@ -89,4 +93,8 @@ struct rte_reciprocal rte_reciprocal_value(uint32_t d); struct rte_reciprocal_u64 rte_reciprocal_value_u64(uint64_t d); +#ifdef __cplusplus +} +#endif + #endif /* _RTE_RECIPROCAL_H_ */ diff -Nru dpdk-19.11.7/lib/librte_eal/common/include/rte_service.h dpdk-19.11.10~rc1/lib/librte_eal/common/include/rte_service.h --- dpdk-19.11.7/lib/librte_eal/common/include/rte_service.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/common/include/rte_service.h 2021-08-18 14:45:29.000000000 +0000 @@ -47,10 +47,7 @@ #define RTE_SERVICE_CAP_MT_SAFE (1 << 0) /** - * Return the number of services registered. - * - * The number of services registered can be passed to *rte_service_get_by_id*, - * enabling the application to retrieve the specification of each service. + * Return the number of services registered. * * @return The number of services registered. */ diff -Nru dpdk-19.11.7/lib/librte_eal/common/include/rte_vfio.h dpdk-19.11.10~rc1/lib/librte_eal/common/include/rte_vfio.h --- dpdk-19.11.7/lib/librte_eal/common/include/rte_vfio.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/common/include/rte_vfio.h 2021-08-18 14:45:29.000000000 +0000 @@ -14,6 +14,7 @@ extern "C" { #endif +#include #include /* @@ -156,7 +157,7 @@ * kernel module name. * * @return - * !0 if true. + * 1 if true. * 0 otherwise. */ int rte_vfio_is_enabled(const char *modname); @@ -168,8 +169,9 @@ * an error on BSD. * * @return - * !0 if true. - * 0 otherwise. + * 1 if true. + * 0 if false. + * <0 for errors. */ int rte_vfio_noiommu_is_enabled(void); diff -Nru dpdk-19.11.7/lib/librte_eal/common/malloc_mp.c dpdk-19.11.10~rc1/lib/librte_eal/common/malloc_mp.c --- dpdk-19.11.7/lib/librte_eal/common/malloc_mp.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/common/malloc_mp.c 2021-08-18 14:45:29.000000000 +0000 @@ -170,9 +170,7 @@ resp->id = req->id; resp->result = ret == 0 ? REQ_RESULT_SUCCESS : REQ_RESULT_FAIL; - rte_mp_reply(&reply, peer); - - return 0; + return rte_mp_reply(&reply, peer); } static int diff -Nru dpdk-19.11.7/lib/librte_eal/freebsd/eal/include/rte_os.h dpdk-19.11.10~rc1/lib/librte_eal/freebsd/eal/include/rte_os.h --- dpdk-19.11.7/lib/librte_eal/freebsd/eal/include/rte_os.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/freebsd/eal/include/rte_os.h 2021-08-18 14:45:29.000000000 +0000 @@ -6,9 +6,8 @@ #define _RTE_OS_H_ /** - * This is header should contain any function/macro definition - * which are not supported natively or named differently in the - * freebsd OS. Functions will be added in future releases. + * This header should contain any definition + * which is not supported natively or named differently in FreeBSD. */ #include diff -Nru dpdk-19.11.7/lib/librte_eal/linux/eal/eal_log.c dpdk-19.11.10~rc1/lib/librte_eal/linux/eal/eal_log.c --- dpdk-19.11.7/lib/librte_eal/linux/eal/eal_log.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/linux/eal/eal_log.c 2021-08-18 14:45:29.000000000 +0000 @@ -27,9 +27,9 @@ { ssize_t ret; - /* write on stdout */ - ret = fwrite(buf, 1, size, stdout); - fflush(stdout); + /* write on stderr */ + ret = fwrite(buf, 1, size, stderr); + fflush(stderr); /* Syslog error levels are from 0 to 7, so subtract 1 to convert */ syslog(rte_log_cur_msg_loglevel() - 1, "%.*s", (int)size, buf); diff -Nru dpdk-19.11.7/lib/librte_eal/linux/eal/eal_memalloc.c dpdk-19.11.10~rc1/lib/librte_eal/linux/eal/eal_memalloc.c --- dpdk-19.11.7/lib/librte_eal/linux/eal/eal_memalloc.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/linux/eal/eal_memalloc.c 2021-08-18 14:45:29.000000000 +0000 @@ -698,7 +698,6 @@ uint64_t map_offset; char path[PATH_MAX]; int fd, ret = 0; - bool exit_early; /* erase page data */ memset(ms->addr, 0, ms->len); @@ -713,17 +712,8 @@ if (madvise(ms->addr, ms->len, MADV_DONTDUMP) != 0) RTE_LOG(DEBUG, EAL, "madvise failed: %s\n", strerror(errno)); - exit_early = false; - /* if we're using anonymous hugepages, nothing to be done */ - if (internal_config.in_memory && !memfd_create_supported) - exit_early = true; - - /* if we've already unlinked the page, nothing needs to be done */ - if (!internal_config.in_memory && internal_config.hugepage_unlink) - exit_early = true; - - if (exit_early) { + if (internal_config.in_memory && !memfd_create_supported) { memset(ms, 0, sizeof(*ms)); return 0; } @@ -749,7 +739,7 @@ /* if we're able to take out a write lock, we're the last one * holding onto this page. */ - if (!internal_config.in_memory) { + if (!internal_config.in_memory && !internal_config.hugepage_unlink) { ret = lock(fd, LOCK_EX); if (ret >= 0) { /* no one else is using this page */ diff -Nru dpdk-19.11.7/lib/librte_eal/linux/eal/eal_vfio.c dpdk-19.11.10~rc1/lib/librte_eal/linux/eal/eal_vfio.c --- dpdk-19.11.7/lib/librte_eal/linux/eal/eal_vfio.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/linux/eal/eal_vfio.c 2021-08-18 14:45:29.000000000 +0000 @@ -69,6 +69,7 @@ { .type_id = RTE_VFIO_TYPE1, .name = "Type 1", + .partial_unmap = false, .dma_map_func = &vfio_type1_dma_map, .dma_user_map_func = &vfio_type1_dma_mem_map }, @@ -76,6 +77,7 @@ { .type_id = RTE_VFIO_SPAPR, .name = "sPAPR", + .partial_unmap = true, .dma_map_func = &vfio_spapr_dma_map, .dma_user_map_func = &vfio_spapr_dma_mem_map }, @@ -83,6 +85,7 @@ { .type_id = RTE_VFIO_NOIOMMU, .name = "No-IOMMU", + .partial_unmap = true, .dma_map_func = &vfio_noiommu_dma_map, .dma_user_map_func = &vfio_noiommu_dma_mem_map }, @@ -167,6 +170,10 @@ static int merge_map(struct user_mem_map *left, struct user_mem_map *right) { + /* merge the same maps into one */ + if (memcmp(left, right, sizeof(struct user_mem_map)) == 0) + goto out; + if (left->addr + left->len != right->addr) return 0; if (left->iova + left->len != right->iova) @@ -174,6 +181,7 @@ left->len += right->len; +out: memset(right, 0, sizeof(*right)); return 1; @@ -514,23 +522,28 @@ vfio_mem_event_callback(enum rte_mem_event type, const void *addr, size_t len, void *arg __rte_unused) { - rte_iova_t iova_start, iova_expected; struct rte_memseg_list *msl; struct rte_memseg *ms; size_t cur_len = 0; - uint64_t va_start; msl = rte_mem_virt2memseg_list(addr); /* for IOVA as VA mode, no need to care for IOVA addresses */ if (rte_eal_iova_mode() == RTE_IOVA_VA && msl->external == 0) { uint64_t vfio_va = (uint64_t)(uintptr_t)addr; - if (type == RTE_MEM_EVENT_ALLOC) - vfio_dma_mem_map(default_vfio_cfg, vfio_va, vfio_va, - len, 1); - else - vfio_dma_mem_map(default_vfio_cfg, vfio_va, vfio_va, - len, 0); + uint64_t page_sz = msl->page_sz; + + /* Maintain granularity of DMA map/unmap to memseg size */ + for (; cur_len < len; cur_len += page_sz) { + if (type == RTE_MEM_EVENT_ALLOC) + vfio_dma_mem_map(default_vfio_cfg, vfio_va, + vfio_va, page_sz, 1); + else + vfio_dma_mem_map(default_vfio_cfg, vfio_va, + vfio_va, page_sz, 0); + vfio_va += page_sz; + } + return; } @@ -547,63 +560,22 @@ #endif /* memsegs are contiguous in memory */ ms = rte_mem_virt2memseg(addr, msl); - - /* - * This memory is not guaranteed to be contiguous, but it still could - * be, or it could have some small contiguous chunks. Since the number - * of VFIO mappings is limited, and VFIO appears to not concatenate - * adjacent mappings, we have to do this ourselves. - * - * So, find contiguous chunks, then map them. - */ - va_start = ms->addr_64; - iova_start = iova_expected = ms->iova; while (cur_len < len) { - bool new_contig_area = ms->iova != iova_expected; - bool last_seg = (len - cur_len) == ms->len; - bool skip_last = false; - - /* only do mappings when current contiguous area ends */ - if (new_contig_area) { - if (type == RTE_MEM_EVENT_ALLOC) - vfio_dma_mem_map(default_vfio_cfg, va_start, - iova_start, - iova_expected - iova_start, 1); - else - vfio_dma_mem_map(default_vfio_cfg, va_start, - iova_start, - iova_expected - iova_start, 0); - va_start = ms->addr_64; - iova_start = ms->iova; - } /* some memory segments may have invalid IOVA */ if (ms->iova == RTE_BAD_IOVA) { RTE_LOG(DEBUG, EAL, "Memory segment at %p has bad IOVA, skipping\n", ms->addr); - skip_last = true; + goto next; } - iova_expected = ms->iova + ms->len; + if (type == RTE_MEM_EVENT_ALLOC) + vfio_dma_mem_map(default_vfio_cfg, ms->addr_64, + ms->iova, ms->len, 1); + else + vfio_dma_mem_map(default_vfio_cfg, ms->addr_64, + ms->iova, ms->len, 0); +next: cur_len += ms->len; ++ms; - - /* - * don't count previous segment, and don't attempt to - * dereference a potentially invalid pointer. - */ - if (skip_last && !last_seg) { - iova_expected = iova_start = ms->iova; - va_start = ms->addr_64; - } else if (!skip_last && last_seg) { - /* this is the last segment and we're not skipping */ - if (type == RTE_MEM_EVENT_ALLOC) - vfio_dma_mem_map(default_vfio_cfg, va_start, - iova_start, - iova_expected - iova_start, 1); - else - vfio_dma_mem_map(default_vfio_cfg, va_start, - iova_start, - iova_expected - iova_start, 0); - } } #ifdef RTE_ARCH_PPC_64 cur_len = 0; @@ -1383,6 +1355,12 @@ RTE_LOG(ERR, EAL, " cannot clear DMA remapping, error %i (%s)\n", errno, strerror(errno)); return -1; + } else if (dma_unmap.size != len) { + RTE_LOG(ERR, EAL, " unexpected size %"PRIu64" of DMA " + "remapping cleared instead of %"PRIu64"\n", + (uint64_t)dma_unmap.size, len); + rte_errno = EIO; + return -1; } } @@ -1853,6 +1831,12 @@ /* we're partially unmapping a previously mapped region, so we * need to split entry into two. */ + if (!vfio_cfg->vfio_iommu_type->partial_unmap) { + RTE_LOG(DEBUG, EAL, "DMA partial unmap unsupported\n"); + rte_errno = ENOTSUP; + ret = -1; + goto out; + } if (user_mem_maps->n_maps == VFIO_MAX_USER_MEM_MAPS) { RTE_LOG(ERR, EAL, "Not enough space to store partial mapping\n"); rte_errno = ENOMEM; diff -Nru dpdk-19.11.7/lib/librte_eal/linux/eal/eal_vfio.h dpdk-19.11.10~rc1/lib/librte_eal/linux/eal/eal_vfio.h --- dpdk-19.11.7/lib/librte_eal/linux/eal/eal_vfio.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/linux/eal/eal_vfio.h 2021-08-18 14:45:29.000000000 +0000 @@ -113,6 +113,7 @@ struct vfio_iommu_type { int type_id; const char *name; + bool partial_unmap; vfio_dma_user_func_t dma_user_map_func; vfio_dma_func_t dma_map_func; }; diff -Nru dpdk-19.11.7/lib/librte_eal/linux/eal/include/rte_os.h dpdk-19.11.10~rc1/lib/librte_eal/linux/eal/include/rte_os.h --- dpdk-19.11.7/lib/librte_eal/linux/eal/include/rte_os.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/linux/eal/include/rte_os.h 2021-08-18 14:45:29.000000000 +0000 @@ -6,9 +6,8 @@ #define _RTE_OS_H_ /** - * This is header should contain any function/macro definition - * which are not supported natively or named differently in the - * linux OS. Functions will be added in future releases. + * This header should contain any definition + * which is not supported natively or named differently in Linux. */ #include diff -Nru dpdk-19.11.7/lib/librte_eal/rte_eal_exports.def dpdk-19.11.10~rc1/lib/librte_eal/rte_eal_exports.def --- dpdk-19.11.7/lib/librte_eal/rte_eal_exports.def 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/rte_eal_exports.def 2021-08-18 14:45:29.000000000 +0000 @@ -1,5 +1,6 @@ EXPORTS __rte_panic + rte_eal_cleanup rte_eal_init rte_eal_mp_remote_launch rte_eal_mp_wait_lcore diff -Nru dpdk-19.11.7/lib/librte_eal/rte_eal_version.map dpdk-19.11.10~rc1/lib/librte_eal/rte_eal_version.map --- dpdk-19.11.7/lib/librte_eal/rte_eal_version.map 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/rte_eal_version.map 2021-08-18 14:45:29.000000000 +0000 @@ -159,7 +159,6 @@ rte_service_component_unregister; rte_service_dump; rte_service_finalize; - rte_service_get_by_id; rte_service_get_by_name; rte_service_get_count; rte_service_get_name; diff -Nru dpdk-19.11.7/lib/librte_eal/windows/eal/eal.c dpdk-19.11.10~rc1/lib/librte_eal/windows/eal/eal.c --- dpdk-19.11.7/lib/librte_eal/windows/eal/eal.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/windows/eal/eal.c 2021-08-18 14:45:29.000000000 +0000 @@ -82,3 +82,9 @@ rte_eal_mp_wait_lcore(); return 0; } + +int +rte_eal_cleanup(void) +{ + return 0; +} diff -Nru dpdk-19.11.7/lib/librte_eal/windows/eal/eal_thread.c dpdk-19.11.10~rc1/lib/librte_eal/windows/eal/eal_thread.c --- dpdk-19.11.7/lib/librte_eal/windows/eal/eal_thread.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eal/windows/eal/eal_thread.c 2021-08-18 14:45:29.000000000 +0000 @@ -147,8 +147,8 @@ if (!th) return -1; - SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS); - SetThreadPriority(th, THREAD_PRIORITY_TIME_CRITICAL); + SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); + SetThreadPriority(th, THREAD_PRIORITY_NORMAL); return 0; } diff -Nru dpdk-19.11.7/lib/librte_ethdev/rte_ethdev.c dpdk-19.11.10~rc1/lib/librte_ethdev/rte_ethdev.c --- dpdk-19.11.7/lib/librte_ethdev/rte_ethdev.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_ethdev/rte_ethdev.c 2021-08-18 14:45:29.000000000 +0000 @@ -251,7 +251,9 @@ } /* Convert bus args to new syntax for use with new API dev_iterate. */ - if (strcmp(iter->bus->name, "vdev") == 0) { + if ((strcmp(iter->bus->name, "vdev") == 0) || + (strcmp(iter->bus->name, "fslmc") == 0) || + (strcmp(iter->bus->name, "dpaa_bus") == 0)) { bus_param_key = "name"; } else if (strcmp(iter->bus->name, "pci") == 0) { bus_param_key = "addr"; @@ -4873,6 +4875,8 @@ struct rte_eth_dev *dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + if (info == NULL) + return -EINVAL; dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_reg, -ENOTSUP); @@ -4897,6 +4901,8 @@ struct rte_eth_dev *dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + if (info == NULL) + return -EINVAL; dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_eeprom, -ENOTSUP); @@ -4909,6 +4915,8 @@ struct rte_eth_dev *dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + if (info == NULL) + return -EINVAL; dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_eeprom, -ENOTSUP); @@ -4922,6 +4930,8 @@ struct rte_eth_dev *dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + if (modinfo == NULL) + return -EINVAL; dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_module_info, -ENOTSUP); @@ -4935,6 +4945,8 @@ struct rte_eth_dev *dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); + if (info == NULL || info->data == NULL || info->length == 0) + return -EINVAL; dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_module_eeprom, -ENOTSUP); diff -Nru dpdk-19.11.7/lib/librte_ethdev/rte_ethdev.h dpdk-19.11.10~rc1/lib/librte_ethdev/rte_ethdev.h --- dpdk-19.11.7/lib/librte_ethdev/rte_ethdev.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_ethdev/rte_ethdev.h 2021-08-18 14:45:29.000000000 +0000 @@ -3853,6 +3853,7 @@ * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. * - (-ENODEV) if *port_id* invalid. + * - (-EINVAL) if bad parameter. * - (-EIO) if device is removed. * - others depends on the specific operations implementation. */ @@ -3883,6 +3884,7 @@ * @return * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. + * - (-EINVAL) if bad parameter. * - (-ENODEV) if *port_id* invalid. * - (-EIO) if device is removed. * - others depends on the specific operations implementation. @@ -3900,6 +3902,7 @@ * @return * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. + * - (-EINVAL) if bad parameter. * - (-ENODEV) if *port_id* invalid. * - (-EIO) if device is removed. * - others depends on the specific operations implementation. @@ -3920,6 +3923,7 @@ * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. * - (-ENODEV) if *port_id* invalid. + * - (-EINVAL) if bad parameter. * - (-EIO) if device is removed. * - others depends on the specific operations implementation. */ @@ -3942,6 +3946,7 @@ * @return * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. + * - (-EINVAL) if bad parameter. * - (-ENODEV) if *port_id* invalid. * - (-EIO) if device is removed. * - others depends on the specific operations implementation. diff -Nru dpdk-19.11.7/lib/librte_ethdev/rte_flow.c dpdk-19.11.10~rc1/lib/librte_ethdev/rte_flow.c --- dpdk-19.11.7/lib/librte_ethdev/rte_flow.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_ethdev/rte_flow.c 2021-08-18 14:45:29.000000000 +0000 @@ -1062,7 +1062,7 @@ const struct rte_flow_expand_node graph[], int graph_root_index) { - const int elt_n = 8; + const int elt_n = 16; const struct rte_flow_item *item; const struct rte_flow_expand_node *node = &graph[graph_root_index]; const int *next_node; @@ -1185,7 +1185,7 @@ } } /* Go deeper. */ - if (node->next) { + if (!node->optional && node->next) { next_node = node->next; if (stack_pos++ == elt_n) { rte_errno = E2BIG; @@ -1204,23 +1204,5 @@ } node = *next_node ? &graph[*next_node] : NULL; }; - /* no expanded flows but we have missed item, create one rule for it */ - if (buf->entries == 1 && missed != 0) { - elt = 2; - lsize += elt * sizeof(*item) + user_pattern_size; - if (lsize <= size) { - buf->entry[buf->entries].priority = 1; - buf->entry[buf->entries].pattern = addr; - buf->entries++; - flow_items[0].type = missed_item.type; - flow_items[1].type = RTE_FLOW_ITEM_TYPE_END; - rte_memcpy(addr, buf->entry[0].pattern, - user_pattern_size); - addr = (void *)(((uintptr_t)addr) + user_pattern_size); - rte_memcpy(addr, flow_items, elt * sizeof(*item)); - addr = (void *)(((uintptr_t)addr) + - elt * sizeof(*item)); - } - } return lsize; } diff -Nru dpdk-19.11.7/lib/librte_ethdev/rte_flow_driver.h dpdk-19.11.10~rc1/lib/librte_ethdev/rte_flow_driver.h --- dpdk-19.11.7/lib/librte_ethdev/rte_flow_driver.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_ethdev/rte_flow_driver.h 2021-08-18 14:45:29.000000000 +0000 @@ -133,6 +133,8 @@ * RSS types bit-field associated with this node * (see ETH_RSS_* definitions). */ + uint8_t optional; + /**< optional expand field. Default 0 to expand, 1 not go deeper. */ }; /** Object returned by rte_flow_expand_rss(). */ diff -Nru dpdk-19.11.7/lib/librte_ethdev/rte_flow.h dpdk-19.11.10~rc1/lib/librte_ethdev/rte_flow.h --- dpdk-19.11.7/lib/librte_ethdev/rte_flow.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_ethdev/rte_flow.h 2021-08-18 14:45:29.000000000 +0000 @@ -1302,14 +1302,14 @@ */ struct rte_flow_item_gtp_psc { uint8_t pdu_type; /**< PDU type. */ - uint8_t qfi; /**< QoS flow identifier. */ + uint8_t qfi; /**< PPP, RQI, QoS flow identifier. */ }; /** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */ #ifndef __cplusplus static const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask = { - .qfi = 0x3f, + .qfi = 0xff, }; #endif @@ -2558,7 +2558,7 @@ *RTE_FLOW_DYNF_METADATA(m) = v; } -/* +/** * Definition of a single action. * * A list of actions is terminated by a END action. diff -Nru dpdk-19.11.7/lib/librte_eventdev/rte_event_crypto_adapter.c dpdk-19.11.10~rc1/lib/librte_eventdev/rte_event_crypto_adapter.c --- dpdk-19.11.7/lib/librte_eventdev/rte_event_crypto_adapter.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eventdev/rte_event_crypto_adapter.c 2021-08-18 14:45:29.000000000 +0000 @@ -857,6 +857,7 @@ * b. OP_NEW mode -> SW Dequeue */ if ((cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW && + !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && adapter->mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) || (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW) && !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && diff -Nru dpdk-19.11.7/lib/librte_eventdev/rte_event_eth_rx_adapter.c dpdk-19.11.10~rc1/lib/librte_eventdev/rte_event_eth_rx_adapter.c --- dpdk-19.11.7/lib/librte_eventdev/rte_event_eth_rx_adapter.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eventdev/rte_event_eth_rx_adapter.c 2021-08-18 14:45:29.000000000 +0000 @@ -1294,12 +1294,11 @@ err = rte_ctrl_thread_create(&rx_adapter->rx_intr_thread, thread_name, NULL, rxa_intr_thread, rx_adapter); - if (!err) { - rte_thread_setname(rx_adapter->rx_intr_thread, thread_name); + if (!err) return 0; - } RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d\n", err); + rte_free(rx_adapter->epoll_events); error: rte_ring_free(rx_adapter->intr_ring); rx_adapter->intr_ring = NULL; diff -Nru dpdk-19.11.7/lib/librte_eventdev/rte_event_eth_tx_adapter.c dpdk-19.11.10~rc1/lib/librte_eventdev/rte_event_eth_tx_adapter.c --- dpdk-19.11.7/lib/librte_eventdev/rte_event_eth_tx_adapter.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_eventdev/rte_event_eth_tx_adapter.c 2021-08-18 14:45:29.000000000 +0000 @@ -285,7 +285,6 @@ return ret; } - pc->disable_implicit_release = 0; ret = rte_event_port_setup(dev_id, port_id, pc); if (ret) { RTE_EDEV_LOG_ERR("failed to setup event port %u\n", diff -Nru dpdk-19.11.7/lib/librte_flow_classify/rte_flow_classify.c dpdk-19.11.10~rc1/lib/librte_flow_classify/rte_flow_classify.c --- dpdk-19.11.7/lib/librte_flow_classify/rte_flow_classify.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_flow_classify/rte_flow_classify.c 2021-08-18 14:45:29.000000000 +0000 @@ -584,12 +584,12 @@ &rule->u.key.key_del, &rule->key_found, &rule->entry); - + if (ret == 0) + free(rule); return ret; } } } - free(rule); return ret; } diff -Nru dpdk-19.11.7/lib/librte_kni/rte_kni.c dpdk-19.11.10~rc1/lib/librte_kni/rte_kni.c --- dpdk-19.11.7/lib/librte_kni/rte_kni.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_kni/rte_kni.c 2021-08-18 14:45:29.000000000 +0000 @@ -674,8 +674,9 @@ return; } - allocq_free = (kni->alloc_q->read - kni->alloc_q->write - 1) - & (MAX_MBUF_BURST_NUM - 1); + allocq_free = kni_fifo_free_count(kni->alloc_q); + allocq_free = (allocq_free > MAX_MBUF_BURST_NUM) ? + MAX_MBUF_BURST_NUM : allocq_free; for (i = 0; i < allocq_free; i++) { pkts[i] = rte_pktmbuf_alloc(kni->pktmbuf_pool); if (unlikely(pkts[i] == NULL)) { diff -Nru dpdk-19.11.7/lib/librte_mbuf/rte_mbuf_dyn.c dpdk-19.11.10~rc1/lib/librte_mbuf/rte_mbuf_dyn.c --- dpdk-19.11.7/lib/librte_mbuf/rte_mbuf_dyn.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_mbuf/rte_mbuf_dyn.c 2021-08-18 14:45:29.000000000 +0000 @@ -114,8 +114,10 @@ } else { mz = rte_memzone_lookup(RTE_MBUF_DYN_MZNAME); } - if (mz == NULL) + if (mz == NULL) { + RTE_LOG(ERR, MBUF, "Failed to get mbuf dyn shared memory\n"); return -1; + } shm = mz->addr; @@ -524,7 +526,11 @@ size_t i; rte_mcfg_tailq_write_lock(); - init_shared_mem(); + if (init_shared_mem() < 0) { + rte_mcfg_tailq_write_unlock(); + return; + } + fprintf(out, "Reserved fields:\n"); mbuf_dynfield_list = RTE_TAILQ_CAST( mbuf_dynfield_tailq.head, mbuf_dynfield_list); diff -Nru dpdk-19.11.7/lib/librte_net/rte_ip.h dpdk-19.11.10~rc1/lib/librte_net/rte_ip.h --- dpdk-19.11.7/lib/librte_net/rte_ip.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_net/rte_ip.h 2021-08-18 14:45:29.000000000 +0000 @@ -365,7 +365,7 @@ */ struct rte_ipv6_hdr { rte_be32_t vtc_flow; /**< IP version, traffic class & flow label. */ - rte_be16_t payload_len; /**< IP packet length - includes header size */ + rte_be16_t payload_len; /**< IP payload size, including ext. headers */ uint8_t proto; /**< Protocol, next header. */ uint8_t hop_limits; /**< Hop limits. */ uint8_t src_addr[16]; /**< IP address of source host. */ diff -Nru dpdk-19.11.7/lib/librte_power/guest_channel.c dpdk-19.11.10~rc1/lib/librte_power/guest_channel.c --- dpdk-19.11.7/lib/librte_power/guest_channel.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_power/guest_channel.c 2021-08-18 14:45:29.000000000 +0000 @@ -140,6 +140,17 @@ if (pkt_len == 0 || pkt == NULL) return -1; + if (lcore_id >= RTE_MAX_LCORE) { + RTE_LOG(ERR, GUEST_CHANNEL, "Channel(%u) is out of range 0...%d\n", + lcore_id, RTE_MAX_LCORE-1); + return -1; + } + + if (global_fds[lcore_id] < 0) { + RTE_LOG(ERR, GUEST_CHANNEL, "Channel is not connected\n"); + return -1; + } + fds.fd = global_fds[lcore_id]; fds.events = POLLIN; @@ -153,17 +164,6 @@ return -1; } - if (lcore_id >= RTE_MAX_LCORE) { - RTE_LOG(ERR, GUEST_CHANNEL, "Channel(%u) is out of range 0...%d\n", - lcore_id, RTE_MAX_LCORE-1); - return -1; - } - - if (global_fds[lcore_id] < 0) { - RTE_LOG(ERR, GUEST_CHANNEL, "Channel is not connected\n"); - return -1; - } - while (pkt_len > 0) { ret = read(global_fds[lcore_id], pkt, pkt_len); diff -Nru dpdk-19.11.7/lib/librte_power/power_acpi_cpufreq.c dpdk-19.11.10~rc1/lib/librte_power/power_acpi_cpufreq.c --- dpdk-19.11.7/lib/librte_power/power_acpi_cpufreq.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_power/power_acpi_cpufreq.c 2021-08-18 14:45:29.000000000 +0000 @@ -78,7 +78,7 @@ /** * Power info per lcore. */ -struct rte_power_info { +struct acpi_power_info { unsigned int lcore_id; /**< Logical core id */ uint32_t freqs[RTE_MAX_LCORE_FREQS]; /**< Frequency array */ uint32_t nb_freqs; /**< number of available freqs */ @@ -90,14 +90,14 @@ uint16_t turbo_enable; /**< Turbo Boost enable/disable */ } __rte_cache_aligned; -static struct rte_power_info lcore_power_info[RTE_MAX_LCORE]; +static struct acpi_power_info lcore_power_info[RTE_MAX_LCORE]; /** * It is to set specific freq for specific logical core, according to the index * of supported frequencies. */ static int -set_freq_internal(struct rte_power_info *pi, uint32_t idx) +set_freq_internal(struct acpi_power_info *pi, uint32_t idx) { if (idx >= RTE_MAX_LCORE_FREQS || idx >= pi->nb_freqs) { RTE_LOG(ERR, POWER, "Invalid frequency index %u, which " @@ -133,7 +133,7 @@ * governor will be saved for rolling back. */ static int -power_set_governor_userspace(struct rte_power_info *pi) +power_set_governor_userspace(struct acpi_power_info *pi) { FILE *f; int ret = -1; @@ -152,6 +152,9 @@ /* Strip off terminating '\n' */ strtok(buf, "\n"); + /* Save the original governor */ + rte_strscpy(pi->governor_ori, buf, sizeof(pi->governor_ori)); + /* Check if current governor is userspace */ if (strncmp(buf, POWER_GOVERNOR_USERSPACE, sizeof(POWER_GOVERNOR_USERSPACE)) == 0) { @@ -160,8 +163,6 @@ "already userspace\n", pi->lcore_id); goto out; } - /* Save the original governor */ - strlcpy(pi->governor_ori, buf, sizeof(pi->governor_ori)); /* Write 'userspace' to the governor */ val = fseek(f, 0, SEEK_SET); @@ -188,7 +189,7 @@ * sys file. */ static int -power_get_available_freqs(struct rte_power_info *pi) +power_get_available_freqs(struct acpi_power_info *pi) { FILE *f; int ret = -1, i, count; @@ -258,7 +259,7 @@ * It is to fopen the sys file for the future setting the lcore frequency. */ static int -power_init_for_setting_freq(struct rte_power_info *pi) +power_init_for_setting_freq(struct acpi_power_info *pi) { FILE *f; char fullpath[PATH_MAX]; @@ -292,7 +293,7 @@ int power_acpi_cpufreq_init(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Lcore id %u can not exceeds %u\n", @@ -354,7 +355,7 @@ * needed by writing the sys file. */ static int -power_set_governor_original(struct rte_power_info *pi) +power_set_governor_original(struct acpi_power_info *pi) { FILE *f; int ret = -1; @@ -400,7 +401,7 @@ int power_acpi_cpufreq_exit(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Lcore id %u can not exceeds %u\n", @@ -442,7 +443,7 @@ uint32_t power_acpi_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -489,7 +490,7 @@ int power_acpi_cpufreq_freq_down(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -507,7 +508,7 @@ int power_acpi_cpufreq_freq_up(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -548,7 +549,7 @@ int power_acpi_cpufreq_freq_min(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -565,7 +566,7 @@ int power_acpi_turbo_status(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -581,7 +582,7 @@ int power_acpi_enable_turbo(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -614,7 +615,7 @@ int power_acpi_disable_turbo(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -641,7 +642,7 @@ int power_acpi_get_capabilities(unsigned int lcore_id, struct rte_power_core_capabilities *caps) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); diff -Nru dpdk-19.11.7/lib/librte_power/power_pstate_cpufreq.c dpdk-19.11.10~rc1/lib/librte_power/power_pstate_cpufreq.c --- dpdk-19.11.7/lib/librte_power/power_pstate_cpufreq.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_power/power_pstate_cpufreq.c 2021-08-18 14:45:29.000000000 +0000 @@ -350,6 +350,9 @@ /* Strip off terminating '\n' */ strtok(buf, "\n"); + /* Save the original governor */ + rte_strscpy(pi->governor_ori, buf, sizeof(pi->governor_ori)); + /* Check if current governor is performance */ if (strncmp(buf, POWER_GOVERNOR_PERF, sizeof(POWER_GOVERNOR_PERF)) == 0) { @@ -358,8 +361,6 @@ "already performance\n", pi->lcore_id); goto out; } - /* Save the original governor */ - strlcpy(pi->governor_ori, buf, sizeof(pi->governor_ori)); /* Write 'performance' to the governor */ val = fseek(f, 0, SEEK_SET); diff -Nru dpdk-19.11.7/lib/librte_power/rte_power_guest_channel.h dpdk-19.11.10~rc1/lib/librte_power/rte_power_guest_channel.h --- dpdk-19.11.7/lib/librte_power/rte_power_guest_channel.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_power/rte_power_guest_channel.h 2021-08-18 14:45:29.000000000 +0000 @@ -119,11 +119,6 @@ }; /** - * @internal - * - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Send a message contained in pkt over the Virtio-Serial to the host endpoint. * * @param pkt @@ -136,13 +131,10 @@ * - 0 on success. * - Negative on error. */ -__rte_experimental int rte_power_guest_channel_send_msg(struct rte_power_channel_packet *pkt, unsigned int lcore_id); /** - * @internal - * * @warning * @b EXPERIMENTAL: this API may change without prior notice. * diff -Nru dpdk-19.11.7/lib/librte_power/rte_power_version.map dpdk-19.11.10~rc1/lib/librte_power/rte_power_version.map --- dpdk-19.11.7/lib/librte_power/rte_power_version.map 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_power/rte_power_version.map 2021-08-18 14:45:29.000000000 +0000 @@ -35,6 +35,4 @@ rte_power_poll_stat_update; # added in 21.02 - rte_power_guest_channel_receive_msg; - rte_power_guest_channel_send_msg; }; diff -Nru dpdk-19.11.7/lib/librte_rib/rte_rib6.c dpdk-19.11.10~rc1/lib/librte_rib/rte_rib6.c --- dpdk-19.11.7/lib/librte_rib/rte_rib6.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_rib/rte_rib6.c 2021-08-18 14:45:29.000000000 +0000 @@ -79,20 +79,33 @@ static inline int get_dir(const uint8_t ip[RTE_RIB6_IPV6_ADDR_SIZE], uint8_t depth) { - int i = 0; - uint8_t p_depth, msk; + uint8_t index, msk; - for (p_depth = depth; p_depth >= 8; p_depth -= 8) - i++; + /* + * depth & 127 clamps depth to values that will not + * read off the end of ip. + * depth is the number of bits deep into ip to traverse, and + * is incremented in blocks of 8 (1 byte). This means the last + * 3 bits are irrelevant to what the index of ip should be. + */ + index = (depth & (UINT8_MAX - 1)) / CHAR_BIT; - msk = 1 << (7 - p_depth); - return (ip[i] & msk) != 0; + /* + * msk is the bitmask used to extract the bit used to decide the + * direction of the next step of the binary search. + */ + msk = 1 << (7 - (depth & 7)); + + return (ip[index] & msk) != 0; } static inline struct rte_rib6_node * get_nxt_node(struct rte_rib6_node *node, const uint8_t ip[RTE_RIB6_IPV6_ADDR_SIZE]) { + if (node->depth == RIB6_MAXDEPTH) + return NULL; + return (get_dir(ip, node->depth)) ? node->right : node->left; } diff -Nru dpdk-19.11.7/lib/librte_stack/rte_stack.c dpdk-19.11.10~rc1/lib/librte_stack/rte_stack.c --- dpdk-19.11.7/lib/librte_stack/rte_stack.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_stack/rte_stack.c 2021-08-18 14:45:29.000000000 +0000 @@ -61,9 +61,11 @@ #ifdef RTE_ARCH_64 RTE_BUILD_BUG_ON(sizeof(struct rte_stack_lf_head) != 16); -#else +#endif +#if !defined(RTE_STACK_LF_SUPPORTED) if (flags & RTE_STACK_F_LF) { STACK_LOG_ERR("Lock-free stack is not supported on your platform\n"); + rte_errno = ENOTSUP; return NULL; } #endif diff -Nru dpdk-19.11.7/lib/librte_stack/rte_stack.h dpdk-19.11.10~rc1/lib/librte_stack/rte_stack.h --- dpdk-19.11.7/lib/librte_stack/rte_stack.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_stack/rte_stack.h 2021-08-18 14:45:29.000000000 +0000 @@ -93,7 +93,7 @@ /** * The stack uses lock-free push and pop functions. This flag is only - * supported on x86_64 platforms, currently. + * supported on x86_64 or arm64 platforms, currently. */ #define RTE_STACK_F_LF 0x0001 @@ -228,6 +228,7 @@ * - EEXIST - a stack with the same name already exists * - ENOMEM - insufficient memory to create the stack * - ENAMETOOLONG - name size exceeds RTE_STACK_NAMESIZE + * - ENOTSUP - platform does not support given flags combination. */ __rte_experimental struct rte_stack * diff -Nru dpdk-19.11.7/lib/librte_stack/rte_stack_lf.h dpdk-19.11.10~rc1/lib/librte_stack/rte_stack_lf.h --- dpdk-19.11.7/lib/librte_stack/rte_stack_lf.h 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_stack/rte_stack_lf.h 2021-08-18 14:45:29.000000000 +0000 @@ -13,6 +13,11 @@ #else #include "rte_stack_lf_generic.h" #endif + +/** + * Indicates that RTE_STACK_F_LF is supported. + */ +#define RTE_STACK_LF_SUPPORTED #endif /** diff -Nru dpdk-19.11.7/lib/librte_vhost/vhost.c dpdk-19.11.10~rc1/lib/librte_vhost/vhost.c --- dpdk-19.11.7/lib/librte_vhost/vhost.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_vhost/vhost.c 2021-08-18 14:45:29.000000000 +0000 @@ -568,7 +568,7 @@ if (dev->virtqueue[i]) continue; - vq = rte_malloc(NULL, sizeof(struct vhost_virtqueue), 0); + vq = rte_zmalloc(NULL, sizeof(struct vhost_virtqueue), 0); if (vq == NULL) { RTE_LOG(ERR, VHOST_CONFIG, "Failed to allocate memory for vring:%u.\n", i); diff -Nru dpdk-19.11.7/lib/librte_vhost/vhost_crypto.c dpdk-19.11.10~rc1/lib/librte_vhost/vhost_crypto.c --- dpdk-19.11.7/lib/librte_vhost/vhost_crypto.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_vhost/vhost_crypto.c 2021-08-18 14:45:29.000000000 +0000 @@ -1338,13 +1338,15 @@ struct rte_mbuf *m_src = op->sym->m_src; struct rte_mbuf *m_dst = op->sym->m_dst; struct vhost_crypto_data_req *vc_req = rte_mbuf_to_priv(m_src); - struct vhost_virtqueue *vq = vc_req->vq; - uint16_t used_idx = vc_req->desc_idx, desc_idx; + struct vhost_virtqueue *vq; + uint16_t used_idx, desc_idx; if (unlikely(!vc_req)) { VC_LOG_ERR("Failed to retrieve vc_req"); return NULL; } + vq = vc_req->vq; + used_idx = vc_req->desc_idx; if (old_vq && (vq != old_vq)) return vq; diff -Nru dpdk-19.11.7/lib/librte_vhost/vhost_user.c dpdk-19.11.10~rc1/lib/librte_vhost/vhost_user.c --- dpdk-19.11.7/lib/librte_vhost/vhost_user.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_vhost/vhost_user.c 2021-08-18 14:45:29.000000000 +0000 @@ -498,8 +498,8 @@ } /* - * Reallocate virtio_dev and vhost_virtqueue data structure to make them on the - * same numa node as the memory of vring descriptor. + * Reallocate virtio_dev, vhost_virtqueue and related data structures to + * make them on the same numa node as the memory of vring descriptor. */ #ifdef RTE_LIBRTE_VHOST_NUMA static struct virtio_net* @@ -593,6 +593,10 @@ goto out; } if (oldnode != newnode) { + struct rte_vhost_memory *old_mem; + struct guest_page *old_gp; + ssize_t mem_size, gp_size; + RTE_LOG(INFO, VHOST_CONFIG, "reallocate dev from %d to %d node\n", oldnode, newnode); @@ -604,6 +608,29 @@ memcpy(dev, old_dev, sizeof(*dev)); rte_free(old_dev); + + mem_size = sizeof(struct rte_vhost_memory) + + sizeof(struct rte_vhost_mem_region) * dev->mem->nregions; + old_mem = dev->mem; + dev->mem = rte_malloc_socket(NULL, mem_size, 0, newnode); + if (!dev->mem) { + dev->mem = old_mem; + goto out; + } + + memcpy(dev->mem, old_mem, mem_size); + rte_free(old_mem); + + gp_size = dev->max_guest_pages * sizeof(*dev->guest_pages); + old_gp = dev->guest_pages; + dev->guest_pages = rte_malloc_socket(NULL, gp_size, RTE_CACHE_LINE_SIZE, newnode); + if (!dev->guest_pages) { + dev->guest_pages = old_gp; + goto out; + } + + memcpy(dev->guest_pages, old_gp, gp_size); + rte_free(old_gp); } out: @@ -2579,6 +2606,7 @@ break; case VHOST_USER_SET_VRING_NUM: case VHOST_USER_SET_VRING_BASE: + case VHOST_USER_GET_VRING_BASE: case VHOST_USER_SET_VRING_ENABLE: vring_idx = msg->payload.state.index; break; diff -Nru dpdk-19.11.7/lib/librte_vhost/virtio_net.c dpdk-19.11.10~rc1/lib/librte_vhost/virtio_net.c --- dpdk-19.11.7/lib/librte_vhost/virtio_net.c 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/librte_vhost/virtio_net.c 2021-08-18 14:45:29.000000000 +0000 @@ -546,10 +546,11 @@ return -1; } - len += descs[idx].len; + dlen = descs[idx].len; + len += dlen; if (unlikely(map_one_desc(dev, vq, buf_vec, &vec_id, - descs[idx].addr, descs[idx].len, + descs[idx].addr, dlen, perm))) { free_ind_table(idesc); return -1; @@ -666,9 +667,10 @@ return -1; } - *len += descs[i].len; + dlen = descs[i].len; + *len += dlen; if (unlikely(map_one_desc(dev, vq, buf_vec, &vec_id, - descs[i].addr, descs[i].len, + descs[i].addr, dlen, perm))) return -1; } @@ -689,6 +691,7 @@ bool wrap_counter = vq->avail_wrap_counter; struct vring_packed_desc *descs = vq->desc_packed; uint16_t vec_id = *vec_idx; + uint64_t dlen; if (avail_idx < vq->last_avail_idx) wrap_counter ^= 1; @@ -721,11 +724,12 @@ len, perm) < 0)) return -1; } else { - *len += descs[avail_idx].len; + dlen = descs[avail_idx].len; + *len += dlen; if (unlikely(map_one_desc(dev, vq, buf_vec, &vec_id, descs[avail_idx].addr, - descs[avail_idx].len, + dlen, perm))) return -1; } @@ -806,9 +810,10 @@ hdr_mbuf = m; hdr_addr = buf_addr; - if (unlikely(buf_len < dev->vhost_hlen)) + if (unlikely(buf_len < dev->vhost_hlen)) { + memset(&tmp_hdr, 0, sizeof(struct virtio_net_hdr_mrg_rxbuf)); hdr = &tmp_hdr; - else + } else hdr = (struct virtio_net_hdr_mrg_rxbuf *)(uintptr_t)hdr_addr; VHOST_LOG_DEBUG(VHOST_DATA, "(%d) RX: num merge buffers %d\n", @@ -1861,7 +1866,7 @@ } vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) { - pkts[i]->pkt_len = descs[avail_idx + i].len - buf_offset; + pkts[i]->pkt_len = lens[i] - buf_offset; pkts[i]->data_len = pkts[i]->pkt_len; ids[i] = descs[avail_idx + i].id; } diff -Nru dpdk-19.11.7/lib/meson.build dpdk-19.11.10~rc1/lib/meson.build --- dpdk-19.11.7/lib/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/lib/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -127,7 +127,7 @@ dependencies: static_deps, include_directories: includes, install: true) - static_dep = declare_dependency( + static_dep = declare_dependency(link_with: static_lib, include_directories: includes, dependencies: static_deps) diff -Nru dpdk-19.11.7/license/README dpdk-19.11.10~rc1/license/README --- dpdk-19.11.7/license/README 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/license/README 2021-08-18 14:45:29.000000000 +0000 @@ -49,7 +49,7 @@ Any exception to the DPDK IP policies shall be approved by DPDK Tech Board and DPDK Governing Board. Steps for any exception approval: 1. Mention the appropriate license identifier form SPDX. If the license is not - listed in SPDX Licenses. It is the submitters responsibiliity to get it + listed in SPDX Licenses. It is the submitters responsibility to get it first listed. 2. Get the required approval from the DPDK Technical Board. Technical Board may advise the author to check alternate means first. If no other alternative @@ -72,6 +72,6 @@ URL: http://spdx.org/licenses/GPL-2.0.html#licenseText DPDK License text: licenses/gpl-2.0.txt 3. GNU Lesser General Public License v2.1 - SPDX-License-Identifieri: LGPL-2.1 + SPDX-License-Identifier: LGPL-2.1 URL: http://spdx.org/licenses/LGPL-2.1.html#licenseText DPDK License text: licenses/lgpl-2.1.txt diff -Nru dpdk-19.11.7/MAINTAINERS dpdk-19.11.10~rc1/MAINTAINERS --- dpdk-19.11.7/MAINTAINERS 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/MAINTAINERS 2021-08-18 14:45:29.000000000 +0000 @@ -131,8 +131,6 @@ F: buildtools/call-sphinx-build.py F: buildtools/gen-pmdinfo-cfile.sh F: buildtools/map_to_def.py -F: buildtools/list-dir-globs.py -F: buildtools/pkg-config/ F: buildtools/symlink-drivers-solibs.sh Public CI diff -Nru dpdk-19.11.7/meson.build dpdk-19.11.10~rc1/meson.build --- dpdk-19.11.7/meson.build 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/meson.build 2021-08-18 14:45:29.000000000 +0000 @@ -50,7 +50,7 @@ subdir('examples') install_subdir('examples', install_dir: get_option('datadir') + '/dpdk', - exclude_files: 'meson.build') + exclude_files: ex_file_excludes) # build kernel modules if enabled if get_option('enable_kmods') @@ -64,8 +64,34 @@ install_dir: join_paths(get_option('includedir'), get_option('include_subdir_arch'))) -# build pkg-config files for dpdk -subdir('buildtools/pkg-config') +platform_flags = [] +if not is_windows + platform_flags += ['-Wl,--export-dynamic'] # ELF only +endif + +# for static builds, include the drivers as libs and we need to "whole-archive" +# them. +dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive'] + platform_flags + +pkg = import('pkgconfig') +pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args +if is_freebsd + pkg_extra_cflags += ['-D__BSD_VISIBLE'] +endif +pkg.generate(name: meson.project_name(), + filebase: 'lib' + meson.project_name().to_lower(), + version: meson.project_version(), + libraries: dpdk_libraries, + libraries_private: dpdk_drivers + dpdk_static_libraries + + ['-Wl,-Bdynamic'] + dpdk_extra_ldflags, + requires: libbsd, # apps using rte_string_fns.h may need this if enabled + # if libbsd is not enabled, then this is blank + description: '''The Data Plane Development Kit (DPDK). +Note that CFLAGS might contain an -march flag higher than typical baseline. +This is required for a number of static inline functions in the public headers.''', + subdirs: [get_option('include_subdir_arch'), '.'], + extra_cflags: pkg_extra_cflags +) # final output, list all the libs and drivers to be built # this does not affect any part of the build, for information only. diff -Nru dpdk-19.11.7/VERSION dpdk-19.11.10~rc1/VERSION --- dpdk-19.11.7/VERSION 2021-03-17 16:43:15.000000000 +0000 +++ dpdk-19.11.10~rc1/VERSION 2021-08-18 14:45:29.000000000 +0000 @@ -1 +1 @@ -19.11.7 +19.11.10-rc1