Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-05-10 14:13:58 +0200
committerJiri Slaby <jslaby@suse.cz>2019-05-16 08:30:28 +0200
commitaa5f3a0eb7b584ed0759ff41d3fc8b59f02834e0 (patch)
treed9e756bdf546b4745112356ea1bf3bc8d8a1d5c9
parent03c8e1b6ca7c0089950b3e1bcd71c9e817493c1b (diff)
thunderx: enable page recycling for non-XDP case
(networking-stable-19_03_28).
-rw-r--r--patches.suse/thunderx-enable-page-recycling-for-non-XDP-case.patch62
-rw-r--r--series.conf1
2 files changed, 63 insertions, 0 deletions
diff --git a/patches.suse/thunderx-enable-page-recycling-for-non-XDP-case.patch b/patches.suse/thunderx-enable-page-recycling-for-non-XDP-case.patch
new file mode 100644
index 0000000000..c3f6240220
--- /dev/null
+++ b/patches.suse/thunderx-enable-page-recycling-for-non-XDP-case.patch
@@ -0,0 +1,62 @@
+From: Dean Nelson <dnelson@redhat.com>
+Date: Tue, 26 Mar 2019 11:53:19 -0400
+Subject: thunderx: enable page recycling for non-XDP case
+Git-commit: b3e208069477588c06f4d5d986164b435bb06e6d
+Patch-mainline: v5.1-rc4
+References: networking-stable-19_03_28
+
+Commit 773225388dae15e72790 ("net: thunderx: Optimize page recycling for XDP")
+added code to nicvf_alloc_page() that inadvertently disables receive buffer
+page recycling for the non-XDP case by always NULL'ng the page pointer.
+
+This patch corrects two if-conditionals to allow for the recycling of non-XDP
+mode pages by only setting the page pointer to NULL when the page is not ready
+for recycling.
+
+Fixes: 773225388dae ("net: thunderx: Optimize page recycling for XDP")
+Signed-off-by: Dean Nelson <dnelson@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ .../ethernet/cavium/thunder/nicvf_queues.c | 23 +++++++++----------
+ 1 file changed, 11 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
+index 5b4d3badcb73..55dbf02c42af 100644
+--- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
++++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
+@@ -105,20 +105,19 @@ static inline struct pgcache *nicvf_alloc_page(struct nicvf *nic,
+ /* Check if page can be recycled */
+ if (page) {
+ ref_count = page_ref_count(page);
+- /* Check if this page has been used once i.e 'put_page'
+- * called after packet transmission i.e internal ref_count
+- * and page's ref_count are equal i.e page can be recycled.
++ /* This page can be recycled if internal ref_count and page's
++ * ref_count are equal, indicating that the page has been used
++ * once for packet transmission. For non-XDP mode, internal
++ * ref_count is always '1'.
+ */
+- if (rbdr->is_xdp && (ref_count == pgcache->ref_count))
+- pgcache->ref_count--;
+- else
+- page = NULL;
+-
+- /* In non-XDP mode, page's ref_count needs to be '1' for it
+- * to be recycled.
+- */
+- if (!rbdr->is_xdp && (ref_count != 1))
++ if (rbdr->is_xdp) {
++ if (ref_count == pgcache->ref_count)
++ pgcache->ref_count--;
++ else
++ page = NULL;
++ } else if (ref_count != 1) {
+ page = NULL;
++ }
+ }
+
+ if (!page) {
+--
+2.21.0
+
diff --git a/series.conf b/series.conf
index e57a34eefd..5f76402202 100644
--- a/series.conf
+++ b/series.conf
@@ -21659,6 +21659,7 @@
patches.drivers/HID-debug-fix-race-condition-with-between-rdesc_show.patch
patches.drivers/HID-input-add-mapping-for-Assistant-key.patch
patches.fixes/0001-net-datagram-fix-unbounded-loop-in-__skb_try_recv_da.patch
+ patches.suse/thunderx-enable-page-recycling-for-non-XDP-case.patch
patches.fixes/batman-adv-Reduce-claim-hash-refcnt-only-for-removed.patch
patches.fixes/batman-adv-Reduce-tt_local-hash-refcnt-only-for-remo.patch
patches.fixes/batman-adv-Reduce-tt_global-hash-refcnt-only-for-rem.patch