From: Greg Kroah-Hartman Date: Thu, 17 Sep 2020 15:25:17 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v4.4.237~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd5ac5400ac33bf43b08d54786eb393320956dab;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch rdma-bnxt_re-restrict-the-max_gids-to-256.patch --- diff --git a/queue-5.4/hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch b/queue-5.4/hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch new file mode 100644 index 00000000000..9dd8871d2bb --- /dev/null +++ b/queue-5.4/hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch @@ -0,0 +1,34 @@ +From 4d820543c54c47a2bd3c95ddbf52f83c89a219a0 Mon Sep 17 00:00:00 2001 +From: Haiyang Zhang +Date: Thu, 20 Aug 2020 14:53:14 -0700 +Subject: hv_netvsc: Remove "unlikely" from netvsc_select_queue + +From: Haiyang Zhang + +commit 4d820543c54c47a2bd3c95ddbf52f83c89a219a0 upstream. + +When using vf_ops->ndo_select_queue, the number of queues of VF is +usually bigger than the synthetic NIC. This condition may happen +often. +Remove "unlikely" from the comparison of ndev->real_num_tx_queues. + +Fixes: b3bf5666a510 ("hv_netvsc: defer queue selection to VF") +Signed-off-by: Haiyang Zhang +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/hyperv/netvsc_drv.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/hyperv/netvsc_drv.c ++++ b/drivers/net/hyperv/netvsc_drv.c +@@ -366,7 +366,7 @@ static u16 netvsc_select_queue(struct ne + } + rcu_read_unlock(); + +- while (unlikely(txq >= ndev->real_num_tx_queues)) ++ while (txq >= ndev->real_num_tx_queues) + txq -= ndev->real_num_tx_queues; + + return txq; diff --git a/queue-5.4/net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch b/queue-5.4/net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch new file mode 100644 index 00000000000..7e0faa02037 --- /dev/null +++ b/queue-5.4/net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch @@ -0,0 +1,40 @@ +From eabe861881a733fc84f286f4d5a1ffaddd4f526f Mon Sep 17 00:00:00 2001 +From: Miaohe Lin +Date: Sat, 15 Aug 2020 04:46:41 -0400 +Subject: net: handle the return value of pskb_carve_frag_list() correctly + +From: Miaohe Lin + +commit eabe861881a733fc84f286f4d5a1ffaddd4f526f upstream. + +pskb_carve_frag_list() may return -ENOMEM in pskb_carve_inside_nonlinear(). +we should handle this correctly or we would get wrong sk_buff. + +Fixes: 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function") +Signed-off-by: Miaohe Lin +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + net/core/skbuff.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -5882,9 +5882,13 @@ static int pskb_carve_inside_nonlinear(s + if (skb_has_frag_list(skb)) + skb_clone_fraglist(skb); + +- if (k == 0) { +- /* split line is in frag list */ +- pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask); ++ /* split line is in frag list */ ++ if (k == 0 && pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask)) { ++ /* skb_frag_unref() is not needed here as shinfo->nr_frags = 0. */ ++ if (skb_has_frag_list(skb)) ++ kfree_skb_list(skb_shinfo(skb)->frag_list); ++ kfree(data); ++ return -ENOMEM; + } + skb_release_data(skb); + diff --git a/queue-5.4/rdma-bnxt_re-restrict-the-max_gids-to-256.patch b/queue-5.4/rdma-bnxt_re-restrict-the-max_gids-to-256.patch new file mode 100644 index 00000000000..8df50361c94 --- /dev/null +++ b/queue-5.4/rdma-bnxt_re-restrict-the-max_gids-to-256.patch @@ -0,0 +1,45 @@ +From 847b97887ed4569968d5b9a740f2334abca9f99a Mon Sep 17 00:00:00 2001 +From: Naresh Kumar PBS +Date: Mon, 24 Aug 2020 11:14:35 -0700 +Subject: RDMA/bnxt_re: Restrict the max_gids to 256 + +From: Naresh Kumar PBS + +commit 847b97887ed4569968d5b9a740f2334abca9f99a upstream. + +Some adapters report more than 256 gid entries. Restrict it to 256 for +now. + +Fixes: 1ac5a4047975("RDMA/bnxt_re: Add bnxt_re RoCE driver") +Link: https://lore.kernel.org/r/1598292876-26529-6-git-send-email-selvin.xavier@broadcom.com +Signed-off-by: Naresh Kumar PBS +Signed-off-by: Selvin Xavier +Signed-off-by: Jason Gunthorpe +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/infiniband/hw/bnxt_re/qplib_sp.c | 2 +- + drivers/infiniband/hw/bnxt_re/qplib_sp.h | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c ++++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c +@@ -152,7 +152,7 @@ int bnxt_qplib_get_dev_attr(struct bnxt_ + attr->max_inline_data = le32_to_cpu(sb->max_inline_data); + attr->l2_db_size = (sb->l2_db_space_size + 1) * + (0x01 << RCFW_DBR_BASE_PAGE_SHIFT); +- attr->max_sgid = le32_to_cpu(sb->max_gid); ++ attr->max_sgid = BNXT_QPLIB_NUM_GIDS_SUPPORTED; + + bnxt_qplib_query_version(rcfw, attr->fw_ver); + +--- a/drivers/infiniband/hw/bnxt_re/qplib_sp.h ++++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.h +@@ -47,6 +47,7 @@ + struct bnxt_qplib_dev_attr { + #define FW_VER_ARR_LEN 4 + u8 fw_ver[FW_VER_ARR_LEN]; ++#define BNXT_QPLIB_NUM_GIDS_SUPPORTED 256 + u16 max_sgid; + u16 max_mrw; + u32 max_qp; diff --git a/queue-5.4/series b/queue-5.4/series index 2b2645a4a78..0132d8d1c18 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -1,3 +1,6 @@ gfs2-initialize-transaction-tr_ailx_lists-earlier.patch +rdma-bnxt_re-restrict-the-max_gids-to-256.patch e1000e-add-support-for-comet-lake.patch dsa-allow-forwarding-of-redirected-igmp-traffic.patch +net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch +hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch