Version in base suite: 22.11.6-1~deb12u1 Base version: dpdk_22.11.6-1~deb12u1 Target version: dpdk_22.11.7-1~deb12u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/d/dpdk/dpdk_22.11.6-1~deb12u1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/d/dpdk/dpdk_22.11.7-1~deb12u1.dsc .mailmap | 10 VERSION | 2 app/dumpcap/main.c | 17 app/proc-info/main.c | 3 app/test-pmd/cmdline.c | 440 +++++++++---------- app/test-pmd/cmdline_flow.c | 12 app/test-pmd/config.c | 9 app/test/test_common.c | 31 - app/test/test_cryptodev.c | 8 app/test/test_eal_flags.c | 4 app/test/test_event_crypto_adapter.c | 24 - app/test/test_link_bonding.c | 2 app/test/test_link_bonding_rssconf.c | 1 app/test/test_pcapng.c | 10 app/test/test_power_cpufreq.c | 21 buildtools/chkincs/meson.build | 3 config/arm/meson.build | 5 debian/changelog | 7 devtools/check-forbidden-tokens.awk | 10 devtools/git-log-fixes.sh | 2 doc/guides/nics/features.rst | 34 - doc/guides/nics/mlx5.rst | 71 +++ doc/guides/rel_notes/release_22_11.rst | 276 +++++++++++ drivers/baseband/acc/acc_common.h | 2 drivers/baseband/acc/rte_acc100_pmd.c | 36 - drivers/baseband/acc/rte_acc200_pmd.c | 37 - drivers/baseband/la12xx/bbdev_la12xx.c | 1 drivers/bus/dpaa/base/fman/fman.c | 29 + drivers/bus/dpaa/base/fman/fman_hw.c | 9 drivers/bus/dpaa/base/qbman/qman.c | 54 +- drivers/bus/fslmc/qbman/qbman_debug.c | 49 +- drivers/common/cnxk/roc_ie_ot.c | 1 drivers/common/cnxk/roc_irq.c | 2 drivers/common/cnxk/roc_platform.c | 2 drivers/common/dpaax/caamflib/desc/pdcp.h | 10 drivers/common/dpaax/caamflib/rta/operation_cmd.h | 4 drivers/common/idpf/base/idpf_osdep.h | 10 drivers/common/mlx5/mlx5_common_utils.h | 2 drivers/common/mlx5/mlx5_devx_cmds.c | 1 drivers/common/mlx5/mlx5_devx_cmds.h | 1 drivers/common/mlx5/mlx5_prm.h | 33 + drivers/common/mlx5/windows/mlx5_win_defs.h | 12 drivers/compress/mlx5/mlx5_compress.c | 4 drivers/crypto/bcmfs/bcmfs_device.c | 4 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 1 drivers/crypto/ipsec_mb/meson.build | 2 drivers/crypto/openssl/rte_openssl_pmd.c | 30 - drivers/crypto/qat/qat_asym.c | 2 drivers/dma/idxd/idxd_pci.c | 2 drivers/event/cnxk/cn10k_eventdev.c | 32 + drivers/event/cnxk/cn9k_eventdev.c | 31 + drivers/event/cnxk/cnxk_eventdev.c | 2 drivers/event/cnxk/cnxk_eventdev_adptr.c | 2 drivers/event/octeontx/ssovf_evdev.c | 16 drivers/meson.build | 1 drivers/net/bnx2x/bnx2x.c | 19 drivers/net/bnx2x/bnx2x_stats.c | 4 drivers/net/bnxt/bnxt_ethdev.c | 1 drivers/net/bnxt/bnxt_txr.c | 17 drivers/net/bnxt/tf_core/tf_msg.c | 2 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c | 26 - drivers/net/bnxt/tf_ulp/ulp_flow_db.c | 21 drivers/net/bnxt/tf_ulp/ulp_flow_db.h | 2 drivers/net/cnxk/cn10k_ethdev.c | 18 drivers/net/cnxk/cn9k_ethdev.c | 17 drivers/net/cnxk/cnxk_ethdev.c | 2 drivers/net/cnxk/cnxk_ethdev.h | 7 drivers/net/cnxk/cnxk_ethdev_devargs.c | 2 drivers/net/dpaa/dpaa_ethdev.c | 6 drivers/net/dpaa/dpaa_rxtx.c | 2 drivers/net/dpaa2/dpaa2_ethdev.c | 3 drivers/net/dpaa2/dpaa2_tm.c | 29 - drivers/net/e1000/em_ethdev.c | 3 drivers/net/e1000/igb_ethdev.c | 4 drivers/net/ena/base/ena_plat_dpdk.h | 9 drivers/net/gve/base/gve_osdep.h | 42 + drivers/net/hns3/hns3_cmd.c | 4 drivers/net/hns3/hns3_ethdev.c | 2 drivers/net/hns3/hns3_ethdev.h | 2 drivers/net/hns3/hns3_fdir.c | 1 drivers/net/hns3/hns3_flow.c | 7 drivers/net/hns3/hns3_intr.c | 6 drivers/net/hns3/hns3_regs.c | 14 drivers/net/hns3/hns3_rxtx.c | 2 drivers/net/hns3/hns3_rxtx_vec.c | 5 drivers/net/hns3/hns3_rxtx_vec_sve.c | 5 drivers/net/i40e/base/i40e_adminq.c | 19 drivers/net/i40e/base/i40e_common.c | 42 - drivers/net/i40e/base/i40e_diag.c | 12 drivers/net/i40e/base/i40e_nvm.c | 16 drivers/net/i40e/i40e_flow.c | 77 ++- drivers/net/i40e/i40e_rxtx_vec_avx512.c | 7 drivers/net/iavf/iavf_ethdev.c | 19 drivers/net/iavf/iavf_rxtx.c | 6 drivers/net/iavf/iavf_rxtx_vec_avx512.c | 7 drivers/net/iavf/iavf_vchnl.c | 5 drivers/net/ice/base/ice_adminq_cmd.h | 2 drivers/net/ice/base/ice_controlq.c | 23 drivers/net/ice/base/ice_nvm.c | 36 + drivers/net/ice/base/ice_switch.c | 2 drivers/net/ice/ice_rxtx.c | 5 drivers/net/ice/ice_rxtx_vec_avx512.c | 7 drivers/net/idpf/idpf_ethdev.c | 3 drivers/net/idpf/idpf_rxtx_vec_avx512.c | 7 drivers/net/ionic/ionic_osdep.h | 28 - drivers/net/ixgbe/base/ixgbe_82599.c | 8 drivers/net/ixgbe/ixgbe_ethdev.c | 5 drivers/net/mana/meson.build | 4 drivers/net/memif/rte_eth_memif.c | 10 drivers/net/mlx5/hws/mlx5dr.h | 4 drivers/net/mlx5/hws/mlx5dr_context.c | 9 drivers/net/mlx5/linux/mlx5_os.c | 8 drivers/net/mlx5/mlx5.c | 6 drivers/net/mlx5/mlx5.h | 3 drivers/net/mlx5/mlx5_ethdev.c | 4 drivers/net/mlx5/mlx5_flow.c | 2 drivers/net/mlx5/mlx5_flow.h | 14 drivers/net/mlx5/mlx5_flow_aso.c | 6 drivers/net/mlx5/mlx5_flow_dv.c | 25 - drivers/net/mlx5/mlx5_flow_flex.c | 184 +++++-- drivers/net/mlx5/mlx5_flow_hw.c | 22 drivers/net/mlx5/mlx5_flow_meter.c | 6 drivers/net/mlx5/mlx5_hws_cnt.c | 46 + drivers/net/mlx5/mlx5_rx.c | 2 drivers/net/mlx5/mlx5_rx.h | 1 drivers/net/mlx5/mlx5_rxq.c | 21 drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 15 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 27 - drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 9 drivers/net/mlx5/mlx5_tx.c | 8 drivers/net/mlx5/mlx5_tx.h | 30 + drivers/net/mlx5/mlx5_txpp.c | 11 drivers/net/mlx5/mlx5_txq.c | 8 drivers/net/mlx5/windows/mlx5_os.c | 8 drivers/net/mvneta/mvneta_ethdev.c | 6 drivers/net/netvsc/hn_ethdev.c | 9 drivers/net/netvsc/hn_rxtx.c | 89 +++ drivers/net/nfb/nfb_rx.c | 2 drivers/net/nfb/nfb_tx.c | 2 drivers/net/nfp/nfp_ethdev.c | 25 - drivers/net/nfp/nfp_flow.c | 1 drivers/net/ngbe/base/ngbe_regs.h | 2 drivers/net/ngbe/ngbe_ethdev.c | 75 +-- drivers/net/pcap/pcap_ethdev.c | 39 - drivers/net/sfc/sfc_flow_rss.c | 4 drivers/net/sfc/sfc_mae.c | 13 drivers/net/tap/rte_eth_tap.c | 2 drivers/net/tap/tap_netlink.c | 3 drivers/net/txgbe/base/txgbe_mng.c | 1 drivers/net/txgbe/base/txgbe_regs.h | 2 drivers/net/txgbe/txgbe_ethdev.c | 5 drivers/net/txgbe/txgbe_rxtx.c | 3 drivers/net/virtio/virtio_user_ethdev.c | 1 drivers/net/vmxnet3/vmxnet3_ethdev.c | 35 - drivers/net/vmxnet3/vmxnet3_ethdev.h | 4 drivers/raw/ifpga/base/opae_intel_max10.c | 11 drivers/raw/ifpga/ifpga_rawdev.c | 8 examples/eventdev_pipeline/pipeline_worker_generic.c | 12 examples/ipsec-secgw/ipsec-secgw.c | 6 examples/ipsec-secgw/ipsec_process.c | 3 examples/l2fwd-event/l2fwd_event.c | 1 examples/l3fwd/l3fwd_altivec.h | 6 examples/l3fwd/l3fwd_common.h | 7 examples/l3fwd/l3fwd_em_hlm.h | 2 examples/l3fwd/l3fwd_em_sequential.h | 2 examples/l3fwd/l3fwd_fib.c | 2 examples/l3fwd/l3fwd_lpm_altivec.h | 2 examples/l3fwd/l3fwd_lpm_neon.h | 2 examples/l3fwd/l3fwd_lpm_sse.h | 2 examples/l3fwd/l3fwd_neon.h | 6 examples/l3fwd/l3fwd_sse.h | 6 examples/ntb/ntb_fwd.c | 5 examples/vhost_blk/vhost_blk.c | 2 lib/bpf/bpf_convert.c | 2 lib/dmadev/rte_dmadev.c | 2 lib/eal/common/eal_common_dev.c | 13 lib/eal/unix/meson.build | 5 lib/eal/unix/rte_thread.c | 25 + lib/eal/x86/include/rte_io.h | 2 lib/ethdev/rte_ethdev.c | 18 lib/eventdev/rte_event_eth_rx_adapter.c | 2 lib/fib/dir24_8.c | 4 lib/fib/trie.c | 10 lib/hash/rte_thash.c | 26 + lib/member/rte_member_ht.c | 2 lib/pcapng/rte_pcapng.c | 12 lib/power/power_acpi_cpufreq.c | 6 lib/power/power_common.c | 23 lib/power/power_common.h | 1 lib/power/power_cppc_cpufreq.c | 8 lib/power/power_pstate_cpufreq.c | 6 lib/power/rte_power_pmd_mgmt.c | 12 lib/vhost/vdpa.c | 1 lib/vhost/vhost_user.c | 2 lib/vhost/virtio_net.c | 3 195 files changed, 2119 insertions(+), 1013 deletions(-) Unrecognised file line in .dsc: -----BEGIN PGP SIGNATURE----- Unrecognised file line in .dsc: -----BEGIN PGP SIGNATURE----- diff -Nru dpdk-22.11.6/.mailmap dpdk-22.11.7/.mailmap --- dpdk-22.11.6/.mailmap 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/.mailmap 2024-12-13 14:35:22.000000000 +0000 @@ -166,6 +166,7 @@ Bhagyada Modali Bharat Mota Bill Hong +Bill Xiang Billy McFall Billy O'Mahony Bing Zhao @@ -217,6 +218,7 @@ Chengwen Feng Chenmin Sun Chenming Chang +Chenxingyu Wang Chenxu Di Cheryl Houser Chinh T Cao @@ -735,7 +737,7 @@ Kishore Padmanabha Klaus Degner Kommula Shiva Shankar -Konstantin Ananyev +Konstantin Ananyev Krishna Murthy Krzysztof Galazka Krzysztof Kanas @@ -822,6 +824,7 @@ Mahipal Challa Mah Yock Gen Mairtin o Loingsigh +Malcolm Bumgardner Mallesham Jatharakonda Mallesh Koujalagi Malvika Gupta @@ -929,6 +932,7 @@ Michal Wilczynski Michel Machado Miguel Bernal Marin +Mihai Brodschi Mihai Pogonaru Mike Baucom Mike Pattrick @@ -986,6 +990,7 @@ Nemanja Marjanovic Netanel Belgazal Netanel Gonen +Niall Meade Niall Power Nick Connolly Nick Nunley @@ -1012,6 +1017,7 @@ Nobuhiro Miki Norbert Ciosek Odi Assli +Ofer Dagan Ognjen Joldzic Ola Liljedahl Oleg Polyakov @@ -1072,6 +1078,7 @@ Peng Zhang Pengzhen Liu Peter Mccarthy +Peter Morrow Peter Spreadborough Petr Houska Phanendra Vukkisala @@ -1386,6 +1393,7 @@ Timothy McDaniel Timothy Miskell Timothy Redaelli +Tim Martin Tim Shearer Ting-Kai Ku Ting Xu diff -Nru dpdk-22.11.6/VERSION dpdk-22.11.7/VERSION --- dpdk-22.11.6/VERSION 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/VERSION 2024-12-13 14:35:22.000000000 +0000 @@ -1 +1 @@ -22.11.6 +22.11.7 diff -Nru dpdk-22.11.6/app/dumpcap/main.c dpdk-22.11.7/app/dumpcap/main.c --- dpdk-22.11.6/app/dumpcap/main.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/dumpcap/main.c 2024-12-13 14:35:22.000000000 +0000 @@ -83,8 +83,6 @@ TAILQ_ENTRY(interface) next; uint16_t port; char name[RTE_ETH_NAME_MAX_LEN]; - - struct rte_rxtx_callback *rx_cb[RTE_MAX_QUEUES_PER_PORT]; }; TAILQ_HEAD(interface_list, interface); @@ -740,7 +738,7 @@ pcap_write_packets(pcap_dumper_t *dumper, struct rte_mbuf *pkts[], uint16_t n) { - uint8_t temp_data[snaplen]; + uint8_t temp_data[RTE_ETHER_MAX_JUMBO_FRAME_LEN]; struct pcap_pkthdr header; uint16_t i; size_t total = 0; @@ -749,14 +747,19 @@ for (i = 0; i < n; i++) { struct rte_mbuf *m = pkts[i]; + size_t len, caplen; + + len = caplen = rte_pktmbuf_pkt_len(m); + if (unlikely(!rte_pktmbuf_is_contiguous(m) && len > snaplen)) + caplen = snaplen; - header.len = rte_pktmbuf_pkt_len(m); - header.caplen = RTE_MIN(header.len, snaplen); + header.len = len; + header.caplen = caplen; pcap_dump((u_char *)dumper, &header, - rte_pktmbuf_read(m, 0, header.caplen, temp_data)); + rte_pktmbuf_read(m, 0, caplen, temp_data)); - total += sizeof(header) + header.len; + total += sizeof(header) + caplen; } return total; diff -Nru dpdk-22.11.6/app/proc-info/main.c dpdk-22.11.7/app/proc-info/main.c --- dpdk-22.11.6/app/proc-info/main.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/proc-info/main.c 2024-12-13 14:35:22.000000000 +0000 @@ -1793,7 +1793,7 @@ if (mem_info) { meminfo_display(); - return 0; + goto cleanup; } nb_ports = rte_eth_dev_count_avail(); @@ -1875,6 +1875,7 @@ RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); +cleanup: ret = rte_eal_cleanup(); if (ret) printf("Error from rte_eal_cleanup(), %d\n", ret); diff -Nru dpdk-22.11.6/app/test/test_common.c dpdk-22.11.7/app/test/test_common.c --- dpdk-22.11.6/app/test/test_common.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/test/test_common.c 2024-12-13 14:35:22.000000000 +0000 @@ -8,11 +8,12 @@ #include #include #include +#include #include #include "test.h" -#define MAX_NUM 1 << 20 +#define MAX_NUM (1 << 20) #define FAIL(x)\ {printf(x "() test failed!\n");\ @@ -217,19 +218,21 @@ } } - for (p = 1; p <= MAX_NUM / 2; p++) { - for (i = 1; i <= MAX_NUM / 2; i++) { - val = RTE_ALIGN_MUL_CEIL(i, p); - if (val % p != 0 || val < i) - FAIL_ALIGN("RTE_ALIGN_MUL_CEIL", i, p); - val = RTE_ALIGN_MUL_FLOOR(i, p); - if (val % p != 0 || val > i) - FAIL_ALIGN("RTE_ALIGN_MUL_FLOOR", i, p); - val = RTE_ALIGN_MUL_NEAR(i, p); - if (val % p != 0 || ((val != RTE_ALIGN_MUL_CEIL(i, p)) - & (val != RTE_ALIGN_MUL_FLOOR(i, p)))) - FAIL_ALIGN("RTE_ALIGN_MUL_NEAR", i, p); - } + /* testing the whole space of 2^20^2 takes too long. */ + for (j = 1; j <= MAX_NUM ; j++) { + i = rte_rand_max(MAX_NUM - 1) + 1; + p = rte_rand_max(MAX_NUM - 1) + 1; + + val = RTE_ALIGN_MUL_CEIL(i, p); + if (val % p != 0 || val < i) + FAIL_ALIGN("RTE_ALIGN_MUL_CEIL", i, p); + val = RTE_ALIGN_MUL_FLOOR(i, p); + if (val % p != 0 || val > i) + FAIL_ALIGN("RTE_ALIGN_MUL_FLOOR", i, p); + val = RTE_ALIGN_MUL_NEAR(i, p); + if (val % p != 0 || ((val != RTE_ALIGN_MUL_CEIL(i, p)) + & (val != RTE_ALIGN_MUL_FLOOR(i, p)))) + FAIL_ALIGN("RTE_ALIGN_MUL_NEAR", i, p); } return 0; diff -Nru dpdk-22.11.6/app/test/test_cryptodev.c dpdk-22.11.7/app/test/test_cryptodev.c --- dpdk-22.11.6/app/test/test_cryptodev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/test/test_cryptodev.c 2024-12-13 14:35:22.000000000 +0000 @@ -12692,6 +12692,10 @@ uint16_t qp_id = 0; int j = 0; + /* Skip test if synchronous API is used */ + if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) + return TEST_SKIPPED; + /* Verify the crypto capabilities for which enqueue/dequeue is done. */ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH; cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL; @@ -12813,6 +12817,10 @@ uint16_t qp_id = 0; int j = 0; + /* Skip test if synchronous API is used */ + if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) + return TEST_SKIPPED; + /* Verify the crypto capabilities for which enqueue/dequeue is done. */ cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH; cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL; diff -Nru dpdk-22.11.6/app/test/test_eal_flags.c dpdk-22.11.7/app/test/test_eal_flags.c --- dpdk-22.11.6/app/test/test_eal_flags.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/test/test_eal_flags.c 2024-12-13 14:35:22.000000000 +0000 @@ -677,8 +677,8 @@ if (rte_lcore_is_enabled(0) && rte_lcore_is_enabled(1) && rte_lcore_is_enabled(2) && rte_lcore_is_enabled(3) && - rte_lcore_is_enabled(3) && rte_lcore_is_enabled(5) && - rte_lcore_is_enabled(4) && rte_lcore_is_enabled(7) && + rte_lcore_is_enabled(4) && rte_lcore_is_enabled(5) && + rte_lcore_is_enabled(6) && rte_lcore_is_enabled(7) && launch_proc(argv29) != 0) { printf("Error - " "process did not run ok with valid corelist value\n"); diff -Nru dpdk-22.11.6/app/test/test_event_crypto_adapter.c dpdk-22.11.7/app/test/test_event_crypto_adapter.c --- dpdk-22.11.6/app/test/test_event_crypto_adapter.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/test/test_event_crypto_adapter.c 2024-12-13 14:35:22.000000000 +0000 @@ -1040,21 +1040,17 @@ static inline void evdev_set_conf_values(struct rte_event_dev_config *dev_conf, - struct rte_event_dev_info *info) + const struct rte_event_dev_info *info) { - memset(dev_conf, 0, sizeof(struct rte_event_dev_config)); - dev_conf->dequeue_timeout_ns = info->min_dequeue_timeout_ns; - dev_conf->nb_event_ports = NB_TEST_PORTS; - dev_conf->nb_event_queues = NB_TEST_QUEUES; - dev_conf->nb_event_queue_flows = info->max_event_queue_flows; - dev_conf->nb_event_port_dequeue_depth = - info->max_event_port_dequeue_depth; - dev_conf->nb_event_port_enqueue_depth = - info->max_event_port_enqueue_depth; - dev_conf->nb_event_port_enqueue_depth = - info->max_event_port_enqueue_depth; - dev_conf->nb_events_limit = - info->max_num_events; + *dev_conf = (struct rte_event_dev_config) { + .dequeue_timeout_ns = info->min_dequeue_timeout_ns, + .nb_event_ports = NB_TEST_PORTS, + .nb_event_queues = NB_TEST_QUEUES, + .nb_event_queue_flows = info->max_event_queue_flows, + .nb_event_port_dequeue_depth = info->max_event_port_dequeue_depth, + .nb_event_port_enqueue_depth = info->max_event_port_enqueue_depth, + .nb_events_limit = info->max_num_events, + }; } static int diff -Nru dpdk-22.11.6/app/test/test_link_bonding.c dpdk-22.11.7/app/test/test_link_bonding.c --- dpdk-22.11.6/app/test/test_link_bonding.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/test/test_link_bonding.c 2024-12-13 14:35:22.000000000 +0000 @@ -786,7 +786,7 @@ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), "Failed to get mac address (port %d)", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(memcmp(&read_mac_addr, &read_mac_addr, + TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), "bonded port mac address not set to that of primary port\n"); diff -Nru dpdk-22.11.6/app/test/test_link_bonding_rssconf.c dpdk-22.11.7/app/test/test_link_bonding_rssconf.c --- dpdk-22.11.6/app/test/test_link_bonding_rssconf.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/test/test_link_bonding_rssconf.c 2024-12-13 14:35:22.000000000 +0000 @@ -616,7 +616,6 @@ mac_addr.addr_bytes[5] = 0x10 + port->port_id; rte_eth_dev_default_mac_addr_set(port->port_id, &mac_addr); - rte_eth_dev_info_get(port->port_id, &port->dev_info); retval = rte_eth_dev_info_get(port->port_id, &port->dev_info); TEST_ASSERT((retval == 0), "Error during getting device (port %u) info: %s\n", diff -Nru dpdk-22.11.6/app/test/test_pcapng.c dpdk-22.11.7/app/test/test_pcapng.c --- dpdk-22.11.6/app/test/test_pcapng.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/test/test_pcapng.c 2024-12-13 14:35:22.000000000 +0000 @@ -81,6 +81,14 @@ rte_eth_random_addr(pkt.eth.src_addr.addr_bytes); memcpy(rte_pktmbuf_mtod(dm->mb, void *), &pkt, RTE_MIN(sizeof(pkt), plen)); + + /* Idea here is to create mbuf chain big enough that after mbuf deep copy they won't be + * compressed into single mbuf to properly test store of chained mbufs + */ + dummy_mbuf_prep(&dm->mb[1], dm->buf[1], sizeof(dm->buf[1]), pkt_len); + dummy_mbuf_prep(&dm->mb[2], dm->buf[2], sizeof(dm->buf[2]), pkt_len); + rte_pktmbuf_chain(&dm->mb[0], &dm->mb[1]); + rte_pktmbuf_chain(&dm->mb[0], &dm->mb[2]); } static int @@ -138,7 +146,7 @@ for (i = 0; i < NUM_PACKETS; i++) { struct rte_mbuf *mc; - mc = rte_pcapng_copy(port_id, 0, orig, mp, pkt_len, + mc = rte_pcapng_copy(port_id, 0, orig, mp, rte_pktmbuf_pkt_len(orig), rte_get_tsc_cycles(), 0); if (mc == NULL) { fprintf(stderr, "Cannot copy packet\n"); diff -Nru dpdk-22.11.6/app/test/test_power_cpufreq.c dpdk-22.11.7/app/test/test_power_cpufreq.c --- dpdk-22.11.6/app/test/test_power_cpufreq.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/test/test_power_cpufreq.c 2024-12-13 14:35:22.000000000 +0000 @@ -9,6 +9,7 @@ #include #include #include +#include #include "test.h" @@ -46,9 +47,10 @@ static uint32_t total_freq_num; static uint32_t freqs[TEST_POWER_FREQS_NUM_MAX]; +static uint32_t cpu_id; static int -check_cur_freq(unsigned int lcore_id, uint32_t idx, bool turbo) +check_cur_freq(__rte_unused unsigned int lcore_id, uint32_t idx, bool turbo) { #define TEST_POWER_CONVERT_TO_DECIMAL 10 #define MAX_LOOP 100 @@ -62,13 +64,13 @@ int i; if (snprintf(fullpath, sizeof(fullpath), - TEST_POWER_SYSFILE_CPUINFO_FREQ, lcore_id) < 0) { + TEST_POWER_SYSFILE_CPUINFO_FREQ, cpu_id) < 0) { return 0; } f = fopen(fullpath, "r"); if (f == NULL) { if (snprintf(fullpath, sizeof(fullpath), - TEST_POWER_SYSFILE_SCALING_FREQ, lcore_id) < 0) { + TEST_POWER_SYSFILE_SCALING_FREQ, cpu_id) < 0) { return 0; } f = fopen(fullpath, "r"); @@ -486,6 +488,19 @@ { int ret = -1; enum power_management_env env; + rte_cpuset_t lcore_cpus; + + lcore_cpus = rte_lcore_cpuset(TEST_POWER_LCORE_ID); + if (CPU_COUNT(&lcore_cpus) != 1) { + printf("Power management doesn't support lcore %u mapping to %u CPUs\n", + TEST_POWER_LCORE_ID, + CPU_COUNT(&lcore_cpus)); + return TEST_SKIPPED; + } + for (cpu_id = 0; cpu_id < CPU_SETSIZE; cpu_id++) { + if (CPU_ISSET(cpu_id, &lcore_cpus)) + break; + } /* Test initialisation of a valid lcore */ ret = rte_power_init(TEST_POWER_LCORE_ID); diff -Nru dpdk-22.11.6/app/test-pmd/cmdline.c dpdk-22.11.7/app/test-pmd/cmdline.c --- dpdk-22.11.6/app/test-pmd/cmdline.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/test-pmd/cmdline.c 2024-12-13 14:35:22.000000000 +0000 @@ -12615,232 +12615,232 @@ /* list of instructions */ static cmdline_parse_ctx_t builtin_ctx[] = { - (cmdline_parse_inst_t *)&cmd_help_brief, - (cmdline_parse_inst_t *)&cmd_help_long, - (cmdline_parse_inst_t *)&cmd_quit, - (cmdline_parse_inst_t *)&cmd_load_from_file, - (cmdline_parse_inst_t *)&cmd_showport, - (cmdline_parse_inst_t *)&cmd_showqueue, - (cmdline_parse_inst_t *)&cmd_showeeprom, - (cmdline_parse_inst_t *)&cmd_showportall, - (cmdline_parse_inst_t *)&cmd_representor_info, - (cmdline_parse_inst_t *)&cmd_showdevice, - (cmdline_parse_inst_t *)&cmd_showcfg, - (cmdline_parse_inst_t *)&cmd_showfwdall, - (cmdline_parse_inst_t *)&cmd_start, - (cmdline_parse_inst_t *)&cmd_start_tx_first, - (cmdline_parse_inst_t *)&cmd_start_tx_first_n, - (cmdline_parse_inst_t *)&cmd_set_link_up, - (cmdline_parse_inst_t *)&cmd_set_link_down, - (cmdline_parse_inst_t *)&cmd_reset, - (cmdline_parse_inst_t *)&cmd_set_numbers, - (cmdline_parse_inst_t *)&cmd_set_log, - (cmdline_parse_inst_t *)&cmd_set_rxoffs, - (cmdline_parse_inst_t *)&cmd_set_rxpkts, - (cmdline_parse_inst_t *)&cmd_set_rxhdrs, - (cmdline_parse_inst_t *)&cmd_set_txpkts, - (cmdline_parse_inst_t *)&cmd_set_txsplit, - (cmdline_parse_inst_t *)&cmd_set_txtimes, - (cmdline_parse_inst_t *)&cmd_set_fwd_list, - (cmdline_parse_inst_t *)&cmd_set_fwd_mask, - (cmdline_parse_inst_t *)&cmd_set_fwd_mode, - (cmdline_parse_inst_t *)&cmd_set_fwd_retry_mode, - (cmdline_parse_inst_t *)&cmd_set_burst_tx_retry, - (cmdline_parse_inst_t *)&cmd_set_promisc_mode_one, - (cmdline_parse_inst_t *)&cmd_set_promisc_mode_all, - (cmdline_parse_inst_t *)&cmd_set_allmulti_mode_one, - (cmdline_parse_inst_t *)&cmd_set_allmulti_mode_all, - (cmdline_parse_inst_t *)&cmd_set_flush_rx, - (cmdline_parse_inst_t *)&cmd_set_link_check, - (cmdline_parse_inst_t *)&cmd_vlan_offload, - (cmdline_parse_inst_t *)&cmd_vlan_tpid, - (cmdline_parse_inst_t *)&cmd_rx_vlan_filter_all, - (cmdline_parse_inst_t *)&cmd_rx_vlan_filter, - (cmdline_parse_inst_t *)&cmd_tx_vlan_set, - (cmdline_parse_inst_t *)&cmd_tx_vlan_set_qinq, - (cmdline_parse_inst_t *)&cmd_tx_vlan_reset, - (cmdline_parse_inst_t *)&cmd_tx_vlan_set_pvid, - (cmdline_parse_inst_t *)&cmd_csum_set, - (cmdline_parse_inst_t *)&cmd_csum_show, - (cmdline_parse_inst_t *)&cmd_csum_tunnel, - (cmdline_parse_inst_t *)&cmd_csum_mac_swap, - (cmdline_parse_inst_t *)&cmd_tso_set, - (cmdline_parse_inst_t *)&cmd_tso_show, - (cmdline_parse_inst_t *)&cmd_tunnel_tso_set, - (cmdline_parse_inst_t *)&cmd_tunnel_tso_show, + &cmd_help_brief, + &cmd_help_long, + &cmd_quit, + &cmd_load_from_file, + &cmd_showport, + &cmd_showqueue, + &cmd_showeeprom, + &cmd_showportall, + &cmd_representor_info, + &cmd_showdevice, + &cmd_showcfg, + &cmd_showfwdall, + &cmd_start, + &cmd_start_tx_first, + &cmd_start_tx_first_n, + &cmd_set_link_up, + &cmd_set_link_down, + &cmd_reset, + &cmd_set_numbers, + &cmd_set_log, + &cmd_set_rxoffs, + &cmd_set_rxpkts, + &cmd_set_rxhdrs, + &cmd_set_txpkts, + &cmd_set_txsplit, + &cmd_set_txtimes, + &cmd_set_fwd_list, + &cmd_set_fwd_mask, + &cmd_set_fwd_mode, + &cmd_set_fwd_retry_mode, + &cmd_set_burst_tx_retry, + &cmd_set_promisc_mode_one, + &cmd_set_promisc_mode_all, + &cmd_set_allmulti_mode_one, + &cmd_set_allmulti_mode_all, + &cmd_set_flush_rx, + &cmd_set_link_check, + &cmd_vlan_offload, + &cmd_vlan_tpid, + &cmd_rx_vlan_filter_all, + &cmd_rx_vlan_filter, + &cmd_tx_vlan_set, + &cmd_tx_vlan_set_qinq, + &cmd_tx_vlan_reset, + &cmd_tx_vlan_set_pvid, + &cmd_csum_set, + &cmd_csum_show, + &cmd_csum_tunnel, + &cmd_csum_mac_swap, + &cmd_tso_set, + &cmd_tso_show, + &cmd_tunnel_tso_set, + &cmd_tunnel_tso_show, #ifdef RTE_LIB_GRO - (cmdline_parse_inst_t *)&cmd_gro_enable, - (cmdline_parse_inst_t *)&cmd_gro_flush, - (cmdline_parse_inst_t *)&cmd_gro_show, + &cmd_gro_enable, + &cmd_gro_flush, + &cmd_gro_show, #endif #ifdef RTE_LIB_GSO - (cmdline_parse_inst_t *)&cmd_gso_enable, - (cmdline_parse_inst_t *)&cmd_gso_size, - (cmdline_parse_inst_t *)&cmd_gso_show, + &cmd_gso_enable, + &cmd_gso_size, + &cmd_gso_show, #endif - (cmdline_parse_inst_t *)&cmd_link_flow_control_set, - (cmdline_parse_inst_t *)&cmd_link_flow_control_set_rx, - (cmdline_parse_inst_t *)&cmd_link_flow_control_set_tx, - (cmdline_parse_inst_t *)&cmd_link_flow_control_set_hw, - (cmdline_parse_inst_t *)&cmd_link_flow_control_set_lw, - (cmdline_parse_inst_t *)&cmd_link_flow_control_set_pt, - (cmdline_parse_inst_t *)&cmd_link_flow_control_set_xon, - (cmdline_parse_inst_t *)&cmd_link_flow_control_set_macfwd, - (cmdline_parse_inst_t *)&cmd_link_flow_control_set_autoneg, - (cmdline_parse_inst_t *)&cmd_link_flow_control_show, - (cmdline_parse_inst_t *)&cmd_priority_flow_control_set, - (cmdline_parse_inst_t *)&cmd_queue_priority_flow_control_set, - (cmdline_parse_inst_t *)&cmd_config_dcb, - (cmdline_parse_inst_t *)&cmd_read_rxd_txd, - (cmdline_parse_inst_t *)&cmd_stop, - (cmdline_parse_inst_t *)&cmd_mac_addr, - (cmdline_parse_inst_t *)&cmd_set_fwd_eth_peer, - (cmdline_parse_inst_t *)&cmd_set_qmap, - (cmdline_parse_inst_t *)&cmd_set_xstats_hide_zero, - (cmdline_parse_inst_t *)&cmd_set_record_core_cycles, - (cmdline_parse_inst_t *)&cmd_set_record_burst_stats, - (cmdline_parse_inst_t *)&cmd_operate_port, - (cmdline_parse_inst_t *)&cmd_operate_specific_port, - (cmdline_parse_inst_t *)&cmd_operate_attach_port, - (cmdline_parse_inst_t *)&cmd_operate_detach_port, - (cmdline_parse_inst_t *)&cmd_operate_detach_device, - (cmdline_parse_inst_t *)&cmd_set_port_setup_on, - (cmdline_parse_inst_t *)&cmd_config_speed_all, - (cmdline_parse_inst_t *)&cmd_config_speed_specific, - (cmdline_parse_inst_t *)&cmd_config_loopback_all, - (cmdline_parse_inst_t *)&cmd_config_loopback_specific, - (cmdline_parse_inst_t *)&cmd_config_rx_tx, - (cmdline_parse_inst_t *)&cmd_config_mtu, - (cmdline_parse_inst_t *)&cmd_config_max_pkt_len, - (cmdline_parse_inst_t *)&cmd_config_max_lro_pkt_size, - (cmdline_parse_inst_t *)&cmd_config_rx_mode_flag, - (cmdline_parse_inst_t *)&cmd_config_rss, - (cmdline_parse_inst_t *)&cmd_config_rxtx_ring_size, - (cmdline_parse_inst_t *)&cmd_config_rxtx_queue, - (cmdline_parse_inst_t *)&cmd_config_deferred_start_rxtx_queue, - (cmdline_parse_inst_t *)&cmd_setup_rxtx_queue, - (cmdline_parse_inst_t *)&cmd_config_rss_reta, - (cmdline_parse_inst_t *)&cmd_showport_reta, - (cmdline_parse_inst_t *)&cmd_showport_macs, - (cmdline_parse_inst_t *)&cmd_show_port_flow_transfer_proxy, - (cmdline_parse_inst_t *)&cmd_config_burst, - (cmdline_parse_inst_t *)&cmd_config_thresh, - (cmdline_parse_inst_t *)&cmd_config_threshold, - (cmdline_parse_inst_t *)&cmd_set_uc_hash_filter, - (cmdline_parse_inst_t *)&cmd_set_uc_all_hash_filter, - (cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter, - (cmdline_parse_inst_t *)&cmd_queue_rate_limit, - (cmdline_parse_inst_t *)&cmd_tunnel_udp_config, - (cmdline_parse_inst_t *)&cmd_showport_rss_hash, - (cmdline_parse_inst_t *)&cmd_showport_rss_hash_key, - (cmdline_parse_inst_t *)&cmd_config_rss_hash_key, - (cmdline_parse_inst_t *)&cmd_cleanup_txq_mbufs, - (cmdline_parse_inst_t *)&cmd_dump, - (cmdline_parse_inst_t *)&cmd_dump_one, - (cmdline_parse_inst_t *)&cmd_flow, - (cmdline_parse_inst_t *)&cmd_show_port_meter_cap, - (cmdline_parse_inst_t *)&cmd_add_port_meter_profile_srtcm, - (cmdline_parse_inst_t *)&cmd_add_port_meter_profile_trtcm, - (cmdline_parse_inst_t *)&cmd_add_port_meter_profile_trtcm_rfc4115, - (cmdline_parse_inst_t *)&cmd_del_port_meter_profile, - (cmdline_parse_inst_t *)&cmd_create_port_meter, - (cmdline_parse_inst_t *)&cmd_enable_port_meter, - (cmdline_parse_inst_t *)&cmd_disable_port_meter, - (cmdline_parse_inst_t *)&cmd_del_port_meter, - (cmdline_parse_inst_t *)&cmd_del_port_meter_policy, - (cmdline_parse_inst_t *)&cmd_set_port_meter_profile, - (cmdline_parse_inst_t *)&cmd_set_port_meter_dscp_table, - (cmdline_parse_inst_t *)&cmd_set_port_meter_vlan_table, - (cmdline_parse_inst_t *)&cmd_set_port_meter_in_proto, - (cmdline_parse_inst_t *)&cmd_get_port_meter_in_proto, - (cmdline_parse_inst_t *)&cmd_get_port_meter_in_proto_prio, - (cmdline_parse_inst_t *)&cmd_set_port_meter_stats_mask, - (cmdline_parse_inst_t *)&cmd_show_port_meter_stats, - (cmdline_parse_inst_t *)&cmd_mcast_addr, - (cmdline_parse_inst_t *)&cmd_set_vf_vlan_anti_spoof, - (cmdline_parse_inst_t *)&cmd_set_vf_mac_anti_spoof, - (cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq, - (cmdline_parse_inst_t *)&cmd_set_vf_vlan_insert, - (cmdline_parse_inst_t *)&cmd_set_tx_loopback, - (cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en, - (cmdline_parse_inst_t *)&cmd_set_vf_traffic, - (cmdline_parse_inst_t *)&cmd_set_vf_rxmode, - (cmdline_parse_inst_t *)&cmd_vf_rate_limit, - (cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter, - (cmdline_parse_inst_t *)&cmd_set_vf_mac_addr, - (cmdline_parse_inst_t *)&cmd_set_vxlan, - (cmdline_parse_inst_t *)&cmd_set_vxlan_tos_ttl, - (cmdline_parse_inst_t *)&cmd_set_vxlan_with_vlan, - (cmdline_parse_inst_t *)&cmd_set_nvgre, - (cmdline_parse_inst_t *)&cmd_set_nvgre_with_vlan, - (cmdline_parse_inst_t *)&cmd_set_l2_encap, - (cmdline_parse_inst_t *)&cmd_set_l2_encap_with_vlan, - (cmdline_parse_inst_t *)&cmd_set_l2_decap, - (cmdline_parse_inst_t *)&cmd_set_l2_decap_with_vlan, - (cmdline_parse_inst_t *)&cmd_set_mplsogre_encap, - (cmdline_parse_inst_t *)&cmd_set_mplsogre_encap_with_vlan, - (cmdline_parse_inst_t *)&cmd_set_mplsogre_decap, - (cmdline_parse_inst_t *)&cmd_set_mplsogre_decap_with_vlan, - (cmdline_parse_inst_t *)&cmd_set_mplsoudp_encap, - (cmdline_parse_inst_t *)&cmd_set_mplsoudp_encap_with_vlan, - (cmdline_parse_inst_t *)&cmd_set_mplsoudp_decap, - (cmdline_parse_inst_t *)&cmd_set_mplsoudp_decap_with_vlan, - (cmdline_parse_inst_t *)&cmd_set_conntrack_common, - (cmdline_parse_inst_t *)&cmd_set_conntrack_dir, - (cmdline_parse_inst_t *)&cmd_show_vf_stats, - (cmdline_parse_inst_t *)&cmd_clear_vf_stats, - (cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes, - (cmdline_parse_inst_t *)&cmd_set_port_ptypes, - (cmdline_parse_inst_t *)&cmd_show_port_tm_cap, - (cmdline_parse_inst_t *)&cmd_show_port_tm_level_cap, - (cmdline_parse_inst_t *)&cmd_show_port_tm_node_cap, - (cmdline_parse_inst_t *)&cmd_show_port_tm_node_type, - (cmdline_parse_inst_t *)&cmd_show_port_tm_node_stats, - (cmdline_parse_inst_t *)&cmd_add_port_tm_node_shaper_profile, - (cmdline_parse_inst_t *)&cmd_del_port_tm_node_shaper_profile, - (cmdline_parse_inst_t *)&cmd_add_port_tm_node_shared_shaper, - (cmdline_parse_inst_t *)&cmd_del_port_tm_node_shared_shaper, - (cmdline_parse_inst_t *)&cmd_add_port_tm_node_wred_profile, - (cmdline_parse_inst_t *)&cmd_del_port_tm_node_wred_profile, - (cmdline_parse_inst_t *)&cmd_set_port_tm_node_shaper_profile, - (cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node, - (cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node_pmode, - (cmdline_parse_inst_t *)&cmd_add_port_tm_leaf_node, - (cmdline_parse_inst_t *)&cmd_del_port_tm_node, - (cmdline_parse_inst_t *)&cmd_set_port_tm_node_parent, - (cmdline_parse_inst_t *)&cmd_suspend_port_tm_node, - (cmdline_parse_inst_t *)&cmd_resume_port_tm_node, - (cmdline_parse_inst_t *)&cmd_port_tm_hierarchy_commit, - (cmdline_parse_inst_t *)&cmd_port_tm_mark_ip_ecn, - (cmdline_parse_inst_t *)&cmd_port_tm_mark_ip_dscp, - (cmdline_parse_inst_t *)&cmd_port_tm_mark_vlan_dei, - (cmdline_parse_inst_t *)&cmd_cfg_tunnel_udp_port, - (cmdline_parse_inst_t *)&cmd_rx_offload_get_capa, - (cmdline_parse_inst_t *)&cmd_rx_offload_get_configuration, - (cmdline_parse_inst_t *)&cmd_config_per_port_rx_offload, - (cmdline_parse_inst_t *)&cmd_config_per_queue_rx_offload, - (cmdline_parse_inst_t *)&cmd_tx_offload_get_capa, - (cmdline_parse_inst_t *)&cmd_tx_offload_get_configuration, - (cmdline_parse_inst_t *)&cmd_config_per_port_tx_offload, - (cmdline_parse_inst_t *)&cmd_config_per_queue_tx_offload, + &cmd_link_flow_control_set, + &cmd_link_flow_control_set_rx, + &cmd_link_flow_control_set_tx, + &cmd_link_flow_control_set_hw, + &cmd_link_flow_control_set_lw, + &cmd_link_flow_control_set_pt, + &cmd_link_flow_control_set_xon, + &cmd_link_flow_control_set_macfwd, + &cmd_link_flow_control_set_autoneg, + &cmd_link_flow_control_show, + &cmd_priority_flow_control_set, + &cmd_queue_priority_flow_control_set, + &cmd_config_dcb, + &cmd_read_rxd_txd, + &cmd_stop, + &cmd_mac_addr, + &cmd_set_fwd_eth_peer, + &cmd_set_qmap, + &cmd_set_xstats_hide_zero, + &cmd_set_record_core_cycles, + &cmd_set_record_burst_stats, + &cmd_operate_port, + &cmd_operate_specific_port, + &cmd_operate_attach_port, + &cmd_operate_detach_port, + &cmd_operate_detach_device, + &cmd_set_port_setup_on, + &cmd_config_speed_all, + &cmd_config_speed_specific, + &cmd_config_loopback_all, + &cmd_config_loopback_specific, + &cmd_config_rx_tx, + &cmd_config_mtu, + &cmd_config_max_pkt_len, + &cmd_config_max_lro_pkt_size, + &cmd_config_rx_mode_flag, + &cmd_config_rss, + &cmd_config_rxtx_ring_size, + &cmd_config_rxtx_queue, + &cmd_config_deferred_start_rxtx_queue, + &cmd_setup_rxtx_queue, + &cmd_config_rss_reta, + &cmd_showport_reta, + &cmd_showport_macs, + &cmd_show_port_flow_transfer_proxy, + &cmd_config_burst, + &cmd_config_thresh, + &cmd_config_threshold, + &cmd_set_uc_hash_filter, + &cmd_set_uc_all_hash_filter, + &cmd_vf_mac_addr_filter, + &cmd_queue_rate_limit, + &cmd_tunnel_udp_config, + &cmd_showport_rss_hash, + &cmd_showport_rss_hash_key, + &cmd_config_rss_hash_key, + &cmd_cleanup_txq_mbufs, + &cmd_dump, + &cmd_dump_one, + &cmd_flow, + &cmd_show_port_meter_cap, + &cmd_add_port_meter_profile_srtcm, + &cmd_add_port_meter_profile_trtcm, + &cmd_add_port_meter_profile_trtcm_rfc4115, + &cmd_del_port_meter_profile, + &cmd_create_port_meter, + &cmd_enable_port_meter, + &cmd_disable_port_meter, + &cmd_del_port_meter, + &cmd_del_port_meter_policy, + &cmd_set_port_meter_profile, + &cmd_set_port_meter_dscp_table, + &cmd_set_port_meter_vlan_table, + &cmd_set_port_meter_in_proto, + &cmd_get_port_meter_in_proto, + &cmd_get_port_meter_in_proto_prio, + &cmd_set_port_meter_stats_mask, + &cmd_show_port_meter_stats, + &cmd_mcast_addr, + &cmd_set_vf_vlan_anti_spoof, + &cmd_set_vf_mac_anti_spoof, + &cmd_set_vf_vlan_stripq, + &cmd_set_vf_vlan_insert, + &cmd_set_tx_loopback, + &cmd_set_all_queues_drop_en, + &cmd_set_vf_traffic, + &cmd_set_vf_rxmode, + &cmd_vf_rate_limit, + &cmd_vf_rxvlan_filter, + &cmd_set_vf_mac_addr, + &cmd_set_vxlan, + &cmd_set_vxlan_tos_ttl, + &cmd_set_vxlan_with_vlan, + &cmd_set_nvgre, + &cmd_set_nvgre_with_vlan, + &cmd_set_l2_encap, + &cmd_set_l2_encap_with_vlan, + &cmd_set_l2_decap, + &cmd_set_l2_decap_with_vlan, + &cmd_set_mplsogre_encap, + &cmd_set_mplsogre_encap_with_vlan, + &cmd_set_mplsogre_decap, + &cmd_set_mplsogre_decap_with_vlan, + &cmd_set_mplsoudp_encap, + &cmd_set_mplsoudp_encap_with_vlan, + &cmd_set_mplsoudp_decap, + &cmd_set_mplsoudp_decap_with_vlan, + &cmd_set_conntrack_common, + &cmd_set_conntrack_dir, + &cmd_show_vf_stats, + &cmd_clear_vf_stats, + &cmd_show_port_supported_ptypes, + &cmd_set_port_ptypes, + &cmd_show_port_tm_cap, + &cmd_show_port_tm_level_cap, + &cmd_show_port_tm_node_cap, + &cmd_show_port_tm_node_type, + &cmd_show_port_tm_node_stats, + &cmd_add_port_tm_node_shaper_profile, + &cmd_del_port_tm_node_shaper_profile, + &cmd_add_port_tm_node_shared_shaper, + &cmd_del_port_tm_node_shared_shaper, + &cmd_add_port_tm_node_wred_profile, + &cmd_del_port_tm_node_wred_profile, + &cmd_set_port_tm_node_shaper_profile, + &cmd_add_port_tm_nonleaf_node, + &cmd_add_port_tm_nonleaf_node_pmode, + &cmd_add_port_tm_leaf_node, + &cmd_del_port_tm_node, + &cmd_set_port_tm_node_parent, + &cmd_suspend_port_tm_node, + &cmd_resume_port_tm_node, + &cmd_port_tm_hierarchy_commit, + &cmd_port_tm_mark_ip_ecn, + &cmd_port_tm_mark_ip_dscp, + &cmd_port_tm_mark_vlan_dei, + &cmd_cfg_tunnel_udp_port, + &cmd_rx_offload_get_capa, + &cmd_rx_offload_get_configuration, + &cmd_config_per_port_rx_offload, + &cmd_config_per_queue_rx_offload, + &cmd_tx_offload_get_capa, + &cmd_tx_offload_get_configuration, + &cmd_config_per_port_tx_offload, + &cmd_config_per_queue_tx_offload, #ifdef RTE_LIB_BPF - (cmdline_parse_inst_t *)&cmd_operate_bpf_ld_parse, - (cmdline_parse_inst_t *)&cmd_operate_bpf_unld_parse, + &cmd_operate_bpf_ld_parse, + &cmd_operate_bpf_unld_parse, #endif - (cmdline_parse_inst_t *)&cmd_config_tx_metadata_specific, - (cmdline_parse_inst_t *)&cmd_show_tx_metadata, - (cmdline_parse_inst_t *)&cmd_show_rx_tx_desc_status, - (cmdline_parse_inst_t *)&cmd_show_rx_queue_desc_used_count, - (cmdline_parse_inst_t *)&cmd_set_raw, - (cmdline_parse_inst_t *)&cmd_show_set_raw, - (cmdline_parse_inst_t *)&cmd_show_set_raw_all, - (cmdline_parse_inst_t *)&cmd_config_tx_dynf_specific, - (cmdline_parse_inst_t *)&cmd_show_fec_mode, - (cmdline_parse_inst_t *)&cmd_set_fec_mode, - (cmdline_parse_inst_t *)&cmd_set_rxq_avail_thresh, - (cmdline_parse_inst_t *)&cmd_show_capability, - (cmdline_parse_inst_t *)&cmd_set_flex_is_pattern, - (cmdline_parse_inst_t *)&cmd_set_flex_spec_pattern, + &cmd_config_tx_metadata_specific, + &cmd_show_tx_metadata, + &cmd_show_rx_tx_desc_status, + &cmd_show_rx_queue_desc_used_count, + &cmd_set_raw, + &cmd_show_set_raw, + &cmd_show_set_raw_all, + &cmd_config_tx_dynf_specific, + &cmd_show_fec_mode, + &cmd_set_fec_mode, + &cmd_set_rxq_avail_thresh, + &cmd_show_capability, + &cmd_set_flex_is_pattern, + &cmd_set_flex_spec_pattern, NULL, }; diff -Nru dpdk-22.11.6/app/test-pmd/cmdline_flow.c dpdk-22.11.7/app/test-pmd/cmdline_flow.c --- dpdk-22.11.6/app/test-pmd/cmdline_flow.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/test-pmd/cmdline_flow.c 2024-12-13 14:35:22.000000000 +0000 @@ -100,7 +100,6 @@ PULL, /* Flex arguments */ - FLEX_ITEM_INIT, FLEX_ITEM_CREATE, FLEX_ITEM_DESTROY, @@ -1084,7 +1083,6 @@ }) static const enum index next_flex_item[] = { - FLEX_ITEM_INIT, FLEX_ITEM_CREATE, FLEX_ITEM_DESTROY, ZERO, @@ -3297,15 +3295,6 @@ .next = NEXT(next_flex_item), .call = parse_flex, }, - [FLEX_ITEM_INIT] = { - .name = "init", - .help = "flex item init", - .args = ARGS(ARGS_ENTRY(struct buffer, args.flex.token), - ARGS_ENTRY(struct buffer, port)), - .next = NEXT(NEXT_ENTRY(COMMON_FLEX_TOKEN), - NEXT_ENTRY(COMMON_PORT_ID)), - .call = parse_flex - }, [FLEX_ITEM_CREATE] = { .name = "create", .help = "flex item create", @@ -9233,7 +9222,6 @@ switch (ctx->curr) { default: break; - case FLEX_ITEM_INIT: case FLEX_ITEM_CREATE: case FLEX_ITEM_DESTROY: out->command = ctx->curr; diff -Nru dpdk-22.11.6/app/test-pmd/config.c dpdk-22.11.7/app/test-pmd/config.c --- dpdk-22.11.6/app/test-pmd/config.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/app/test-pmd/config.c 2024-12-13 14:35:22.000000000 +0000 @@ -2137,7 +2137,7 @@ for (act_n = 0, start = act; act->type != RTE_FLOW_ACTION_TYPE_END; act++) act_n++; - if (act_n && act->type == RTE_FLOW_ACTION_TYPE_END) + if (act_n > 0) policy.actions[i] = start; else policy.actions[i] = NULL; @@ -3561,8 +3561,10 @@ } type = (enum age_action_context_type *)contexts[idx]; switch (*type) { - case ACTION_AGE_CONTEXT_TYPE_FLOW: + case ACTION_AGE_CONTEXT_TYPE_FLOW: { + uint32_t flow_id; ctx.pf = container_of(type, struct port_flow, age_type); + flow_id = ctx.pf->id; printf("%-20s\t%" PRIu32 "\t%" PRIu32 "\t%" PRIu32 "\t%c%c%c\t\n", "Flow", @@ -3573,9 +3575,10 @@ ctx.pf->rule.attr->egress ? 'e' : '-', ctx.pf->rule.attr->transfer ? 't' : '-'); if (destroy && !port_flow_destroy(port_id, 1, - &ctx.pf->id)) + &flow_id)) total++; break; + } case ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION: ctx.pia = container_of(type, struct port_indirect_action, age_type); diff -Nru dpdk-22.11.6/buildtools/chkincs/meson.build dpdk-22.11.7/buildtools/chkincs/meson.build --- dpdk-22.11.6/buildtools/chkincs/meson.build 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/buildtools/chkincs/meson.build 2024-12-13 14:35:22.000000000 +0000 @@ -21,6 +21,9 @@ # some driver SDK headers depend on these two buses, which are mandatory in build # so we always include them in deps list deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')] +if dpdk_conf.has('RTE_BUS_VMBUS') + deps += get_variable('shared_rte_bus_vmbus') +endif # add the rest of the libs to the dependencies foreach l:enabled_libs deps += get_variable('shared_rte_' + l) diff -Nru dpdk-22.11.6/config/arm/meson.build dpdk-22.11.7/config/arm/meson.build --- dpdk-22.11.6/config/arm/meson.build 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/config/arm/meson.build 2024-12-13 14:35:22.000000000 +0000 @@ -544,9 +544,8 @@ # native build # The script returns ['Implementer', 'Variant', 'Architecture', # 'Primary Part number', 'Revision'] - detect_vendor = find_program(join_paths(meson.current_source_dir(), - 'armv8_machine.py')) - cmd = run_command(detect_vendor.path(), check: false) + detect_vendor = py3 + files('armv8_machine.py') + cmd = run_command(detect_vendor, check: false) if cmd.returncode() == 0 cmd_output = cmd.stdout().to_lower().strip().split(' ') implementer_id = cmd_output[0] diff -Nru dpdk-22.11.6/debian/changelog dpdk-22.11.7/debian/changelog --- dpdk-22.11.6/debian/changelog 2024-08-20 20:45:08.000000000 +0000 +++ dpdk-22.11.7/debian/changelog 2024-12-13 23:28:47.000000000 +0000 @@ -1,3 +1,10 @@ +dpdk (22.11.7-1~deb12u1) bookworm-security; urgency=medium + + * Update upstream source from tag 'upstream/22.11.7' + Fixes rx checksum calculation in virtio driver (CVE-2024-11614) + + -- Luca Boccassi Fri, 13 Dec 2024 23:28:47 +0000 + dpdk (22.11.6-1~deb12u1) bookworm; urgency=medium [ Christian Ehrhardt ] diff -Nru dpdk-22.11.6/devtools/check-forbidden-tokens.awk dpdk-22.11.7/devtools/check-forbidden-tokens.awk --- dpdk-22.11.6/devtools/check-forbidden-tokens.awk 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/devtools/check-forbidden-tokens.awk 2024-12-13 14:35:22.000000000 +0000 @@ -32,14 +32,11 @@ for (i in deny_expr) { forbidden_added = "^\\+.*" deny_expr[i]; forbidden_removed="^-.*" deny_expr[i]; - current = expressions[deny_expr[i]] if ($0 ~ forbidden_added) { - count = count + 1; - expressions[deny_expr[i]] = current + 1 + count = count + 1 } if ($0 ~ forbidden_removed) { - count = count - 1; - expressions[deny_expr[i]] = current - 1 + count = count - 1 } } } @@ -49,12 +46,13 @@ } } # switch to next file , check if the balance of add/remove -# of previous filehad new additions +# of previous file had new additions ($0 ~ "^\\+\\+\\+ b/") { in_file = 0; if (count > 0) { exit; } + count = 0 for (i in deny_folders) { re = "^\\+\\+\\+ b/" deny_folders[i]; if ($0 ~ re) { diff -Nru dpdk-22.11.6/devtools/git-log-fixes.sh dpdk-22.11.7/devtools/git-log-fixes.sh --- dpdk-22.11.6/devtools/git-log-fixes.sh 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/devtools/git-log-fixes.sh 2024-12-13 14:35:22.000000000 +0000 @@ -68,7 +68,7 @@ { for origin in $* ; do # check hash is valid - git rev-parse -q --verify $1 >&- || continue + git rev-parse -q --verify $origin >&- || continue # get version of this bug origin local origver=$(commit_version $origin) local roothashes="$(origin_filter $origin)" diff -Nru dpdk-22.11.6/doc/guides/nics/features.rst dpdk-22.11.7/doc/guides/nics/features.rst --- dpdk-22.11.6/doc/guides/nics/features.rst 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/doc/guides/nics/features.rst 2024-12-13 14:35:22.000000000 +0000 @@ -705,14 +705,32 @@ Support basic statistics such as: ipackets, opackets, ibytes, obytes, imissed, ierrors, oerrors, rx_nombuf. -And per queue stats: q_ipackets, q_opackets, q_ibytes, q_obytes, q_errors. - These apply to all drivers. * **[implements] eth_dev_ops**: ``stats_get``, ``stats_reset``. * **[related] API**: ``rte_eth_stats_get``, ``rte_eth_stats_reset()``. +.. _nic_features_stats_per_queue: + +Stats per queue +--------------- + +Supports per queue stats: q_ipackets, q_opackets, q_ibytes, q_obytes, q_errors. +Statistics only supplied for first ``RTE_ETHDEV_QUEUE_STAT_CNTRS`` (16) queues. +If driver does not support this feature the per queue stats will be zero. + +* **[implements] eth_dev_ops**: ``stats_get``, ``stats_reset``. +* **[related] API**: ``rte_eth_stats_get``, ``rte_eth_stats_reset()``. + +May also support configuring per-queue stat counter mapping. +Used by some drivers to workaround HW limitations. + +* **[implements] eth_dev_ops**: ``queue_stats_mapping_set``. +* **[related] API**: ``rte_eth_dev_set_rx_queue_stats_mapping()``, + ``rte_eth_dev_set_tx_queue_stats_mapping()``. + + .. _nic_features_extended_stats: Extended stats @@ -727,18 +745,6 @@ ``rte_eth_xstats_get_names_by_id()``, ``rte_eth_xstats_get_id_by_name()``. -.. _nic_features_stats_per_queue: - -Stats per queue ---------------- - -Supports configuring per-queue stat counter mapping. - -* **[implements] eth_dev_ops**: ``queue_stats_mapping_set``. -* **[related] API**: ``rte_eth_dev_set_rx_queue_stats_mapping()``, - ``rte_eth_dev_set_tx_queue_stats_mapping()``. - - .. _nic_features_congestion_management: Congestion management diff -Nru dpdk-22.11.6/doc/guides/nics/mlx5.rst dpdk-22.11.7/doc/guides/nics/mlx5.rst --- dpdk-22.11.6/doc/guides/nics/mlx5.rst 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/doc/guides/nics/mlx5.rst 2024-12-13 14:35:22.000000000 +0000 @@ -1589,6 +1589,77 @@ The application should re-create the flows as required after the port restart. +Notes for flow counters +----------------------- + +mlx5 PMD supports the ``COUNT`` flow action, +which provides an ability to count packets (and bytes) +matched against a given flow rule. +This section describes the high level overview of +how this support is implemented and limitations. + +HW steering flow engine +~~~~~~~~~~~~~~~~~~~~~~~ + +Flow counters are allocated from HW in bulks. +A set of bulks forms a flow counter pool managed by PMD. +When flow counters are queried from HW, +each counter is identified by an offset in a given bulk. +Querying HW flow counter requires sending a request to HW, +which will request a read of counter values for given offsets. +HW will asynchronously provide these values through a DMA write. + +In order to optimize HW to SW communication, +these requests are handled in a separate counter service thread +spawned by mlx5 PMD. +This service thread will refresh the counter values stored in memory, +in cycles, each spanning ``svc_cycle_time`` milliseconds. +By default, ``svc_cycle_time`` is set to 500. +When applications query the ``COUNT`` flow action, +PMD returns the values stored in host memory. + +mlx5 PMD manages 3 global rings of allocated counter offsets: + +- ``free`` ring - Counters which were not used at all. +- ``wait_reset`` ring - Counters which were used in some flow rules, + but were recently freed (flow rule was destroyed + or an indirect action was destroyed). + Since the count value might have changed + between the last counter service thread cycle and the moment it was freed, + the value in host memory might be stale. + During the next service thread cycle, + such counters will be moved to ``reuse`` ring. +- ``reuse`` ring - Counters which were used at least once + and can be reused in new flow rules. + +When counters are assigned to a flow rule (or allocated to indirect action), +the PMD first tries to fetch a counter from ``reuse`` ring. +If it's empty, the PMD fetches a counter from ``free`` ring. + +The counter service thread works as follows: + +#. Record counters stored in ``wait_reset`` ring. +#. Read values of all counters which were used at least once + or are currently in use. +#. Move recorded counters from ``wait_reset`` to ``reuse`` ring. +#. Sleep for ``(query time) - svc_cycle_time`` milliseconds +#. Repeat. + +Because freeing a counter (by destroying a flow rule or destroying indirect action) +does not immediately make it available for the application, +the PMD might return: + +- ``ENOENT`` if no counter is available in ``free``, ``reuse`` + or ``wait_reset`` rings. + No counter will be available until the application releases some of them. +- ``EAGAIN`` if no counter is available in ``free`` and ``reuse`` rings, + but there are counters in ``wait_reset`` ring. + This means that after the next service thread cycle new counters will be available. + +The application has to be aware that flow rule create or indirect action create +might need be retried. + + Notes for hairpin ----------------- diff -Nru dpdk-22.11.6/doc/guides/rel_notes/release_22_11.rst dpdk-22.11.7/doc/guides/rel_notes/release_22_11.rst --- dpdk-22.11.6/doc/guides/rel_notes/release_22_11.rst 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/doc/guides/rel_notes/release_22_11.rst 2024-12-13 14:35:22.000000000 +0000 @@ -2540,3 +2540,279 @@ * Ubuntu 20.04 * Driver MLNX_OFED_LINUX-24.07-0.6.1.0 * fw 22.42.1000 + +22.11.7 Release Notes +--------------------- + + +22.11.7 Fixes +~~~~~~~~~~~~~ + +* app/dumpcap: fix handling of jumbo frames +* app/dumpcap: remove unused struct array +* app/procinfo: fix leak on exit +* app/testpmd: fix aged flow destroy +* app/testpmd: remove flex item init command leftover +* app/testpmd: remove redundant policy action condition +* app/testpmd: remove unnecessary cast +* baseband/acc: fix access to deallocated mem +* baseband/acc: fix ring memory allocation +* baseband/la12xx: fix use after free in modem config +* bpf: fix free function mismatch if convert fails +* build: remove version check on compiler links function +* buildtools/chkincs: check driver specific headers +* bus/dpaa: fix lock condition during error handling +* bus/dpaa: fix PFDRs leaks due to FQRNIs +* bus/dpaa: fix the fman details status +* bus/dpaa: fix VSP for 1G fm1-mac9 and 10 +* bus/fslmc: fix Coverity warnings in QBMAN +* common/cnxk: fix base log level +* common/cnxk: fix build on Ubuntu 24.04 +* common/cnxk: fix CPT HW word size for outbound SA +* common/dpaax/caamflib: enable fallthrough warnings +* common/dpaax/caamflib: fix PDCP SNOW-ZUC watchdog +* common/idpf: fix use after free in mailbox init +* common/mlx5: fix error CQE handling for 128 bytes CQE +* common/mlx5: fix misalignment +* config/arm: fix warning for native build with meson >= 0.55 +* crypto/bcmfs: fix free function mismatch +* crypto/dpaa2_sec: fix memory leak +* crypto/openssl: fix 3DES-CTR with big endian CPUs +* crypto/openssl: fix potential string overflow +* crypto/qat: fix modexp/inv length +* dev: fix callback lookup when unregistering device +* devtools: fix check of multiple commits fixed at once +* devtools: fix forbidden token check with multiple files +* dmadev: fix potential null pointer access +* dma/idxd: fix free function mismatch in device probe +* doc: correct definition of stats per queue feature +* eal/unix: optimize thread creation +* eal/x86: fix 32-bit write combining store +* ethdev: fix overflow in descriptor count +* ethdev: verify queue ID in Tx done cleanup +* event/cnxk: fix free function mismatch in port config +* event/cnxk: fix Rx timestamp handling +* eventdev: fix possible array underflow/overflow +* event/octeontx: fix possible integer overflow +* examples/eventdev: fix queue crash with generic pipeline +* examples/ipsec-secgw: fix dequeue count from cryptodev +* examples/l2fwd-event: fix spinlock handling +* examples/l3fwd: fix read beyond boundaries +* examples/ntb: check info query return +* examples/vhost: fix free function mismatch +* fib6: add runtime checks in AVX512 lookup +* fib: fix AVX512 lookup +* hash: fix thash LFSR initialization +* member: fix choice of bucket for displacement +* net/bnx2x: fix always true expression +* net/bnx2x: fix duplicate branch +* net/bnx2x: fix possible infinite loop at startup +* net/bnx2x: remove dead conditional +* net/bnxt: fix bad action offset in Tx BD +* net/bnxt: fix reading SFF-8436 SFP EEPROMs +* net/bnxt: fix TCP and UDP checksum flags +* net/bnxt/tf_core: fix Thor TF EM key size check +* net/bnxt/tf_ulp: fix parent child DB counters +* net/cnxk: fix build on Ubuntu 24.04 +* net/cnxk: fix Rx offloads to handle timestamp +* net/cnxk: fix Rx timestamp handling for VF +* net/dpaa2: fix memory corruption in TM +* net/dpaa2: remove unnecessary check for null before free +* net/dpaa: fix reallocate mbuf handling +* net/dpaa: fix typecasting channel ID +* net/e1000: fix link status crash in secondary process +* net/e1000: fix use after free in filter flush +* net/ena: revert redefining memcpy +* net/gve/base: fix build with Fedora Rawhide +* net/hns3: fix crash for NEON and SVE +* net/hns3: fix dump counter of registers +* net/hns3: fix error code for repeatedly create counter +* net/hns3: fix fully use hardware flow director table +* net/hns3: remove ROH devices +* net/hns3: remove some basic address dump +* net/hns3: restrict tunnel flow rule to one header +* net/hns3: verify reset type from firmware +* net/i40e/base: fix blinking X722 with X557 PHY +* net/i40e/base: fix DDP loading with reserved track ID +* net/i40e/base: fix loop bounds +* net/i40e/base: fix misleading debug logs and comments +* net/i40e/base: fix repeated register dumps +* net/i40e/base: fix setting flags in init function +* net/i40e/base: fix unchecked return value +* net/i40e: check register read for outer VLAN +* net/i40e: fix AVX-512 pointer copy on 32-bit +* net/iavf: add segment-length check to Tx prep +* net/iavf: fix AVX-512 pointer copy on 32-bit +* net/iavf: fix crash when link is unstable +* net/iavf: preserve MAC address with i40e PF Linux driver +* net/ice/base: add bounds check +* net/ice/base: fix iteration of TLVs in Preserved Fields Area +* net/ice/base: fix link speed for 200G +* net/ice/base: fix VLAN replay after reset +* net/ice: detect stopping a flow director queue twice +* net/ice: fix AVX-512 pointer copy on 32-bit +* net/idpf: fix AVX-512 pointer copy on 32-bit +* net/ionic: fix build on Fedora Rawhide +* net/ixgbe/base: fix unchecked return value +* net/ixgbe: fix link status delay on FreeBSD +* net/mana: support rdma-core via pkg-config +* net/memif: fix buffer overflow in zero copy Rx +* net/mlx5: fix counter query loop getting stuck +* net/mlx5: fix default RSS flows creation order +* net/mlx5: fix flex item header length field translation +* net/mlx5: fix GRE flow item translation for root table +* net/mlx5: fix memory leak in metering +* net/mlx5: fix miniCQEs number calculation +* net/mlx5: fix next protocol validation after flex item +* net/mlx5: fix non full word sample fields in flex item +* net/mlx5: fix number of supported flex parsers +* net/mlx5: fix real time counter reading from PCI BAR +* net/mlx5: fix reported Rx/Tx descriptor limits +* net/mlx5: fix Rx queue reference count in flushing flows +* net/mlx5: fix shared queue port number in vector Rx +* net/mlx5: fix SQ flow item size +* net/mlx5: fix SWS meter state initialization +* net/mlx5/hws: fix allocation of STCs +* net/mlx5: update flex parser arc types support +* net/mlx5: workaround list management of Rx queue control +* net/mvneta: fix possible out-of-bounds write +* net/netvsc: fix using Tx queue higher than Rx queues +* net/netvsc: force Tx VLAN offload on 801.2Q packet +* net/nfb: fix use after free +* net/nfp: fix double free in flow destroy +* net/nfp: fix link change return value +* net/ngbe: fix driver load bit to inform firmware +* net/ngbe: fix interrupt lost in legacy or MSI mode +* net/ngbe: reconfigure more MAC Rx registers +* net/ngbe: restrict configuration of VLAN strip offload +* net/pcap: fix blocking Rx +* net/pcap: set live interface as non-blocking +* net/sfc: fix use after free in debug logs +* net/tap: avoid memcpy with null argument +* net/tap: restrict maximum number of MP FDs +* net/txgbe: fix driver load bit to inform firmware +* net/txgbe: fix SWFW mbox +* net/txgbe: fix VF-PF mbox interrupt +* net/txgbe: remove outer UDP checksum capability +* net/virtio: fix Rx checksum calculation +* net/virtio-user: reset used index counter +* net/vmxnet3: fix crash after configuration failure +* net/vmxnet3: fix potential out of bounds stats access +* net/vmxnet3: support larger MTU with version 6 +* pcapng: fix handling of chained mbufs +* power: enable CPPC +* power: fix log message when checking lcore ID +* power: fix mapped lcore ID +* raw/ifpga/base: fix use after free +* raw/ifpga: fix free function mismatch in interrupt config +* Revert "test/bonding: fix loop on members" +* test/bonding: fix loop on members +* test/bonding: fix MAC address comparison +* test/bonding: remove redundant info query +* test/crypto: fix synchronous API calls +* test/eal: fix lcore check +* test/eal: fix loop coverage for alignment macros +* test/event: avoid duplicate initialization +* vdpa: update used flags in used ring relay +* version: 22.11.7-rc1 +* vhost: fix offset while mapping log base address + +22.11.7 Validation +~~~~~~~~~~~~~~~~~~ + +* Red Hat(R) Testing + + * Platform + + * RHEL 9.2 + * Kernel 5.14 + * Qemu 7.2.0 + * libvirt 9.0 + * openvswitch 3.1 + * X540-AT2 NIC(ixgbe, 10G) + + * Functionality + + * Guest with device assignment(PF) throughput testing(1G hugepage size) + * Guest with device assignment(PF) throughput testing(2M hugepage size) + * Guest with device assignment(VF) throughput testing + * PVP (host dpdk testpmd as vswitch) 1Q: throughput testing + * PVP vhost-user 2Q throughput testing + * PVP vhost-user 1Q cross numa node throughput testing + * Guest with vhost-user 2 queues throughput testing + * vhost-user reconnect with dpdk-client, qemu-server: qemu reconnect + * vhost-user reconnect with dpdk-client, qemu-server: ovs reconnect + * PVP reconnect with dpdk-client, qemu-server: PASS + * PVP 1Q live migration testing + * PVP 1Q cross numa node live migration testing + * Guest with ovs+dpdk+vhost-user 1Q live migration testing + * Guest with ovs+dpdk+vhost-user 1Q live migration testing (2M) + * Guest with ovs+dpdk+vhost-user 2Q live migration testing + * Guest with ovs+dpdk+vhost-user 4Q live migration testing + * Host PF + DPDK testing + * Host VF + DPDK testing + + +* Nvidia(R) Testing + + * Basic functionality via testpmd/example applications + + * Tx/Rx + * xstats + * Timestamps + * Link status + * RTE flow and flow_director + * RSS + * VLAN filtering, stripping and insertion + * Checksum/TSO + * ptype + * link_status_interrupt example application + * l3fwd-power example application + * Multi-process example applications + * Hardware LRO tests + * Buffer Split tests + * Tx scheduling tests + + * Build tests + + * Debian 12 with MLNX_OFED_LINUX-24.10-1.1.4.0. + * Ubuntu 22.04 with MLNX_OFED_LINUX-24.10-1.1.4.0. + * Ubuntu 24.04 with MLNX_OFED_LINUX-24.10-1.1.4.0. + * Ubuntu 24.04 with rdma-core v50.0. + * Fedora 40 with rdma-core v48.0. + * Fedora 42 (Rawhide) with rdma-core v51.0. + * OpenSUSE Leap 15.6 with rdma-core v49.1. + + * BlueField-2 + + * DOCA 2.9.1 + * fw 24.43.2026 + + * ConnectX-7 + + * Ubuntu 22.04 + * Driver MLNX_OFED_LINUX-24.10-1.1.4.0 + * fw 28.43.2026 + + * ConnectX-6 Dx + + * Ubuntu 22.04 + * Driver MLNX_OFED_LINUX-24.10-1.1.4.0 + * fw 22.43.2026 + + +* Intel(R) Testing + + * Basic Intel(R) NIC testing + * Build & CFLAG compile: cover the build test combination with latest GCC/Clang version and the popular OS revision such as Ubuntu24.04, Ubuntu24.10, Fedora40, RHEL8.10, RHEL9.4, FreeBSD14.1, SUSE15, Centos7.9, AzureLinux3.0, OpenAnolis8.9 etc. + * PF(i40e, ixgbe): test scenarios including RTE_FLOW/TSO/Jumboframe/checksum offload/VLAN/VXLAN, etc. + * VF(i40e, ixgbe): test scenarios including VF-RTE_FLOW/TSO/Jumboframe/checksum offload/VLAN/VXLAN, etc. + * PPF/VF(ice): test scenarios including Switch features/Package Management/Flow Director/Advanced Tx/Advanced RSS/ACL/DCF/Flexible Descriptor, etc. + * Intel NIC single core/NIC performance: test scenarios including PF/VF single core performance test, etc. + * IPsec: test scenarios including ipsec/ipsec-gw/ipsec library basic test - QAT&SW/FIB library, etc. + + * Basic cryptodev and virtio testing + * Virtio: both function and performance test are covered. Such as PVP/Virtio_loopback/virtio-user loopback/virtio-net VM2VM perf testing/VMAWARE ESXI 8.0, etc. + * Cryptodev: + * Function test: test scenarios including Cryptodev API testing/CompressDev ISA-L/QAT/ZLIB PMD Testing/FIPS, etc. + * Performance test: test scenarios including Thoughput Performance/Cryptodev Latency, etc. diff -Nru dpdk-22.11.6/drivers/baseband/acc/acc_common.h dpdk-22.11.7/drivers/baseband/acc/acc_common.h --- dpdk-22.11.6/drivers/baseband/acc/acc_common.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/baseband/acc/acc_common.h 2024-12-13 14:35:22.000000000 +0000 @@ -729,7 +729,7 @@ sw_rings_base, ACC_SIZE_64MBYTE); next_64mb_align_addr_iova = sw_rings_base_iova + next_64mb_align_offset; - sw_ring_iova_end_addr = sw_rings_base_iova + dev_sw_ring_size; + sw_ring_iova_end_addr = sw_rings_base_iova + dev_sw_ring_size - 1; /* Check if the end of the sw ring memory block is before the * start of next 64MB aligned mem address diff -Nru dpdk-22.11.6/drivers/baseband/acc/rte_acc100_pmd.c dpdk-22.11.7/drivers/baseband/acc/rte_acc100_pmd.c --- dpdk-22.11.6/drivers/baseband/acc/rte_acc100_pmd.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/baseband/acc/rte_acc100_pmd.c 2024-12-13 14:35:22.000000000 +0000 @@ -837,51 +837,15 @@ return ret; } -static inline void -acc100_print_op(struct rte_bbdev_dec_op *op, enum rte_bbdev_op_type op_type, - uint16_t index) -{ - if (op == NULL) - return; - if (op_type == RTE_BBDEV_OP_LDPC_DEC) - rte_bbdev_log(DEBUG, - " Op 5GUL %d %d %d %d %d %d %d %d %d %d %d %d", - index, - op->ldpc_dec.basegraph, op->ldpc_dec.z_c, - op->ldpc_dec.n_cb, op->ldpc_dec.q_m, - op->ldpc_dec.n_filler, op->ldpc_dec.cb_params.e, - op->ldpc_dec.op_flags, op->ldpc_dec.rv_index, - op->ldpc_dec.iter_max, op->ldpc_dec.iter_count, - op->ldpc_dec.harq_combined_input.length - ); - else if (op_type == RTE_BBDEV_OP_LDPC_ENC) { - struct rte_bbdev_enc_op *op_dl = (struct rte_bbdev_enc_op *) op; - rte_bbdev_log(DEBUG, - " Op 5GDL %d %d %d %d %d %d %d %d %d", - index, - op_dl->ldpc_enc.basegraph, op_dl->ldpc_enc.z_c, - op_dl->ldpc_enc.n_cb, op_dl->ldpc_enc.q_m, - op_dl->ldpc_enc.n_filler, op_dl->ldpc_enc.cb_params.e, - op_dl->ldpc_enc.op_flags, op_dl->ldpc_enc.rv_index - ); - } -} - static int acc100_queue_stop(struct rte_bbdev *dev, uint16_t queue_id) { struct acc_queue *q; - struct rte_bbdev_dec_op *op; - uint16_t i; q = dev->data->queues[queue_id].queue_private; rte_bbdev_log(INFO, "Queue Stop %d H/T/D %d %d %x OpType %d", queue_id, q->sw_ring_head, q->sw_ring_tail, q->sw_ring_depth, q->op_type); - for (i = 0; i < q->sw_ring_depth; ++i) { - op = (q->ring_addr + i)->req.op_addr; - acc100_print_op(op, q->op_type, i); - } /* ignore all operations in flight and clear counters */ q->sw_ring_tail = q->sw_ring_head; q->aq_enqueued = 0; diff -Nru dpdk-22.11.6/drivers/baseband/acc/rte_acc200_pmd.c dpdk-22.11.7/drivers/baseband/acc/rte_acc200_pmd.c --- dpdk-22.11.6/drivers/baseband/acc/rte_acc200_pmd.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/baseband/acc/rte_acc200_pmd.c 2024-12-13 14:35:22.000000000 +0000 @@ -924,51 +924,16 @@ return ret; } -static inline void -acc200_print_op(struct rte_bbdev_dec_op *op, enum rte_bbdev_op_type op_type, - uint16_t index) -{ - if (op == NULL) - return; - if (op_type == RTE_BBDEV_OP_LDPC_DEC) - rte_bbdev_log(INFO, - " Op 5GUL %d %d %d %d %d %d %d %d %d %d %d %d", - index, - op->ldpc_dec.basegraph, op->ldpc_dec.z_c, - op->ldpc_dec.n_cb, op->ldpc_dec.q_m, - op->ldpc_dec.n_filler, op->ldpc_dec.cb_params.e, - op->ldpc_dec.op_flags, op->ldpc_dec.rv_index, - op->ldpc_dec.iter_max, op->ldpc_dec.iter_count, - op->ldpc_dec.harq_combined_input.length - ); - else if (op_type == RTE_BBDEV_OP_LDPC_ENC) { - struct rte_bbdev_enc_op *op_dl = (struct rte_bbdev_enc_op *) op; - rte_bbdev_log(INFO, - " Op 5GDL %d %d %d %d %d %d %d %d %d", - index, - op_dl->ldpc_enc.basegraph, op_dl->ldpc_enc.z_c, - op_dl->ldpc_enc.n_cb, op_dl->ldpc_enc.q_m, - op_dl->ldpc_enc.n_filler, op_dl->ldpc_enc.cb_params.e, - op_dl->ldpc_enc.op_flags, op_dl->ldpc_enc.rv_index - ); - } -} - /* Stop ACC200 queue and clear counters. */ static int acc200_queue_stop(struct rte_bbdev *dev, uint16_t queue_id) { struct acc_queue *q; - struct rte_bbdev_dec_op *op; - uint16_t i; + q = dev->data->queues[queue_id].queue_private; rte_bbdev_log(INFO, "Queue Stop %d H/T/D %d %d %x OpType %d", queue_id, q->sw_ring_head, q->sw_ring_tail, q->sw_ring_depth, q->op_type); - for (i = 0; i < q->sw_ring_depth; ++i) { - op = (q->ring_addr + i)->req.op_addr; - acc200_print_op(op, q->op_type, i); - } /* ignore all operations in flight and clear counters */ q->sw_ring_tail = q->sw_ring_head; q->aq_enqueued = 0; diff -Nru dpdk-22.11.6/drivers/baseband/la12xx/bbdev_la12xx.c dpdk-22.11.7/drivers/baseband/la12xx/bbdev_la12xx.c --- dpdk-22.11.6/drivers/baseband/la12xx/bbdev_la12xx.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/baseband/la12xx/bbdev_la12xx.c 2024-12-13 14:35:22.000000000 +0000 @@ -789,6 +789,7 @@ ipc_priv->hugepg_start.size = hp->len; rte_free(hp); + hp = NULL; } dev_ipc = open_ipc_dev(priv->modem_id); diff -Nru dpdk-22.11.6/drivers/bus/dpaa/base/fman/fman.c dpdk-22.11.7/drivers/bus/dpaa/base/fman/fman.c --- dpdk-22.11.6/drivers/bus/dpaa/base/fman/fman.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/bus/dpaa/base/fman/fman.c 2024-12-13 14:35:22.000000000 +0000 @@ -153,7 +153,7 @@ size_t lenp; const uint8_t mac_idx[] = {-1, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1}; - if (__if->__if.mac_type == fman_mac_1g) { + if (__if->__if.mac_idx <= 8) { for_each_compatible_node(dev, NULL, "fsl,fman-port-1g-rx-extended-args") { prop = of_get_property(dev, "cell-index", &lenp); @@ -176,7 +176,32 @@ } } } - } else if (__if->__if.mac_type == fman_mac_10g) { + + for_each_compatible_node(dev, NULL, + "fsl,fman-port-op-extended-args") { + prop = of_get_property(dev, "cell-index", &lenp); + + if (prop) { + cell_index = of_read_number(&prop[0], + lenp / sizeof(phandle)); + + if (cell_index == __if->__if.mac_idx) { + prop = of_get_property(dev, + "vsp-window", + &lenp); + + if (prop) { + __if->__if.num_profiles = + of_read_number(&prop[0], + 1); + __if->__if.base_profile_id = + of_read_number(&prop[1], + 1); + } + } + } + } + } else { for_each_compatible_node(dev, NULL, "fsl,fman-port-10g-rx-extended-args") { prop = of_get_property(dev, "cell-index", &lenp); diff -Nru dpdk-22.11.6/drivers/bus/dpaa/base/fman/fman_hw.c dpdk-22.11.7/drivers/bus/dpaa/base/fman/fman_hw.c --- dpdk-22.11.6/drivers/bus/dpaa/base/fman/fman_hw.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/bus/dpaa/base/fman/fman_hw.c 2024-12-13 14:35:22.000000000 +0000 @@ -243,10 +243,11 @@ int i; 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) | - (u64)in_be32((char *)regs + base_offset + - 8 * i + 4)) << 32); + for (i = 0; i < n; i++) { + uint64_t a = in_be32((char *)regs + base_offset + 8 * i); + uint64_t b = in_be32((char *)regs + base_offset + 8 * i + 4); + value[i] = a | b << 32; + } } void diff -Nru dpdk-22.11.6/drivers/bus/dpaa/base/qbman/qman.c dpdk-22.11.7/drivers/bus/dpaa/base/qbman/qman.c --- dpdk-22.11.6/drivers/bus/dpaa/base/qbman/qman.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/bus/dpaa/base/qbman/qman.c 2024-12-13 14:35:22.000000000 +0000 @@ -294,10 +294,32 @@ qm_dqrr_set_maxfill(&p->p, 0); } +static inline void qm_mr_pvb_update(struct qm_portal *portal) +{ + register struct qm_mr *mr = &portal->mr; + const struct qm_mr_entry *res = qm_cl(mr->ring, mr->pi); + +#ifdef RTE_LIBRTE_DPAA_HWDEBUG + DPAA_ASSERT(mr->pmode == qm_mr_pvb); +#endif + /* when accessing 'verb', use __raw_readb() to ensure that compiler + * inlining doesn't try to optimise out "excess reads". + */ + if ((__raw_readb(&res->ern.verb) & QM_MR_VERB_VBIT) == mr->vbit) { + mr->pi = (mr->pi + 1) & (QM_MR_SIZE - 1); + if (!mr->pi) + mr->vbit ^= QM_MR_VERB_VBIT; + mr->fill++; + res = MR_INC(res); + } + dcbit_ro(res); +} + static int drain_mr_fqrni(struct qm_portal *p) { const struct qm_mr_entry *msg; loop: + qm_mr_pvb_update(p); msg = qm_mr_current(p); if (!msg) { /* @@ -319,6 +341,7 @@ do { now = mfatb(); } while ((then + 10000) > now); + qm_mr_pvb_update(p); msg = qm_mr_current(p); if (!msg) return 0; @@ -481,27 +504,6 @@ return 0; } -static inline void qm_mr_pvb_update(struct qm_portal *portal) -{ - register struct qm_mr *mr = &portal->mr; - const struct qm_mr_entry *res = qm_cl(mr->ring, mr->pi); - -#ifdef RTE_LIBRTE_DPAA_HWDEBUG - DPAA_ASSERT(mr->pmode == qm_mr_pvb); -#endif - /* when accessing 'verb', use __raw_readb() to ensure that compiler - * inlining doesn't try to optimise out "excess reads". - */ - if ((__raw_readb(&res->ern.verb) & QM_MR_VERB_VBIT) == mr->vbit) { - mr->pi = (mr->pi + 1) & (QM_MR_SIZE - 1); - if (!mr->pi) - mr->vbit ^= QM_MR_VERB_VBIT; - mr->fill++; - res = MR_INC(res); - } - dcbit_ro(res); -} - struct qman_portal * qman_init_portal(struct qman_portal *portal, const struct qm_portal_config *c, @@ -1825,6 +1827,8 @@ } out: FQUNLOCK(fq); + /* Draining FQRNIs, if any */ + drain_mr_fqrni(&p->p); return rval; } @@ -2165,8 +2169,10 @@ if (!p->vdqcr_owned) { FQLOCK(fq); - if (fq_isset(fq, QMAN_FQ_STATE_VDQCR)) + if (fq_isset(fq, QMAN_FQ_STATE_VDQCR)) { + FQUNLOCK(fq); goto escape; + } fq_set(fq, QMAN_FQ_STATE_VDQCR); FQUNLOCK(fq); p->vdqcr_owned = fq; @@ -2199,8 +2205,10 @@ if (!p->vdqcr_owned) { FQLOCK(fq); - if (fq_isset(fq, QMAN_FQ_STATE_VDQCR)) + if (fq_isset(fq, QMAN_FQ_STATE_VDQCR)) { + FQUNLOCK(fq); goto escape; + } fq_set(fq, QMAN_FQ_STATE_VDQCR); FQUNLOCK(fq); p->vdqcr_owned = fq; diff -Nru dpdk-22.11.6/drivers/bus/fslmc/qbman/qbman_debug.c dpdk-22.11.7/drivers/bus/fslmc/qbman/qbman_debug.c --- dpdk-22.11.6/drivers/bus/fslmc/qbman/qbman_debug.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/bus/fslmc/qbman/qbman_debug.c 2024-12-13 14:35:22.000000000 +0000 @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (C) 2015 Freescale Semiconductor, Inc. - * Copyright 2018-2020 NXP + * Copyright 2018-2020,2022 NXP */ #include "compat.h" @@ -37,6 +37,7 @@ struct qbman_bp_query_rslt *r) { struct qbman_bp_query_desc *p; + struct qbman_bp_query_rslt *bp_query_rslt; /* Start the management command */ p = (struct qbman_bp_query_desc *)qbman_swp_mc_start(s); @@ -47,14 +48,16 @@ p->bpid = bpid; /* Complete the management command */ - *r = *(struct qbman_bp_query_rslt *)qbman_swp_mc_complete(s, p, - QBMAN_BP_QUERY); - if (!r) { + bp_query_rslt = (struct qbman_bp_query_rslt *)qbman_swp_mc_complete(s, + p, QBMAN_BP_QUERY); + if (!bp_query_rslt) { pr_err("qbman: Query BPID %d failed, no response\n", bpid); return -EIO; } + *r = *bp_query_rslt; + /* Decode the outcome */ QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_BP_QUERY); @@ -202,20 +205,23 @@ struct qbman_fq_query_rslt *r) { struct qbman_fq_query_desc *p; + struct qbman_fq_query_rslt *fq_query_rslt; p = (struct qbman_fq_query_desc *)qbman_swp_mc_start(s); if (!p) return -EBUSY; p->fqid = fqid; - *r = *(struct qbman_fq_query_rslt *)qbman_swp_mc_complete(s, p, - QBMAN_FQ_QUERY); - if (!r) { + fq_query_rslt = (struct qbman_fq_query_rslt *)qbman_swp_mc_complete(s, + p, QBMAN_FQ_QUERY); + if (!fq_query_rslt) { pr_err("qbman: Query FQID %d failed, no response\n", fqid); return -EIO; } + *r = *fq_query_rslt; + /* Decode the outcome */ QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_FQ_QUERY); @@ -398,20 +404,23 @@ struct qbman_cgr_query_rslt *r) { struct qbman_cgr_query_desc *p; + struct qbman_cgr_query_rslt *cgr_query_rslt; p = (struct qbman_cgr_query_desc *)qbman_swp_mc_start(s); if (!p) return -EBUSY; p->cgid = cgid; - *r = *(struct qbman_cgr_query_rslt *)qbman_swp_mc_complete(s, p, - QBMAN_CGR_QUERY); - if (!r) { + cgr_query_rslt = (struct qbman_cgr_query_rslt *)qbman_swp_mc_complete(s, + p, QBMAN_CGR_QUERY); + if (!cgr_query_rslt) { pr_err("qbman: Query CGID %d failed, no response\n", cgid); return -EIO; } + *r = *cgr_query_rslt; + /* Decode the outcome */ QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_CGR_QUERY); @@ -473,20 +482,23 @@ struct qbman_wred_query_rslt *r) { struct qbman_cgr_query_desc *p; + struct qbman_wred_query_rslt *wred_query_rslt; p = (struct qbman_cgr_query_desc *)qbman_swp_mc_start(s); if (!p) return -EBUSY; p->cgid = cgid; - *r = *(struct qbman_wred_query_rslt *)qbman_swp_mc_complete(s, p, - QBMAN_WRED_QUERY); - if (!r) { + wred_query_rslt = (struct qbman_wred_query_rslt *)qbman_swp_mc_complete( + s, p, QBMAN_WRED_QUERY); + if (!wred_query_rslt) { pr_err("qbman: Query CGID WRED %d failed, no response\n", cgid); return -EIO; } + *r = *wred_query_rslt; + /* Decode the outcome */ QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_WRED_QUERY); @@ -527,7 +539,7 @@ if (mn == 0) *maxth = ma; else - *maxth = ((ma+256) * (1<<(mn-1))); + *maxth = ((uint64_t)(ma+256) * (1<<(mn-1))); if (step_s == 0) *minth = *maxth - step_i; @@ -630,6 +642,7 @@ struct qbman_wqchan_query_rslt *r) { struct qbman_wqchan_query_desc *p; + struct qbman_wqchan_query_rslt *wqchan_query_rslt; /* Start the management command */ p = (struct qbman_wqchan_query_desc *)qbman_swp_mc_start(s); @@ -640,14 +653,16 @@ p->chid = chanid; /* Complete the management command */ - *r = *(struct qbman_wqchan_query_rslt *)qbman_swp_mc_complete(s, p, - QBMAN_WQ_QUERY); - if (!r) { + wqchan_query_rslt = (struct qbman_wqchan_query_rslt *)qbman_swp_mc_complete( + s, p, QBMAN_WQ_QUERY); + if (!wqchan_query_rslt) { pr_err("qbman: Query WQ Channel %d failed, no response\n", chanid); return -EIO; } + *r = *wqchan_query_rslt; + /* Decode the outcome */ QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_WQ_QUERY); diff -Nru dpdk-22.11.6/drivers/common/cnxk/roc_ie_ot.c dpdk-22.11.7/drivers/common/cnxk/roc_ie_ot.c --- dpdk-22.11.6/drivers/common/cnxk/roc_ie_ot.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/common/cnxk/roc_ie_ot.c 2024-12-13 14:35:22.000000000 +0000 @@ -38,5 +38,6 @@ offset = offsetof(struct roc_ot_ipsec_outb_sa, ctx); sa->w0.s.ctx_push_size = (offset / ROC_CTX_UNIT_8B) + 1; sa->w0.s.ctx_size = ROC_IE_OT_CTX_ILEN; + sa->w0.s.ctx_hdr_size = ROC_IE_OT_SA_CTX_HDR_SIZE; sa->w0.s.aop_valid = 1; } diff -Nru dpdk-22.11.6/drivers/common/cnxk/roc_irq.c dpdk-22.11.7/drivers/common/cnxk/roc_irq.c --- dpdk-22.11.6/drivers/common/cnxk/roc_irq.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/common/cnxk/roc_irq.c 2024-12-13 14:35:22.000000000 +0000 @@ -15,7 +15,7 @@ #define MSIX_IRQ_SET_BUF_LEN \ (sizeof(struct vfio_irq_set) + sizeof(int) * \ - (plt_intr_max_intr_get(intr_handle))) + ((uint32_t)plt_intr_max_intr_get(intr_handle))) static int irq_get_info(struct plt_intr_handle *intr_handle) diff -Nru dpdk-22.11.6/drivers/common/cnxk/roc_platform.c dpdk-22.11.7/drivers/common/cnxk/roc_platform.c --- dpdk-22.11.6/drivers/common/cnxk/roc_platform.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/common/cnxk/roc_platform.c 2024-12-13 14:35:22.000000000 +0000 @@ -60,7 +60,7 @@ return 0; } -RTE_LOG_REGISTER(cnxk_logtype_base, pmd.cnxk.base, NOTICE); +RTE_LOG_REGISTER(cnxk_logtype_base, pmd.cnxk.base, INFO); RTE_LOG_REGISTER(cnxk_logtype_mbox, pmd.cnxk.mbox, NOTICE); RTE_LOG_REGISTER(cnxk_logtype_cpt, pmd.crypto.cnxk, NOTICE); RTE_LOG_REGISTER(cnxk_logtype_npa, pmd.mempool.cnxk, NOTICE); diff -Nru dpdk-22.11.6/drivers/common/dpaax/caamflib/desc/pdcp.h dpdk-22.11.7/drivers/common/dpaax/caamflib/desc/pdcp.h --- dpdk-22.11.6/drivers/common/dpaax/caamflib/desc/pdcp.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/common/dpaax/caamflib/desc/pdcp.h 2024-12-13 14:35:22.000000000 +0000 @@ -1220,6 +1220,11 @@ SEQFIFOLOAD(p, MSG1, 0, VLF | LAST1 | FLUSH1); MOVEB(p, CONTEXT1, 0, MATH3, 0, 4, WAITCOMP | IMMED); + /* conditional jump with calm added to ensure that the + * previous processing has been completed + */ + JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM); + LOAD(p, CLRW_RESET_CLS1_CHA | CLRW_CLR_C1KEY | CLRW_CLR_C1CTX | @@ -1921,6 +1926,11 @@ MOVEB(p, OFIFO, 0, MATH3, 0, 4, IMMED); + /* conditional jump with calm added to ensure that the + * previous processing has been completed + */ + JUMP(p, 1, LOCAL_JUMP, ALL_TRUE, CALM); + LOAD(p, CLRW_RESET_CLS1_CHA | CLRW_CLR_C1KEY | CLRW_CLR_C1CTX | diff -Nru dpdk-22.11.6/drivers/common/dpaax/caamflib/rta/operation_cmd.h dpdk-22.11.7/drivers/common/dpaax/caamflib/rta/operation_cmd.h --- dpdk-22.11.6/drivers/common/dpaax/caamflib/rta/operation_cmd.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/common/dpaax/caamflib/rta/operation_cmd.h 2024-12-13 14:35:22.000000000 +0000 @@ -7,10 +7,6 @@ #ifndef __RTA_OPERATION_CMD_H__ #define __RTA_OPERATION_CMD_H__ -#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 70000) -#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" -#endif - extern enum rta_sec_era rta_sec_era; static inline int diff -Nru dpdk-22.11.6/drivers/common/idpf/base/idpf_osdep.h dpdk-22.11.7/drivers/common/idpf/base/idpf_osdep.h --- dpdk-22.11.6/drivers/common/idpf/base/idpf_osdep.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/common/idpf/base/idpf_osdep.h 2024-12-13 14:35:22.000000000 +0000 @@ -349,10 +349,16 @@ #define LIST_ENTRY_TYPE(type) LIST_ENTRY(type) #endif +#ifndef LIST_FOREACH_SAFE +#define LIST_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = LIST_FIRST((head)); \ + (var) && ((tvar) = LIST_NEXT((var), field), 1); \ + (var) = (tvar)) +#endif + #ifndef LIST_FOR_EACH_ENTRY_SAFE #define LIST_FOR_EACH_ENTRY_SAFE(pos, temp, head, entry_type, list) \ - LIST_FOREACH(pos, head, list) - + LIST_FOREACH_SAFE(pos, head, list, temp) #endif #ifndef LIST_FOR_EACH_ENTRY diff -Nru dpdk-22.11.6/drivers/common/mlx5/mlx5_common_utils.h dpdk-22.11.7/drivers/common/mlx5/mlx5_common_utils.h --- dpdk-22.11.6/drivers/common/mlx5/mlx5_common_utils.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/common/mlx5/mlx5_common_utils.h 2024-12-13 14:35:22.000000000 +0000 @@ -131,7 +131,7 @@ * For huge amount of entries, please consider hash list. * */ -struct mlx5_list { +struct __rte_aligned(16) mlx5_list { struct mlx5_list_const l_const; struct mlx5_list_inconst l_inconst; }; diff -Nru dpdk-22.11.6/drivers/common/mlx5/mlx5_devx_cmds.c dpdk-22.11.7/drivers/common/mlx5/mlx5_devx_cmds.c --- dpdk-22.11.6/drivers/common/mlx5/mlx5_devx_cmds.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/common/mlx5/mlx5_devx_cmds.c 2024-12-13 14:35:22.000000000 +0000 @@ -953,6 +953,7 @@ attr->log_max_qp = MLX5_GET(cmd_hca_cap, hcattr, log_max_qp); attr->log_max_cq_sz = MLX5_GET(cmd_hca_cap, hcattr, log_max_cq_sz); attr->log_max_qp_sz = MLX5_GET(cmd_hca_cap, hcattr, log_max_qp_sz); + attr->log_max_wq_sz = MLX5_GET(cmd_hca_cap, hcattr, log_max_wq_sz); attr->log_max_mrw_sz = MLX5_GET(cmd_hca_cap, hcattr, log_max_mrw_sz); attr->log_max_pd = MLX5_GET(cmd_hca_cap, hcattr, log_max_pd); attr->log_max_srq = MLX5_GET(cmd_hca_cap, hcattr, log_max_srq); diff -Nru dpdk-22.11.6/drivers/common/mlx5/mlx5_devx_cmds.h dpdk-22.11.7/drivers/common/mlx5/mlx5_devx_cmds.h --- dpdk-22.11.6/drivers/common/mlx5/mlx5_devx_cmds.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/common/mlx5/mlx5_devx_cmds.h 2024-12-13 14:35:22.000000000 +0000 @@ -245,6 +245,7 @@ struct mlx5_hca_vdpa_attr vdpa; struct mlx5_hca_flow_attr flow; struct mlx5_hca_flex_attr flex; + uint8_t log_max_wq_sz; int log_max_qp_sz; int log_max_cq_sz; int log_max_qp; diff -Nru dpdk-22.11.6/drivers/common/mlx5/mlx5_prm.h dpdk-22.11.7/drivers/common/mlx5/mlx5_prm.h --- dpdk-22.11.6/drivers/common/mlx5/mlx5_prm.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/common/mlx5/mlx5_prm.h 2024-12-13 14:35:22.000000000 +0000 @@ -262,8 +262,12 @@ /* Maximum number of DS in WQE. Limited by 6-bit field. */ #define MLX5_DSEG_MAX 63 -/* The 32 bit syndrome offset in struct mlx5_err_cqe. */ +/* The 32 bit syndrome offset in struct mlx5_error_cqe. */ +#if (RTE_CACHE_LINE_SIZE == 128) +#define MLX5_ERROR_CQE_SYNDROME_OFFSET 116 +#else #define MLX5_ERROR_CQE_SYNDROME_OFFSET 52 +#endif /* The completion mode offset in the WQE control segment line 2. */ #define MLX5_COMP_MODE_OFFSET 2 @@ -403,6 +407,29 @@ #define MLX5_MPRQ_STRIDE_SHIFT_BYTE 2 +struct mlx5_error_cqe { +#if (RTE_CACHE_LINE_SIZE == 128) + uint8_t padding[64]; +#endif + uint8_t rsvd0[2]; + uint16_t eth_wqe_id; + uint8_t rsvd1[16]; + uint16_t ib_stride_index; + uint8_t rsvd2[10]; + uint32_t srqn; + uint8_t rsvd3[8]; + uint32_t byte_cnt; + uint8_t rsvd4[4]; + uint8_t hw_err_synd; + uint8_t hw_synd_type; + uint8_t vendor_err_synd; + uint8_t syndrome; + uint32_t s_wqe_opcode_qpn; + uint16_t wqe_counter; + uint8_t signature; + uint8_t op_own; +}; + /* CQ element structure - should be equal to the cache line size */ struct mlx5_cqe { #if (RTE_CACHE_LINE_SIZE == 128) @@ -784,7 +811,7 @@ unsigned int field:12; unsigned int action_type:4; }; - }; + } __rte_packed; union { uint32_t data1; uint8_t data[4]; @@ -795,7 +822,7 @@ unsigned int dst_field:12; unsigned int rsvd4:4; }; - }; + } __rte_packed; }; typedef uint64_t u64; diff -Nru dpdk-22.11.6/drivers/common/mlx5/windows/mlx5_win_defs.h dpdk-22.11.7/drivers/common/mlx5/windows/mlx5_win_defs.h --- dpdk-22.11.6/drivers/common/mlx5/windows/mlx5_win_defs.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/common/mlx5/windows/mlx5_win_defs.h 2024-12-13 14:35:22.000000000 +0000 @@ -219,18 +219,6 @@ } dest_tir; }; -struct mlx5_err_cqe { - uint8_t rsvd0[32]; - uint32_t srqn; - uint8_t rsvd1[18]; - uint8_t vendor_err_synd; - uint8_t syndrome; - uint32_t s_wqe_opcode_qpn; - uint16_t wqe_counter; - uint8_t signature; - uint8_t op_own; -}; - struct mlx5_wqe_srq_next_seg { uint8_t rsvd0[2]; rte_be16_t next_wqe_index; diff -Nru dpdk-22.11.6/drivers/compress/mlx5/mlx5_compress.c dpdk-22.11.7/drivers/compress/mlx5/mlx5_compress.c --- dpdk-22.11.6/drivers/compress/mlx5/mlx5_compress.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/compress/mlx5/mlx5_compress.c 2024-12-13 14:35:22.000000000 +0000 @@ -536,7 +536,7 @@ size_t i; DRV_LOG(ERR, "Error cqe:"); - for (i = 0; i < sizeof(struct mlx5_err_cqe) >> 2; i += 4) + for (i = 0; i < sizeof(struct mlx5_error_cqe) >> 2; i += 4) DRV_LOG(ERR, "%08X %08X %08X %08X", cqe[i], cqe[i + 1], cqe[i + 2], cqe[i + 3]); DRV_LOG(ERR, "\nError wqe:"); @@ -554,7 +554,7 @@ struct rte_comp_op *op) { const uint32_t idx = qp->ci & (qp->entries_n - 1); - volatile struct mlx5_err_cqe *cqe = (volatile struct mlx5_err_cqe *) + volatile struct mlx5_error_cqe *cqe = (volatile struct mlx5_error_cqe *) &qp->cq.cqes[idx]; volatile struct mlx5_gga_wqe *wqes = (volatile struct mlx5_gga_wqe *) qp->qp.wqes; diff -Nru dpdk-22.11.6/drivers/crypto/bcmfs/bcmfs_device.c dpdk-22.11.7/drivers/crypto/bcmfs/bcmfs_device.c --- dpdk-22.11.6/drivers/crypto/bcmfs/bcmfs_device.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/crypto/bcmfs/bcmfs_device.c 2024-12-13 14:35:22.000000000 +0000 @@ -139,7 +139,7 @@ return fsdev; cleanup: - free(fsdev); + rte_free(fsdev); return NULL; } @@ -163,7 +163,7 @@ return; TAILQ_REMOVE(&fsdev_list, fsdev, next); - free(fsdev); + rte_free(fsdev); } static int diff -Nru dpdk-22.11.6/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c dpdk-22.11.7/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c --- dpdk-22.11.6/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c 2024-12-13 14:35:22.000000000 +0000 @@ -3444,6 +3444,7 @@ } } else { DPAA2_SEC_ERR("Invalid crypto type"); + rte_free(priv); return -EINVAL; } diff -Nru dpdk-22.11.6/drivers/crypto/ipsec_mb/meson.build dpdk-22.11.7/drivers/crypto/ipsec_mb/meson.build --- dpdk-22.11.6/drivers/crypto/ipsec_mb/meson.build 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/crypto/ipsec_mb/meson.build 2024-12-13 14:35:22.000000000 +0000 @@ -17,7 +17,7 @@ build = false reason = 'missing dependency, "libIPSec_MB"' # if the lib is found, check it's the right format -elif meson.version().version_compare('>=0.60') and not cc.links( +elif not cc.links( 'int main(void) {return 0;}', dependencies: lib) build = false reason = 'incompatible dependency, "libIPSec_MB"' diff -Nru dpdk-22.11.6/drivers/crypto/openssl/rte_openssl_pmd.c dpdk-22.11.7/drivers/crypto/openssl/rte_openssl_pmd.c --- dpdk-22.11.6/drivers/crypto/openssl/rte_openssl_pmd.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/crypto/openssl/rte_openssl_pmd.c 2024-12-13 14:35:22.000000000 +0000 @@ -2,6 +2,7 @@ * Copyright(c) 2016-2017 Intel Corporation */ +#include #include #include #include @@ -98,22 +99,6 @@ static int cryptodev_openssl_remove(struct rte_vdev_device *vdev); -/*----------------------------------------------------------------------------*/ - -/** - * Increment counter by 1 - * Counter is 64 bit array, big-endian - */ -static void -ctr_inc(uint8_t *ctr) -{ - uint64_t *ctr64 = (uint64_t *)ctr; - - *ctr64 = __builtin_bswap64(*ctr64); - (*ctr64)++; - *ctr64 = __builtin_bswap64(*ctr64); -} - /* *------------------------------------------------------------------------------ * Session Prepare @@ -691,7 +676,7 @@ else return -EINVAL; - rte_memcpy(algo_name, algo, strlen(algo) + 1); + strlcpy(algo_name, algo, sizeof(algo_name)); params[0] = OSSL_PARAM_construct_utf8_string( OSSL_MAC_PARAM_CIPHER, algo_name, 0); params[1] = OSSL_PARAM_construct_end(); @@ -1191,7 +1176,8 @@ process_openssl_cipher_des3ctr(struct rte_mbuf *mbuf_src, uint8_t *dst, int offset, uint8_t *iv, int srclen, EVP_CIPHER_CTX *ctx) { - uint8_t ebuf[8], ctr[8]; + uint8_t ebuf[8]; + uint64_t ctr; int unused, n; struct rte_mbuf *m; uint8_t *src; @@ -1207,15 +1193,19 @@ src = rte_pktmbuf_mtod_offset(m, uint8_t *, offset); l = rte_pktmbuf_data_len(m) - offset; - memcpy(ctr, iv, 8); + memcpy(&ctr, iv, 8); for (n = 0; n < srclen; n++) { if (n % 8 == 0) { + uint64_t cpu_ctr; + if (EVP_EncryptUpdate(ctx, (unsigned char *)&ebuf, &unused, (const unsigned char *)&ctr, 8) <= 0) goto process_cipher_des3ctr_err; - ctr_inc(ctr); + cpu_ctr = rte_be_to_cpu_64(ctr); + cpu_ctr++; + ctr = rte_cpu_to_be_64(cpu_ctr); } dst[n] = *(src++) ^ ebuf[n % 8]; diff -Nru dpdk-22.11.6/drivers/crypto/qat/qat_asym.c dpdk-22.11.7/drivers/crypto/qat/qat_asym.c --- dpdk-22.11.6/drivers/crypto/qat/qat_asym.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/crypto/qat/qat_asym.c 2024-12-13 14:35:22.000000000 +0000 @@ -268,6 +268,7 @@ rte_memcpy(modexp_result, cookie->output_array[0] + alg_bytesize - n.length, n.length); + asym_op->modex.result.length = alg_bytesize; HEXDUMP("ModExp result", cookie->output_array[0], alg_bytesize); return RTE_CRYPTO_OP_STATUS_SUCCESS; @@ -329,6 +330,7 @@ - n.length), cookie->output_array[0] + alg_bytesize - n.length, n.length); + asym_op->modinv.result.length = alg_bytesize; HEXDUMP("ModInv result", cookie->output_array[0], alg_bytesize); return RTE_CRYPTO_OP_STATUS_SUCCESS; diff -Nru dpdk-22.11.6/drivers/dma/idxd/idxd_pci.c dpdk-22.11.7/drivers/dma/idxd/idxd_pci.c --- dpdk-22.11.6/drivers/dma/idxd/idxd_pci.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/dma/idxd/idxd_pci.c 2024-12-13 14:35:22.000000000 +0000 @@ -292,7 +292,7 @@ return nb_wqs; err: - free(pci); + rte_free(pci); return err_code; } diff -Nru dpdk-22.11.6/drivers/event/cnxk/cn10k_eventdev.c dpdk-22.11.7/drivers/event/cnxk/cn10k_eventdev.c --- dpdk-22.11.6/drivers/event/cnxk/cn10k_eventdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/event/cnxk/cn10k_eventdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -864,12 +864,40 @@ } } +static void +eventdev_fops_tstamp_update(struct rte_eventdev *event_dev) +{ + struct rte_event_fp_ops *fp_op = + rte_event_fp_ops + event_dev->data->dev_id; + + fp_op->dequeue = event_dev->dequeue; + fp_op->dequeue_burst = event_dev->dequeue_burst; +} + +static void +cn10k_sso_tstamp_hdl_update(uint16_t port_id, uint16_t flags, bool ptp_en) +{ + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + struct cnxk_eth_dev *cnxk_eth_dev = dev->data->dev_private; + struct rte_eventdev *event_dev = cnxk_eth_dev->evdev_priv; + struct cnxk_sso_evdev *evdev = cnxk_sso_pmd_priv(event_dev); + + evdev->rx_offloads |= flags; + if (ptp_en) + evdev->tstamp[port_id] = &cnxk_eth_dev->tstamp; + else + evdev->tstamp[port_id] = NULL; + cn10k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev); + eventdev_fops_tstamp_update(event_dev); +} + static int cn10k_sso_rx_adapter_queue_add( const struct rte_eventdev *event_dev, const struct rte_eth_dev *eth_dev, int32_t rx_queue_id, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) { + struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private; struct cn10k_eth_rxq *rxq; uint64_t meta_aura; void *lookup_mem; @@ -883,6 +911,10 @@ queue_conf); if (rc) return -EINVAL; + + cnxk_eth_dev->cnxk_sso_ptp_tstamp_cb = cn10k_sso_tstamp_hdl_update; + cnxk_eth_dev->evdev_priv = (struct rte_eventdev *)(uintptr_t)event_dev; + rxq = eth_dev->data->rx_queues[0]; lookup_mem = rxq->lookup_mem; meta_aura = rxq->meta_aura; diff -Nru dpdk-22.11.6/drivers/event/cnxk/cn9k_eventdev.c dpdk-22.11.7/drivers/event/cnxk/cn9k_eventdev.c --- dpdk-22.11.6/drivers/event/cnxk/cn9k_eventdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/event/cnxk/cn9k_eventdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -981,12 +981,40 @@ } } +static void +eventdev_fops_tstamp_update(struct rte_eventdev *event_dev) +{ + struct rte_event_fp_ops *fp_op = + rte_event_fp_ops + event_dev->data->dev_id; + + fp_op->dequeue = event_dev->dequeue; + fp_op->dequeue_burst = event_dev->dequeue_burst; +} + +static void +cn9k_sso_tstamp_hdl_update(uint16_t port_id, uint16_t flags, bool ptp_en) +{ + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + struct cnxk_eth_dev *cnxk_eth_dev = dev->data->dev_private; + struct rte_eventdev *event_dev = cnxk_eth_dev->evdev_priv; + struct cnxk_sso_evdev *evdev = cnxk_sso_pmd_priv(event_dev); + + evdev->rx_offloads |= flags; + if (ptp_en) + evdev->tstamp[port_id] = &cnxk_eth_dev->tstamp; + else + evdev->tstamp[port_id] = NULL; + cn9k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev); + eventdev_fops_tstamp_update(event_dev); +} + static int cn9k_sso_rx_adapter_queue_add( const struct rte_eventdev *event_dev, const struct rte_eth_dev *eth_dev, int32_t rx_queue_id, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) { + struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private; struct cn9k_eth_rxq *rxq; void *lookup_mem; int rc; @@ -1000,6 +1028,9 @@ if (rc) return -EINVAL; + cnxk_eth_dev->cnxk_sso_ptp_tstamp_cb = cn9k_sso_tstamp_hdl_update; + cnxk_eth_dev->evdev_priv = (struct rte_eventdev *)(uintptr_t)event_dev; + rxq = eth_dev->data->rx_queues[0]; lookup_mem = rxq->lookup_mem; cn9k_sso_set_priv_mem(event_dev, lookup_mem, 0); diff -Nru dpdk-22.11.6/drivers/event/cnxk/cnxk_eventdev.c dpdk-22.11.7/drivers/event/cnxk/cnxk_eventdev.c --- dpdk-22.11.6/drivers/event/cnxk/cnxk_eventdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/event/cnxk/cnxk_eventdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -109,8 +109,8 @@ return 0; hws_fini: for (i = i - 1; i >= 0; i--) { - event_dev->data->ports[i] = NULL; rte_free(cnxk_sso_hws_get_cookie(event_dev->data->ports[i])); + event_dev->data->ports[i] = NULL; } return -ENOMEM; } diff -Nru dpdk-22.11.6/drivers/event/cnxk/cnxk_eventdev_adptr.c dpdk-22.11.7/drivers/event/cnxk/cnxk_eventdev_adptr.c --- dpdk-22.11.6/drivers/event/cnxk/cnxk_eventdev_adptr.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/event/cnxk/cnxk_eventdev_adptr.c 2024-12-13 14:35:22.000000000 +0000 @@ -212,7 +212,7 @@ cnxk_sso_tstamp_cfg(uint16_t port_id, struct cnxk_eth_dev *cnxk_eth_dev, struct cnxk_sso_evdev *dev) { - if (cnxk_eth_dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) + if (cnxk_eth_dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP || cnxk_eth_dev->ptp_en) dev->tstamp[port_id] = &cnxk_eth_dev->tstamp; } diff -Nru dpdk-22.11.6/drivers/event/octeontx/ssovf_evdev.c dpdk-22.11.7/drivers/event/octeontx/ssovf_evdev.c --- dpdk-22.11.6/drivers/event/octeontx/ssovf_evdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/event/octeontx/ssovf_evdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -714,10 +714,20 @@ } static int -ssovf_parsekv(const char *key __rte_unused, const char *value, void *opaque) +ssovf_parsekv(const char *key, const char *value, void *opaque) { - int *flag = opaque; - *flag = !!atoi(value); + uint8_t *flag = opaque; + uint64_t v; + char *end; + + errno = 0; + v = strtoul(value, &end, 0); + if ((errno != 0) || (value == end) || *end != '\0' || v > 1) { + ssovf_log_err("invalid %s value %s", key, value); + return -EINVAL; + } + + *flag = !!v; return 0; } diff -Nru dpdk-22.11.6/drivers/meson.build dpdk-22.11.7/drivers/meson.build --- dpdk-22.11.6/drivers/meson.build 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/meson.build 2024-12-13 14:35:22.000000000 +0000 @@ -175,6 +175,7 @@ if get_option('enable_driver_sdk') install_headers(driver_sdk_headers) endif + dpdk_chkinc_headers += driver_sdk_headers if headers.length() > 0 dpdk_includes += include_directories(drv_path) diff -Nru dpdk-22.11.6/drivers/net/bnx2x/bnx2x.c dpdk-22.11.7/drivers/net/bnx2x/bnx2x.c --- dpdk-22.11.6/drivers/net/bnx2x/bnx2x.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/bnx2x/bnx2x.c 2024-12-13 14:35:22.000000000 +0000 @@ -1623,16 +1623,12 @@ } /* request unload mode from the MCP: COMMON, PORT or FUNCTION */ -static uint32_t bnx2x_send_unload_req(struct bnx2x_softc *sc, int unload_mode) +static uint32_t bnx2x_send_unload_req(struct bnx2x_softc *sc, int unload_mode __rte_unused) { uint32_t reset_code = 0; /* Select the UNLOAD request mode */ - if (unload_mode == UNLOAD_NORMAL) { - reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; - } else { - reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; - } + reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; /* Send the request to the MCP */ if (!BNX2X_NOMCP(sc)) { @@ -10337,12 +10333,13 @@ REG_WR(sc, PXP2_REG_RD_DISABLE_INPUTS, 0); if (!CHIP_IS_E1x(sc)) { - int factor = 0; + int factor = CHIP_REV_IS_EMUL(sc) ? 1000 : + (CHIP_REV_IS_FPGA(sc) ? 400 : 0); ecore_init_block(sc, BLOCK_PGLUE_B, PHASE_COMMON); ecore_init_block(sc, BLOCK_ATC, PHASE_COMMON); -/* let the HW do it's magic... */ + /* let the HW do it's magic... */ do { DELAY(200000); val = REG_RD(sc, ATC_REG_ATC_INIT_DONE); @@ -11195,11 +11192,9 @@ /* Turn on a single ISR mode in IGU if driver is going to use * INT#x or MSI */ - if ((sc->interrupt_mode != INTR_MODE_MSIX) - || (sc->interrupt_mode != INTR_MODE_SINGLE_MSIX)) { + if (sc->interrupt_mode == INTR_MODE_INTX || + sc->interrupt_mode == INTR_MODE_MSI) pf_conf |= IGU_PF_CONF_SINGLE_ISR_EN; - } - /* * Timers workaround bug: function init part. * Need to wait 20msec after initializing ILT, diff -Nru dpdk-22.11.6/drivers/net/bnx2x/bnx2x_stats.c dpdk-22.11.7/drivers/net/bnx2x/bnx2x_stats.c --- dpdk-22.11.6/drivers/net/bnx2x/bnx2x_stats.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/bnx2x/bnx2x_stats.c 2024-12-13 14:35:22.000000000 +0000 @@ -75,10 +75,6 @@ int rc; if (!sc->stats_pending) { - if (sc->stats_pending) { - return; - } - sc->fw_stats_req->hdr.drv_stats_counter = htole16(sc->stats_counter++); diff -Nru dpdk-22.11.6/drivers/net/bnxt/bnxt_ethdev.c dpdk-22.11.7/drivers/net/bnxt/bnxt_ethdev.c --- dpdk-22.11.6/drivers/net/bnxt/bnxt_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/bnxt/bnxt_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -3959,7 +3959,6 @@ switch (module_info[0]) { case SFF_MODULE_ID_SFP: - module_info[SFF_DIAG_SUPPORT_OFFSET] = 0; if (module_info[SFF_DIAG_SUPPORT_OFFSET]) { pg_addr[2] = I2C_DEV_ADDR_A2; pg_addr[3] = I2C_DEV_ADDR_A2; diff -Nru dpdk-22.11.6/drivers/net/bnxt/bnxt_txr.c dpdk-22.11.7/drivers/net/bnxt/bnxt_txr.c --- dpdk-22.11.6/drivers/net/bnxt/bnxt_txr.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/bnxt/bnxt_txr.c 2024-12-13 14:35:22.000000000 +0000 @@ -255,17 +255,24 @@ */ txbd1->kid_or_ts_high_mss = 0; - if (txq->vfr_tx_cfa_action) - txbd1->cfa_action = txq->vfr_tx_cfa_action; - else - txbd1->cfa_action = txq->bp->tx_cfa_action; + if (txq->vfr_tx_cfa_action) { + txbd1->cfa_action = txq->vfr_tx_cfa_action & 0xffff; + txbd1->cfa_action_high = (txq->vfr_tx_cfa_action >> 16) & + TX_BD_LONG_CFA_ACTION_HIGH_MASK; + } else { + txbd1->cfa_action = txq->bp->tx_cfa_action & 0xffff; + txbd1->cfa_action_high = (txq->bp->tx_cfa_action >> 16) & + TX_BD_LONG_CFA_ACTION_HIGH_MASK; + } if (tx_pkt->ol_flags & RTE_MBUF_F_TX_TCP_SEG) { uint16_t hdr_size; /* TSO */ txbd1->lflags |= TX_BD_LONG_LFLAGS_LSO | - TX_BD_LONG_LFLAGS_T_IPID; + TX_BD_LONG_LFLAGS_T_IPID | + TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM | + TX_BD_LONG_LFLAGS_T_IP_CHKSUM; hdr_size = tx_pkt->l2_len + tx_pkt->l3_len + tx_pkt->l4_len; hdr_size += (tx_pkt->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) ? diff -Nru dpdk-22.11.6/drivers/net/bnxt/tf_core/tf_msg.c dpdk-22.11.7/drivers/net/bnxt/tf_core/tf_msg.c --- dpdk-22.11.6/drivers/net/bnxt/tf_core/tf_msg.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/bnxt/tf_core/tf_msg.c 2024-12-13 14:35:22.000000000 +0000 @@ -25,7 +25,7 @@ */ #define TF_MSG_SET_GLOBAL_CFG_DATA_SIZE 16 #define TF_MSG_EM_INSERT_KEY_SIZE 64 -#define TF_MSG_EM_INSERT_RECORD_SIZE 80 +#define TF_MSG_EM_INSERT_RECORD_SIZE 96 #define TF_MSG_TBL_TYPE_SET_DATA_SIZE 88 /* Compile check - Catch any msg changes that we depend on, like the diff -Nru dpdk-22.11.6/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c dpdk-22.11.7/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c --- dpdk-22.11.6/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c 2024-12-13 14:35:22.000000000 +0000 @@ -720,18 +720,21 @@ } while (!rc && nxt_resource_index); - bnxt_ulp_cntxt_release_fdb_lock(ctxt); - - if (rc || !found_cntr_resource) + if (rc || !found_cntr_resource) { + bnxt_ulp_cntxt_release_fdb_lock(ctxt); return rc; + } dir = params.direction; hw_cntr_id = params.resource_hndl; if (!found_parent_flow && params.resource_sub_type == BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT) { - if (!ulp_fc_info->num_counters) - return ulp_fc_tf_flow_stat_get(ctxt, ¶ms, count); + if (!ulp_fc_info->num_counters) { + rc = ulp_fc_tf_flow_stat_get(ctxt, ¶ms, count); + bnxt_ulp_cntxt_release_fdb_lock(ctxt); + return rc; + } /* TODO: * Think about optimizing with try_lock later @@ -755,9 +758,14 @@ params.resource_sub_type == BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT) { /* Get stats from the parent child table */ - ulp_flow_db_parent_flow_count_get(ctxt, pc_idx, - &count->hits, &count->bytes, - count->reset); + if (ulp_flow_db_parent_flow_count_get(ctxt, flow_id, + pc_idx, + &count->hits, + &count->bytes, + count->reset)) { + bnxt_ulp_cntxt_release_fdb_lock(ctxt); + return -EIO; + } if (count->hits) count->hits_set = 1; if (count->bytes) @@ -766,7 +774,7 @@ /* TBD: Handle External counters */ rc = -EINVAL; } - + bnxt_ulp_cntxt_release_fdb_lock(ctxt); return rc; } diff -Nru dpdk-22.11.6/drivers/net/bnxt/tf_ulp/ulp_flow_db.c dpdk-22.11.7/drivers/net/bnxt/tf_ulp/ulp_flow_db.c --- dpdk-22.11.6/drivers/net/bnxt/tf_ulp/ulp_flow_db.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/bnxt/tf_ulp/ulp_flow_db.c 2024-12-13 14:35:22.000000000 +0000 @@ -1361,13 +1361,12 @@ if (set_flag) { pc_entry->parent_fid = parent_fid; + pc_entry->parent_ref_cnt++; } else { - if (pc_entry->parent_fid != parent_fid) - BNXT_TF_DBG(ERR, "Panic: invalid parent id\n"); - pc_entry->parent_fid = 0; - + if (pc_entry->parent_ref_cnt > 0) + pc_entry->parent_ref_cnt--; /* Free the parent child db entry if no user present */ - if (!pc_entry->f2_cnt) + if (!pc_entry->parent_ref_cnt && !pc_entry->f2_cnt) ulp_flow_db_pc_db_entry_free(ulp_ctxt, pc_entry); } return 0; @@ -1422,7 +1421,7 @@ ULP_INDEX_BITMAP_RESET(t[a_idx], child_fid); if (pc_entry->f2_cnt) pc_entry->f2_cnt--; - if (!pc_entry->f2_cnt && !pc_entry->parent_fid) + if (!pc_entry->f2_cnt && !pc_entry->parent_ref_cnt) ulp_flow_db_pc_db_entry_free(ulp_ctxt, pc_entry); } return 0; @@ -1514,7 +1513,7 @@ /* check for parent idx validity */ p_pdb = &flow_db->parent_child_db; if (pc_idx >= p_pdb->entries_count || - !p_pdb->parent_flow_tbl[pc_idx].parent_fid) { + !p_pdb->parent_flow_tbl[pc_idx].parent_ref_cnt) { BNXT_TF_DBG(ERR, "Invalid parent child index %x\n", pc_idx); return -EINVAL; } @@ -1761,6 +1760,7 @@ */ int32_t ulp_flow_db_parent_flow_count_get(struct bnxt_ulp_context *ulp_ctxt, + uint32_t flow_id, uint32_t pc_idx, uint64_t *packet_count, uint64_t *byte_count, uint8_t count_reset) { @@ -1773,6 +1773,13 @@ return -EINVAL; } + /* stale parent fid */ + if (flow_id != pc_entry->parent_fid) { + *packet_count = 0; + *byte_count = 0; + return 0; + } + if (pc_entry->counter_acc) { *packet_count = pc_entry->pkt_count; *byte_count = pc_entry->byte_count; diff -Nru dpdk-22.11.6/drivers/net/bnxt/tf_ulp/ulp_flow_db.h dpdk-22.11.7/drivers/net/bnxt/tf_ulp/ulp_flow_db.h --- dpdk-22.11.6/drivers/net/bnxt/tf_ulp/ulp_flow_db.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/bnxt/tf_ulp/ulp_flow_db.h 2024-12-13 14:35:22.000000000 +0000 @@ -60,6 +60,7 @@ struct ulp_fdb_parent_info { uint32_t valid; uint32_t parent_fid; + uint32_t parent_ref_cnt; uint32_t counter_acc; uint64_t pkt_count; uint64_t byte_count; @@ -385,6 +386,7 @@ */ int32_t ulp_flow_db_parent_flow_count_get(struct bnxt_ulp_context *ulp_ctxt, + uint32_t flow_id, uint32_t pc_idx, uint64_t *packet_count, uint64_t *byte_count, diff -Nru dpdk-22.11.6/drivers/net/cnxk/cn10k_ethdev.c dpdk-22.11.7/drivers/net/cnxk/cn10k_ethdev.c --- dpdk-22.11.6/drivers/net/cnxk/cn10k_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/cnxk/cn10k_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -30,7 +30,7 @@ if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SCATTER) flags |= NIX_RX_MULTI_SEG_F; - if ((dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)) + if ((dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) || dev->ptp_en) flags |= NIX_RX_OFFLOAD_TSTAMP_F; if (!dev->ptype_disable) @@ -381,7 +381,7 @@ struct cnxk_eth_dev *dev = (struct cnxk_eth_dev *)nix; struct rte_eth_dev *eth_dev; struct cn10k_eth_rxq *rxq; - int i; + int i, rc; if (!dev) return -EINVAL; @@ -404,8 +404,22 @@ * and MTU setting also requires MBOX message to be * sent(VF->PF) */ + if (dev->ptp_en) { + rc = rte_mbuf_dyn_rx_timestamp_register + (&dev->tstamp.tstamp_dynfield_offset, + &dev->tstamp.rx_tstamp_dynflag); + if (rc != 0) { + plt_err("Failed to register Rx timestamp field/flag"); + return -EINVAL; + } + } eth_dev->rx_pkt_burst = nix_ptp_vf_burst; + rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst = eth_dev->rx_pkt_burst; rte_mb(); + if (dev->cnxk_sso_ptp_tstamp_cb) + dev->cnxk_sso_ptp_tstamp_cb(eth_dev->data->port_id, + NIX_RX_OFFLOAD_TSTAMP_F, dev->ptp_en); + } return 0; diff -Nru dpdk-22.11.6/drivers/net/cnxk/cn9k_ethdev.c dpdk-22.11.7/drivers/net/cnxk/cn9k_ethdev.c --- dpdk-22.11.6/drivers/net/cnxk/cn9k_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/cnxk/cn9k_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -30,7 +30,7 @@ if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SCATTER) flags |= NIX_RX_MULTI_SEG_F; - if ((dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)) + if ((dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) || dev->ptp_en) flags |= NIX_RX_OFFLOAD_TSTAMP_F; if (!dev->ptype_disable) @@ -362,7 +362,7 @@ struct cnxk_eth_dev *dev = (struct cnxk_eth_dev *)nix; struct rte_eth_dev *eth_dev; struct cn9k_eth_rxq *rxq; - int i; + int i, rc; if (!dev) return -EINVAL; @@ -385,8 +385,21 @@ * and MTU setting also requires MBOX message to be * sent(VF->PF) */ + if (dev->ptp_en) { + rc = rte_mbuf_dyn_rx_timestamp_register + (&dev->tstamp.tstamp_dynfield_offset, + &dev->tstamp.rx_tstamp_dynflag); + if (rc != 0) { + plt_err("Failed to register Rx timestamp field/flag"); + return -EINVAL; + } + } eth_dev->rx_pkt_burst = nix_ptp_vf_burst; + rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst = eth_dev->rx_pkt_burst; rte_mb(); + if (dev->cnxk_sso_ptp_tstamp_cb) + dev->cnxk_sso_ptp_tstamp_cb(eth_dev->data->port_id, + NIX_RX_OFFLOAD_TSTAMP_F, dev->ptp_en); } return 0; diff -Nru dpdk-22.11.6/drivers/net/cnxk/cnxk_ethdev.c dpdk-22.11.7/drivers/net/cnxk/cnxk_ethdev.c --- dpdk-22.11.6/drivers/net/cnxk/cnxk_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/cnxk/cnxk_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -1684,7 +1684,7 @@ else cnxk_eth_dev_ops.timesync_disable(eth_dev); - if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { + if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP || dev->ptp_en) { rc = rte_mbuf_dyn_rx_timestamp_register (&dev->tstamp.tstamp_dynfield_offset, &dev->tstamp.rx_tstamp_dynflag); diff -Nru dpdk-22.11.6/drivers/net/cnxk/cnxk_ethdev.h dpdk-22.11.7/drivers/net/cnxk/cnxk_ethdev.h --- dpdk-22.11.6/drivers/net/cnxk/cnxk_ethdev.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/cnxk/cnxk_ethdev.h 2024-12-13 14:35:22.000000000 +0000 @@ -443,6 +443,13 @@ /* Reassembly dynfield/flag offsets */ int reass_dynfield_off; int reass_dynflag_bit; + + /* SSO event dev */ + void *evdev_priv; + + /* SSO event dev ptp */ + void (*cnxk_sso_ptp_tstamp_cb) + (uint16_t port_id, uint16_t flags, bool ptp_en); }; struct cnxk_eth_rxq_sp { diff -Nru dpdk-22.11.6/drivers/net/cnxk/cnxk_ethdev_devargs.c dpdk-22.11.7/drivers/net/cnxk/cnxk_ethdev_devargs.c --- dpdk-22.11.6/drivers/net/cnxk/cnxk_ethdev_devargs.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/cnxk/cnxk_ethdev_devargs.c 2024-12-13 14:35:22.000000000 +0000 @@ -269,7 +269,7 @@ uint16_t custom_sa_act = 0; struct rte_kvargs *kvlist; uint16_t no_inl_dev = 0; - uint8_t lock_rx_ctx = 0; + uint16_t lock_rx_ctx = 0; memset(&sdp_chan, 0, sizeof(sdp_chan)); memset(&pre_l2_info, 0, sizeof(struct flow_pre_l2_size_info)); diff -Nru dpdk-22.11.6/drivers/net/dpaa/dpaa_ethdev.c dpdk-22.11.7/drivers/net/dpaa/dpaa_ethdev.c --- dpdk-22.11.6/drivers/net/dpaa/dpaa_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/dpaa/dpaa_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -971,7 +971,7 @@ struct fman_if *fif = dev->process_private; struct qman_fq *rxq = &dpaa_intf->rx_queues[queue_idx]; struct qm_mcc_initfq opts = {0}; - u32 flags = 0; + u32 ch_id, flags = 0; int ret; u32 buffsz = rte_pktmbuf_data_room_size(mp) - RTE_PKTMBUF_HEADROOM; uint32_t max_rx_pktlen; @@ -1095,7 +1095,9 @@ DPAA_IF_RX_CONTEXT_STASH; /*Create a channel and associate given queue with the channel*/ - qman_alloc_pool_range((u32 *)&rxq->ch_id, 1, 1, 0); + qman_alloc_pool_range(&ch_id, 1, 1, 0); + rxq->ch_id = (u16)ch_id; + opts.we_mask = opts.we_mask | QM_INITFQ_WE_DESTWQ; opts.fqd.dest.channel = rxq->ch_id; opts.fqd.dest.wq = DPAA_IF_RX_PRIORITY; diff -Nru dpdk-22.11.6/drivers/net/dpaa/dpaa_rxtx.c dpdk-22.11.7/drivers/net/dpaa/dpaa_rxtx.c --- dpdk-22.11.6/drivers/net/dpaa/dpaa_rxtx.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/dpaa/dpaa_rxtx.c 2024-12-13 14:35:22.000000000 +0000 @@ -1034,7 +1034,7 @@ /* Copy the data */ data = rte_pktmbuf_append(new_mbufs[0], bytes_to_copy); - rte_memcpy((uint8_t *)data, rte_pktmbuf_mtod_offset(mbuf, + rte_memcpy((uint8_t *)data, rte_pktmbuf_mtod_offset(temp_mbuf, void *, offset1), bytes_to_copy); /* Set new offsets and the temp buffers */ diff -Nru dpdk-22.11.6/drivers/net/dpaa2/dpaa2_ethdev.c dpdk-22.11.7/drivers/net/dpaa2/dpaa2_ethdev.c --- dpdk-22.11.6/drivers/net/dpaa2/dpaa2_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/dpaa2/dpaa2_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -1390,8 +1390,7 @@ for (i = 0; i < MAX_TCS; i++) rte_free((void *)(size_t)priv->extract.tc_extract_param[i]); - if (priv->extract.qos_extract_param) - rte_free((void *)(size_t)priv->extract.qos_extract_param); + rte_free((void *)(size_t)priv->extract.qos_extract_param); DPAA2_PMD_INFO("%s: netdev deleted", dev->data->name); return 0; diff -Nru dpdk-22.11.6/drivers/net/dpaa2/dpaa2_tm.c dpdk-22.11.7/drivers/net/dpaa2/dpaa2_tm.c --- dpdk-22.11.6/drivers/net/dpaa2/dpaa2_tm.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/dpaa2/dpaa2_tm.c 2024-12-13 14:35:22.000000000 +0000 @@ -684,6 +684,7 @@ struct dpaa2_tm_node *leaf_node, *temp_leaf_node, *channel_node; struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private; int ret, t; + bool conf_schedule = false; /* Populate TCs */ LIST_FOREACH(channel_node, &priv->nodes, next) { @@ -757,7 +758,7 @@ } LIST_FOREACH(channel_node, &priv->nodes, next) { - int wfq_grp = 0, is_wfq_grp = 0, conf[DPNI_MAX_TC]; + int wfq_grp = 0, is_wfq_grp = 0, conf[priv->nb_tx_queues]; struct dpni_tx_priorities_cfg prio_cfg; memset(&prio_cfg, 0, sizeof(prio_cfg)); @@ -767,6 +768,7 @@ if (channel_node->level_id != CHANNEL_LEVEL) continue; + conf_schedule = false; LIST_FOREACH(leaf_node, &priv->nodes, next) { struct dpaa2_queue *leaf_dpaa2_q; uint8_t leaf_tc_id; @@ -789,6 +791,7 @@ if (leaf_node->parent != channel_node) continue; + conf_schedule = true; leaf_dpaa2_q = (struct dpaa2_queue *)dev->data->tx_queues[leaf_node->id]; leaf_tc_id = leaf_dpaa2_q->tc_index; /* Process sibling leaf nodes */ @@ -829,8 +832,8 @@ goto out; } is_wfq_grp = 1; - conf[temp_leaf_node->id] = 1; } + conf[temp_leaf_node->id] = 1; } if (is_wfq_grp) { if (wfq_grp == 0) { @@ -851,6 +854,9 @@ } conf[leaf_node->id] = 1; } + if (!conf_schedule) + continue; + if (wfq_grp > 1) { prio_cfg.separate_groups = 1; if (prio_cfg.prio_group_B < prio_cfg.prio_group_A) { @@ -864,6 +870,16 @@ prio_cfg.prio_group_A = 1; prio_cfg.channel_idx = channel_node->channel_id; + DPAA2_PMD_DEBUG("########################################\n"); + DPAA2_PMD_DEBUG("Channel idx = %d\n", prio_cfg.channel_idx); + for (t = 0; t < DPNI_MAX_TC; t++) + DPAA2_PMD_DEBUG("tc = %d mode = %d, delta = %d\n", t, + prio_cfg.tc_sched[t].mode, + prio_cfg.tc_sched[t].delta_bandwidth); + + DPAA2_PMD_DEBUG("prioritya = %d, priorityb = %d, separate grps" + " = %d\n", prio_cfg.prio_group_A, + prio_cfg.prio_group_B, prio_cfg.separate_groups); ret = dpni_set_tx_priorities(dpni, 0, priv->token, &prio_cfg); if (ret) { ret = -rte_tm_error_set(error, EINVAL, @@ -871,15 +887,6 @@ "Scheduling Failed\n"); goto out; } - DPAA2_PMD_DEBUG("########################################\n"); - DPAA2_PMD_DEBUG("Channel idx = %d\n", prio_cfg.channel_idx); - for (t = 0; t < DPNI_MAX_TC; t++) { - DPAA2_PMD_DEBUG("tc = %d mode = %d ", t, prio_cfg.tc_sched[t].mode); - DPAA2_PMD_DEBUG("delta = %d\n", prio_cfg.tc_sched[t].delta_bandwidth); - } - DPAA2_PMD_DEBUG("prioritya = %d\n", prio_cfg.prio_group_A); - DPAA2_PMD_DEBUG("priorityb = %d\n", prio_cfg.prio_group_B); - DPAA2_PMD_DEBUG("separate grps = %d\n\n", prio_cfg.separate_groups); } return 0; diff -Nru dpdk-22.11.6/drivers/net/e1000/em_ethdev.c dpdk-22.11.7/drivers/net/e1000/em_ethdev.c --- dpdk-22.11.6/drivers/net/e1000/em_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/e1000/em_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -1121,6 +1121,9 @@ struct rte_eth_link link; int link_up, count; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -1; + link_up = 0; hw->mac.get_link_status = 1; diff -Nru dpdk-22.11.6/drivers/net/e1000/igb_ethdev.c dpdk-22.11.7/drivers/net/e1000/igb_ethdev.c --- dpdk-22.11.6/drivers/net/e1000/igb_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/e1000/igb_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -3857,11 +3857,11 @@ filter_info->twotuple_mask &= ~(1 << filter->index); TAILQ_REMOVE(&filter_info->twotuple_list, filter, entries); - rte_free(filter); E1000_WRITE_REG(hw, E1000_TTQF(filter->index), E1000_TTQF_DISABLE_MASK); E1000_WRITE_REG(hw, E1000_IMIR(filter->index), 0); E1000_WRITE_REG(hw, E1000_IMIREXT(filter->index), 0); + rte_free(filter); return 0; } @@ -4298,7 +4298,6 @@ filter_info->fivetuple_mask &= ~(1 << filter->index); TAILQ_REMOVE(&filter_info->fivetuple_list, filter, entries); - rte_free(filter); E1000_WRITE_REG(hw, E1000_FTQF(filter->index), E1000_FTQF_VF_BP | E1000_FTQF_MASK); @@ -4307,6 +4306,7 @@ E1000_WRITE_REG(hw, E1000_SPQF(filter->index), 0); E1000_WRITE_REG(hw, E1000_IMIR(filter->index), 0); E1000_WRITE_REG(hw, E1000_IMIREXT(filter->index), 0); + rte_free(filter); return 0; } diff -Nru dpdk-22.11.6/drivers/net/ena/base/ena_plat_dpdk.h dpdk-22.11.7/drivers/net/ena/base/ena_plat_dpdk.h --- dpdk-22.11.6/drivers/net/ena/base/ena_plat_dpdk.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ena/base/ena_plat_dpdk.h 2024-12-13 14:35:22.000000000 +0000 @@ -26,7 +26,6 @@ #include #include -#include typedef uint64_t u64; typedef uint32_t u32; @@ -67,14 +66,6 @@ #define ENA_UDELAY(x) rte_delay_us_block(x) #define ENA_TOUCH(x) ((void)(x)) -/* Redefine memcpy with caution: rte_memcpy can be simply aliased to memcpy, so - * make the redefinition only if it's safe (and beneficial) to do so. - */ -#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64_MEMCPY) || \ - defined(RTE_ARCH_ARM_NEON_MEMCPY) -#undef memcpy -#define memcpy rte_memcpy -#endif #define wmb rte_wmb #define rmb rte_rmb #define mb rte_mb diff -Nru dpdk-22.11.6/drivers/net/gve/base/gve_osdep.h dpdk-22.11.7/drivers/net/gve/base/gve_osdep.h --- dpdk-22.11.6/drivers/net/gve/base/gve_osdep.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/gve/base/gve_osdep.h 2024-12-13 14:35:22.000000000 +0000 @@ -24,18 +24,36 @@ #include "../gve_logs.h" -typedef uint8_t u8; -typedef uint16_t u16; -typedef uint32_t u32; -typedef uint64_t u64; - -typedef rte_be16_t __sum16; - -typedef rte_be16_t __be16; -typedef rte_be32_t __be32; -typedef rte_be64_t __be64; - -typedef rte_iova_t dma_addr_t; +#ifndef u8 +#define u8 uint8_t +#endif +#ifndef u16 +#define u16 uint16_t +#endif +#ifndef u32 +#define u32 uint32_t +#endif +#ifndef u64 +#define u64 uint64_t +#endif + +#ifndef __sum16 +#define __sum16 rte_be16_t +#endif + +#ifndef __be16 +#define __be16 rte_be16_t +#endif +#ifndef __be32 +#define __be32 rte_be32_t +#endif +#ifndef __be64 +#define __be64 rte_be64_t +#endif + +#ifndef dma_addr_t +#define dma_addr_t rte_iova_t +#endif #define ETH_MIN_MTU RTE_ETHER_MIN_MTU #define ETH_ALEN RTE_ETHER_ADDR_LEN diff -Nru dpdk-22.11.6/drivers/net/hns3/hns3_cmd.c dpdk-22.11.7/drivers/net/hns3/hns3_cmd.c --- dpdk-22.11.6/drivers/net/hns3/hns3_cmd.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/hns3/hns3_cmd.c 2024-12-13 14:35:22.000000000 +0000 @@ -539,9 +539,7 @@ if (device_id == HNS3_DEV_ID_25GE_RDMA || device_id == HNS3_DEV_ID_50GE_RDMA || device_id == HNS3_DEV_ID_100G_RDMA_MACSEC || - device_id == HNS3_DEV_ID_200G_RDMA || - device_id == HNS3_DEV_ID_100G_ROH || - device_id == HNS3_DEV_ID_200G_ROH) + device_id == HNS3_DEV_ID_200G_RDMA) hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_DCB_B, 1); } diff -Nru dpdk-22.11.6/drivers/net/hns3/hns3_ethdev.c dpdk-22.11.7/drivers/net/hns3/hns3_ethdev.c --- dpdk-22.11.6/drivers/net/hns3/hns3_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/hns3/hns3_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -6650,8 +6650,6 @@ { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_50GE_RDMA) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_100G_RDMA_MACSEC) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_200G_RDMA) }, - { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_100G_ROH) }, - { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_200G_ROH) }, { .vendor_id = 0, }, /* sentinel */ }; diff -Nru dpdk-22.11.6/drivers/net/hns3/hns3_ethdev.h dpdk-22.11.7/drivers/net/hns3/hns3_ethdev.h --- dpdk-22.11.6/drivers/net/hns3/hns3_ethdev.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/hns3/hns3_ethdev.h 2024-12-13 14:35:22.000000000 +0000 @@ -28,9 +28,7 @@ #define HNS3_DEV_ID_25GE_RDMA 0xA222 #define HNS3_DEV_ID_50GE_RDMA 0xA224 #define HNS3_DEV_ID_100G_RDMA_MACSEC 0xA226 -#define HNS3_DEV_ID_100G_ROH 0xA227 #define HNS3_DEV_ID_200G_RDMA 0xA228 -#define HNS3_DEV_ID_200G_ROH 0xA22C #define HNS3_DEV_ID_100G_VF 0xA22E #define HNS3_DEV_ID_100G_RDMA_PFC_VF 0xA22F diff -Nru dpdk-22.11.6/drivers/net/hns3/hns3_fdir.c dpdk-22.11.7/drivers/net/hns3/hns3_fdir.c --- dpdk-22.11.6/drivers/net/hns3/hns3_fdir.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/hns3/hns3_fdir.c 2024-12-13 14:35:22.000000000 +0000 @@ -832,6 +832,7 @@ .key_len = sizeof(struct hns3_fdir_key_conf), .hash_func = rte_hash_crc, .hash_func_init_val = 0, + .extra_flag = RTE_HASH_EXTRA_FLAGS_EXT_TABLE, }; int ret; diff -Nru dpdk-22.11.6/drivers/net/hns3/hns3_flow.c dpdk-22.11.7/drivers/net/hns3/hns3_flow.c --- dpdk-22.11.6/drivers/net/hns3/hns3_flow.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/hns3/hns3_flow.c 2024-12-13 14:35:22.000000000 +0000 @@ -283,7 +283,7 @@ cnt = hns3_counter_lookup(dev, id); if (cnt) { if (!cnt->indirect || cnt->indirect != indirect) - return rte_flow_error_set(error, ENOTSUP, + return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_CONF, cnt, "Counter id is used, indirect flag not match"); @@ -1182,6 +1182,11 @@ "Tunnel packets must configure " "with mask"); + if (rule->key_conf.spec.tunnel_type != 0) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, "Too many tunnel headers!"); + switch (item->type) { case RTE_FLOW_ITEM_TYPE_VXLAN: case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: diff -Nru dpdk-22.11.6/drivers/net/hns3/hns3_intr.c dpdk-22.11.7/drivers/net/hns3/hns3_intr.c --- dpdk-22.11.6/drivers/net/hns3/hns3_intr.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/hns3/hns3_intr.c 2024-12-13 14:35:22.000000000 +0000 @@ -2252,6 +2252,12 @@ sum_err_info = (struct hns3_sum_err_info *)&buf[offset++]; mod_num = sum_err_info->mod_num; reset_type = sum_err_info->reset_type; + + if (reset_type >= HNS3_MAX_RESET) { + hns3_err(hw, "invalid reset type = %u", reset_type); + return; + } + if (reset_type && reset_type != HNS3_NONE_RESET) hns3_atomic_set_bit(reset_type, &hw->reset.request); diff -Nru dpdk-22.11.6/drivers/net/hns3/hns3_regs.c dpdk-22.11.7/drivers/net/hns3/hns3_regs.c --- dpdk-22.11.6/drivers/net/hns3/hns3_regs.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/hns3/hns3_regs.c 2024-12-13 14:35:22.000000000 +0000 @@ -17,13 +17,9 @@ static int hns3_get_dfx_reg_line(struct hns3_hw *hw, uint32_t *lines); -static const uint32_t cmdq_reg_addrs[] = {HNS3_CMDQ_TX_ADDR_L_REG, - HNS3_CMDQ_TX_ADDR_H_REG, - HNS3_CMDQ_TX_DEPTH_REG, +static const uint32_t cmdq_reg_addrs[] = {HNS3_CMDQ_TX_DEPTH_REG, HNS3_CMDQ_TX_TAIL_REG, HNS3_CMDQ_TX_HEAD_REG, - HNS3_CMDQ_RX_ADDR_L_REG, - HNS3_CMDQ_RX_ADDR_H_REG, HNS3_CMDQ_RX_DEPTH_REG, HNS3_CMDQ_RX_TAIL_REG, HNS3_CMDQ_RX_HEAD_REG, @@ -44,9 +40,7 @@ HNS3_FUN_RST_ING, HNS3_GRO_EN_REG}; -static const uint32_t ring_reg_addrs[] = {HNS3_RING_RX_BASEADDR_L_REG, - HNS3_RING_RX_BASEADDR_H_REG, - HNS3_RING_RX_BD_NUM_REG, +static const uint32_t ring_reg_addrs[] = {HNS3_RING_RX_BD_NUM_REG, HNS3_RING_RX_BD_LEN_REG, HNS3_RING_RX_EN_REG, HNS3_RING_RX_MERGE_EN_REG, @@ -57,8 +51,6 @@ HNS3_RING_RX_FBD_OFFSET_REG, HNS3_RING_RX_STASH_REG, HNS3_RING_RX_BD_ERR_REG, - HNS3_RING_TX_BASEADDR_L_REG, - HNS3_RING_TX_BASEADDR_H_REG, HNS3_RING_TX_BD_NUM_REG, HNS3_RING_TX_EN_REG, HNS3_RING_TX_PRIORITY_REG, @@ -135,7 +127,7 @@ tqp_intr_lines = sizeof(tqp_intr_reg_addrs) / REG_LEN_PER_LINE + 1; len = (cmdq_lines + common_lines + ring_lines * hw->tqps_num + - tqp_intr_lines * hw->num_msi) * REG_NUM_PER_LINE; + tqp_intr_lines * hw->intr_tqps_num) * REG_NUM_PER_LINE; if (!hns->is_vf) { ret = hns3_get_regs_num(hw, ®s_num_32_bit, ®s_num_64_bit); diff -Nru dpdk-22.11.6/drivers/net/hns3/hns3_rxtx.c dpdk-22.11.7/drivers/net/hns3/hns3_rxtx.c --- dpdk-22.11.6/drivers/net/hns3/hns3_rxtx.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/hns3/hns3_rxtx.c 2024-12-13 14:35:22.000000000 +0000 @@ -51,7 +51,7 @@ } } for (i = 0; i < rxq->rx_rearm_nb; i++) - rxq->sw_ring[rxq->rx_rearm_start + i].mbuf = NULL; + rxq->sw_ring[(rxq->rx_rearm_start + i) % rxq->nb_rx_desc].mbuf = NULL; } for (i = 0; i < rxq->bulk_mbuf_num; i++) diff -Nru dpdk-22.11.6/drivers/net/hns3/hns3_rxtx_vec.c dpdk-22.11.7/drivers/net/hns3/hns3_rxtx_vec.c --- dpdk-22.11.6/drivers/net/hns3/hns3_rxtx_vec.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/hns3/hns3_rxtx_vec.c 2024-12-13 14:35:22.000000000 +0000 @@ -66,6 +66,11 @@ if (unlikely(rte_mempool_get_bulk(rxq->mb_pool, (void *)rxep, HNS3_DEFAULT_RXQ_REARM_THRESH) < 0)) { + /* + * Clear VLD bit for the first descriptor rearmed in case + * of going to receive packets later. + */ + rxdp[0].rx.bd_base_info = 0; rte_eth_devices[rxq->port_id].data->rx_mbuf_alloc_failed++; return; } diff -Nru dpdk-22.11.6/drivers/net/hns3/hns3_rxtx_vec_sve.c dpdk-22.11.7/drivers/net/hns3/hns3_rxtx_vec_sve.c --- dpdk-22.11.6/drivers/net/hns3/hns3_rxtx_vec_sve.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/hns3/hns3_rxtx_vec_sve.c 2024-12-13 14:35:22.000000000 +0000 @@ -248,6 +248,11 @@ if (unlikely(rte_mempool_get_bulk(rxq->mb_pool, (void *)rxep, HNS3_DEFAULT_RXQ_REARM_THRESH) < 0)) { + /* + * Clear VLD bit for the first descriptor rearmed in case + * of going to receive packets later. + */ + rxdp[0].rx.bd_base_info = 0; rte_eth_devices[rxq->port_id].data->rx_mbuf_alloc_failed++; return; } diff -Nru dpdk-22.11.6/drivers/net/i40e/base/i40e_adminq.c dpdk-22.11.7/drivers/net/i40e/base/i40e_adminq.c --- dpdk-22.11.6/drivers/net/i40e/base/i40e_adminq.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/i40e/base/i40e_adminq.c 2024-12-13 14:35:22.000000000 +0000 @@ -791,12 +791,26 @@ u16 ntc = asq->next_to_clean; struct i40e_aq_desc desc_cb; struct i40e_aq_desc *desc; + u32 head = 0; + + if (ntc >= (1 << 10)) + goto clean_asq_exit; desc = I40E_ADMINQ_DESC(*asq, ntc); details = I40E_ADMINQ_DETAILS(*asq, ntc); - while (rd32(hw, hw->aq.asq.head) != ntc) { + while (true) { + head = rd32(hw, hw->aq.asq.head); + + if (head >= asq->count) { + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "Read head value is improper\n"); + return 0; + } + + if (head == ntc) + break; + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, - "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head)); + "ntc %d head %d.\n", ntc, head); if (details->callback) { I40E_ADMINQ_CALLBACK cb_func = @@ -816,6 +830,7 @@ asq->next_to_clean = ntc; +clean_asq_exit: return I40E_DESC_UNUSED(asq); } diff -Nru dpdk-22.11.6/drivers/net/i40e/base/i40e_common.c dpdk-22.11.7/drivers/net/i40e/base/i40e_common.c --- dpdk-22.11.6/drivers/net/i40e/base/i40e_common.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/i40e/base/i40e_common.c 2024-12-13 14:35:22.000000000 +0000 @@ -1017,9 +1017,6 @@ else hw->pf_id = (u8)(func_rid & 0x7); - if (hw->mac.type == I40E_MAC_X722) - hw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE | - I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; /* NVMUpdate features structure initialization */ hw->nvmupd_features.major = I40E_NVMUPD_FEATURES_API_VER_MAJOR; hw->nvmupd_features.minor = I40E_NVMUPD_FEATURES_API_VER_MINOR; @@ -1588,7 +1585,6 @@ **/ u32 i40e_led_get(struct i40e_hw *hw) { - u32 current_mode = 0; u32 mode = 0; int i; @@ -1601,21 +1597,6 @@ if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } - mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT; break; @@ -1635,7 +1616,6 @@ **/ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) { - u32 current_mode = 0; int i; if (mode & ~I40E_LED_MODE_VALID) { @@ -1652,21 +1632,6 @@ if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } - if (I40E_IS_X710TL_DEVICE(hw->device_id)) { u32 pin_func = 0; @@ -4261,8 +4226,8 @@ /* use AQ read to get the physical register offset instead * of the port relative offset */ - i40e_aq_debug_read_register(hw, port_cfg_reg, &port_cfg, NULL); - if (!(port_cfg & I40E_PRTGEN_CNF_PORT_DIS_MASK)) + status = i40e_aq_debug_read_register(hw, port_cfg_reg, &port_cfg, NULL); + if ((status == I40E_SUCCESS) && (!(port_cfg & I40E_PRTGEN_CNF_PORT_DIS_MASK))) hw->num_ports++; } @@ -8198,7 +8163,8 @@ u32 sec_off; u32 i; - if (track_id == I40E_DDP_TRACKID_INVALID) { + if (track_id == I40E_DDP_TRACKID_INVALID || + track_id == I40E_DDP_TRACKID_RDONLY) { i40e_debug(hw, I40E_DEBUG_PACKAGE, "Invalid track_id\n"); return I40E_NOT_SUPPORTED; } diff -Nru dpdk-22.11.6/drivers/net/i40e/base/i40e_diag.c dpdk-22.11.7/drivers/net/i40e/base/i40e_diag.c --- dpdk-22.11.6/drivers/net/i40e/base/i40e_diag.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/i40e/base/i40e_diag.c 2024-12-13 14:35:22.000000000 +0000 @@ -55,7 +55,7 @@ return I40E_SUCCESS; } -static struct i40e_diag_reg_test_info i40e_reg_list[] = { +static const struct i40e_diag_reg_test_info i40e_reg_list[] = { /* offset mask elements stride */ {I40E_QTX_CTL(0), 0x0000FFBF, 1, I40E_QTX_CTL(1) - I40E_QTX_CTL(0)}, {I40E_PFINT_ITR0(0), 0x00000FFF, 3, I40E_PFINT_ITR0(1) - I40E_PFINT_ITR0(0)}, @@ -81,28 +81,28 @@ { enum i40e_status_code ret_code = I40E_SUCCESS; u32 reg, mask; + u32 elements; u32 i, j; for (i = 0; i40e_reg_list[i].offset != 0 && ret_code == I40E_SUCCESS; i++) { + elements = i40e_reg_list[i].elements; /* set actual reg range for dynamically allocated resources */ if (i40e_reg_list[i].offset == I40E_QTX_CTL(0) && hw->func_caps.num_tx_qp != 0) - i40e_reg_list[i].elements = hw->func_caps.num_tx_qp; + elements = hw->func_caps.num_tx_qp; if ((i40e_reg_list[i].offset == I40E_PFINT_ITRN(0, 0) || i40e_reg_list[i].offset == I40E_PFINT_ITRN(1, 0) || i40e_reg_list[i].offset == I40E_PFINT_ITRN(2, 0) || i40e_reg_list[i].offset == I40E_QINT_TQCTL(0) || i40e_reg_list[i].offset == I40E_QINT_RQCTL(0)) && hw->func_caps.num_msix_vectors != 0) - i40e_reg_list[i].elements = - hw->func_caps.num_msix_vectors - 1; + elements = hw->func_caps.num_msix_vectors - 1; /* test register access */ mask = i40e_reg_list[i].mask; - for (j = 0; j < i40e_reg_list[i].elements && - ret_code == I40E_SUCCESS; j++) { + for (j = 0; j < elements && ret_code == I40E_SUCCESS; j++) { reg = i40e_reg_list[i].offset + (j * i40e_reg_list[i].stride); ret_code = i40e_diag_reg_pattern_test(hw, reg, mask); diff -Nru dpdk-22.11.6/drivers/net/i40e/base/i40e_nvm.c dpdk-22.11.7/drivers/net/i40e/base/i40e_nvm.c --- dpdk-22.11.6/drivers/net/i40e/base/i40e_nvm.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/i40e/base/i40e_nvm.c 2024-12-13 14:35:22.000000000 +0000 @@ -223,11 +223,11 @@ * @hw: pointer to the HW structure. * @module_pointer: module pointer location in words from the NVM beginning * @offset: offset in words from module start - * @words: number of words to write - * @data: buffer with words to write to the Shadow RAM + * @words: number of words to read + * @data: buffer with words to read from the Shadow RAM * @last_command: tells the AdminQ that this is the last command * - * Writes a 16 bit words buffer to the Shadow RAM using the admin command. + * Reads a 16 bit words buffer to the Shadow RAM using the admin command. **/ STATIC enum i40e_status_code i40e_read_nvm_aq(struct i40e_hw *hw, u8 module_pointer, u32 offset, @@ -249,18 +249,18 @@ */ if ((offset + words) > hw->nvm.sr_size) i40e_debug(hw, I40E_DEBUG_NVM, - "NVM write error: offset %d beyond Shadow RAM limit %d\n", + "NVM read error: offset %d beyond Shadow RAM limit %d\n", (offset + words), hw->nvm.sr_size); else if (words > I40E_SR_SECTOR_SIZE_IN_WORDS) - /* We can write only up to 4KB (one sector), in one AQ write */ + /* We can read only up to 4KB (one sector), in one AQ read */ i40e_debug(hw, I40E_DEBUG_NVM, - "NVM write fail error: tried to write %d words, limit is %d.\n", + "NVM read fail error: tried to read %d words, limit is %d.\n", words, I40E_SR_SECTOR_SIZE_IN_WORDS); else if (((offset + (words - 1)) / I40E_SR_SECTOR_SIZE_IN_WORDS) != (offset / I40E_SR_SECTOR_SIZE_IN_WORDS)) - /* A single write cannot spread over two sectors */ + /* A single read cannot spread over two sectors */ i40e_debug(hw, I40E_DEBUG_NVM, - "NVM write error: cannot spread over two sectors in a single write offset=%d words=%d\n", + "NVM read error: cannot spread over two sectors in a single read offset=%d words=%d\n", offset, words); else ret_code = i40e_aq_read_nvm(hw, module_pointer, diff -Nru dpdk-22.11.6/drivers/net/i40e/i40e_flow.c dpdk-22.11.7/drivers/net/i40e/i40e_flow.c --- dpdk-22.11.6/drivers/net/i40e/i40e_flow.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/i40e/i40e_flow.c 2024-12-13 14:35:22.000000000 +0000 @@ -1263,27 +1263,31 @@ return 0; } -static uint16_t -i40e_get_outer_vlan(struct rte_eth_dev *dev) +static int +i40e_get_outer_vlan(struct rte_eth_dev *dev, uint16_t *tpid) { struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); int qinq = dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_VLAN_EXTEND; uint64_t reg_r = 0; uint16_t reg_id; - uint16_t tpid; + int ret; if (qinq) reg_id = 2; else reg_id = 3; - i40e_aq_debug_read_register(hw, I40E_GL_SWT_L2TAGCTRL(reg_id), + ret = i40e_aq_debug_read_register(hw, I40E_GL_SWT_L2TAGCTRL(reg_id), ®_r, NULL); + if (ret != I40E_SUCCESS) { + PMD_DRV_LOG(ERR, "Failed to read from L2 tag ctrl register [%d]", reg_id); + return -EIO; + } - tpid = (reg_r >> I40E_GL_SWT_L2TAGCTRL_ETHERTYPE_SHIFT) & 0xFFFF; + *tpid = (reg_r >> I40E_GL_SWT_L2TAGCTRL_ETHERTYPE_SHIFT) & 0xFFFF; - return tpid; + return 0; } /* 1. Last in item should be NULL as range is not supported. @@ -1303,6 +1307,8 @@ const struct rte_flow_item_eth *eth_spec; const struct rte_flow_item_eth *eth_mask; enum rte_flow_item_type item_type; + int ret; + uint16_t tpid; for (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) { if (item->last) { @@ -1361,8 +1367,23 @@ if (filter->ether_type == RTE_ETHER_TYPE_IPV4 || filter->ether_type == RTE_ETHER_TYPE_IPV6 || - filter->ether_type == RTE_ETHER_TYPE_LLDP || - filter->ether_type == i40e_get_outer_vlan(dev)) { + filter->ether_type == RTE_ETHER_TYPE_LLDP) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Unsupported ether_type in control packet filter."); + return -rte_errno; + } + + ret = i40e_get_outer_vlan(dev, &tpid); + if (ret != 0) { + rte_flow_error_set(error, EIO, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Can not get the Ethertype identifying the L2 tag"); + return -rte_errno; + } + if (filter->ether_type == tpid) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, @@ -1370,6 +1391,7 @@ " control packet filter."); return -rte_errno; } + break; default: break; @@ -1641,6 +1663,7 @@ bool outer_ip = true; uint8_t field_idx; int ret; + uint16_t tpid; memset(off_arr, 0, sizeof(off_arr)); memset(len_arr, 0, sizeof(len_arr)); @@ -1709,14 +1732,29 @@ ether_type = rte_be_to_cpu_16(eth_spec->type); if (ether_type == RTE_ETHER_TYPE_IPV4 || - ether_type == RTE_ETHER_TYPE_IPV6 || - ether_type == i40e_get_outer_vlan(dev)) { + ether_type == RTE_ETHER_TYPE_IPV6) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, "Unsupported ether_type."); return -rte_errno; } + ret = i40e_get_outer_vlan(dev, &tpid); + if (ret != 0) { + rte_flow_error_set(error, EIO, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Can not get the Ethertype identifying the L2 tag"); + return -rte_errno; + } + if (ether_type == tpid) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Unsupported ether_type."); + return -rte_errno; + } + input_set |= I40E_INSET_LAST_ETHER_TYPE; filter->input.flow.l2_flow.ether_type = eth_spec->type; @@ -1763,14 +1801,29 @@ rte_be_to_cpu_16(vlan_spec->inner_type); if (ether_type == RTE_ETHER_TYPE_IPV4 || - ether_type == RTE_ETHER_TYPE_IPV6 || - ether_type == i40e_get_outer_vlan(dev)) { + ether_type == RTE_ETHER_TYPE_IPV6) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, "Unsupported inner_type."); return -rte_errno; } + ret = i40e_get_outer_vlan(dev, &tpid); + if (ret != 0) { + rte_flow_error_set(error, EIO, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Can not get the Ethertype identifying the L2 tag"); + return -rte_errno; + } + if (ether_type == tpid) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Unsupported ether_type."); + return -rte_errno; + } + input_set |= I40E_INSET_LAST_ETHER_TYPE; filter->input.flow.l2_flow.ether_type = vlan_spec->inner_type; diff -Nru dpdk-22.11.6/drivers/net/i40e/i40e_rxtx_vec_avx512.c dpdk-22.11.7/drivers/net/i40e/i40e_rxtx_vec_avx512.c --- dpdk-22.11.6/drivers/net/i40e/i40e_rxtx_vec_avx512.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/i40e/i40e_rxtx_vec_avx512.c 2024-12-13 14:35:22.000000000 +0000 @@ -922,6 +922,7 @@ uint32_t copied = 0; /* n is multiple of 32 */ while (copied < n) { +#ifdef RTE_ARCH_64 const __m512i a = _mm512_load_si512(&txep[copied]); const __m512i b = _mm512_load_si512(&txep[copied + 8]); const __m512i c = _mm512_load_si512(&txep[copied + 16]); @@ -931,6 +932,12 @@ _mm512_storeu_si512(&cache_objs[copied + 8], b); _mm512_storeu_si512(&cache_objs[copied + 16], c); _mm512_storeu_si512(&cache_objs[copied + 24], d); +#else + const __m512i a = _mm512_load_si512(&txep[copied]); + const __m512i b = _mm512_load_si512(&txep[copied + 16]); + _mm512_storeu_si512(&cache_objs[copied], a); + _mm512_storeu_si512(&cache_objs[copied + 16], b); +#endif copied += 32; } cache->len += n; diff -Nru dpdk-22.11.6/drivers/net/iavf/iavf_ethdev.c dpdk-22.11.7/drivers/net/iavf/iavf_ethdev.c --- dpdk-22.11.6/drivers/net/iavf/iavf_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/iavf/iavf_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -1012,7 +1012,7 @@ if (iavf_configure_queues(adapter, IAVF_CFG_Q_NUM_PER_BUF, index) != 0) { PMD_DRV_LOG(ERR, "configure queues failed"); - goto err_queue; + goto error; } num_queue_pairs -= IAVF_CFG_Q_NUM_PER_BUF; index += IAVF_CFG_Q_NUM_PER_BUF; @@ -1020,12 +1020,12 @@ if (iavf_configure_queues(adapter, num_queue_pairs, index) != 0) { PMD_DRV_LOG(ERR, "configure queues failed"); - goto err_queue; + goto error; } if (iavf_config_rx_queues_irqs(dev, intr_handle) != 0) { PMD_DRV_LOG(ERR, "configure irq failed"); - goto err_queue; + goto error; } /* re-enable intr again, because efd assign may change */ if (dev->data->dev_conf.intr_conf.rxq != 0) { @@ -1045,14 +1045,12 @@ if (iavf_start_queues(dev) != 0) { PMD_DRV_LOG(ERR, "enable queues failed"); - goto err_mac; + goto error; } return 0; -err_mac: - iavf_add_del_all_mac_addr(adapter, false); -err_queue: +error: return -1; } @@ -1084,13 +1082,6 @@ /* Rx interrupt vector mapping free */ rte_intr_vec_list_free(intr_handle); - /* remove all mac addrs */ - iavf_add_del_all_mac_addr(adapter, false); - - /* remove all multicast addresses */ - iavf_add_del_mc_addr_list(adapter, vf->mc_addrs, vf->mc_addrs_num, - false); - iavf_stop_queues(dev); adapter->stopped = 1; diff -Nru dpdk-22.11.6/drivers/net/iavf/iavf_rxtx.c dpdk-22.11.7/drivers/net/iavf/iavf_rxtx.c --- dpdk-22.11.6/drivers/net/iavf/iavf_rxtx.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/iavf/iavf_rxtx.c 2024-12-13 14:35:22.000000000 +0000 @@ -3005,7 +3005,11 @@ return i; } - if (m->pkt_len < IAVF_TX_MIN_PKT_LEN) { + /* valid packets are greater than min size, and single-buffer pkts + * must have data_len == pkt_len + */ + if (m->pkt_len < IAVF_TX_MIN_PKT_LEN || + (m->nb_segs == 1 && m->data_len != m->pkt_len)) { rte_errno = EINVAL; return i; } diff -Nru dpdk-22.11.6/drivers/net/iavf/iavf_rxtx_vec_avx512.c dpdk-22.11.7/drivers/net/iavf/iavf_rxtx_vec_avx512.c --- dpdk-22.11.6/drivers/net/iavf/iavf_rxtx_vec_avx512.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/iavf/iavf_rxtx_vec_avx512.c 2024-12-13 14:35:22.000000000 +0000 @@ -1818,6 +1818,7 @@ uint32_t copied = 0; /* n is multiple of 32 */ while (copied < n) { +#ifdef RTE_ARCH_64 const __m512i a = _mm512_loadu_si512(&txep[copied]); const __m512i b = _mm512_loadu_si512(&txep[copied + 8]); const __m512i c = _mm512_loadu_si512(&txep[copied + 16]); @@ -1827,6 +1828,12 @@ _mm512_storeu_si512(&cache_objs[copied + 8], b); _mm512_storeu_si512(&cache_objs[copied + 16], c); _mm512_storeu_si512(&cache_objs[copied + 24], d); +#else + const __m512i a = _mm512_loadu_si512(&txep[copied]); + const __m512i b = _mm512_loadu_si512(&txep[copied + 16]); + _mm512_storeu_si512(&cache_objs[copied], a); + _mm512_storeu_si512(&cache_objs[copied + 16], b); +#endif copied += 32; } cache->len += n; diff -Nru dpdk-22.11.6/drivers/net/iavf/iavf_vchnl.c dpdk-22.11.7/drivers/net/iavf/iavf_vchnl.c --- dpdk-22.11.6/drivers/net/iavf/iavf_vchnl.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/iavf/iavf_vchnl.c 2024-12-13 14:35:22.000000000 +0000 @@ -246,8 +246,8 @@ case VIRTCHNL_EVENT_LINK_CHANGE: vf->link_up = vpe->event_data.link_event.link_status; - if (vf->vf_res->vf_cap_flags & - VIRTCHNL_VF_CAP_ADV_LINK_SPEED) { + if (vf->vf_res != NULL && + vf->vf_res->vf_cap_flags & VIRTCHNL_VF_CAP_ADV_LINK_SPEED) { vf->link_speed = vpe->event_data.link_event_adv.link_speed; } else { @@ -696,6 +696,7 @@ VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF | VIRTCHNL_VF_OFFLOAD_FSUB_PF | VIRTCHNL_VF_OFFLOAD_REQ_QUEUES | + VIRTCHNL_VF_OFFLOAD_USO | VIRTCHNL_VF_OFFLOAD_CRC | VIRTCHNL_VF_OFFLOAD_VLAN_V2 | VIRTCHNL_VF_LARGE_NUM_QPAIRS | diff -Nru dpdk-22.11.6/drivers/net/ice/base/ice_adminq_cmd.h dpdk-22.11.7/drivers/net/ice/base/ice_adminq_cmd.h --- dpdk-22.11.6/drivers/net/ice/base/ice_adminq_cmd.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ice/base/ice_adminq_cmd.h 2024-12-13 14:35:22.000000000 +0000 @@ -1621,7 +1621,7 @@ #define ICE_AQ_LINK_PWR_QSFP_CLASS_3 2 #define ICE_AQ_LINK_PWR_QSFP_CLASS_4 3 __le16 link_speed; -#define ICE_AQ_LINK_SPEED_M 0x7FF +#define ICE_AQ_LINK_SPEED_M 0xFFF #define ICE_AQ_LINK_SPEED_10MB BIT(0) #define ICE_AQ_LINK_SPEED_100MB BIT(1) #define ICE_AQ_LINK_SPEED_1000MB BIT(2) diff -Nru dpdk-22.11.6/drivers/net/ice/base/ice_controlq.c dpdk-22.11.7/drivers/net/ice/base/ice_controlq.c --- dpdk-22.11.6/drivers/net/ice/base/ice_controlq.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ice/base/ice_controlq.c 2024-12-13 14:35:22.000000000 +0000 @@ -846,12 +846,23 @@ u16 ntc = sq->next_to_clean; struct ice_sq_cd *details; struct ice_aq_desc *desc; + u32 head; desc = ICE_CTL_Q_DESC(*sq, ntc); details = ICE_CTL_Q_DETAILS(*sq, ntc); - while (rd32(hw, cq->sq.head) != ntc) { - ice_debug(hw, ICE_DBG_AQ_MSG, "ntc %d head %d.\n", ntc, rd32(hw, cq->sq.head)); + head = rd32(hw, sq->head); + if (head >= sq->count) { + ice_debug(hw, ICE_DBG_AQ_MSG, + "Read head value (%d) exceeds allowed range.\n", + head); + return 0; + } + + while (head != ntc) { + ice_debug(hw, ICE_DBG_AQ_MSG, + "ntc %d head %d.\n", + ntc, head); ice_memset(desc, 0, sizeof(*desc), ICE_DMA_MEM); ice_memset(details, 0, sizeof(*details), ICE_NONDMA_MEM); ntc++; @@ -859,6 +870,14 @@ ntc = 0; desc = ICE_CTL_Q_DESC(*sq, ntc); details = ICE_CTL_Q_DETAILS(*sq, ntc); + + head = rd32(hw, sq->head); + if (head >= sq->count) { + ice_debug(hw, ICE_DBG_AQ_MSG, + "Read head value (%d) exceeds allowed range.\n", + head); + return 0; + } } sq->next_to_clean = ntc; diff -Nru dpdk-22.11.6/drivers/net/ice/base/ice_nvm.c dpdk-22.11.7/drivers/net/ice/base/ice_nvm.c --- dpdk-22.11.6/drivers/net/ice/base/ice_nvm.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ice/base/ice_nvm.c 2024-12-13 14:35:22.000000000 +0000 @@ -471,6 +471,8 @@ return status; } +#define check_add_overflow __builtin_add_overflow + /** * ice_get_pfa_module_tlv - Reads sub module TLV from NVM PFA * @hw: pointer to hardware structure @@ -487,8 +489,7 @@ u16 module_type) { enum ice_status status; - u16 pfa_len, pfa_ptr; - u32 next_tlv; + u16 pfa_len, pfa_ptr, next_tlv, max_tlv; status = ice_read_sr_word(hw, ICE_SR_PFA_PTR, &pfa_ptr); if (status != ICE_SUCCESS) { @@ -500,11 +501,23 @@ ice_debug(hw, ICE_DBG_INIT, "Failed to read PFA length.\n"); return status; } - /* Starting with first TLV after PFA length, iterate through the list + + if (check_add_overflow(pfa_ptr, (u16)(pfa_len - 1), &max_tlv)) { + ice_debug(hw, ICE_DBG_INIT, "PFA starts at offset %u. PFA length of %u caused 16-bit arithmetic overflow.\n", + pfa_ptr, pfa_len); + return ICE_ERR_INVAL_SIZE; + } + + /* The Preserved Fields Area contains a sequence of TLVs which define + * its contents. The PFA length includes all of the TLVs, plus its + * initial length word itself, *and* one final word at the end of all + * of the TLVs. + * + * Starting with first TLV after PFA length, iterate through the list * of TLVs to find the requested one. */ next_tlv = pfa_ptr + 1; - while (next_tlv < ((u32)pfa_ptr + pfa_len)) { + while (next_tlv < max_tlv) { u16 tlv_sub_module_type; u16 tlv_len; @@ -521,10 +534,6 @@ ice_debug(hw, ICE_DBG_INIT, "Failed to read TLV length.\n"); break; } - if (tlv_len > pfa_len) { - ice_debug(hw, ICE_DBG_INIT, "Invalid TLV length.\n"); - return ICE_ERR_INVAL_SIZE; - } if (tlv_sub_module_type == module_type) { if (tlv_len) { *module_tlv = (u16)next_tlv; @@ -533,10 +542,13 @@ } return ICE_ERR_INVAL_SIZE; } - /* Check next TLV, i.e. current TLV pointer + length + 2 words - * (for current TLV's type and length) - */ - next_tlv = next_tlv + tlv_len + 2; + + if (check_add_overflow(next_tlv, (u16)2, &next_tlv) || + check_add_overflow(next_tlv, tlv_len, &next_tlv)) { + ice_debug(hw, ICE_DBG_INIT, "TLV of type %u and length 0x%04x caused 16-bit arithmetic overflow. The PFA starts at 0x%04x and has length of 0x%04x\n", + tlv_sub_module_type, tlv_len, pfa_ptr, pfa_len); + return ICE_ERR_INVAL_SIZE; + } } /* Module does not exist */ return ICE_ERR_DOES_NOT_EXIST; diff -Nru dpdk-22.11.6/drivers/net/ice/base/ice_switch.c dpdk-22.11.7/drivers/net/ice/base/ice_switch.c --- dpdk-22.11.6/drivers/net/ice/base/ice_switch.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ice/base/ice_switch.c 2024-12-13 14:35:22.000000000 +0000 @@ -9473,8 +9473,6 @@ if (!itr->vsi_list_info || !ice_is_bit_set(itr->vsi_list_info->vsi_map, vsi_handle)) continue; - /* Clearing it so that the logic can add it back */ - ice_clear_bit(vsi_handle, itr->vsi_list_info->vsi_map); f_entry.fltr_info.vsi_handle = vsi_handle; f_entry.fltr_info.fltr_act = ICE_FWD_TO_VSI; /* update the src in case it is VSI num */ diff -Nru dpdk-22.11.6/drivers/net/ice/ice_rxtx.c dpdk-22.11.7/drivers/net/ice/ice_rxtx.c --- dpdk-22.11.6/drivers/net/ice/ice_rxtx.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ice/ice_rxtx.c 2024-12-13 14:35:22.000000000 +0000 @@ -1122,6 +1122,10 @@ tx_queue_id); return -EINVAL; } + if (txq->qtx_tail == NULL) { + PMD_DRV_LOG(INFO, "TX queue %u not started", tx_queue_id); + return 0; + } vsi = txq->vsi; q_ids[0] = txq->reg_idx; @@ -1136,6 +1140,7 @@ } txq->tx_rel_mbufs(txq); + txq->qtx_tail = NULL; return 0; } diff -Nru dpdk-22.11.6/drivers/net/ice/ice_rxtx_vec_avx512.c dpdk-22.11.7/drivers/net/ice/ice_rxtx_vec_avx512.c --- dpdk-22.11.6/drivers/net/ice/ice_rxtx_vec_avx512.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ice/ice_rxtx_vec_avx512.c 2024-12-13 14:35:22.000000000 +0000 @@ -1020,6 +1020,7 @@ uint32_t copied = 0; /* n is multiple of 32 */ while (copied < n) { +#ifdef RTE_ARCH_64 const __m512i a = _mm512_loadu_si512(&txep[copied]); const __m512i b = _mm512_loadu_si512(&txep[copied + 8]); const __m512i c = _mm512_loadu_si512(&txep[copied + 16]); @@ -1029,6 +1030,12 @@ _mm512_storeu_si512(&cache_objs[copied + 8], b); _mm512_storeu_si512(&cache_objs[copied + 16], c); _mm512_storeu_si512(&cache_objs[copied + 24], d); +#else + const __m512i a = _mm512_loadu_si512(&txep[copied]); + const __m512i b = _mm512_loadu_si512(&txep[copied + 16]); + _mm512_storeu_si512(&cache_objs[copied], a); + _mm512_storeu_si512(&cache_objs[copied + 16], b); +#endif copied += 32; } cache->len += n; diff -Nru dpdk-22.11.6/drivers/net/idpf/idpf_ethdev.c dpdk-22.11.7/drivers/net/idpf/idpf_ethdev.c --- dpdk-22.11.6/drivers/net/idpf/idpf_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/idpf/idpf_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -895,8 +895,7 @@ if (ret != 0) return ret; - LIST_FOR_EACH_ENTRY_SAFE(ctlq, NULL, &hw->cq_list_head, - struct idpf_ctlq_info, cq_list) { + LIST_FOR_EACH_ENTRY(ctlq, &hw->cq_list_head, struct idpf_ctlq_info, cq_list) { if (ctlq->q_id == IDPF_CTLQ_ID && ctlq->cq_type == IDPF_CTLQ_TYPE_MAILBOX_TX) hw->asq = ctlq; diff -Nru dpdk-22.11.6/drivers/net/idpf/idpf_rxtx_vec_avx512.c dpdk-22.11.7/drivers/net/idpf/idpf_rxtx_vec_avx512.c --- dpdk-22.11.6/drivers/net/idpf/idpf_rxtx_vec_avx512.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/idpf/idpf_rxtx_vec_avx512.c 2024-12-13 14:35:22.000000000 +0000 @@ -587,6 +587,7 @@ uint32_t copied = 0; /* n is multiple of 32 */ while (copied < n) { +#ifdef RTE_ARCH_64 const __m512i a = _mm512_loadu_si512(&txep[copied]); const __m512i b = _mm512_loadu_si512(&txep[copied + 8]); const __m512i c = _mm512_loadu_si512(&txep[copied + 16]); @@ -596,6 +597,12 @@ _mm512_storeu_si512(&cache_objs[copied + 8], b); _mm512_storeu_si512(&cache_objs[copied + 16], c); _mm512_storeu_si512(&cache_objs[copied + 24], d); +#else + const __m512i a = _mm512_loadu_si512(&txep[copied]); + const __m512i b = _mm512_loadu_si512(&txep[copied + 16]); + _mm512_storeu_si512(&cache_objs[copied], a); + _mm512_storeu_si512(&cache_objs[copied + 16], b); +#endif copied += 32; } cache->len += n; diff -Nru dpdk-22.11.6/drivers/net/ionic/ionic_osdep.h dpdk-22.11.7/drivers/net/ionic/ionic_osdep.h --- dpdk-22.11.6/drivers/net/ionic/ionic_osdep.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ionic/ionic_osdep.h 2024-12-13 14:35:22.000000000 +0000 @@ -30,14 +30,28 @@ #define __iomem -typedef uint8_t u8; -typedef uint16_t u16; -typedef uint32_t u32; -typedef uint64_t u64; +#ifndef u8 +#define u8 uint8_t +#endif +#ifndef u16 +#define u16 uint16_t +#endif +#ifndef u32 +#define u32 uint32_t +#endif +#ifndef uint64_t +#define u64 uint64_t +#endif -typedef uint16_t __le16; -typedef uint32_t __le32; -typedef uint64_t __le64; +#ifndef __le16 +#define __le16 uint16_t +#endif +#ifndef __le32 +#define __le32 uint32_t +#endif +#ifndef __le64 +#define __le64 uint64_t +#endif #define ioread8(reg) rte_read8(reg) #define ioread32(reg) rte_read32(rte_le_to_cpu_32(reg)) diff -Nru dpdk-22.11.6/drivers/net/ixgbe/base/ixgbe_82599.c dpdk-22.11.7/drivers/net/ixgbe/base/ixgbe_82599.c --- dpdk-22.11.6/drivers/net/ixgbe/base/ixgbe_82599.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ixgbe/base/ixgbe_82599.c 2024-12-13 14:35:22.000000000 +0000 @@ -551,13 +551,15 @@ **/ void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) { - u32 autoc2_reg; u16 ee_ctrl_2 = 0; + u32 autoc2_reg; + u32 status; DEBUGFUNC("ixgbe_stop_mac_link_on_d3_82599"); - ixgbe_read_eeprom(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2); + status = ixgbe_read_eeprom(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2); - if (!ixgbe_mng_present(hw) && !hw->wol_enabled && + if (status == IXGBE_SUCCESS && + !ixgbe_mng_present(hw) && !hw->wol_enabled && ee_ctrl_2 & IXGBE_EEPROM_CCD_BIT) { autoc2_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC2); autoc2_reg |= IXGBE_AUTOC2_LINK_DISABLE_ON_D3_MASK; diff -Nru dpdk-22.11.6/drivers/net/ixgbe/ixgbe_ethdev.c dpdk-22.11.7/drivers/net/ixgbe/ixgbe_ethdev.c --- dpdk-22.11.6/drivers/net/ixgbe/ixgbe_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ixgbe/ixgbe_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -4302,11 +4302,6 @@ if (wait_to_complete == 0 || dev->data->dev_conf.intr_conf.lsc != 0) wait = 0; -/* BSD has no interrupt mechanism, so force NIC status synchronization. */ -#ifdef RTE_EXEC_ENV_FREEBSD - wait = 1; -#endif - if (vf) diag = ixgbevf_check_link(hw, &link_speed, &link_up, wait); else diff -Nru dpdk-22.11.6/drivers/net/mana/meson.build dpdk-22.11.7/drivers/net/mana/meson.build --- dpdk-22.11.6/drivers/net/mana/meson.build 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mana/meson.build 2024-12-13 14:35:22.000000000 +0000 @@ -19,12 +19,14 @@ ) libnames = ['ibverbs', 'mana'] +libs = [] foreach libname:libnames lib = dependency('lib' + libname, required:false) if not lib.found() lib = cc.find_library(libname, required:false) endif if lib.found() + libs += lib ext_deps += lib else build = false @@ -43,7 +45,7 @@ ] foreach arg:required_symbols - if not cc.has_header_symbol(arg[0], arg[1]) + if not cc.has_header_symbol(arg[0], arg[1], dependencies: libs, args: cflags) build = false reason = 'missing symbol "' + arg[1] + '" in "' + arg[0] + '"' subdir_done() diff -Nru dpdk-22.11.6/drivers/net/memif/rte_eth_memif.c dpdk-22.11.7/drivers/net/memif/rte_eth_memif.c --- dpdk-22.11.6/drivers/net/memif/rte_eth_memif.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/memif/rte_eth_memif.c 2024-12-13 14:35:22.000000000 +0000 @@ -531,6 +531,10 @@ ret = rte_pktmbuf_alloc_bulk(mq->mempool, &mq->buffers[head & mask], n_slots); if (unlikely(ret < 0)) goto no_free_mbufs; + if (unlikely(n_slots > ring_size - (head & mask))) { + rte_memcpy(mq->buffers, &mq->buffers[ring_size], + (n_slots + (head & mask) - ring_size) * sizeof(struct rte_mbuf *)); + } while (n_slots--) { s0 = head++ & mask; @@ -1127,8 +1131,12 @@ } mq->buffers = NULL; if (pmd->flags & ETH_MEMIF_FLAG_ZERO_COPY) { + /* + * Allocate 2x ring_size to reserve a contiguous array for + * rte_pktmbuf_alloc_bulk (to store allocated mbufs). + */ mq->buffers = rte_zmalloc("bufs", sizeof(struct rte_mbuf *) * - (1 << mq->log2_ring_size), 0); + (1 << (mq->log2_ring_size + 1)), 0); if (mq->buffers == NULL) return -ENOMEM; } diff -Nru dpdk-22.11.6/drivers/net/mlx5/hws/mlx5dr.h dpdk-22.11.7/drivers/net/mlx5/hws/mlx5dr.h --- dpdk-22.11.6/drivers/net/mlx5/hws/mlx5dr.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/hws/mlx5dr.h 2024-12-13 14:35:22.000000000 +0000 @@ -95,8 +95,10 @@ uint16_t queues; uint16_t queue_size; size_t initial_log_ste_memory; /* Currently not in use */ - /* Optional PD used for allocating res ources */ + /* Optional PD used for allocating resources */ struct ibv_pd *pd; + /* Optional the STC array size for that context */ + size_t initial_log_stc_memory; }; struct mlx5dr_table_attr { diff -Nru dpdk-22.11.6/drivers/net/mlx5/hws/mlx5dr_context.c dpdk-22.11.7/drivers/net/mlx5/hws/mlx5dr_context.c --- dpdk-22.11.6/drivers/net/mlx5/hws/mlx5dr_context.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/hws/mlx5dr_context.c 2024-12-13 14:35:22.000000000 +0000 @@ -4,7 +4,8 @@ #include "mlx5dr_internal.h" -static int mlx5dr_context_pools_init(struct mlx5dr_context *ctx) +static int mlx5dr_context_pools_init(struct mlx5dr_context *ctx, + struct mlx5dr_context_attr *attr) { struct mlx5dr_pool_attr pool_attr = {0}; uint8_t max_log_sz; @@ -16,7 +17,9 @@ /* Create an STC pool per FT type */ pool_attr.pool_type = MLX5DR_POOL_TYPE_STC; pool_attr.flags = MLX5DR_POOL_FLAGS_FOR_STC_POOL; - max_log_sz = RTE_MIN(MLX5DR_POOL_STC_LOG_SZ, ctx->caps->stc_alloc_log_max); + if (!attr->initial_log_stc_memory) + attr->initial_log_stc_memory = MLX5DR_POOL_STC_LOG_SZ; + max_log_sz = RTE_MIN(attr->initial_log_stc_memory, ctx->caps->stc_alloc_log_max); pool_attr.alloc_log_sz = RTE_MAX(max_log_sz, ctx->caps->stc_alloc_log_gran); for (i = 0; i < MLX5DR_TABLE_TYPE_MAX; i++) { @@ -151,7 +154,7 @@ if (ret) return ret; - ret = mlx5dr_context_pools_init(ctx); + ret = mlx5dr_context_pools_init(ctx, attr); if (ret) goto uninit_pd; diff -Nru dpdk-22.11.6/drivers/net/mlx5/linux/mlx5_os.c dpdk-22.11.7/drivers/net/mlx5/linux/mlx5_os.c --- dpdk-22.11.6/drivers/net/mlx5/linux/mlx5_os.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/linux/mlx5_os.c 2024-12-13 14:35:22.000000000 +0000 @@ -1533,9 +1533,11 @@ priv->ctrl_flows = 0; rte_spinlock_init(&priv->flow_list_lock); TAILQ_INIT(&priv->flow_meters); - priv->mtr_profile_tbl = mlx5_l3t_create(MLX5_L3T_TYPE_PTR); - if (!priv->mtr_profile_tbl) - goto error; + if (priv->mtr_en) { + priv->mtr_profile_tbl = mlx5_l3t_create(MLX5_L3T_TYPE_PTR); + if (!priv->mtr_profile_tbl) + goto error; + } /* Bring Ethernet device up. */ DRV_LOG(DEBUG, "port %u forcing Ethernet interface up", eth_dev->data->port_id); diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5.c dpdk-22.11.7/drivers/net/mlx5/mlx5.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5.c 2024-12-13 14:35:22.000000000 +0000 @@ -904,7 +904,7 @@ */ case MLX5_IPOOL_MLX5_FLOW: cfg.size = sh->config.dv_flow_en ? - sizeof(struct mlx5_flow_handle) : + RTE_ALIGN_MUL_CEIL(sizeof(struct mlx5_flow_handle), 8) : MLX5_FLOW_HANDLE_VERBS_SIZE; break; #if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H) @@ -1961,6 +1961,7 @@ mlx5_proc_priv_init(struct rte_eth_dev *dev) { struct mlx5_priv *priv = dev->data->dev_private; + struct mlx5_dev_ctx_shared *sh = priv->sh; struct mlx5_proc_priv *ppriv; size_t ppriv_size; @@ -1981,6 +1982,9 @@ dev->process_private = ppriv; if (rte_eal_process_type() == RTE_PROC_PRIMARY) priv->sh->pppriv = ppriv; + /* Check and try to map HCA PCI BAR to allow reading real time. */ + if (sh->dev_cap.rt_timestamp && mlx5_dev_is_pci(dev->device)) + mlx5_txpp_map_hca_bar(dev); return 0; } diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5.h dpdk-22.11.7/drivers/net/mlx5/mlx5.h --- dpdk-22.11.6/drivers/net/mlx5/mlx5.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5.h 2024-12-13 14:35:22.000000000 +0000 @@ -60,7 +60,7 @@ #define MLX5_ROOT_TBL_MODIFY_NUM 16 /* Maximal number of flex items created on the port.*/ -#define MLX5_PORT_FLEX_ITEM_NUM 4 +#define MLX5_PORT_FLEX_ITEM_NUM 8 /* Maximal number of field/field parts to map into sample registers .*/ #define MLX5_FLEX_ITEM_MAPPING_NUM 32 @@ -1804,6 +1804,7 @@ uint32_t nb_queue; /* HW steering queue number. */ struct mlx5_hws_cnt_pool *hws_cpool; /* HW steering's counter pool. */ uint32_t hws_mark_refcnt; /* HWS mark action reference counter. */ + bool hws_rule_flushing; /**< Whether this port is in rules flushing stage. */ #if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H) /* Item template list. */ LIST_HEAD(flow_hw_itt, rte_flow_pattern_template) flow_hw_itt; diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_ethdev.c dpdk-22.11.7/drivers/net/mlx5/mlx5_ethdev.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -351,6 +351,10 @@ info->flow_type_rss_offloads = ~MLX5_RSS_HF_MASK; mlx5_set_default_params(dev, info); mlx5_set_txlimit_params(dev, info); + info->rx_desc_lim.nb_max = + 1 << priv->sh->cdev->config.hca_attr.log_max_wq_sz; + info->tx_desc_lim.nb_max = + 1 << priv->sh->cdev->config.hca_attr.log_max_wq_sz; if (priv->sh->cdev->config.hca_attr.mem_rq_rmp && priv->obj_ops.rxq_obj_new == devx_obj_ops.rxq_obj_new) info->dev_capa |= RTE_ETH_DEV_CAPA_RXQ_SHARE; diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_flow.c dpdk-22.11.7/drivers/net/mlx5/mlx5_flow.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_flow.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_flow.c 2024-12-13 14:35:22.000000000 +0000 @@ -7474,7 +7474,9 @@ #ifdef HAVE_IBV_FLOW_DV_SUPPORT if (priv->sh->config.dv_flow_en == 2 && type == MLX5_FLOW_TYPE_GEN) { + priv->hws_rule_flushing = true; flow_hw_q_flow_flush(dev, NULL); + priv->hws_rule_flushing = false; return; } #endif diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_flow.h dpdk-22.11.7/drivers/net/mlx5/mlx5_flow.h --- dpdk-22.11.6/drivers/net/mlx5/mlx5_flow.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_flow.h 2024-12-13 14:35:22.000000000 +0000 @@ -117,6 +117,9 @@ /* Matches on source queue. */ struct mlx5_rte_flow_item_sq { uint32_t queue; /* DevX SQ number */ +#ifdef RTE_ARCH_64 + uint32_t reserved; +#endif }; /* Feature name to allocate metadata register. */ @@ -2180,13 +2183,13 @@ /* All types of RSS actions used in control flow rules. */ enum mlx5_flow_ctrl_rx_expanded_rss_type { - MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_NON_IP = 0, - MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV4, + MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV6_UDP = 0, + MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV6_TCP, MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV4_UDP, MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV4_TCP, MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV6, - MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV6_UDP, - MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV6_TCP, + MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV4, + MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_NON_IP, MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_MAX, }; @@ -2644,4 +2647,7 @@ enum rte_flow_field_id field, int inherit, const struct rte_flow_attr *attr, struct rte_flow_error *error); + +#define MLX5_REPR_STC_MEMORY_LOG 11 + #endif /* RTE_PMD_MLX5_FLOW_H_ */ diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_flow_aso.c dpdk-22.11.7/drivers/net/mlx5/mlx5_flow_aso.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_flow_aso.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_flow_aso.c 2024-12-13 14:35:22.000000000 +0000 @@ -489,7 +489,7 @@ int i; DRV_LOG(ERR, "Error cqe:"); - for (i = 0; i < 16; i += 4) + for (i = 0; i < (int)sizeof(struct mlx5_error_cqe) / 4; i += 4) DRV_LOG(ERR, "%08X %08X %08X %08X", cqe[i], cqe[i + 1], cqe[i + 2], cqe[i + 3]); DRV_LOG(ERR, "\nError wqe:"); @@ -509,8 +509,8 @@ { struct mlx5_aso_cq *cq = &sq->cq; uint32_t idx = cq->cq_ci & ((1 << cq->log_desc_n) - 1); - volatile struct mlx5_err_cqe *cqe = - (volatile struct mlx5_err_cqe *)&cq->cq_obj.cqes[idx]; + volatile struct mlx5_error_cqe *cqe = + (volatile struct mlx5_error_cqe *)&cq->cq_obj.cqes[idx]; cq->errors++; idx = rte_be_to_cpu_16(cqe->wqe_counter) & (1u << sq->log_desc_n); diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_flow_dv.c dpdk-22.11.7/drivers/net/mlx5/mlx5_flow_dv.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_flow_dv.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_flow_dv.c 2024-12-13 14:35:22.000000000 +0000 @@ -7503,6 +7503,8 @@ tunnel != 0, error); if (ret < 0) return ret; + /* Reset for next proto, it is unknown. */ + next_protocol = 0xff; break; case RTE_FLOW_ITEM_TYPE_METER_COLOR: ret = flow_dv_validate_item_meter_color(dev, items, @@ -9106,22 +9108,23 @@ } gre_crks_rsvd0_ver_m, gre_crks_rsvd0_ver_v; uint16_t protocol_m, protocol_v; - if (key_type & MLX5_SET_MATCHER_M) + if (key_type & MLX5_SET_MATCHER_M) { MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, 0xff); - else + if (!gre_m) + gre_m = &rte_flow_item_gre_mask; + gre_v = gre_m; + } else { MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, IPPROTO_GRE); - if (!gre_v) { - gre_v = &empty_gre; - gre_m = &empty_gre; - } else { - if (!gre_m) + if (!gre_v) { + gre_v = &empty_gre; + gre_m = &empty_gre; + } else if (!gre_m) { gre_m = &rte_flow_item_gre_mask; + } + if (key_type == MLX5_SET_MATCHER_HS_V) + gre_m = gre_v; } - if (key_type & MLX5_SET_MATCHER_M) - gre_v = gre_m; - else if (key_type == MLX5_SET_MATCHER_HS_V) - gre_m = gre_v; gre_crks_rsvd0_ver_m.value = rte_be_to_cpu_16(gre_m->c_rsvd0_ver); gre_crks_rsvd0_ver_v.value = rte_be_to_cpu_16(gre_v->c_rsvd0_ver); MLX5_SET(fte_match_set_misc, misc_v, gre_c_present, diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_flow_flex.c dpdk-22.11.7/drivers/net/mlx5/mlx5_flow_flex.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_flow_flex.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_flow_flex.c 2024-12-13 14:35:22.000000000 +0000 @@ -118,28 +118,32 @@ uint32_t pos, uint32_t width, uint32_t shift) { const uint8_t *ptr = item->pattern + pos / CHAR_BIT; - uint32_t val, vbits; + uint32_t val, vbits, skip = pos % CHAR_BIT; /* Proceed the bitfield start byte. */ MLX5_ASSERT(width <= sizeof(uint32_t) * CHAR_BIT && width); MLX5_ASSERT(width + shift <= sizeof(uint32_t) * CHAR_BIT); if (item->length <= pos / CHAR_BIT) return 0; - val = *ptr++ >> (pos % CHAR_BIT); + /* Bits are enumerated in byte in network order: 01234567 */ + val = *ptr++; vbits = CHAR_BIT - pos % CHAR_BIT; - pos = (pos + vbits) / CHAR_BIT; + pos = RTE_ALIGN_CEIL(pos, CHAR_BIT) / CHAR_BIT; vbits = RTE_MIN(vbits, width); - val &= RTE_BIT32(vbits) - 1; + /* Load bytes to cover the field width, checking pattern boundary */ while (vbits < width && pos < item->length) { uint32_t part = RTE_MIN(width - vbits, (uint32_t)CHAR_BIT); uint32_t tmp = *ptr++; - pos++; - tmp &= RTE_BIT32(part) - 1; - val |= tmp << vbits; + val |= tmp << RTE_ALIGN_CEIL(vbits, CHAR_BIT); vbits += part; + pos++; } - return rte_bswap32(val <<= shift); + val = rte_cpu_to_be_32(val); + val <<= skip; + val >>= shift; + val &= (RTE_BIT64(width) - 1) << (sizeof(uint32_t) * CHAR_BIT - shift - width); + return val; } #define SET_FP_MATCH_SAMPLE_ID(x, def, msk, val, sid) \ @@ -235,19 +239,21 @@ mask = item->mask; tp = (struct mlx5_flex_item *)spec->handle; MLX5_ASSERT(mlx5_flex_index(dev->data->dev_private, tp) >= 0); - for (i = 0; i < tp->mapnum; i++) { + for (i = 0; i < tp->mapnum && pos < (spec->length * CHAR_BIT); i++) { struct mlx5_flex_pattern_field *map = tp->map + i; uint32_t id = map->reg_id; - uint32_t def = (RTE_BIT64(map->width) - 1) << map->shift; - uint32_t val, msk; + uint32_t val, msk, def; /* Skip placeholders for DUMMY fields. */ if (id == MLX5_INVALID_SAMPLE_REG_ID) { pos += map->width; continue; } + def = (uint32_t)(RTE_BIT64(map->width) - 1); + def <<= (sizeof(uint32_t) * CHAR_BIT - map->shift - map->width); val = mlx5_flex_get_bitfield(spec, pos, map->width, map->shift); - msk = mlx5_flex_get_bitfield(mask, pos, map->width, map->shift); + msk = pos < (mask->length * CHAR_BIT) ? + mlx5_flex_get_bitfield(mask, pos, map->width, map->shift) : def; MLX5_ASSERT(map->width); MLX5_ASSERT(id < tp->devx_fp->num_samples); if (tp->tunnel_mode == FLEX_TUNNEL_MODE_MULTI && is_inner) { @@ -258,7 +264,7 @@ id += num_samples; } mlx5_flex_set_match_sample(misc4_m, misc4_v, - def, msk & def, val & msk & def, + def, msk, val & msk, tp->devx_fp->sample_ids[id], id); pos += map->width; } @@ -338,12 +344,14 @@ * * shift mask * ------- --------------- - * 0 b111100 0x3C - * 1 b111110 0x3E - * 2 b111111 0x3F - * 3 b011111 0x1F - * 4 b001111 0x0F - * 5 b000111 0x07 + * 0 b11111100 0x3C + * 1 b01111110 0x3E + * 2 b00111111 0x3F + * 3 b00011111 0x1F + * 4 b00001111 0x0F + * 5 b00000111 0x07 + * 6 b00000011 0x03 + * 7 b00000001 0x01 */ static uint8_t mlx5_flex_hdr_len_mask(uint8_t shift, @@ -353,8 +361,7 @@ int diff = shift - MLX5_PARSE_GRAPH_NODE_HDR_LEN_SHIFT_DWORD; base_mask = mlx5_hca_parse_graph_node_base_hdr_len_mask(attr); - return diff == 0 ? base_mask : - diff < 0 ? (base_mask << -diff) & base_mask : base_mask >> diff; + return diff < 0 ? base_mask << -diff : base_mask >> diff; } static int @@ -365,7 +372,6 @@ { const struct rte_flow_item_flex_field *field = &conf->next_header; struct mlx5_devx_graph_node_attr *node = &devx->devx_conf; - uint32_t len_width, mask; if (field->field_base % CHAR_BIT) return rte_flow_error_set @@ -393,49 +399,90 @@ "negative header length field base (FIXED)"); node->header_length_mode = MLX5_GRAPH_NODE_LEN_FIXED; break; - case FIELD_MODE_OFFSET: + case FIELD_MODE_OFFSET: { + uint32_t msb, lsb; + int32_t shift = field->offset_shift; + uint32_t offset = field->offset_base; + uint32_t mask = field->offset_mask; + uint32_t wmax = attr->header_length_mask_width + + MLX5_PARSE_GRAPH_NODE_HDR_LEN_SHIFT_DWORD; + if (!(attr->header_length_mode & RTE_BIT32(MLX5_GRAPH_NODE_LEN_FIELD))) return rte_flow_error_set (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, "unsupported header length field mode (OFFSET)"); - node->header_length_mode = MLX5_GRAPH_NODE_LEN_FIELD; - if (field->offset_mask == 0 || - !rte_is_power_of_2(field->offset_mask + 1)) + if (!field->field_size) + return rte_flow_error_set + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "field size is a must for offset mode"); + if ((offset ^ (field->field_size + offset)) >> 5) + return rte_flow_error_set + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "field crosses the 32-bit word boundary"); + /* Hardware counts in dwords, all shifts done by offset within mask */ + if (shift < 0 || (uint32_t)shift >= wmax) + return rte_flow_error_set + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "header length field shift exceeds limits (OFFSET)"); + if (!mask) return rte_flow_error_set (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, - "invalid length field offset mask (OFFSET)"); - len_width = rte_fls_u32(field->offset_mask); - if (len_width > attr->header_length_mask_width) + "zero length field offset mask (OFFSET)"); + msb = rte_fls_u32(mask) - 1; + lsb = rte_bsf32(mask); + if (!rte_is_power_of_2((mask >> lsb) + 1)) return rte_flow_error_set (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, - "length field offset mask too wide (OFFSET)"); - mask = mlx5_flex_hdr_len_mask(field->offset_shift, attr); - if (mask < field->offset_mask) + "length field offset mask not contiguous (OFFSET)"); + if (msb >= field->field_size) return rte_flow_error_set (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, - "length field shift too big (OFFSET)"); - node->header_length_field_mask = RTE_MIN(mask, - field->offset_mask); + "length field offset mask exceeds field size (OFFSET)"); + if (msb >= wmax) + return rte_flow_error_set + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "length field offset mask exceeds supported width (OFFSET)"); + if (mask & ~mlx5_flex_hdr_len_mask(shift, attr)) + return rte_flow_error_set + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "mask and shift combination not supported (OFFSET)"); + msb++; + offset += field->field_size - msb; + if (msb < attr->header_length_mask_width) { + if (attr->header_length_mask_width - msb > offset) + return rte_flow_error_set + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "field size plus offset_base is too small"); + offset += msb; + /* + * Here we can move to preceding dword. Hardware does + * cyclic left shift so we should avoid this and stay + * at current dword offset. + */ + offset = (offset & ~0x1Fu) | + ((offset - attr->header_length_mask_width) & 0x1F); + } + node->header_length_mode = MLX5_GRAPH_NODE_LEN_FIELD; + node->header_length_field_mask = mask; + node->header_length_field_shift = shift; + node->header_length_field_offset = offset; break; + } case FIELD_MODE_BITMASK: if (!(attr->header_length_mode & RTE_BIT32(MLX5_GRAPH_NODE_LEN_BITMASK))) return rte_flow_error_set (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, "unsupported header length field mode (BITMASK)"); - if (attr->header_length_mask_width < field->field_size) + if (field->offset_shift > 15 || field->offset_shift < 0) return rte_flow_error_set (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, - "header length field width exceeds limit"); + "header length field shift exceeds limit (BITMASK)"); node->header_length_mode = MLX5_GRAPH_NODE_LEN_BITMASK; - mask = mlx5_flex_hdr_len_mask(field->offset_shift, attr); - if (mask < field->offset_mask) - return rte_flow_error_set - (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, - "length field shift too big (BITMASK)"); - node->header_length_field_mask = RTE_MIN(mask, - field->offset_mask); + node->header_length_field_mask = field->offset_mask; + node->header_length_field_shift = field->offset_shift; + node->header_length_field_offset = field->offset_base; break; default: return rte_flow_error_set @@ -448,15 +495,6 @@ (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, "header length field base exceeds limit"); node->header_length_base_value = field->field_base / CHAR_BIT; - if (field->field_mode == FIELD_MODE_OFFSET || - field->field_mode == FIELD_MODE_BITMASK) { - if (field->offset_shift > 15 || field->offset_shift < 0) - return rte_flow_error_set - (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, - "header length field shift exceeds limit"); - node->header_length_field_shift = field->offset_shift; - node->header_length_field_offset = field->offset_base; - } return 0; } @@ -1006,6 +1044,8 @@ return MLX5_GRAPH_ARC_NODE_GENEVE; case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: return MLX5_GRAPH_ARC_NODE_VXLAN_GPE; + case RTE_FLOW_ITEM_TYPE_ESP: + return MLX5_GRAPH_ARC_NODE_IPSEC_ESP; default: return -EINVAL; } @@ -1044,6 +1084,38 @@ } static int +mlx5_flex_arc_in_ipv4(const struct rte_flow_item *item, + struct rte_flow_error *error) +{ + const struct rte_flow_item_ipv4 *spec = item->spec; + const struct rte_flow_item_ipv4 *mask = item->mask; + struct rte_flow_item_ipv4 ip = { .hdr.next_proto_id = 0xff }; + + if (memcmp(mask, &ip, sizeof(struct rte_flow_item_ipv4))) { + return rte_flow_error_set + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, + "invalid ipv4 item mask, full mask is desired"); + } + return spec->hdr.next_proto_id; +} + +static int +mlx5_flex_arc_in_ipv6(const struct rte_flow_item *item, + struct rte_flow_error *error) +{ + const struct rte_flow_item_ipv6 *spec = item->spec; + const struct rte_flow_item_ipv6 *mask = item->mask; + struct rte_flow_item_ipv6 ip = { .hdr.proto = 0xff }; + + if (memcmp(mask, &ip, sizeof(struct rte_flow_item_ipv6))) { + return rte_flow_error_set + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, + "invalid ipv6 item mask, full mask is desired"); + } + return spec->hdr.proto; +} + +static int mlx5_flex_translate_arc_in(struct mlx5_hca_flex_attr *attr, const struct rte_flow_item_flex_conf *conf, struct mlx5_flex_parser_devx *devx, @@ -1089,6 +1161,12 @@ case RTE_FLOW_ITEM_TYPE_UDP: ret = mlx5_flex_arc_in_udp(rte_item, error); break; + case RTE_FLOW_ITEM_TYPE_IPV4: + ret = mlx5_flex_arc_in_ipv4(rte_item, error); + break; + case RTE_FLOW_ITEM_TYPE_IPV6: + ret = mlx5_flex_arc_in_ipv6(rte_item, error); + break; default: MLX5_ASSERT(false); return rte_flow_error_set diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_flow_hw.c dpdk-22.11.7/drivers/net/mlx5/mlx5_flow_hw.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_flow_hw.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_flow_hw.c 2024-12-13 14:35:22.000000000 +0000 @@ -2377,8 +2377,11 @@ case RTE_FLOW_ACTION_TYPE_COUNT: cnt_queue = mlx5_hws_cnt_get_queue(priv, &queue); ret = mlx5_hws_cnt_pool_get(priv->hws_cpool, cnt_queue, &cnt_id, age_idx); - if (ret != 0) + if (ret != 0) { + rte_flow_error_set(error, -ret, RTE_FLOW_ERROR_TYPE_ACTION, + action, "Failed to allocate flow counter"); goto error; + } ret = mlx5_hws_cnt_pool_get_action_offset (priv->hws_cpool, cnt_id, @@ -2571,6 +2574,7 @@ struct mlx5_hw_q_job *job; const struct rte_flow_item *rule_items; uint32_t flow_idx; + struct rte_flow_error sub_error = { 0 }; int ret; if (unlikely(!priv->hw_q[queue].job_idx)) { @@ -2611,7 +2615,7 @@ if (flow_hw_actions_construct(dev, job, &table->ats[action_template_index], pattern_template_index, actions, - rule_acts, queue, error)) + rule_acts, queue, &sub_error)) goto free; rule_items = flow_hw_get_rule_items(dev, table, items, pattern_template_index, job); @@ -2628,9 +2632,12 @@ mlx5_ipool_free(table->flow, flow_idx); priv->hw_q[queue].job_idx++; error: - rte_flow_error_set(error, rte_errno, - RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, - "fail to create rte flow"); + if (sub_error.cause != RTE_FLOW_ERROR_TYPE_NONE && error != NULL) + *error = sub_error; + else + rte_flow_error_set(error, rte_errno, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "fail to create rte flow"); return NULL; } @@ -7295,6 +7302,9 @@ } dr_ctx_attr.pd = priv->sh->cdev->pd; dr_ctx_attr.queues = nb_q_updated; + /* Assign initial value of STC numbers for representors. */ + if (priv->representor) + dr_ctx_attr.initial_log_stc_memory = MLX5_REPR_STC_MEMORY_LOG; /* Queue size should all be the same. Take the first one. */ dr_ctx_attr.queue_size = _queue_attr[0]->size; dr_ctx = mlx5dr_context_open(priv->sh->cdev->ctx, &dr_ctx_attr); @@ -9772,7 +9782,7 @@ struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_flow_hw_ctrl_rx *hw_ctrl_rx; unsigned int i; - unsigned int j; + int j; int ret = 0; RTE_SET_USED(priv); diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_flow_meter.c dpdk-22.11.7/drivers/net/mlx5/mlx5_flow_meter.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_flow_meter.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_flow_meter.c 2024-12-13 14:35:22.000000000 +0000 @@ -100,8 +100,8 @@ if (priv->mtr_profile_arr) return &priv->mtr_profile_arr[meter_profile_id]; - if (mlx5_l3t_get_entry(priv->mtr_profile_tbl, - meter_profile_id, &data) || !data.ptr) + if (!priv->mtr_profile_tbl || + mlx5_l3t_get_entry(priv->mtr_profile_tbl, meter_profile_id, &data) || !data.ptr) return NULL; fmp = data.ptr; /* Remove reference taken by the mlx5_l3t_get_entry. */ @@ -1636,6 +1636,7 @@ if (priv->sh->meter_aso_en) { fm->is_enable = !!is_enable; aso_mtr = container_of(fm, struct mlx5_aso_mtr, fm); + aso_mtr->state = ASO_METER_WAIT; ret = mlx5_aso_meter_update_by_wqe(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr, &priv->mtr_bulk, NULL, true); if (ret) @@ -1886,6 +1887,7 @@ /* If ASO meter supported, update ASO flow meter by wqe. */ if (priv->sh->meter_aso_en) { aso_mtr = container_of(fm, struct mlx5_aso_mtr, fm); + aso_mtr->state = ASO_METER_WAIT; ret = mlx5_aso_meter_update_by_wqe(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr, &priv->mtr_bulk, NULL, true); if (ret) diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_hws_cnt.c dpdk-22.11.7/drivers/net/mlx5/mlx5_hws_cnt.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_hws_cnt.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_hws_cnt.c 2024-12-13 14:35:22.000000000 +0000 @@ -72,26 +72,29 @@ uint32_t ret __rte_unused; reset_cnt_num = rte_ring_count(reset_list); - do { - cpool->query_gen++; - mlx5_aso_cnt_query(sh, cpool); - zcdr.n1 = 0; - zcdu.n1 = 0; - ret = rte_ring_enqueue_zc_burst_elem_start(reuse_list, - sizeof(cnt_id_t), - reset_cnt_num, &zcdu, - NULL); - MLX5_ASSERT(ret == reset_cnt_num); - ret = rte_ring_dequeue_zc_burst_elem_start(reset_list, - sizeof(cnt_id_t), - reset_cnt_num, &zcdr, - NULL); - MLX5_ASSERT(ret == reset_cnt_num); - __hws_cnt_r2rcpy(&zcdu, &zcdr, reset_cnt_num); - rte_ring_dequeue_zc_elem_finish(reset_list, reset_cnt_num); - rte_ring_enqueue_zc_elem_finish(reuse_list, reset_cnt_num); + cpool->query_gen++; + mlx5_aso_cnt_query(sh, cpool); + zcdr.n1 = 0; + zcdu.n1 = 0; + ret = rte_ring_enqueue_zc_burst_elem_start(reuse_list, + sizeof(cnt_id_t), + reset_cnt_num, &zcdu, + NULL); + MLX5_ASSERT(ret == reset_cnt_num); + ret = rte_ring_dequeue_zc_burst_elem_start(reset_list, + sizeof(cnt_id_t), + reset_cnt_num, &zcdr, + NULL); + MLX5_ASSERT(ret == reset_cnt_num); + __hws_cnt_r2rcpy(&zcdu, &zcdr, reset_cnt_num); + rte_ring_dequeue_zc_elem_finish(reset_list, reset_cnt_num); + rte_ring_enqueue_zc_elem_finish(reuse_list, reset_cnt_num); + + if (rte_log_can_log(mlx5_logtype, RTE_LOG_DEBUG)) { reset_cnt_num = rte_ring_count(reset_list); - } while (reset_cnt_num > 0); + DRV_LOG(DEBUG, "ibdev %s cpool %p wait_reset_cnt=%" PRIu32, + sh->ibdev_name, (void *)cpool, reset_cnt_num); + } } /** @@ -331,6 +334,11 @@ rte_spinlock_unlock(&sh->cpool_lock); query_us = query_cycle / (rte_get_timer_hz() / US_PER_S); sleep_us = interval - query_us; + DRV_LOG(DEBUG, "ibdev %s counter service thread: " + "interval_us=%" PRIu64 " query_us=%" PRIu64 " " + "sleep_us=%" PRIu64, + sh->ibdev_name, interval, query_us, + interval > query_us ? sleep_us : 0); if (interval > query_us) rte_delay_us_sleep(sleep_us); } diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_rx.c dpdk-22.11.7/drivers/net/mlx5/mlx5_rx.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_rx.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_rx.c 2024-12-13 14:35:22.000000000 +0000 @@ -451,7 +451,7 @@ container_of(rxq, struct mlx5_rxq_ctrl, rxq); union { volatile struct mlx5_cqe *cqe; - volatile struct mlx5_err_cqe *err_cqe; + volatile struct mlx5_error_cqe *err_cqe; } u = { .cqe = &(*rxq->cqes)[(rxq->cq_ci - vec) & cqe_mask], }; diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_rx.h dpdk-22.11.7/drivers/net/mlx5/mlx5_rx.h --- dpdk-22.11.6/drivers/net/mlx5/mlx5_rx.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_rx.h 2024-12-13 14:35:22.000000000 +0000 @@ -170,6 +170,7 @@ struct mlx5_rxq_priv { uint16_t idx; /* Queue index. */ uint32_t refcnt; /* Reference counter. */ + bool possessor; /* Shared rxq_ctrl allocated for the 1st time. */ struct mlx5_rxq_ctrl *ctrl; /* Shared Rx Queue. */ LIST_ENTRY(mlx5_rxq_priv) owner_entry; /* Entry in shared rxq_ctrl. */ struct mlx5_priv *priv; /* Back pointer to private data. */ diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_rxq.c dpdk-22.11.7/drivers/net/mlx5/mlx5_rxq.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_rxq.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_rxq.c 2024-12-13 14:35:22.000000000 +0000 @@ -652,6 +652,14 @@ struct mlx5_rxq_priv *rxq; bool empty; + if (*desc > 1 << priv->sh->cdev->config.hca_attr.log_max_wq_sz) { + DRV_LOG(ERR, + "port %u number of descriptors requested for Rx queue" + " %u is more than supported", + dev->data->port_id, idx); + rte_errno = EINVAL; + return -EINVAL; + } if (!rte_is_power_of_2(*desc)) { *desc = 1 << log2above(*desc); DRV_LOG(WARNING, @@ -935,6 +943,7 @@ rte_errno = ENOMEM; return -rte_errno; } + rxq->possessor = true; } rxq->priv = priv; rxq->idx = idx; @@ -2013,6 +2022,7 @@ tmpl->rxq.mr_ctrl.cache_bh = (struct mlx5_mr_btree) { 0 }; tmpl->rxq.idx = idx; rxq->hairpin_conf = *hairpin_conf; + rxq->possessor = true; mlx5_rxq_ref(dev, idx); LIST_INSERT_HEAD(&priv->rxqsctrl, tmpl, next); return tmpl; @@ -2280,7 +2290,8 @@ RTE_ETH_QUEUE_STATE_STOPPED; } } else { /* Refcnt zero, closing device. */ - LIST_REMOVE(rxq_ctrl, next); + if (rxq->possessor) + LIST_REMOVE(rxq_ctrl, next); LIST_REMOVE(rxq, owner_entry); if (LIST_EMPTY(&rxq_ctrl->owners)) { if (!rxq_ctrl->is_hairpin) @@ -2880,6 +2891,7 @@ __mlx5_hrxq_remove(struct rte_eth_dev *dev, struct mlx5_hrxq *hrxq) { struct mlx5_priv *priv = dev->data->dev_private; + bool deref_rxqs = true; #ifdef HAVE_IBV_FLOW_DV_SUPPORT if (hrxq->hws_flags) @@ -2889,9 +2901,10 @@ #endif priv->obj_ops.hrxq_destroy(hrxq); if (!hrxq->standalone) { - mlx5_ind_table_obj_release(dev, hrxq->ind_table, - hrxq->hws_flags ? - (!!dev->data->dev_started) : true); + if (!dev->data->dev_started && hrxq->hws_flags && + !priv->hws_rule_flushing) + deref_rxqs = false; + mlx5_ind_table_obj_release(dev, hrxq->ind_table, deref_rxqs); } mlx5_ipool_free(priv->sh->ipool[MLX5_IPOOL_HRXQ], hrxq->idx); } diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h dpdk-22.11.7/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h --- dpdk-22.11.6/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h 2024-12-13 14:35:22.000000000 +0000 @@ -93,8 +93,7 @@ -1, -1, /* skip vlan_tci */ 11, 10, 9, 8}; /* bswap32, rss */ /* Restore the compressed count. Must be 16 bits. */ - const uint16_t mcqe_n = t_pkt->data_len + - (rxq->crc_present * RTE_ETHER_CRC_LEN); + const uint16_t mcqe_n = rte_be_to_cpu_32(cq->byte_cnt); const __vector unsigned char rearm = (__vector unsigned char)vec_vsx_ld(0, (signed int const *)&t_pkt->rearm_data); @@ -1201,9 +1200,9 @@ rxq_cq_to_ptype_oflags_v(rxq, cqes, opcode, &pkts[pos]); if (unlikely(rxq->shared)) { pkts[pos]->port = cq[pos].user_index_low; - pkts[pos + p1]->port = cq[pos + p1].user_index_low; - pkts[pos + p2]->port = cq[pos + p2].user_index_low; - pkts[pos + p3]->port = cq[pos + p3].user_index_low; + pkts[pos + 1]->port = cq[pos + p1].user_index_low; + pkts[pos + 2]->port = cq[pos + p2].user_index_low; + pkts[pos + 3]->port = cq[pos + p3].user_index_low; } if (rxq->hw_timestamp) { int offset = rxq->timestamp_offset; @@ -1247,17 +1246,17 @@ metadata; pkts[pos]->ol_flags |= metadata ? flag : 0ULL; metadata = rte_be_to_cpu_32 - (cq[pos + 1].flow_table_metadata) & mask; + (cq[pos + p1].flow_table_metadata) & mask; *RTE_MBUF_DYNFIELD(pkts[pos + 1], offs, uint32_t *) = metadata; pkts[pos + 1]->ol_flags |= metadata ? flag : 0ULL; metadata = rte_be_to_cpu_32 - (cq[pos + 2].flow_table_metadata) & mask; + (cq[pos + p2].flow_table_metadata) & mask; *RTE_MBUF_DYNFIELD(pkts[pos + 2], offs, uint32_t *) = metadata; pkts[pos + 2]->ol_flags |= metadata ? flag : 0ULL; metadata = rte_be_to_cpu_32 - (cq[pos + 3].flow_table_metadata) & mask; + (cq[pos + p3].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-22.11.6/drivers/net/mlx5/mlx5_rxtx_vec_neon.h dpdk-22.11.7/drivers/net/mlx5/mlx5_rxtx_vec_neon.h --- dpdk-22.11.6/drivers/net/mlx5/mlx5_rxtx_vec_neon.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_rxtx_vec_neon.h 2024-12-13 14:35:22.000000000 +0000 @@ -92,8 +92,7 @@ 11, 10, 9, 8 /* hash.rss, bswap32 */ }; /* Restore the compressed count. Must be 16 bits. */ - const uint16_t mcqe_n = t_pkt->data_len + - (rxq->crc_present * RTE_ETHER_CRC_LEN); + const uint16_t mcqe_n = rte_be_to_cpu_32(cq->byte_cnt); const uint64x2_t rearm = vld1q_u64((void *)&t_pkt->rearm_data); const uint32x4_t rxdf_mask = { @@ -800,13 +799,13 @@ rxq_cq_to_ptype_oflags_v(rxq, ptype_info, flow_tag, opcode, &elts[pos]); if (unlikely(rxq->shared)) { - elts[pos]->port = container_of(p0, struct mlx5_cqe, + pkts[pos]->port = container_of(p0, struct mlx5_cqe, pkt_info)->user_index_low; - elts[pos + 1]->port = container_of(p1, struct mlx5_cqe, + pkts[pos + 1]->port = container_of(p1, struct mlx5_cqe, pkt_info)->user_index_low; - elts[pos + 2]->port = container_of(p2, struct mlx5_cqe, + pkts[pos + 2]->port = container_of(p2, struct mlx5_cqe, pkt_info)->user_index_low; - elts[pos + 3]->port = container_of(p3, struct mlx5_cqe, + pkts[pos + 3]->port = container_of(p3, struct mlx5_cqe, pkt_info)->user_index_low; } if (unlikely(rxq->hw_timestamp)) { @@ -818,34 +817,34 @@ ts = rte_be_to_cpu_64 (container_of(p0, struct mlx5_cqe, pkt_info)->timestamp); - mlx5_timestamp_set(elts[pos], offset, + mlx5_timestamp_set(pkts[pos], offset, mlx5_txpp_convert_rx_ts(sh, ts)); ts = rte_be_to_cpu_64 (container_of(p1, struct mlx5_cqe, pkt_info)->timestamp); - mlx5_timestamp_set(elts[pos + 1], offset, + mlx5_timestamp_set(pkts[pos + 1], offset, mlx5_txpp_convert_rx_ts(sh, ts)); ts = rte_be_to_cpu_64 (container_of(p2, struct mlx5_cqe, pkt_info)->timestamp); - mlx5_timestamp_set(elts[pos + 2], offset, + mlx5_timestamp_set(pkts[pos + 2], offset, mlx5_txpp_convert_rx_ts(sh, ts)); ts = rte_be_to_cpu_64 (container_of(p3, struct mlx5_cqe, pkt_info)->timestamp); - mlx5_timestamp_set(elts[pos + 3], offset, + mlx5_timestamp_set(pkts[pos + 3], offset, mlx5_txpp_convert_rx_ts(sh, ts)); } else { - mlx5_timestamp_set(elts[pos], offset, + mlx5_timestamp_set(pkts[pos], offset, rte_be_to_cpu_64(container_of(p0, struct mlx5_cqe, pkt_info)->timestamp)); - mlx5_timestamp_set(elts[pos + 1], offset, + mlx5_timestamp_set(pkts[pos + 1], offset, rte_be_to_cpu_64(container_of(p1, struct mlx5_cqe, pkt_info)->timestamp)); - mlx5_timestamp_set(elts[pos + 2], offset, + mlx5_timestamp_set(pkts[pos + 2], offset, rte_be_to_cpu_64(container_of(p2, struct mlx5_cqe, pkt_info)->timestamp)); - mlx5_timestamp_set(elts[pos + 3], offset, + mlx5_timestamp_set(pkts[pos + 3], offset, rte_be_to_cpu_64(container_of(p3, struct mlx5_cqe, pkt_info)->timestamp)); } diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_rxtx_vec_sse.h dpdk-22.11.7/drivers/net/mlx5/mlx5_rxtx_vec_sse.h --- dpdk-22.11.6/drivers/net/mlx5/mlx5_rxtx_vec_sse.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_rxtx_vec_sse.h 2024-12-13 14:35:22.000000000 +0000 @@ -92,8 +92,7 @@ -1, -1, 14, 15, /* pkt_len, bswap16 */ -1, -1, -1, -1 /* skip packet_type */); /* Restore the compressed count. Must be 16 bits. */ - const uint16_t mcqe_n = t_pkt->data_len + - (rxq->crc_present * RTE_ETHER_CRC_LEN); + const uint16_t mcqe_n = rte_be_to_cpu_32(cq->byte_cnt); const __m128i rearm = _mm_loadu_si128((__m128i *)&t_pkt->rearm_data); const __m128i rxdf = @@ -741,9 +740,9 @@ rxq_cq_to_ptype_oflags_v(rxq, cqes, opcode, &pkts[pos]); if (unlikely(rxq->shared)) { pkts[pos]->port = cq[pos].user_index_low; - pkts[pos + p1]->port = cq[pos + p1].user_index_low; - pkts[pos + p2]->port = cq[pos + p2].user_index_low; - pkts[pos + p3]->port = cq[pos + p3].user_index_low; + pkts[pos + 1]->port = cq[pos + p1].user_index_low; + pkts[pos + 2]->port = cq[pos + p2].user_index_low; + pkts[pos + 3]->port = cq[pos + p3].user_index_low; } if (unlikely(rxq->hw_timestamp)) { int offset = rxq->timestamp_offset; diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_tx.c dpdk-22.11.7/drivers/net/mlx5/mlx5_tx.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_tx.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_tx.c 2024-12-13 14:35:22.000000000 +0000 @@ -55,7 +55,7 @@ /* Return 1 if the error CQE is signed otherwise, sign it and return 0. */ static int -check_err_cqe_seen(volatile struct mlx5_err_cqe *err_cqe) +check_err_cqe_seen(volatile struct mlx5_error_cqe *err_cqe) { static const uint8_t magic[] = "seen"; int ret = 1; @@ -83,7 +83,7 @@ */ static int mlx5_tx_error_cqe_handle(struct mlx5_txq_data *__rte_restrict txq, - volatile struct mlx5_err_cqe *err_cqe) + volatile struct mlx5_error_cqe *err_cqe) { if (err_cqe->syndrome != MLX5_CQE_SYNDROME_WR_FLUSH_ERR) { const uint16_t wqe_m = ((1 << txq->wqe_n) - 1); @@ -107,7 +107,7 @@ mlx5_dump_debug_information(name, "MLX5 Error CQ:", (const void *)((uintptr_t) txq->cqes), - sizeof(struct mlx5_cqe) * + sizeof(struct mlx5_error_cqe) * (1 << txq->cqe_n)); mlx5_dump_debug_information(name, "MLX5 Error SQ:", (const void *)((uintptr_t) @@ -206,7 +206,7 @@ */ rte_wmb(); ret = mlx5_tx_error_cqe_handle - (txq, (volatile struct mlx5_err_cqe *)cqe); + (txq, (volatile struct mlx5_error_cqe *)cqe); if (unlikely(ret < 0)) { /* * Some error occurred on queue error diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_tx.h dpdk-22.11.7/drivers/net/mlx5/mlx5_tx.h --- dpdk-22.11.6/drivers/net/mlx5/mlx5_tx.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_tx.h 2024-12-13 14:35:22.000000000 +0000 @@ -18,6 +18,7 @@ #include #include "mlx5.h" +#include "mlx5_rx.h" #include "mlx5_autoconf.h" /* TX burst subroutines return codes. */ @@ -362,6 +363,35 @@ } /** + * Read real time clock counter directly from the device PCI BAR area. + * The PCI BAR must be mapped to the process memory space at initialization. + * + * @param dev + * Device to read clock counter from + * + * @return + * 0 - if HCA BAR is not supported or not mapped. + * !=0 - read 64-bit value of real-time in UTC formatv (nanoseconds) + */ +static __rte_always_inline uint64_t mlx5_read_pcibar_clock(struct rte_eth_dev *dev) +{ + struct mlx5_proc_priv *ppriv = dev->process_private; + + if (ppriv && ppriv->hca_bar) { + struct mlx5_priv *priv = dev->data->dev_private; + struct mlx5_dev_ctx_shared *sh = priv->sh; + uint64_t *hca_ptr = (uint64_t *)(ppriv->hca_bar) + + __mlx5_64_off(initial_seg, real_time); + uint64_t ts = __atomic_load_n(hca_ptr, __ATOMIC_SEQ_CST); + + ts = rte_be_to_cpu_64(ts); + ts = mlx5_txpp_convert_rx_ts(sh, ts); + return ts; + } + return 0; +} + +/** * Set Software Parser flags and offsets in Ethernet Segment of WQE. * Flags must be preliminary initialized to zero. * diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_txpp.c dpdk-22.11.7/drivers/net/mlx5/mlx5_txpp.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_txpp.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_txpp.c 2024-12-13 14:35:22.000000000 +0000 @@ -969,7 +969,6 @@ { struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_dev_ctx_shared *sh = priv->sh; - struct mlx5_proc_priv *ppriv; uint64_t ts; int ret; @@ -995,15 +994,9 @@ *timestamp = ts; return 0; } - /* Check and try to map HCA PIC BAR to allow reading real time. */ - ppriv = dev->process_private; - if (ppriv && !ppriv->hca_bar && - sh->dev_cap.rt_timestamp && mlx5_dev_is_pci(dev->device)) - mlx5_txpp_map_hca_bar(dev); /* Check if we can read timestamp directly from hardware. */ - if (ppriv && ppriv->hca_bar) { - ts = MLX5_GET64(initial_seg, ppriv->hca_bar, real_time); - ts = mlx5_txpp_convert_rx_ts(sh, ts); + ts = mlx5_read_pcibar_clock(dev); + if (ts != 0) { *timestamp = ts; return 0; } diff -Nru dpdk-22.11.6/drivers/net/mlx5/mlx5_txq.c dpdk-22.11.7/drivers/net/mlx5/mlx5_txq.c --- dpdk-22.11.6/drivers/net/mlx5/mlx5_txq.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/mlx5_txq.c 2024-12-13 14:35:22.000000000 +0000 @@ -332,6 +332,14 @@ { struct mlx5_priv *priv = dev->data->dev_private; + if (*desc > 1 << priv->sh->cdev->config.hca_attr.log_max_wq_sz) { + DRV_LOG(ERR, + "port %u number of descriptors requested for Tx queue" + " %u is more than supported", + dev->data->port_id, idx); + rte_errno = EINVAL; + return -EINVAL; + } if (*desc <= MLX5_TX_COMP_THRESH) { DRV_LOG(WARNING, "port %u number of descriptors requested for Tx queue" diff -Nru dpdk-22.11.6/drivers/net/mlx5/windows/mlx5_os.c dpdk-22.11.7/drivers/net/mlx5/windows/mlx5_os.c --- dpdk-22.11.6/drivers/net/mlx5/windows/mlx5_os.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mlx5/windows/mlx5_os.c 2024-12-13 14:35:22.000000000 +0000 @@ -474,9 +474,11 @@ claim_zero(mlx5_mac_addr_add(eth_dev, &mac, 0, 0)); priv->ctrl_flows = 0; TAILQ_INIT(&priv->flow_meters); - priv->mtr_profile_tbl = mlx5_l3t_create(MLX5_L3T_TYPE_PTR); - if (!priv->mtr_profile_tbl) - goto error; + if (priv->mtr_en) { + priv->mtr_profile_tbl = mlx5_l3t_create(MLX5_L3T_TYPE_PTR); + if (!priv->mtr_profile_tbl) + goto error; + } /* Bring Ethernet device up. */ DRV_LOG(DEBUG, "port %u forcing Ethernet interface up.", eth_dev->data->port_id); diff -Nru dpdk-22.11.6/drivers/net/mvneta/mvneta_ethdev.c dpdk-22.11.7/drivers/net/mvneta/mvneta_ethdev.c --- dpdk-22.11.6/drivers/net/mvneta/mvneta_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/mvneta/mvneta_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -91,6 +91,12 @@ { struct mvneta_ifnames *ifnames = extra_args; + if (ifnames->idx >= NETA_NUM_ETH_PPIO) { + MVNETA_LOG(ERR, "Too many ifnames specified (max %u)", + NETA_NUM_ETH_PPIO); + return -EINVAL; + } + ifnames->names[ifnames->idx++] = value; return 0; diff -Nru dpdk-22.11.6/drivers/net/netvsc/hn_ethdev.c dpdk-22.11.7/drivers/net/netvsc/hn_ethdev.c --- dpdk-22.11.6/drivers/net/netvsc/hn_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/netvsc/hn_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -313,6 +313,15 @@ if (reta_conf[idx].mask & mask) hv->rss_ind[i] = reta_conf[idx].reta[shift]; + + /* + * Ensure we don't allow config that directs traffic to an Rx + * queue that we aren't going to poll + */ + if (hv->rss_ind[i] >= dev->data->nb_rx_queues) { + PMD_DRV_LOG(ERR, "RSS distributing traffic to invalid Rx queue"); + return -EINVAL; + } } err = hn_rndis_conf_rss(hv, NDIS_RSS_FLAG_DISABLE); diff -Nru dpdk-22.11.6/drivers/net/netvsc/hn_rxtx.c dpdk-22.11.7/drivers/net/netvsc/hn_rxtx.c --- dpdk-22.11.6/drivers/net/netvsc/hn_rxtx.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/netvsc/hn_rxtx.c 2024-12-13 14:35:22.000000000 +0000 @@ -234,6 +234,17 @@ txq->agg_prevpkt = NULL; } +static void +hn_rx_queue_free_common(struct hn_rx_queue *rxq) +{ + if (!rxq) + return; + + rte_free(rxq->rxbuf_info); + rte_free(rxq->event_buf); + rte_free(rxq); +} + int hn_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, @@ -243,6 +254,7 @@ { struct hn_data *hv = dev->data->dev_private; struct hn_tx_queue *txq; + struct hn_rx_queue *rxq = NULL; char name[RTE_MEMPOOL_NAMESIZE]; uint32_t tx_free_thresh; int err = -ENOMEM; @@ -301,6 +313,27 @@ goto error; } + /* + * If there are more Tx queues than Rx queues, allocate rx_queues + * with event buffer so that Tx completion messages can still be + * received + */ + if (queue_idx >= dev->data->nb_rx_queues) { + rxq = hn_rx_queue_alloc(hv, queue_idx, socket_id); + + if (!rxq) { + err = -ENOMEM; + goto error; + } + + /* + * Don't allocate mbuf pool or rx ring. RSS is always configured + * to ensure packets aren't received by this Rx queue. + */ + rxq->mb_pool = NULL; + rxq->rx_ring = NULL; + } + txq->agg_szmax = RTE_MIN(hv->chim_szmax, hv->rndis_agg_size); txq->agg_pktmax = hv->rndis_agg_pkts; txq->agg_align = hv->rndis_agg_align; @@ -311,12 +344,15 @@ socket_id, tx_conf); if (err == 0) { dev->data->tx_queues[queue_idx] = txq; + if (rxq != NULL) + dev->data->rx_queues[queue_idx] = rxq; return 0; } error: rte_mempool_free(txq->txdesc_pool); rte_memzone_free(txq->tx_rndis_mz); + hn_rx_queue_free_common(rxq); rte_free(txq); return err; } @@ -363,6 +399,12 @@ if (!txq) return; + /* + * Free any Rx queues allocated for a Tx queue without a corresponding + * Rx queue + */ + if (qid >= dev->data->nb_rx_queues) + hn_rx_queue_free_common(dev->data->rx_queues[qid]); rte_mempool_free(txq->txdesc_pool); @@ -552,10 +594,12 @@ const struct hn_rxinfo *info) { struct hn_data *hv = rxq->hv; - struct rte_mbuf *m; + struct rte_mbuf *m = NULL; bool use_extbuf = false; - m = rte_pktmbuf_alloc(rxq->mb_pool); + if (likely(rxq->mb_pool != NULL)) + m = rte_pktmbuf_alloc(rxq->mb_pool); + if (unlikely(!m)) { struct rte_eth_dev *dev = &rte_eth_devices[rxq->port_id]; @@ -942,7 +986,15 @@ if (queue_idx == 0) { rxq = hv->primary; } else { - rxq = hn_rx_queue_alloc(hv, queue_idx, socket_id); + /* + * If the number of Tx queues was previously greater than the + * number of Rx queues, we may already have allocated an rxq. + */ + if (!dev->data->rx_queues[queue_idx]) + rxq = hn_rx_queue_alloc(hv, queue_idx, socket_id); + else + rxq = dev->data->rx_queues[queue_idx]; + if (!rxq) return -ENOMEM; } @@ -975,9 +1027,10 @@ fail: rte_ring_free(rxq->rx_ring); - rte_free(rxq->rxbuf_info); - rte_free(rxq->event_buf); - rte_free(rxq); + /* Only free rxq if it was created in this function. */ + if (!dev->data->rx_queues[queue_idx]) + hn_rx_queue_free_common(rxq); + return error; } @@ -998,9 +1051,7 @@ if (keep_primary && rxq == rxq->hv->primary) return; - rte_free(rxq->rxbuf_info); - rte_free(rxq->event_buf); - rte_free(rxq); + hn_rx_queue_free_common(rxq); } void @@ -1518,14 +1569,32 @@ for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) { struct rte_mbuf *m = tx_pkts[nb_tx]; - uint32_t pkt_size = m->pkt_len + HN_RNDIS_PKT_LEN; struct rndis_packet_msg *pkt; struct hn_txdesc *txd; + uint32_t pkt_size; txd = hn_txd_get(txq); if (txd == NULL) break; + if (!(m->ol_flags & RTE_MBUF_F_TX_VLAN)) { + struct rte_ether_hdr *eh = + rte_pktmbuf_mtod(m, struct rte_ether_hdr *); + struct rte_vlan_hdr *vh; + + /* Force TX vlan offloading for 801.2Q packet */ + if (eh->ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN)) { + vh = (struct rte_vlan_hdr *)(eh + 1); + m->ol_flags |= RTE_MBUF_F_TX_VLAN; + m->vlan_tci = rte_be_to_cpu_16(vh->vlan_tci); + + /* Copy ether header over */ + memmove(rte_pktmbuf_adj(m, sizeof(struct rte_vlan_hdr)), + eh, 2 * RTE_ETHER_ADDR_LEN); + } + } + pkt_size = m->pkt_len + HN_RNDIS_PKT_LEN; + /* For small packets aggregate them in chimney buffer */ if (m->pkt_len <= hv->tx_copybreak && pkt_size <= txq->agg_szmax) { diff -Nru dpdk-22.11.6/drivers/net/nfb/nfb_rx.c dpdk-22.11.7/drivers/net/nfb/nfb_rx.c --- dpdk-22.11.6/drivers/net/nfb/nfb_rx.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/nfb/nfb_rx.c 2024-12-13 14:35:22.000000000 +0000 @@ -129,7 +129,7 @@ if (rxq->queue != NULL) { ndp_close_rx_queue(rxq->queue); - rte_free(rxq); rxq->queue = NULL; + rte_free(rxq); } } diff -Nru dpdk-22.11.6/drivers/net/nfb/nfb_tx.c dpdk-22.11.7/drivers/net/nfb/nfb_tx.c --- dpdk-22.11.6/drivers/net/nfb/nfb_tx.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/nfb/nfb_tx.c 2024-12-13 14:35:22.000000000 +0000 @@ -108,7 +108,7 @@ if (txq->queue != NULL) { ndp_close_tx_queue(txq->queue); - rte_free(txq); txq->queue = NULL; + rte_free(txq); } } diff -Nru dpdk-22.11.6/drivers/net/nfp/nfp_ethdev.c dpdk-22.11.7/drivers/net/nfp/nfp_ethdev.c --- dpdk-22.11.6/drivers/net/nfp/nfp_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/nfp/nfp_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -205,6 +205,7 @@ static int nfp_net_stop(struct rte_eth_dev *dev) { + int ret; struct nfp_net_hw *hw; PMD_INIT_LOG(DEBUG, "Stop"); @@ -220,10 +221,12 @@ if (rte_eal_process_type() == RTE_PROC_PRIMARY) /* Configure the physical port down */ - nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); + ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); else - nfp_eth_set_configured(dev->process_private, + ret = nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 0); + if (ret < 0) + return ret; return 0; } @@ -232,6 +235,7 @@ static int nfp_net_set_link_up(struct rte_eth_dev *dev) { + int ret; struct nfp_net_hw *hw; PMD_DRV_LOG(DEBUG, "Set link up"); @@ -240,16 +244,21 @@ if (rte_eal_process_type() == RTE_PROC_PRIMARY) /* Configure the physical port down */ - return nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 1); + ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 1); else - return nfp_eth_set_configured(dev->process_private, + ret = nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 1); + if (ret < 0) + return ret; + + return 0; } /* Set the link down. */ static int nfp_net_set_link_down(struct rte_eth_dev *dev) { + int ret; struct nfp_net_hw *hw; PMD_DRV_LOG(DEBUG, "Set link down"); @@ -258,10 +267,14 @@ if (rte_eal_process_type() == RTE_PROC_PRIMARY) /* Configure the physical port down */ - return nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); + ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0); else - return nfp_eth_set_configured(dev->process_private, + ret = nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 0); + if (ret < 0) + return ret; + + return 0; } static void diff -Nru dpdk-22.11.6/drivers/net/nfp/nfp_flow.c dpdk-22.11.7/drivers/net/nfp/nfp_flow.c --- dpdk-22.11.6/drivers/net/nfp/nfp_flow.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/nfp/nfp_flow.c 2024-12-13 14:35:22.000000000 +0000 @@ -3019,7 +3019,6 @@ goto free_entry; } - rte_free(entry); rte_free(find_entry); priv->pre_tun_cnt--; diff -Nru dpdk-22.11.6/drivers/net/ngbe/base/ngbe_regs.h dpdk-22.11.7/drivers/net/ngbe/base/ngbe_regs.h --- dpdk-22.11.6/drivers/net/ngbe/base/ngbe_regs.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ngbe/base/ngbe_regs.h 2024-12-13 14:35:22.000000000 +0000 @@ -712,6 +712,8 @@ #define NGBE_MACRXFLT_CTL_PASS LS(3, 6, 0x3) #define NGBE_MACRXFLT_RXALL MS(31, 0x1) +#define NGBE_MAC_WDG_TIMEOUT 0x01100C + /****************************************************************************** * Statistic Registers ******************************************************************************/ diff -Nru dpdk-22.11.6/drivers/net/ngbe/ngbe_ethdev.c dpdk-22.11.7/drivers/net/ngbe/ngbe_ethdev.c --- dpdk-22.11.6/drivers/net/ngbe/ngbe_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/ngbe/ngbe_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -263,6 +263,8 @@ status = hw->mac.reset_hw(hw); ctrl_ext = rd32(hw, NGBE_PORTCTL); + /* let hardware know driver is loaded */ + ctrl_ext |= NGBE_PORTCTL_DRVLOAD; /* Set PF Reset Done bit so PF/VF Mail Ops can work */ ctrl_ext |= NGBE_PORTCTL_RSTDONE; wr32(hw, NGBE_PORTCTL, ctrl_ext); @@ -582,41 +584,25 @@ } static void -ngbe_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on) +ngbe_vlan_strip_q_set(struct rte_eth_dev *dev, uint16_t queue, int on) { - struct ngbe_hw *hw = ngbe_dev_hw(dev); - struct ngbe_rx_queue *rxq; - bool restart; - uint32_t rxcfg, rxbal, rxbah; - if (on) ngbe_vlan_hw_strip_enable(dev, queue); else ngbe_vlan_hw_strip_disable(dev, queue); +} - rxq = dev->data->rx_queues[queue]; - rxbal = rd32(hw, NGBE_RXBAL(rxq->reg_idx)); - rxbah = rd32(hw, NGBE_RXBAH(rxq->reg_idx)); - rxcfg = rd32(hw, NGBE_RXCFG(rxq->reg_idx)); - if (rxq->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) { - restart = (rxcfg & NGBE_RXCFG_ENA) && - !(rxcfg & NGBE_RXCFG_VLAN); - rxcfg |= NGBE_RXCFG_VLAN; - } else { - restart = (rxcfg & NGBE_RXCFG_ENA) && - (rxcfg & NGBE_RXCFG_VLAN); - rxcfg &= ~NGBE_RXCFG_VLAN; - } - rxcfg &= ~NGBE_RXCFG_ENA; - - if (restart) { - /* set vlan strip for ring */ - ngbe_dev_rx_queue_stop(dev, queue); - wr32(hw, NGBE_RXBAL(rxq->reg_idx), rxbal); - wr32(hw, NGBE_RXBAH(rxq->reg_idx), rxbah); - wr32(hw, NGBE_RXCFG(rxq->reg_idx), rxcfg); - ngbe_dev_rx_queue_start(dev, queue); +static void +ngbe_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on) +{ + struct ngbe_hw *hw = ngbe_dev_hw(dev); + + if (!hw->adapter_stopped) { + PMD_DRV_LOG(ERR, "Please stop port first"); + return; } + + ngbe_vlan_strip_q_set(dev, queue, on); } static int @@ -842,9 +828,9 @@ rxq = dev->data->rx_queues[i]; if (rxq->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) - ngbe_vlan_hw_strip_enable(dev, i); + ngbe_vlan_strip_q_set(dev, i, 1); else - ngbe_vlan_hw_strip_disable(dev, i); + ngbe_vlan_strip_q_set(dev, i, 0); } } @@ -906,6 +892,13 @@ static int ngbe_vlan_offload_set(struct rte_eth_dev *dev, int mask) { + struct ngbe_hw *hw = ngbe_dev_hw(dev); + + if (!hw->adapter_stopped && (mask & RTE_ETH_VLAN_STRIP_MASK)) { + PMD_DRV_LOG(ERR, "Please stop port first"); + return -EPERM; + } + ngbe_config_vlan_strip_on_all_queues(dev, mask); ngbe_vlan_offload_config(dev, mask); @@ -1269,6 +1262,9 @@ ngbe_dev_stop(dev); + /* Let firmware take over control of hardware */ + wr32m(hw, NGBE_PORTCTL, NGBE_PORTCTL_DRVLOAD, 0); + ngbe_dev_free_queues(dev); ngbe_set_pcie_master(hw, false); @@ -1889,6 +1885,7 @@ bool link_up; int err; int wait = 1; + u32 reg; memset(&link, 0, sizeof(link)); link.link_status = RTE_ETH_LINK_DOWN; @@ -1946,8 +1943,13 @@ wr32m(hw, NGBE_MACTXCFG, NGBE_MACTXCFG_SPEED_MASK, NGBE_MACTXCFG_SPEED_1G | NGBE_MACTXCFG_TE); } + /* Re configure MAC RX */ + reg = rd32(hw, NGBE_MACRXCFG); + wr32(hw, NGBE_MACRXCFG, reg); wr32m(hw, NGBE_MACRXFLT, NGBE_MACRXFLT_PROMISC, NGBE_MACRXFLT_PROMISC); + reg = rd32(hw, NGBE_MAC_WDG_TIMEOUT); + wr32(hw, NGBE_MAC_WDG_TIMEOUT, reg); } return rte_eth_linkstatus_set(dev, &link); @@ -2135,6 +2137,19 @@ struct ngbe_hw *hw = ngbe_dev_hw(dev); struct ngbe_interrupt *intr = ngbe_dev_intr(dev); + eicr = ((u32 *)hw->isb_mem)[NGBE_ISB_VEC0]; + if (!eicr) { + /* + * shared interrupt alert! + * make sure interrupts are enabled because the read will + * have disabled interrupts. + */ + if (!hw->adapter_stopped) + ngbe_enable_intr(dev); + return 0; + } + ((u32 *)hw->isb_mem)[NGBE_ISB_VEC0] = 0; + /* read-on-clear nic registers here */ eicr = ((u32 *)hw->isb_mem)[NGBE_ISB_MISC]; PMD_DRV_LOG(DEBUG, "eicr %x", eicr); diff -Nru dpdk-22.11.6/drivers/net/pcap/pcap_ethdev.c dpdk-22.11.7/drivers/net/pcap/pcap_ethdev.c --- dpdk-22.11.6/drivers/net/pcap/pcap_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/pcap/pcap_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -274,7 +274,7 @@ eth_pcap_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) { unsigned int i; - struct pcap_pkthdr header; + struct pcap_pkthdr *header; struct pmd_process_private *pp; const u_char *packet; struct rte_mbuf *mbuf; @@ -294,9 +294,13 @@ */ for (i = 0; i < nb_pkts; i++) { /* Get the next PCAP packet */ - packet = pcap_next(pcap, &header); - if (unlikely(packet == NULL)) + int ret = pcap_next_ex(pcap, &header, &packet); + if (ret != 1) { + if (ret == PCAP_ERROR) + pcap_q->rx_stat.err_pkts++; + break; + } mbuf = rte_pktmbuf_alloc(pcap_q->mb_pool); if (unlikely(mbuf == NULL)) { @@ -304,33 +308,30 @@ break; } - if (header.caplen <= rte_pktmbuf_tailroom(mbuf)) { + uint32_t len = header->caplen; + if (len <= rte_pktmbuf_tailroom(mbuf)) { /* pcap packet will fit in the mbuf, can copy it */ - rte_memcpy(rte_pktmbuf_mtod(mbuf, void *), packet, - header.caplen); - mbuf->data_len = (uint16_t)header.caplen; + rte_memcpy(rte_pktmbuf_mtod(mbuf, void *), packet, len); + mbuf->data_len = len; } else { /* Try read jumbo frame into multi mbufs. */ if (unlikely(eth_pcap_rx_jumbo(pcap_q->mb_pool, - mbuf, - packet, - header.caplen) == -1)) { + mbuf, packet, len) == -1)) { pcap_q->rx_stat.err_pkts++; rte_pktmbuf_free(mbuf); break; } } - mbuf->pkt_len = (uint16_t)header.caplen; - *RTE_MBUF_DYNFIELD(mbuf, timestamp_dynfield_offset, - rte_mbuf_timestamp_t *) = - (uint64_t)header.ts.tv_sec * 1000000 + - header.ts.tv_usec; + mbuf->pkt_len = len; + uint64_t us = (uint64_t)header->ts.tv_sec * US_PER_S + header->ts.tv_usec; + + *RTE_MBUF_DYNFIELD(mbuf, timestamp_dynfield_offset, rte_mbuf_timestamp_t *) = us; mbuf->ol_flags |= timestamp_rx_dynflag; mbuf->port = pcap_q->port_id; bufs[num_rx] = mbuf; num_rx++; - rx_bytes += header.caplen; + rx_bytes += len; } pcap_q->rx_stat.pkts += num_rx; pcap_q->rx_stat.bytes += rx_bytes; @@ -522,6 +523,12 @@ return -1; } + if (pcap_setnonblock(*pcap, 1, errbuf)) { + PMD_LOG(ERR, "Couldn't set non-blocking on %s: %s", iface, errbuf); + pcap_close(*pcap); + return -1; + } + return 0; } diff -Nru dpdk-22.11.6/drivers/net/sfc/sfc_flow_rss.c dpdk-22.11.7/drivers/net/sfc/sfc_flow_rss.c --- dpdk-22.11.6/drivers/net/sfc/sfc_flow_rss.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/sfc/sfc_flow_rss.c 2024-12-13 14:35:22.000000000 +0000 @@ -303,9 +303,9 @@ TAILQ_REMOVE(&flow_rss->ctx_list, ctx, entries); rte_free(ctx->qid_offsets); - rte_free(ctx); - sfc_dbg(sa, "flow-rss: deleted ctx=%p", ctx); + + rte_free(ctx); } static int diff -Nru dpdk-22.11.6/drivers/net/sfc/sfc_mae.c dpdk-22.11.7/drivers/net/sfc/sfc_mae.c --- dpdk-22.11.6/drivers/net/sfc/sfc_mae.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/sfc/sfc_mae.c 2024-12-13 14:35:22.000000000 +0000 @@ -421,9 +421,8 @@ efx_mae_match_spec_fini(sa->nic, rule->match_spec); TAILQ_REMOVE(&mae->outer_rules, rule, entries); - rte_free(rule); - sfc_dbg(sa, "deleted outer_rule=%p", rule); + rte_free(rule); } static int @@ -582,9 +581,8 @@ } TAILQ_REMOVE(&mae->mac_addrs, mac_addr, entries); - rte_free(mac_addr); - sfc_dbg(sa, "deleted mac_addr=%p", mac_addr); + rte_free(mac_addr); } enum sfc_mae_mac_addr_type { @@ -779,10 +777,10 @@ } TAILQ_REMOVE(&mae->encap_headers, encap_header, entries); + sfc_dbg(sa, "deleted encap_header=%p", encap_header); + rte_free(encap_header->buf); rte_free(encap_header); - - sfc_dbg(sa, "deleted encap_header=%p", encap_header); } static int @@ -1085,9 +1083,8 @@ rte_free(action_set->counters); } TAILQ_REMOVE(&mae->action_sets, action_set, entries); - rte_free(action_set); - sfc_dbg(sa, "deleted action_set=%p", action_set); + rte_free(action_set); } static int diff -Nru dpdk-22.11.6/drivers/net/tap/rte_eth_tap.c dpdk-22.11.7/drivers/net/tap/rte_eth_tap.c --- dpdk-22.11.6/drivers/net/tap/rte_eth_tap.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/tap/rte_eth_tap.c 2024-12-13 14:35:22.000000000 +0000 @@ -2453,7 +2453,7 @@ reply.num_fds = 0; reply_param->rxq_count = 0; if (dev->data->nb_rx_queues + dev->data->nb_tx_queues > - RTE_MP_MAX_FD_NUM){ + RTE_PMD_TAP_MAX_QUEUES){ TAP_LOG(ERR, "Number of rx/tx queues exceeds max number of fds"); return -1; } diff -Nru dpdk-22.11.6/drivers/net/tap/tap_netlink.c dpdk-22.11.7/drivers/net/tap/tap_netlink.c --- dpdk-22.11.6/drivers/net/tap/tap_netlink.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/tap/tap_netlink.c 2024-12-13 14:35:22.000000000 +0000 @@ -302,7 +302,8 @@ rta = (struct rtattr *)NLMSG_TAIL(nh); rta->rta_len = RTA_LENGTH(data_len); rta->rta_type = type; - memcpy(RTA_DATA(rta), data, data_len); + if (data_len > 0) + memcpy(RTA_DATA(rta), data, data_len); nh->nlmsg_len = NLMSG_ALIGN(nh->nlmsg_len) + RTA_ALIGN(rta->rta_len); } diff -Nru dpdk-22.11.6/drivers/net/txgbe/base/txgbe_mng.c dpdk-22.11.7/drivers/net/txgbe/base/txgbe_mng.c --- dpdk-22.11.6/drivers/net/txgbe/base/txgbe_mng.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/txgbe/base/txgbe_mng.c 2024-12-13 14:35:22.000000000 +0000 @@ -58,6 +58,7 @@ dword_len = length >> 2; + txgbe_flush(hw); /* The device driver writes the relevant command block * into the ram area. */ diff -Nru dpdk-22.11.6/drivers/net/txgbe/base/txgbe_regs.h dpdk-22.11.7/drivers/net/txgbe/base/txgbe_regs.h --- dpdk-22.11.6/drivers/net/txgbe/base/txgbe_regs.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/txgbe/base/txgbe_regs.h 2024-12-13 14:35:22.000000000 +0000 @@ -1197,7 +1197,7 @@ #define TXGBE_ICRMISC_ANDONE MS(19, 0x1) /* link auto-nego done */ #define TXGBE_ICRMISC_ERRIG MS(20, 0x1) /* integrity error */ #define TXGBE_ICRMISC_SPI MS(21, 0x1) /* SPI interface */ -#define TXGBE_ICRMISC_VFMBX MS(22, 0x1) /* VF-PF message box */ +#define TXGBE_ICRMISC_VFMBX MS(23, 0x1) /* VF-PF message box */ #define TXGBE_ICRMISC_GPIO MS(26, 0x1) /* GPIO interrupt */ #define TXGBE_ICRMISC_ERRPCI MS(27, 0x1) /* pcie request error */ #define TXGBE_ICRMISC_HEAT MS(28, 0x1) /* overheat detection */ diff -Nru dpdk-22.11.6/drivers/net/txgbe/txgbe_ethdev.c dpdk-22.11.7/drivers/net/txgbe/txgbe_ethdev.c --- dpdk-22.11.6/drivers/net/txgbe/txgbe_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/txgbe/txgbe_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -330,6 +330,8 @@ status = hw->mac.reset_hw(hw); ctrl_ext = rd32(hw, TXGBE_PORTCTL); + /* let hardware know driver is loaded */ + ctrl_ext |= TXGBE_PORTCTL_DRVLOAD; /* Set PF Reset Done bit so PF/VF Mail Ops can work */ ctrl_ext |= TXGBE_PORTCTL_RSTDONE; wr32(hw, TXGBE_PORTCTL, ctrl_ext); @@ -2046,6 +2048,9 @@ ret = txgbe_dev_stop(dev); + /* Let firmware take over control of hardware */ + wr32m(hw, TXGBE_PORTCTL, TXGBE_PORTCTL_DRVLOAD, 0); + txgbe_dev_free_queues(dev); txgbe_set_pcie_master(hw, false); diff -Nru dpdk-22.11.6/drivers/net/txgbe/txgbe_rxtx.c dpdk-22.11.7/drivers/net/txgbe/txgbe_rxtx.c --- dpdk-22.11.6/drivers/net/txgbe/txgbe_rxtx.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/txgbe/txgbe_rxtx.c 2024-12-13 14:35:22.000000000 +0000 @@ -2254,8 +2254,7 @@ tx_offload_capa |= RTE_ETH_TX_OFFLOAD_MACSEC_INSERT; - tx_offload_capa |= RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM | - RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM; + tx_offload_capa |= RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM; #ifdef RTE_LIB_SECURITY if (dev->security_ctx) diff -Nru dpdk-22.11.6/drivers/net/virtio/virtio_user_ethdev.c dpdk-22.11.7/drivers/net/virtio/virtio_user_ethdev.c --- dpdk-22.11.6/drivers/net/virtio/virtio_user_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/virtio/virtio_user_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -199,6 +199,7 @@ vring->device = (void *)(uintptr_t)used_addr; dev->packed_queues[queue_idx].avail_wrap_counter = true; dev->packed_queues[queue_idx].used_wrap_counter = true; + dev->packed_queues[queue_idx].used_idx = 0; for (i = 0; i < vring->num; i++) vring->desc[i].flags = 0; diff -Nru dpdk-22.11.6/drivers/net/vmxnet3/vmxnet3_ethdev.c dpdk-22.11.7/drivers/net/vmxnet3/vmxnet3_ethdev.c --- dpdk-22.11.6/drivers/net/vmxnet3/vmxnet3_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/vmxnet3/vmxnet3_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -347,6 +347,7 @@ /* Vendor and Device ID need to be set before init of shared code */ hw->device_id = pci_dev->id.device_id; hw->vendor_id = pci_dev->id.vendor_id; + hw->adapter_stopped = TRUE; hw->hw_addr0 = (void *)pci_dev->mem_resource[0].addr; hw->hw_addr1 = (void *)pci_dev->mem_resource[1].addr; @@ -1376,42 +1377,52 @@ struct vmxnet3_hw *hw = dev->data->dev_private; struct UPT1_TxStats txStats; struct UPT1_RxStats rxStats; + uint64_t packets, bytes; VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS); for (i = 0; i < hw->num_tx_queues; i++) { vmxnet3_tx_stats_get(hw, i, &txStats); - stats->q_opackets[i] = txStats.ucastPktsTxOK + + packets = txStats.ucastPktsTxOK + txStats.mcastPktsTxOK + txStats.bcastPktsTxOK; - stats->q_obytes[i] = txStats.ucastBytesTxOK + + bytes = txStats.ucastBytesTxOK + txStats.mcastBytesTxOK + txStats.bcastBytesTxOK; - stats->opackets += stats->q_opackets[i]; - stats->obytes += stats->q_obytes[i]; + stats->opackets += packets; + stats->obytes += bytes; stats->oerrors += txStats.pktsTxError + txStats.pktsTxDiscard; + + if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { + stats->q_opackets[i] = packets; + stats->q_obytes[i] = bytes; + } } for (i = 0; i < hw->num_rx_queues; i++) { vmxnet3_rx_stats_get(hw, i, &rxStats); - stats->q_ipackets[i] = rxStats.ucastPktsRxOK + + packets = rxStats.ucastPktsRxOK + rxStats.mcastPktsRxOK + rxStats.bcastPktsRxOK; - stats->q_ibytes[i] = rxStats.ucastBytesRxOK + + bytes = rxStats.ucastBytesRxOK + rxStats.mcastBytesRxOK + rxStats.bcastBytesRxOK; - stats->ipackets += stats->q_ipackets[i]; - stats->ibytes += stats->q_ibytes[i]; - - stats->q_errors[i] = rxStats.pktsRxError; + stats->ipackets += packets; + stats->ibytes += bytes; stats->ierrors += rxStats.pktsRxError; stats->imissed += rxStats.pktsRxOutOfBuf; + + if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { + stats->q_ipackets[i] = packets; + stats->q_ibytes[i] = bytes; + stats->q_errors[i] = rxStats.pktsRxError; + } } return 0; @@ -1427,8 +1438,6 @@ VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS); - RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_TX_QUEUES); - for (i = 0; i < hw->num_tx_queues; i++) { vmxnet3_hw_tx_stats_get(hw, i, &txStats); memcpy(&hw->snapshot_tx_stats[i], &txStats, @@ -1472,7 +1481,7 @@ dev_info->min_rx_bufsize = 1518 + RTE_PKTMBUF_HEADROOM; dev_info->max_rx_pktlen = 16384; /* includes CRC, cf MAXFRS register */ dev_info->min_mtu = VMXNET3_MIN_MTU; - dev_info->max_mtu = VMXNET3_MAX_MTU; + dev_info->max_mtu = VMXNET3_VERSION_GE_6(hw) ? VMXNET3_V6_MAX_MTU : VMXNET3_MAX_MTU; dev_info->speed_capa = RTE_ETH_LINK_SPEED_10G; dev_info->max_mac_addrs = VMXNET3_MAX_MAC_ADDRS; diff -Nru dpdk-22.11.6/drivers/net/vmxnet3/vmxnet3_ethdev.h dpdk-22.11.7/drivers/net/vmxnet3/vmxnet3_ethdev.h --- dpdk-22.11.6/drivers/net/vmxnet3/vmxnet3_ethdev.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/net/vmxnet3/vmxnet3_ethdev.h 2024-12-13 14:35:22.000000000 +0000 @@ -120,8 +120,8 @@ #define VMXNET3_VFT_TABLE_SIZE (VMXNET3_VFT_SIZE * sizeof(uint32_t)) UPT1_TxStats saved_tx_stats[VMXNET3_EXT_MAX_TX_QUEUES]; UPT1_RxStats saved_rx_stats[VMXNET3_EXT_MAX_RX_QUEUES]; - UPT1_TxStats snapshot_tx_stats[VMXNET3_MAX_TX_QUEUES]; - UPT1_RxStats snapshot_rx_stats[VMXNET3_MAX_RX_QUEUES]; + UPT1_TxStats snapshot_tx_stats[VMXNET3_EXT_MAX_TX_QUEUES]; + UPT1_RxStats snapshot_rx_stats[VMXNET3_EXT_MAX_RX_QUEUES]; }; #define VMXNET3_REV_6 5 /* Vmxnet3 Rev. 6 */ diff -Nru dpdk-22.11.6/drivers/raw/ifpga/base/opae_intel_max10.c dpdk-22.11.7/drivers/raw/ifpga/base/opae_intel_max10.c --- dpdk-22.11.6/drivers/raw/ifpga/base/opae_intel_max10.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/raw/ifpga/base/opae_intel_max10.c 2024-12-13 14:35:22.000000000 +0000 @@ -6,6 +6,13 @@ #include #include "opae_osdep.h" +#ifndef TAILQ_FOREACH_SAFE +#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = TAILQ_FIRST((head)); \ + (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ + (var) = (tvar)) +#endif + int max10_sys_read(struct intel_max10_device *dev, unsigned int offset, unsigned int *val) { @@ -746,9 +753,9 @@ static void max10_sensor_uinit(struct intel_max10_device *dev) { - struct opae_sensor_info *info; + struct opae_sensor_info *info, *next; - TAILQ_FOREACH(info, &dev->opae_sensor_list, node) { + TAILQ_FOREACH_SAFE(info, &dev->opae_sensor_list, node, next) { TAILQ_REMOVE(&dev->opae_sensor_list, info, node); opae_free(info); } diff -Nru dpdk-22.11.6/drivers/raw/ifpga/ifpga_rawdev.c dpdk-22.11.7/drivers/raw/ifpga/ifpga_rawdev.c --- dpdk-22.11.6/drivers/raw/ifpga/ifpga_rawdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/drivers/raw/ifpga/ifpga_rawdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -1498,7 +1498,7 @@ nb_intr = rte_intr_nb_intr_get(*intr_handle); - intr_efds = calloc(nb_intr, sizeof(int)); + intr_efds = rte_calloc("ifpga_efds", nb_intr, sizeof(int), 0); if (!intr_efds) return -ENOMEM; @@ -1507,7 +1507,7 @@ ret = opae_acc_set_irq(acc, vec_start, count, intr_efds); if (ret) { - free(intr_efds); + rte_free(intr_efds); return -EINVAL; } } @@ -1516,13 +1516,13 @@ ret = rte_intr_callback_register(*intr_handle, handler, (void *)arg); if (ret) { - free(intr_efds); + rte_free(intr_efds); return -EINVAL; } IFPGA_RAWDEV_PMD_INFO("success register %s interrupt\n", name); - free(intr_efds); + rte_free(intr_efds); return 0; } diff -Nru dpdk-22.11.6/examples/eventdev_pipeline/pipeline_worker_generic.c dpdk-22.11.7/examples/eventdev_pipeline/pipeline_worker_generic.c --- dpdk-22.11.6/examples/eventdev_pipeline/pipeline_worker_generic.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/eventdev_pipeline/pipeline_worker_generic.c 2024-12-13 14:35:22.000000000 +0000 @@ -38,10 +38,12 @@ } received++; - /* The first worker stage does classification */ - if (ev.queue_id == cdata.qid[0]) + /* The first worker stage does classification and sets txq. */ + if (ev.queue_id == cdata.qid[0]) { ev.flow_id = ev.mbuf->hash.rss % cdata.num_fids; + rte_event_eth_tx_adapter_txq_set(ev.mbuf, 0); + } ev.queue_id = cdata.next_qid[ev.queue_id]; ev.op = RTE_EVENT_OP_FORWARD; @@ -96,10 +98,12 @@ for (i = 0; i < nb_rx; i++) { - /* The first worker stage does classification */ - if (events[i].queue_id == cdata.qid[0]) + /* The first worker stage does classification and sets txq. */ + if (events[i].queue_id == cdata.qid[0]) { events[i].flow_id = events[i].mbuf->hash.rss % cdata.num_fids; + rte_event_eth_tx_adapter_txq_set(events[i].mbuf, 0); + } events[i].queue_id = cdata.next_qid[events[i].queue_id]; events[i].op = RTE_EVENT_OP_FORWARD; diff -Nru dpdk-22.11.6/examples/ipsec-secgw/ipsec-secgw.c dpdk-22.11.7/examples/ipsec-secgw/ipsec-secgw.c --- dpdk-22.11.6/examples/ipsec-secgw/ipsec-secgw.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/ipsec-secgw/ipsec-secgw.c 2024-12-13 14:35:22.000000000 +0000 @@ -626,12 +626,13 @@ uint32_t n; struct ipsec_traffic trf; unsigned int lcoreid = rte_lcore_id(); + const int nb_pkts = RTE_DIM(trf.ipsec.pkts); if (app_sa_prm.enable == 0) { /* dequeue packets from crypto-queue */ n = ipsec_inbound_cqp_dequeue(ctx, trf.ipsec.pkts, - RTE_DIM(trf.ipsec.pkts)); + RTE_MIN(MAX_PKT_BURST, nb_pkts)); trf.ip4.num = 0; trf.ip6.num = 0; @@ -663,12 +664,13 @@ { uint32_t n; struct ipsec_traffic trf; + const int nb_pkts = RTE_DIM(trf.ipsec.pkts); if (app_sa_prm.enable == 0) { /* dequeue packets from crypto-queue */ n = ipsec_outbound_cqp_dequeue(ctx, trf.ipsec.pkts, - RTE_DIM(trf.ipsec.pkts)); + RTE_MIN(MAX_PKT_BURST, nb_pkts)); trf.ip4.num = 0; trf.ip6.num = 0; diff -Nru dpdk-22.11.6/examples/ipsec-secgw/ipsec_process.c dpdk-22.11.7/examples/ipsec-secgw/ipsec_process.c --- dpdk-22.11.6/examples/ipsec-secgw/ipsec_process.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/ipsec-secgw/ipsec_process.c 2024-12-13 14:35:22.000000000 +0000 @@ -336,6 +336,7 @@ struct rte_ipsec_session *ss; struct traffic_type *out; struct rte_ipsec_group *pg; + const int nb_cops = RTE_DIM(trf->ipsec.pkts); struct rte_crypto_op *cop[RTE_DIM(trf->ipsec.pkts)]; struct rte_ipsec_group grp[RTE_DIM(trf->ipsec.pkts)]; @@ -345,7 +346,7 @@ out = &trf->ipsec; /* dequeue completed crypto-ops */ - n = ctx_dequeue(ctx, cop, RTE_DIM(cop)); + n = ctx_dequeue(ctx, cop, RTE_MIN(MAX_PKT_BURST, nb_cops)); if (n == 0) return; diff -Nru dpdk-22.11.6/examples/l2fwd-event/l2fwd_event.c dpdk-22.11.7/examples/l2fwd-event/l2fwd_event.c --- dpdk-22.11.6/examples/l2fwd-event/l2fwd_event.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/l2fwd-event/l2fwd_event.c 2024-12-13 14:35:22.000000000 +0000 @@ -141,6 +141,7 @@ rte_spinlock_lock(&evt_rsrc->evp.lock); if (index >= evt_rsrc->evp.nb_ports) { printf("No free event port is available\n"); + rte_spinlock_unlock(&evt_rsrc->evp.lock); return -1; } diff -Nru dpdk-22.11.6/examples/l3fwd/l3fwd_altivec.h dpdk-22.11.7/examples/l3fwd/l3fwd_altivec.h --- dpdk-22.11.6/examples/l3fwd/l3fwd_altivec.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/l3fwd/l3fwd_altivec.h 2024-12-13 14:35:22.000000000 +0000 @@ -11,6 +11,9 @@ #include "altivec/port_group.h" #include "l3fwd_common.h" +#undef SENDM_PORT_OVERHEAD +#define SENDM_PORT_OVERHEAD(x) ((x) + 2 * FWDSTEP) + /* * Update source and destination MAC addresses in the ethernet header. * Perform RFC1812 checks and updates for IPV4 packets. @@ -117,7 +120,8 @@ */ static __rte_always_inline void send_packets_multi(struct lcore_conf *qconf, struct rte_mbuf **pkts_burst, - uint16_t dst_port[MAX_PKT_BURST], int nb_rx) + uint16_t dst_port[SENDM_PORT_OVERHEAD(MAX_PKT_BURST)], + int nb_rx) { int32_t k; int j = 0; diff -Nru dpdk-22.11.6/examples/l3fwd/l3fwd_common.h dpdk-22.11.7/examples/l3fwd/l3fwd_common.h --- dpdk-22.11.6/examples/l3fwd/l3fwd_common.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/l3fwd/l3fwd_common.h 2024-12-13 14:35:22.000000000 +0000 @@ -19,6 +19,13 @@ #define IPV4_MIN_LEN_BE (sizeof(struct rte_ipv4_hdr) << 8) /* + * send_packet_multi() specific number of dest ports + * due to implementation we need to allocate array bigger then + * actual max number of elements in the array. + */ +#define SENDM_PORT_OVERHEAD(x) (x) + +/* * From http://www.rfc-editor.org/rfc/rfc1812.txt section 5.2.2: * - The IP version number must be 4. * - The IP header length field must be large enough to hold the diff -Nru dpdk-22.11.6/examples/l3fwd/l3fwd_em_hlm.h dpdk-22.11.7/examples/l3fwd/l3fwd_em_hlm.h --- dpdk-22.11.6/examples/l3fwd/l3fwd_em_hlm.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/l3fwd/l3fwd_em_hlm.h 2024-12-13 14:35:22.000000000 +0000 @@ -249,7 +249,7 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, uint16_t portid, struct lcore_conf *qconf) { - uint16_t dst_port[MAX_PKT_BURST]; + uint16_t dst_port[SENDM_PORT_OVERHEAD(MAX_PKT_BURST)]; l3fwd_em_process_packets(nb_rx, pkts_burst, dst_port, portid, qconf, 0); send_packets_multi(qconf, pkts_burst, dst_port, nb_rx); diff -Nru dpdk-22.11.6/examples/l3fwd/l3fwd_em_sequential.h dpdk-22.11.7/examples/l3fwd/l3fwd_em_sequential.h --- dpdk-22.11.6/examples/l3fwd/l3fwd_em_sequential.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/l3fwd/l3fwd_em_sequential.h 2024-12-13 14:35:22.000000000 +0000 @@ -79,7 +79,7 @@ uint16_t portid, struct lcore_conf *qconf) { int32_t i, j; - uint16_t dst_port[MAX_PKT_BURST]; + uint16_t dst_port[SENDM_PORT_OVERHEAD(MAX_PKT_BURST)]; if (nb_rx > 0) { rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[0], diff -Nru dpdk-22.11.6/examples/l3fwd/l3fwd_fib.c dpdk-22.11.7/examples/l3fwd/l3fwd_fib.c --- dpdk-22.11.6/examples/l3fwd/l3fwd_fib.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/l3fwd/l3fwd_fib.c 2024-12-13 14:35:22.000000000 +0000 @@ -121,7 +121,7 @@ { uint32_t ipv4_arr[nb_rx]; uint8_t ipv6_arr[nb_rx][RTE_FIB6_IPV6_ADDR_SIZE]; - uint16_t hops[nb_rx]; + uint16_t hops[SENDM_PORT_OVERHEAD(nb_rx)]; uint64_t hopsv4[nb_rx], hopsv6[nb_rx]; uint8_t type_arr[nb_rx]; uint32_t ipv4_cnt = 0, ipv6_cnt = 0; diff -Nru dpdk-22.11.6/examples/l3fwd/l3fwd_lpm_altivec.h dpdk-22.11.7/examples/l3fwd/l3fwd_lpm_altivec.h --- dpdk-22.11.6/examples/l3fwd/l3fwd_lpm_altivec.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/l3fwd/l3fwd_lpm_altivec.h 2024-12-13 14:35:22.000000000 +0000 @@ -145,7 +145,7 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, uint8_t portid, struct lcore_conf *qconf) { - uint16_t dst_port[MAX_PKT_BURST]; + uint16_t dst_port[SENDM_PORT_OVERHEAD(MAX_PKT_BURST)]; l3fwd_lpm_process_packets(nb_rx, pkts_burst, portid, dst_port, qconf, 0); diff -Nru dpdk-22.11.6/examples/l3fwd/l3fwd_lpm_neon.h dpdk-22.11.7/examples/l3fwd/l3fwd_lpm_neon.h --- dpdk-22.11.6/examples/l3fwd/l3fwd_lpm_neon.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/l3fwd/l3fwd_lpm_neon.h 2024-12-13 14:35:22.000000000 +0000 @@ -171,7 +171,7 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, uint16_t portid, struct lcore_conf *qconf) { - uint16_t dst_port[MAX_PKT_BURST]; + uint16_t dst_port[SENDM_PORT_OVERHEAD(MAX_PKT_BURST)]; l3fwd_lpm_process_packets(nb_rx, pkts_burst, portid, dst_port, qconf, 0); diff -Nru dpdk-22.11.6/examples/l3fwd/l3fwd_lpm_sse.h dpdk-22.11.7/examples/l3fwd/l3fwd_lpm_sse.h --- dpdk-22.11.6/examples/l3fwd/l3fwd_lpm_sse.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/l3fwd/l3fwd_lpm_sse.h 2024-12-13 14:35:22.000000000 +0000 @@ -129,7 +129,7 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, uint16_t portid, struct lcore_conf *qconf) { - uint16_t dst_port[MAX_PKT_BURST]; + uint16_t dst_port[SENDM_PORT_OVERHEAD(MAX_PKT_BURST)]; l3fwd_lpm_process_packets(nb_rx, pkts_burst, portid, dst_port, qconf, 0); diff -Nru dpdk-22.11.6/examples/l3fwd/l3fwd_neon.h dpdk-22.11.7/examples/l3fwd/l3fwd_neon.h --- dpdk-22.11.6/examples/l3fwd/l3fwd_neon.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/l3fwd/l3fwd_neon.h 2024-12-13 14:35:22.000000000 +0000 @@ -10,6 +10,9 @@ #include "neon/port_group.h" #include "l3fwd_common.h" +#undef SENDM_PORT_OVERHEAD +#define SENDM_PORT_OVERHEAD(x) ((x) + 2 * FWDSTEP) + /* * Update source and destination MAC addresses in the ethernet header. * Perform RFC1812 checks and updates for IPV4 packets. @@ -92,7 +95,8 @@ */ static __rte_always_inline void send_packets_multi(struct lcore_conf *qconf, struct rte_mbuf **pkts_burst, - uint16_t dst_port[MAX_PKT_BURST], int nb_rx) + uint16_t dst_port[SENDM_PORT_OVERHEAD(MAX_PKT_BURST)], + int nb_rx) { int32_t k; int j = 0; diff -Nru dpdk-22.11.6/examples/l3fwd/l3fwd_sse.h dpdk-22.11.7/examples/l3fwd/l3fwd_sse.h --- dpdk-22.11.6/examples/l3fwd/l3fwd_sse.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/l3fwd/l3fwd_sse.h 2024-12-13 14:35:22.000000000 +0000 @@ -10,6 +10,9 @@ #include "sse/port_group.h" #include "l3fwd_common.h" +#undef SENDM_PORT_OVERHEAD +#define SENDM_PORT_OVERHEAD(x) ((x) + 2 * FWDSTEP) + /* * Update source and destination MAC addresses in the ethernet header. * Perform RFC1812 checks and updates for IPV4 packets. @@ -91,7 +94,8 @@ */ static __rte_always_inline void send_packets_multi(struct lcore_conf *qconf, struct rte_mbuf **pkts_burst, - uint16_t dst_port[MAX_PKT_BURST], int nb_rx) + uint16_t dst_port[SENDM_PORT_OVERHEAD(MAX_PKT_BURST)], + int nb_rx) { int32_t k; int j = 0; diff -Nru dpdk-22.11.6/examples/ntb/ntb_fwd.c dpdk-22.11.7/examples/ntb/ntb_fwd.c --- dpdk-22.11.6/examples/ntb/ntb_fwd.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/ntb/ntb_fwd.c 2024-12-13 14:35:22.000000000 +0000 @@ -1443,7 +1443,10 @@ eth_port_id = rte_eth_find_next(0); if (eth_port_id < RTE_MAX_ETHPORTS) { - rte_eth_dev_info_get(eth_port_id, ðdev_info); + ret = rte_eth_dev_info_get(eth_port_id, ðdev_info); + if (ret) + rte_exit(EXIT_FAILURE, "Can't get info for port %u\n", eth_port_id); + eth_pconf.rx_adv_conf.rss_conf.rss_hf &= ethdev_info.flow_type_rss_offloads; ret = rte_eth_dev_configure(eth_port_id, num_queues, diff -Nru dpdk-22.11.6/examples/vhost_blk/vhost_blk.c dpdk-22.11.7/examples/vhost_blk/vhost_blk.c --- dpdk-22.11.6/examples/vhost_blk/vhost_blk.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/examples/vhost_blk/vhost_blk.c 2024-12-13 14:35:22.000000000 +0000 @@ -785,7 +785,7 @@ bdev->data = rte_zmalloc(NULL, blk_cnt * blk_size, 0); if (!bdev->data) { fprintf(stderr, "No enough reserved huge memory for disk\n"); - free(bdev); + rte_free(bdev); return NULL; } diff -Nru dpdk-22.11.6/lib/bpf/bpf_convert.c dpdk-22.11.7/lib/bpf/bpf_convert.c --- dpdk-22.11.6/lib/bpf/bpf_convert.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/bpf/bpf_convert.c 2024-12-13 14:35:22.000000000 +0000 @@ -559,7 +559,7 @@ ret = bpf_convert_filter(prog->bf_insns, prog->bf_len, ebpf, &ebpf_len); if (ret < 0) { RTE_BPF_LOG(ERR, "%s: cannot convert cBPF to eBPF\n", __func__); - free(prm); + rte_free(prm); rte_errno = -ret; return NULL; } diff -Nru dpdk-22.11.6/lib/dmadev/rte_dmadev.c dpdk-22.11.7/lib/dmadev/rte_dmadev.c --- dpdk-22.11.6/lib/dmadev/rte_dmadev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/dmadev/rte_dmadev.c 2024-12-13 14:35:22.000000000 +0000 @@ -715,7 +715,7 @@ { struct rte_dma_dev *dev = &rte_dma_devices[dev_id]; - if (!rte_dma_is_valid(dev_id)) + if (!rte_dma_is_valid(dev_id) || status == NULL) return -EINVAL; if (vchan >= dev->data->dev_conf.nb_vchans) { diff -Nru dpdk-22.11.6/lib/eal/common/eal_common_dev.c dpdk-22.11.7/lib/eal/common/eal_common_dev.c --- dpdk-22.11.6/lib/eal/common/eal_common_dev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/eal/common/eal_common_dev.c 2024-12-13 14:35:22.000000000 +0000 @@ -550,16 +550,17 @@ next = TAILQ_NEXT(event_cb, next); if (device_name != NULL && event_cb->dev_name != NULL) { - if (!strcmp(event_cb->dev_name, device_name)) { - if (event_cb->cb_fn != cb_fn || - (cb_arg != (void *)-1 && - event_cb->cb_arg != cb_arg)) - continue; - } + if (strcmp(event_cb->dev_name, device_name)) + continue; } else if (device_name != NULL) { continue; } + /* Remove only matching callback with arg */ + if (event_cb->cb_fn != cb_fn || + (cb_arg != (void *)-1 && event_cb->cb_arg != cb_arg)) + continue; + /* * if this callback is not executing right now, * then remove it. diff -Nru dpdk-22.11.6/lib/eal/unix/meson.build dpdk-22.11.7/lib/eal/unix/meson.build --- dpdk-22.11.6/lib/eal/unix/meson.build 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/eal/unix/meson.build 2024-12-13 14:35:22.000000000 +0000 @@ -11,3 +11,8 @@ 'eal_unix_timer.c', 'rte_thread.c', ) + +if is_freebsd or cc.has_function('pthread_attr_setaffinity_np', args: '-D_GNU_SOURCE', + prefix : '#include ') + cflags += '-DRTE_EAL_PTHREAD_ATTR_SETAFFINITY_NP' +endif diff -Nru dpdk-22.11.6/lib/eal/unix/rte_thread.c dpdk-22.11.7/lib/eal/unix/rte_thread.c --- dpdk-22.11.6/lib/eal/unix/rte_thread.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/eal/unix/rte_thread.c 2024-12-13 14:35:22.000000000 +0000 @@ -17,6 +17,7 @@ pthread_key_t thread_index; }; +#ifndef RTE_EAL_PTHREAD_ATTR_SETAFFINITY_NP struct thread_start_context { rte_thread_func thread_func; void *thread_args; @@ -26,6 +27,7 @@ int wrapper_ret; bool wrapper_done; }; +#endif static int thread_map_priority_to_os_value(enum rte_thread_priority eal_pri, int *os_pri, @@ -86,6 +88,7 @@ return 0; } +#ifndef RTE_EAL_PTHREAD_ATTR_SETAFFINITY_NP static void * thread_start_wrapper(void *arg) { @@ -111,6 +114,7 @@ return (void *)(uintptr_t)thread_func(thread_args); } +#endif int rte_thread_create(rte_thread_t *thread_id, @@ -124,6 +128,7 @@ .sched_priority = 0, }; int policy = SCHED_OTHER; +#ifndef RTE_EAL_PTHREAD_ATTR_SETAFFINITY_NP struct thread_start_context ctx = { .thread_func = thread_func, .thread_args = args, @@ -132,6 +137,7 @@ .wrapper_mutex = PTHREAD_MUTEX_INITIALIZER, .wrapper_cond = PTHREAD_COND_INITIALIZER, }; +#endif if (thread_attr != NULL) { ret = pthread_attr_init(&attr); @@ -142,6 +148,16 @@ attrp = &attr; +#ifdef RTE_EAL_PTHREAD_ATTR_SETAFFINITY_NP + if (CPU_COUNT(&thread_attr->cpuset) > 0) { + ret = pthread_attr_setaffinity_np(attrp, sizeof(thread_attr->cpuset), + &thread_attr->cpuset); + if (ret != 0) { + RTE_LOG(DEBUG, EAL, "pthread_attr_setaffinity_np failed\n"); + goto cleanup; + } + } +#endif /* * Set the inherit scheduler parameter to explicit, * otherwise the priority attribute is ignored. @@ -176,6 +192,14 @@ } } +#ifdef RTE_EAL_PTHREAD_ATTR_SETAFFINITY_NP + ret = pthread_create((pthread_t *)&thread_id->opaque_id, attrp, + (void *)(void *)thread_func, args); + if (ret != 0) { + RTE_LOG(DEBUG, EAL, "pthread_create failed\n"); + goto cleanup; + } +#else /* !RTE_EAL_PTHREAD_ATTR_SETAFFINITY_NP */ ret = pthread_create((pthread_t *)&thread_id->opaque_id, attrp, thread_start_wrapper, &ctx); if (ret != 0) { @@ -191,6 +215,7 @@ if (ret != 0) pthread_join((pthread_t)thread_id->opaque_id, NULL); +#endif /* RTE_EAL_PTHREAD_ATTR_SETAFFINITY_NP */ cleanup: if (attrp != NULL) diff -Nru dpdk-22.11.6/lib/eal/x86/include/rte_io.h dpdk-22.11.7/lib/eal/x86/include/rte_io.h --- dpdk-22.11.6/lib/eal/x86/include/rte_io.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/eal/x86/include/rte_io.h 2024-12-13 14:35:22.000000000 +0000 @@ -24,7 +24,7 @@ { asm volatile( /* MOVDIRI */ - ".byte 0x40, 0x0f, 0x38, 0xf9, 0x02" + ".byte 0x0f, 0x38, 0xf9, 0x02" : : "a" (value), "d" (addr)); } diff -Nru dpdk-22.11.6/lib/ethdev/rte_ethdev.c dpdk-22.11.7/lib/ethdev/rte_ethdev.c --- dpdk-22.11.6/lib/ethdev/rte_ethdev.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/ethdev/rte_ethdev.c 2024-12-13 14:35:22.000000000 +0000 @@ -2491,6 +2491,12 @@ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; +#ifdef RTE_ETHDEV_DEBUG_TX + ret = eth_dev_validate_tx_queue(dev, queue_id); + if (ret != 0) + return ret; +#endif + if (*dev->dev_ops->tx_done_cleanup == NULL) return -ENOTSUP; @@ -5739,13 +5745,19 @@ eth_dev_adjust_nb_desc(uint16_t *nb_desc, const struct rte_eth_desc_lim *desc_lim) { + /* Upcast to uint32 to avoid potential overflow with RTE_ALIGN_CEIL(). */ + uint32_t nb_desc_32 = (uint32_t)*nb_desc; + if (desc_lim->nb_align != 0) - *nb_desc = RTE_ALIGN_CEIL(*nb_desc, desc_lim->nb_align); + nb_desc_32 = RTE_ALIGN_CEIL(nb_desc_32, desc_lim->nb_align); if (desc_lim->nb_max != 0) - *nb_desc = RTE_MIN(*nb_desc, desc_lim->nb_max); + nb_desc_32 = RTE_MIN(nb_desc_32, desc_lim->nb_max); + + nb_desc_32 = RTE_MAX(nb_desc_32, desc_lim->nb_min); - *nb_desc = RTE_MAX(*nb_desc, desc_lim->nb_min); + /* Assign clipped u32 back to u16. */ + *nb_desc = (uint16_t)nb_desc_32; } int diff -Nru dpdk-22.11.6/lib/eventdev/rte_event_eth_rx_adapter.c dpdk-22.11.7/lib/eventdev/rte_event_eth_rx_adapter.c --- dpdk-22.11.6/lib/eventdev/rte_event_eth_rx_adapter.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/eventdev/rte_event_eth_rx_adapter.c 2024-12-13 14:35:22.000000000 +0000 @@ -2293,7 +2293,7 @@ for (i = 0; i < dev_info->dev->data->nb_rx_queues; i++) dev_info->intr_queue[i] = i; } else { - if (!rxa_intr_queue(dev_info, rx_queue_id)) + if (!rxa_intr_queue(dev_info, rx_queue_id) && nb_rx_intr > 0) dev_info->intr_queue[nb_rx_intr - 1] = rx_queue_id; } diff -Nru dpdk-22.11.6/lib/fib/dir24_8.c dpdk-22.11.7/lib/fib/dir24_8.c --- dpdk-22.11.6/lib/fib/dir24_8.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/fib/dir24_8.c 2024-12-13 14:35:22.000000000 +0000 @@ -526,8 +526,8 @@ snprintf(mem_name, sizeof(mem_name), "DP_%s", name); dp = rte_zmalloc_socket(name, sizeof(struct dir24_8_tbl) + - DIR24_8_TBL24_NUM_ENT * (1 << nh_sz), RTE_CACHE_LINE_SIZE, - socket_id); + DIR24_8_TBL24_NUM_ENT * (1 << nh_sz) + sizeof(uint32_t), + RTE_CACHE_LINE_SIZE, socket_id); if (dp == NULL) { rte_errno = ENOMEM; return NULL; diff -Nru dpdk-22.11.6/lib/fib/trie.c dpdk-22.11.7/lib/fib/trie.c --- dpdk-22.11.6/lib/fib/trie.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/fib/trie.c 2024-12-13 14:35:22.000000000 +0000 @@ -46,8 +46,10 @@ get_vector_fn(enum rte_fib_trie_nh_sz nh_sz) { #ifdef CC_TRIE_AVX512_SUPPORT - if ((rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) <= 0) || - (rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_512)) + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) <= 0 || + rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512DQ) <= 0 || + rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) <= 0 || + rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_512) return NULL; switch (nh_sz) { case RTE_FIB6_TRIE_2B: @@ -645,8 +647,8 @@ snprintf(mem_name, sizeof(mem_name), "DP_%s", name); dp = rte_zmalloc_socket(name, sizeof(struct rte_trie_tbl) + - TRIE_TBL24_NUM_ENT * (1 << nh_sz), RTE_CACHE_LINE_SIZE, - socket_id); + TRIE_TBL24_NUM_ENT * (1 << nh_sz) + sizeof(uint32_t), + RTE_CACHE_LINE_SIZE, socket_id); if (dp == NULL) { rte_errno = ENOMEM; return dp; diff -Nru dpdk-22.11.6/lib/hash/rte_thash.c dpdk-22.11.7/lib/hash/rte_thash.c --- dpdk-22.11.6/lib/hash/rte_thash.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/hash/rte_thash.c 2024-12-13 14:35:22.000000000 +0000 @@ -160,6 +160,30 @@ RTE_DIM(irreducible_poly_table[poly_degree])]; } +static inline uint32_t +get_rev_poly(uint32_t poly, int degree) +{ + int i; + /* + * The implicit highest coefficient of the polynomial + * becomes the lowest after reversal. + */ + uint32_t rev_poly = 1; + uint32_t mask = (1 << degree) - 1; + + /* + * Here we assume "poly" argument is an irreducible polynomial, + * thus the lowest coefficient of the "poly" must always be equal to "1". + * After the reversal, this the lowest coefficient becomes the highest and + * it is omitted since the highest coefficient is implicitly determined by + * degree of the polynomial. + */ + for (i = 1; i < degree; i++) + rev_poly |= ((poly >> i) & 0x1) << (degree - i); + + return rev_poly & mask; +} + static struct thash_lfsr * alloc_lfsr(struct rte_thash_ctx *ctx) { @@ -179,7 +203,7 @@ lfsr->state = rte_rand() & ((1 << lfsr->deg) - 1); } while (lfsr->state == 0); /* init reverse order polynomial */ - lfsr->rev_poly = (lfsr->poly >> 1) | (1 << (lfsr->deg - 1)); + lfsr->rev_poly = get_rev_poly(lfsr->poly, lfsr->deg); /* init proper rev_state*/ lfsr->rev_state = lfsr->state; for (i = 0; i <= lfsr->deg; i++) diff -Nru dpdk-22.11.6/lib/member/rte_member_ht.c dpdk-22.11.7/lib/member/rte_member_ht.c --- dpdk-22.11.6/lib/member/rte_member_ht.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/member/rte_member_ht.c 2024-12-13 14:35:22.000000000 +0000 @@ -493,7 +493,7 @@ return ret; /* Random pick prim or sec for recursive displacement */ - uint32_t select_bucket = (tmp_sig && 1U) ? prim_bucket : sec_bucket; + uint32_t select_bucket = (tmp_sig & 1U) ? prim_bucket : sec_bucket; if (ss->cache) { ret = evict_from_bucket(); buckets[select_bucket].sigs[ret] = tmp_sig; diff -Nru dpdk-22.11.6/lib/pcapng/rte_pcapng.c dpdk-22.11.7/lib/pcapng/rte_pcapng.c --- dpdk-22.11.6/lib/pcapng/rte_pcapng.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/pcapng/rte_pcapng.c 2024-12-13 14:35:22.000000000 +0000 @@ -454,7 +454,7 @@ enum rte_pcapng_direction direction) { struct pcapng_enhance_packet_block *epb; - uint32_t orig_len, data_len, padding, flags; + uint32_t orig_len, pkt_len, padding, flags; struct pcapng_option *opt; uint16_t optlen; struct rte_mbuf *mc; @@ -497,8 +497,8 @@ (md->ol_flags & RTE_MBUF_F_RX_RSS_HASH)); /* pad the packet to 32 bit boundary */ - data_len = rte_pktmbuf_data_len(mc); - padding = RTE_ALIGN(data_len, sizeof(uint32_t)) - data_len; + pkt_len = rte_pktmbuf_pkt_len(mc); + padding = RTE_ALIGN(pkt_len, sizeof(uint32_t)) - pkt_len; if (padding > 0) { void *tail = rte_pktmbuf_append(mc, padding); @@ -558,14 +558,14 @@ goto fail; epb->block_type = PCAPNG_ENHANCED_PACKET_BLOCK; - epb->block_length = rte_pktmbuf_data_len(mc); + epb->block_length = rte_pktmbuf_pkt_len(mc); /* Interface index is filled in later during write */ mc->port = port_id; epb->timestamp_hi = ns >> 32; epb->timestamp_lo = (uint32_t)ns; - epb->capture_length = data_len; + epb->capture_length = pkt_len; epb->original_length = orig_len; /* set trailer of block length */ @@ -594,7 +594,7 @@ /* sanity check that is really a pcapng mbuf */ epb = rte_pktmbuf_mtod(m, struct pcapng_enhance_packet_block *); if (unlikely(epb->block_type != PCAPNG_ENHANCED_PACKET_BLOCK || - epb->block_length != rte_pktmbuf_data_len(m))) { + epb->block_length != rte_pktmbuf_pkt_len(m))) { rte_errno = EINVAL; return -1; } diff -Nru dpdk-22.11.6/lib/power/power_acpi_cpufreq.c dpdk-22.11.7/lib/power/power_acpi_cpufreq.c --- dpdk-22.11.6/lib/power/power_acpi_cpufreq.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/power/power_acpi_cpufreq.c 2024-12-13 14:35:22.000000000 +0000 @@ -257,7 +257,11 @@ return -1; } - pi->lcore_id = lcore_id; + if (power_get_lcore_mapped_cpu_id(lcore_id, &pi->lcore_id) < 0) { + RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u\n", lcore_id); + return -1; + } + /* Check and set the governor */ if (power_set_governor_userspace(pi) < 0) { RTE_LOG(ERR, POWER, "Cannot set governor of lcore %u to " diff -Nru dpdk-22.11.6/lib/power/power_common.c dpdk-22.11.7/lib/power/power_common.c --- dpdk-22.11.6/lib/power/power_common.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/power/power_common.c 2024-12-13 14:35:22.000000000 +0000 @@ -9,6 +9,7 @@ #include #include +#include #include "power_common.h" @@ -202,3 +203,25 @@ return ret; } + +int power_get_lcore_mapped_cpu_id(uint32_t lcore_id, uint32_t *cpu_id) +{ + rte_cpuset_t lcore_cpus; + uint32_t cpu; + + lcore_cpus = rte_lcore_cpuset(lcore_id); + if (CPU_COUNT(&lcore_cpus) != 1) { + RTE_LOG(ERR, POWER, + "Power library does not support lcore %u mapping to %u CPUs\n", + lcore_id, CPU_COUNT(&lcore_cpus)); + return -1; + } + + for (cpu = 0; cpu < CPU_SETSIZE; cpu++) { + if (CPU_ISSET(cpu, &lcore_cpus)) + break; + } + *cpu_id = cpu; + + return 0; +} diff -Nru dpdk-22.11.6/lib/power/power_common.h dpdk-22.11.7/lib/power/power_common.h --- dpdk-22.11.6/lib/power/power_common.h 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/power/power_common.h 2024-12-13 14:35:22.000000000 +0000 @@ -27,5 +27,6 @@ int read_core_sysfs_u32(FILE *f, uint32_t *val); int read_core_sysfs_s(FILE *f, char *buf, unsigned int len); int write_core_sysfs_s(FILE *f, const char *str); +int power_get_lcore_mapped_cpu_id(uint32_t lcore_id, uint32_t *cpu_id); #endif /* _POWER_COMMON_H_ */ diff -Nru dpdk-22.11.6/lib/power/power_cppc_cpufreq.c dpdk-22.11.7/lib/power/power_cppc_cpufreq.c --- dpdk-22.11.6/lib/power/power_cppc_cpufreq.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/power/power_cppc_cpufreq.c 2024-12-13 14:35:22.000000000 +0000 @@ -35,7 +35,7 @@ #define POWER_SYSFILE_SYS_MAX \ "/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_max_freq" -#define POWER_CPPC_DRIVER "cppc-cpufreq" +#define POWER_CPPC_DRIVER "cppc_cpufreq" #define BUS_FREQ 100000 enum power_state { @@ -361,7 +361,11 @@ return -1; } - pi->lcore_id = lcore_id; + if (power_get_lcore_mapped_cpu_id(lcore_id, &pi->lcore_id) < 0) { + RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u\n", lcore_id); + return -1; + } + /* Check and set the governor */ if (power_set_governor_userspace(pi) < 0) { RTE_LOG(ERR, POWER, "Cannot set governor of lcore %u to " diff -Nru dpdk-22.11.6/lib/power/power_pstate_cpufreq.c dpdk-22.11.7/lib/power/power_pstate_cpufreq.c --- dpdk-22.11.6/lib/power/power_pstate_cpufreq.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/power/power_pstate_cpufreq.c 2024-12-13 14:35:22.000000000 +0000 @@ -563,7 +563,11 @@ return -1; } - pi->lcore_id = lcore_id; + if (power_get_lcore_mapped_cpu_id(lcore_id, &pi->lcore_id) < 0) { + RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u\n", lcore_id); + return -1; + } + /* Check and set the governor */ if (power_set_governor_performance(pi) < 0) { RTE_LOG(ERR, POWER, "Cannot set governor of lcore %u to " diff -Nru dpdk-22.11.6/lib/power/rte_power_pmd_mgmt.c dpdk-22.11.7/lib/power/rte_power_pmd_mgmt.c --- dpdk-22.11.6/lib/power/rte_power_pmd_mgmt.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/power/rte_power_pmd_mgmt.c 2024-12-13 14:35:22.000000000 +0000 @@ -419,10 +419,11 @@ { enum power_management_env env; - /* only PSTATE and ACPI modes are supported */ + /* only PSTATE, ACPI and CPPC modes are supported */ if (!rte_power_check_env_supported(PM_ENV_ACPI_CPUFREQ) && - !rte_power_check_env_supported(PM_ENV_PSTATE_CPUFREQ)) { - RTE_LOG(DEBUG, POWER, "Neither ACPI nor PSTATE modes are supported\n"); + !rte_power_check_env_supported(PM_ENV_PSTATE_CPUFREQ) && + !rte_power_check_env_supported(PM_ENV_CPPC_CPUFREQ)) { + RTE_LOG(DEBUG, POWER, "Only ACPI, PSTATE, or CPPC modes are supported\n"); return -ENOTSUP; } /* ensure we could initialize the power library */ @@ -431,8 +432,9 @@ /* ensure we initialized the correct env */ env = rte_power_get_env(); - if (env != PM_ENV_ACPI_CPUFREQ && env != PM_ENV_PSTATE_CPUFREQ) { - RTE_LOG(DEBUG, POWER, "Neither ACPI nor PSTATE modes were initialized\n"); + if (env != PM_ENV_ACPI_CPUFREQ && env != PM_ENV_PSTATE_CPUFREQ && + env != PM_ENV_CPPC_CPUFREQ) { + RTE_LOG(DEBUG, POWER, "Unable to initialize ACPI, PSTATE, or CPPC modes\n"); return -ENOTSUP; } diff -Nru dpdk-22.11.6/lib/vhost/vdpa.c dpdk-22.11.7/lib/vhost/vdpa.c --- dpdk-22.11.6/lib/vhost/vdpa.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/vhost/vdpa.c 2024-12-13 14:35:22.000000000 +0000 @@ -173,6 +173,7 @@ idx = vq->used->idx; idx_m = s_vring->used->idx; ret = (uint16_t)(idx_m - idx); + vq->used->flags = s_vring->used->flags; while (idx != idx_m) { /* copy used entry, used ring logging is not covered here */ diff -Nru dpdk-22.11.6/lib/vhost/vhost_user.c dpdk-22.11.7/lib/vhost/vhost_user.c --- dpdk-22.11.6/lib/vhost/vhost_user.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/vhost/vhost_user.c 2024-12-13 14:35:22.000000000 +0000 @@ -2269,7 +2269,7 @@ * mmap from 0 to workaround a hugepage mmap bug: mmap will * fail when offset is not page size aligned. */ - addr = mmap(0, size + off, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + addr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, off); close(fd); if (addr == MAP_FAILED) { VHOST_LOG_CONFIG(dev->ifname, ERR, "mmap log base failed!\n"); diff -Nru dpdk-22.11.6/lib/vhost/virtio_net.c dpdk-22.11.7/lib/vhost/virtio_net.c --- dpdk-22.11.6/lib/vhost/virtio_net.c 2024-08-20 09:26:53.000000000 +0000 +++ dpdk-22.11.7/lib/vhost/virtio_net.c 2024-12-13 14:35:22.000000000 +0000 @@ -2593,6 +2593,9 @@ */ uint16_t csum = 0, off; + if (hdr->csum_start >= rte_pktmbuf_pkt_len(m)) + return; + if (rte_raw_cksum_mbuf(m, hdr->csum_start, rte_pktmbuf_pkt_len(m) - hdr->csum_start, &csum) < 0) return;