From 70e2f1754682c299efc0efaa5754eef2a27c3505 Mon Sep 17 00:00:00 2001 From: "wuchangsheng2@huawei.com" Date: Mon, 15 Nov 2021 10:56:29 +0800 Subject: [PATCH] backport pathes from community (cherry picked from commit b7558bcc248e4a2962125312d921b705806aaebc) --- ...-fix-memory-leak-as-profile-is-freed.patch | 37 ++++++++++++++++ ...net-virtio-fix-interrupt-handle-leak.patch | 43 ++++++++++++++++++ ...rt-0003-vhost-fix-crash-on-reconnect.patch | 44 +++++++++++++++++++ ...io-report-maximum-MTU-in-device-info.patch | 37 ++++++++++++++++ ...freeing-in-FMAN-interface-destructor.patch | 33 ++++++++++++++ ...tributor-fix-128-bit-write-alignment.patch | 38 ++++++++++++++++ dpdk.spec | 18 +++++++- 7 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 backport-0001-net-softnic-fix-memory-leak-as-profile-is-freed.patch create mode 100644 backport-0002-net-virtio-fix-interrupt-handle-leak.patch create mode 100644 backport-0003-vhost-fix-crash-on-reconnect.patch create mode 100644 backport-0004-net-virtio-report-maximum-MTU-in-device-info.patch create mode 100644 backport-0005-bus-dpaa-fix-freeing-in-FMAN-interface-destructor.patch create mode 100644 backport-0006-distributor-fix-128-bit-write-alignment.patch diff --git a/backport-0001-net-softnic-fix-memory-leak-as-profile-is-freed.patch b/backport-0001-net-softnic-fix-memory-leak-as-profile-is-freed.patch new file mode 100644 index 0000000..4166c88 --- /dev/null +++ b/backport-0001-net-softnic-fix-memory-leak-as-profile-is-freed.patch @@ -0,0 +1,37 @@ +From b3bc560bd6bdf3c9851d25bc0a66cb24aa1fd48c Mon Sep 17 00:00:00 2001 +From: Dapeng Yu +Date: Wed, 28 Jul 2021 14:05:39 +0800 +Subject: [PATCH] net/softnic: fix memory leak as profile is freed + +In function softnic_table_action_profile_free(), the memory referenced +by pointer "ap" in the instance of "struct softnic_table_action_profile" +is not freed. + +This patch fixes it. + +Fixes: a737dd4e5863 ("net/softnic: add table action profile") +Cc: stable@dpdk.org + +Signed-off-by: Dapeng Yu +Acked-by: Jasvinder Singh +Conflict: NA +Reference: https://github.com/DPDK/dpdk/commit/b3bc560bd6bdf3c9851d25bc0a66cb24aa1fd48c +--- + drivers/net/softnic/rte_eth_softnic_action.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/softnic/rte_eth_softnic_action.c b/drivers/net/softnic/rte_eth_softnic_action.c +index 92c744dc9a..33be9552a6 100644 +--- a/drivers/net/softnic/rte_eth_softnic_action.c ++++ b/drivers/net/softnic/rte_eth_softnic_action.c +@@ -183,6 +183,7 @@ softnic_table_action_profile_free(struct pmd_internals *p) + break; + + TAILQ_REMOVE(&p->table_action_profile_list, profile, node); ++ rte_table_action_profile_free(profile->ap); + free(profile); + } + } +-- +2.23.0 + diff --git a/backport-0002-net-virtio-fix-interrupt-handle-leak.patch b/backport-0002-net-virtio-fix-interrupt-handle-leak.patch new file mode 100644 index 0000000..0085929 --- /dev/null +++ b/backport-0002-net-virtio-fix-interrupt-handle-leak.patch @@ -0,0 +1,43 @@ +From 7b9195154926b808e3ae23750eaff3e81cd5f529 Mon Sep 17 00:00:00 2001 +From: Gaoxiang Liu +Date: Mon, 26 Jul 2021 22:42:05 +0800 +Subject: [PATCH] net/virtio: fix interrupt handle leak + +Free memory of interrupt handle in virtio_user_dev_uninit() to +avoid memory leak. +when virtio user dev closes, memory of interrupt handle is not freed +that is allocated in virtio_user_fill_intr_handle(). + +Fixes: 3d4fb6fd2505 ("net/virtio-user: support Rx interrupt") +Cc: stable@dpdk.org + +Signed-off-by: Gaoxiang Liu +Reviewed-by: Chenbo Xia +Reviewed-by: Maxime Coquelin +Conflict: dev->hw.port_id to dev->port_id +Reference: https://github.com/DPDK/dpdk/commit/7b9195154926b808e3ae23750eaff3e81cd5f529 +--- + drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c +index ea016e8..6b91806 100644 +--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c ++++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c +@@ -528,6 +528,13 @@ virtio_user_dev_uninit(struct virtio_user_dev *dev) + { + uint32_t i; + ++ struct rte_eth_dev *eth_dev = &rte_eth_devices[dev->port_id]; ++ ++ if (eth_dev->intr_handle) { ++ free(eth_dev->intr_handle); ++ eth_dev->intr_handle = NULL; ++ } ++ + virtio_user_stop_device(dev); + + rte_mem_event_callback_unregister(VIRTIO_USER_MEM_EVENT_CLB_NAME, dev); +-- +2.23.0 + diff --git a/backport-0003-vhost-fix-crash-on-reconnect.patch b/backport-0003-vhost-fix-crash-on-reconnect.patch new file mode 100644 index 0000000..4ba93cd --- /dev/null +++ b/backport-0003-vhost-fix-crash-on-reconnect.patch @@ -0,0 +1,44 @@ +From 3c929a0bb3e7addc5103227bff126b8b9dd952ef Mon Sep 17 00:00:00 2001 +From: Maxime Coquelin +Date: Mon, 26 Jul 2021 09:58:14 +0200 +Subject: [PATCH] vhost: fix crash on reconnect + +When the vhost-user frontend like Virtio-user tries to +reconnect to the restarted Vhost backend, the Vhost backend +segfaults when multiqueue is enabled. + +This is caused by VHOST_USER_GET_VRING_BASE being called for +a virtqueue that has not been created before, causing a NULL +pointer dereferencing. + +This patch adds the VHOST_USER_GET_VRING_BASE requests to +the list of requests that trigger queue pair allocations. + +Fixes: 160cbc815b41 ("vhost: remove a hack on queue allocation") +Cc: stable@dpdk.org + +Reported-by: Yinan Wang +Signed-off-by: Maxime Coquelin +Tested-by: Yinan Wang +Reviewed-by: Chenbo Xia +Conflict: change vhost dir to librte_vhost +Reference: https://github.com/DPDK/dpdk/commit/3c929a0bb3e7addc5103227bff126b8b9dd952ef +--- + lib/librte_vhost/vhost_user.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c +index 433f412fa8..29a4c9af60 100644 +--- a/lib/librte_vhost/vhost_user.c ++++ b/lib/librte_vhost/vhost_user.c +@@ -2796,6 +2796,7 @@ vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev, + break; + case VHOST_USER_SET_VRING_NUM: + case VHOST_USER_SET_VRING_BASE: ++ case VHOST_USER_GET_VRING_BASE: + case VHOST_USER_SET_VRING_ENABLE: + vring_idx = msg->payload.state.index; + break; +-- +2.23.0 + diff --git a/backport-0004-net-virtio-report-maximum-MTU-in-device-info.patch b/backport-0004-net-virtio-report-maximum-MTU-in-device-info.patch new file mode 100644 index 0000000..a43e5aa --- /dev/null +++ b/backport-0004-net-virtio-report-maximum-MTU-in-device-info.patch @@ -0,0 +1,37 @@ +From 11d7bc9ff074dc5e37dd9ab51bb365669d08c3d6 Mon Sep 17 00:00:00 2001 +From: Ivan Ilchenko +Date: Wed, 21 Jul 2021 12:22:25 +0300 +Subject: [PATCH] net/virtio: report maximum MTU in device info + +Fix the driver to report maximum MTU obtained from config if +VIRTIO_NET_F_MTU is supported or calculated based on maximum +Rx packet length. + +Fixes: ad97ceece12c ("ethdev: add min/max MTU to device info") +Cc: stable@dpdk.org + +Signed-off-by: Ivan Ilchenko +Signed-off-by: Andrew Rybchenko +Reviewed-by: Maxime Coquelin +Conflict: NA +Reference: https://github.com/DPDK/dpdk/commit/11d7bc9ff074dc5e37dd9ab51bb365669d08c3d6 + +--- + drivers/net/virtio/virtio_ethdev.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c +index 044eb10..89e4c23 100644 +--- a/drivers/net/virtio/virtio_ethdev.c ++++ b/drivers/net/virtio/virtio_ethdev.c +@@ -2436,6 +2436,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) + dev_info->min_rx_bufsize = VIRTIO_MIN_RX_BUFSIZE; + dev_info->max_rx_pktlen = VIRTIO_MAX_RX_PKTLEN; + dev_info->max_mac_addrs = VIRTIO_MAX_MAC_ADDRS; ++ dev_info->max_mtu = hw->max_mtu; + + host_features = VTPCI_OPS(hw)->get_features(hw); + dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP; +-- +2.23.0 + diff --git a/backport-0005-bus-dpaa-fix-freeing-in-FMAN-interface-destructor.patch b/backport-0005-bus-dpaa-fix-freeing-in-FMAN-interface-destructor.patch new file mode 100644 index 0000000..91b3b4c --- /dev/null +++ b/backport-0005-bus-dpaa-fix-freeing-in-FMAN-interface-destructor.patch @@ -0,0 +1,33 @@ +From 5ddcf3de6bc08fa7c14fd1ead86012aa575cf665 Mon Sep 17 00:00:00 2001 +From: Hemant Agrawal +Date: Mon, 19 Jul 2021 19:29:11 +0530 +Subject: [PATCH] bus/dpaa: fix freeing in FMAN interface destructor + +if was allocated with rte_malloc, free shall be equivalent. + +Fixes: 4762b3d419c3 ("bus/dpaa: delay fman device list to bus probe") +Cc: stable@dpdk.org + +Signed-off-by: Hemant Agrawal +Conflict: NA +Reference: https://github.com/DPDK/dpdk/commit/5ddcf3de6bc08fa7c14fd1ead86012aa575cf665 +--- + drivers/bus/dpaa/base/fman/fman.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c +index 692071b4b0..a14004d7fc 100644 +--- a/drivers/bus/dpaa/base/fman/fman.c ++++ b/drivers/bus/dpaa/base/fman/fman.c +@@ -50,7 +50,7 @@ if_destructor(struct __fman_if *__if) + free(bp); + } + cleanup: +- free(__if); ++ rte_free(__if); + } + + static int +-- +2.23.0 + diff --git a/backport-0006-distributor-fix-128-bit-write-alignment.patch b/backport-0006-distributor-fix-128-bit-write-alignment.patch new file mode 100644 index 0000000..4d6ec8b --- /dev/null +++ b/backport-0006-distributor-fix-128-bit-write-alignment.patch @@ -0,0 +1,38 @@ +From de8606bf73323dfa8395f2dc0a93dc6194ff21b7 Mon Sep 17 00:00:00 2001 +From: David Hunt +Date: Fri, 16 Jul 2021 14:32:37 +0100 +Subject: [PATCH] distributor: fix 128-bit write alignment + +When the distributor sample app is built as a 32-bit app, +the data buffer passed to find_match_vec can be unaligned, +causing a segmentation fault due to writing a 128-bit value +using _mm_store_si128(). 128-bit align the data being +passed in so this does not happen. + +Fixes: 775003ad2f96 ("distributor: add new burst-capable library") +Cc: stable@dpdk.org + +Signed-off-by: David Hunt +Conflict: mv distributor dir to librte_distributor +Reference: https://github.com/DPDK/dpdk/commit/de8606bf73323dfa8395f2dc0a93dc6194ff21b7 + +--- + lib/librte_distributor/rte_distributor.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c +index 6c5b0c8..f6a0107 100644 +--- a/lib/librte_distributor/rte_distributor.c ++++ b/lib/librte_distributor/rte_distributor.c +@@ -373,7 +373,7 @@ rte_distributor_process(struct rte_distributor *d, + } + + while (next_idx < num_mbufs) { +- uint16_t matches[RTE_DIST_BURST_SIZE]; ++ uint16_t matches[RTE_DIST_BURST_SIZE] __rte_aligned(128); + unsigned int pkts; + + /* Sync with worker on GET_BUF flag. */ +-- +2.23.0 + diff --git a/dpdk.spec b/dpdk.spec index 9d360f0..7620503 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -1,6 +1,6 @@ Name: dpdk Version: 19.11 -Release: 14 +Release: 15 Packager: packaging@6wind.com URL: http://dpdk.org %global source_version 19.11 @@ -30,6 +30,12 @@ Patch20: 0010-dpdk-fix-error-in-clearing-secondary-process-memseg-lists.patch Patch21: 0011-dpdk-fix-coredump-when-primary-process-attach-without-shared-file.patch Patch22: 0012-dpdk-fix-fbarray-memseg-destory-error-during-detach.patch Patch23: 0013-dpdk-optimize-the-efficiency-of-compiling-dpdk.patch +Patch24: backport-0001-net-softnic-fix-memory-leak-as-profile-is-freed.patch +Patch25: backport-0002-net-virtio-fix-interrupt-handle-leak.patch +Patch26: backport-0003-vhost-fix-crash-on-reconnect.patch +Patch27: backport-0004-net-virtio-report-maximum-MTU-in-device-info.patch +Patch28: backport-0005-bus-dpaa-fix-freeing-in-FMAN-interface-destructor.patch +Patch29: backport-0006-distributor-fix-128-bit-write-alignment.patch Summary: Data Plane Development Kit core Group: System Environment/Libraries @@ -179,6 +185,16 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko /usr/sbin/depmod %changelog +* Mon Nov 15 2021 wuchangsheng - 19.11-15 +- backport pathes from community +- net/softnic fix memory leak as profile is freed +- net/virtio fix interrupt handle leak +- vhost fix crash on reconnect +- net/virtio report maximum MTU in device info +- bus/dpaa fix freeing in FMAN interface destructor +- distributor fix 128 bit write alignment + + * Sat Nov 6 2021 wuchangsheng - 19.11-14 - merge patches that add support gazelle into one -- Gitee