]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Sep 2020 15:25:17 +0000 (17:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Sep 2020 15:25:17 +0000 (17:25 +0200)
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

queue-5.4/hv_netvsc-remove-unlikely-from-netvsc_select_queue.patch [new file with mode: 0644]
queue-5.4/net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch [new file with mode: 0644]
queue-5.4/rdma-bnxt_re-restrict-the-max_gids-to-256.patch [new file with mode: 0644]
queue-5.4/series

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 (file)
index 0000000..9dd8871
--- /dev/null
@@ -0,0 +1,34 @@
+From 4d820543c54c47a2bd3c95ddbf52f83c89a219a0 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 20 Aug 2020 14:53:14 -0700
+Subject: hv_netvsc: Remove "unlikely" from netvsc_select_queue
+
+From: Haiyang Zhang <haiyangz@microsoft.com>
+
+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 <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..7e0faa0
--- /dev/null
@@ -0,0 +1,40 @@
+From eabe861881a733fc84f286f4d5a1ffaddd4f526f Mon Sep 17 00:00:00 2001
+From: Miaohe Lin <linmiaohe@huawei.com>
+Date: Sat, 15 Aug 2020 04:46:41 -0400
+Subject: net: handle the return value of pskb_carve_frag_list() correctly
+
+From: Miaohe Lin <linmiaohe@huawei.com>
+
+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 <linmiaohe@huawei.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..8df5036
--- /dev/null
@@ -0,0 +1,45 @@
+From 847b97887ed4569968d5b9a740f2334abca9f99a Mon Sep 17 00:00:00 2001
+From: Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>
+Date: Mon, 24 Aug 2020 11:14:35 -0700
+Subject: RDMA/bnxt_re: Restrict the max_gids to 256
+
+From: Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>
+
+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 <nareshkumar.pbs@broadcom.com>
+Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
+Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
index 2b2645a4a7882483989b6cc6ac35e896f8082369..0132d8d1c18b9cd066a97d68de8e47ddc88a4932 100644 (file)
@@ -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