linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Dean Nelson <dnelson@redhat.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.14 016/107] thunderx: enable page recycling for non-XDP case
Date: Mon,  1 Apr 2019 19:01:31 +0200	[thread overview]
Message-ID: <20190401170046.976692195@linuxfoundation.org> (raw)
In-Reply-To: <20190401170045.246405031@linuxfoundation.org>

4.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dean Nelson <dnelson@redhat.com>

[ Upstream commit b3e208069477588c06f4d5d986164b435bb06e6d ]

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/cavium/thunder/nicvf_queues.c |   23 ++++++++++-----------
 1 file changed, 11 insertions(+), 12 deletions(-)

--- 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_allo
 	/* 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) {



  parent reply	other threads:[~2019-04-01 17:20 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01 17:01 [PATCH 4.14 000/107] 4.14.110-stable review Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 001/107] Bluetooth: Check L2CAP option sizes returned from l2cap_get_conf_opt Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 002/107] Bluetooth: Verify that l2cap_get_conf_opt provides large enough buffer Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 003/107] video: fbdev: Set pixclock = 0 in goldfishfb Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 004/107] stmmac: copy unicast mac address to MAC registers Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 005/107] dccp: do not use ipv6 header for ipv4 flow Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 006/107] genetlink: Fix a memory leak on error path Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 007/107] mISDN: hfcpci: Test both vendor & device ID for Digium HFC4S Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 008/107] net: datagram: fix unbounded loop in __skb_try_recv_datagram() Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 009/107] net/packet: Set __GFP_NOWARN upon allocation in alloc_pg_vec Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 010/107] net: rose: fix a possible stack overflow Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 011/107] net: stmmac: fix memory corruption with large MTUs Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 012/107] net-sysfs: call dev_hold if kobject_init_and_add success Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 013/107] packets: Always register packet sk in the same order Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 014/107] rhashtable: Still do rehash when we get EEXIST Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 015/107] tcp: do not use ipv6 header for ipv4 flow Greg Kroah-Hartman
2019-04-01 17:01 ` Greg Kroah-Hartman [this message]
2019-04-01 17:01 ` [PATCH 4.14 017/107] thunderx: eliminate extra calls to put_page() for pages held for recycling Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 018/107] vxlan: Dont call gro_cells_destroy() before device is unregistered Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 019/107] sctp: get sctphdr by offset in sctp_compute_cksum Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 020/107] net: aquantia: fix rx checksum offload for UDP/TCP over IPv6 Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 021/107] mac8390: Fix mmio access size probe Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 022/107] tun: properly test for IFF_UP Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 023/107] tun: add a missing rcu_read_unlock() in error path Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 024/107] powerpc/64s: Add support for ori barrier_nospec patching Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 025/107] powerpc/64s: Patch barrier_nospec in modules Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 026/107] powerpc/64s: Enable barrier_nospec based on firmware settings Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 027/107] powerpc: Use barrier_nospec in copy_from_user() Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 028/107] powerpc/64: Use barrier_nospec in syscall entry Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 029/107] powerpc/64s: Enhance the information in cpu_show_spectre_v1() Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 030/107] powerpc64s: Show ori31 availability in spectre_v1 sysfs file not v2 Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 031/107] powerpc/64: Disable the speculation barrier from the command line Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 032/107] powerpc/64: Make stf barrier PPC_BOOK3S_64 specific Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 033/107] powerpc/64: Add CONFIG_PPC_BARRIER_NOSPEC Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 034/107] powerpc/64: Call setup_barrier_nospec() from setup_arch() Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 035/107] powerpc/64: Make meltdown reporting Book3S 64 specific Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 036/107] powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 037/107] powerpc/fsl: Sanitize the syscall table for NXP PowerPC 32 bit platforms Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 038/107] powerpc/asm: Add a patch_site macro & helpers for patching instructions Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 039/107] powerpc/64s: Add new security feature flags for count cache flush Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 040/107] powerpc/64s: Add support for software " Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 041/107] powerpc/pseries: Query hypervisor for count cache flush settings Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 042/107] powerpc/powernv: Query firmware " Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 043/107] powerpc/fsl: Add infrastructure to fixup branch predictor flush Greg Kroah-Hartman
2019-04-01 17:01 ` [PATCH 4.14 044/107] powerpc/fsl: Add macro to flush the branch predictor Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 045/107] powerpc/fsl: Fix spectre_v2 mitigations reporting Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 046/107] powerpc/fsl: Emulate SPRN_BUCSR register Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 047/107] powerpc/fsl: Add nospectre_v2 command line argument Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 048/107] powerpc/fsl: Flush the branch predictor at each kernel entry (64bit) Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 049/107] powerpc/fsl: Flush the branch predictor at each kernel entry (32 bit) Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 050/107] powerpc/fsl: Flush branch predictor when entering KVM Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 051/107] powerpc/fsl: Enable runtime patching if nospectre_v2 boot arg is used Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 052/107] powerpc/fsl: Update Spectre v2 reporting Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 053/107] powerpc/fsl: Fixed warning: orphan section `__btb_flush_fixup Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 054/107] powerpc/fsl: Fix the flush of branch predictor Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 055/107] powerpc/security: Fix spectre_v2 reporting Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 056/107] Btrfs: fix incorrect file size after shrinking truncate and fsync Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 057/107] btrfs: remove WARN_ON in log_dir_items Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 058/107] btrfs: raid56: properly unmap parity page in finish_parity_scrub() Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 059/107] ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 060/107] powerpc: bpf: Fix generation of load/store DW instructions Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 061/107] NFSv4.1 dont free interrupted slot on open Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 062/107] net: dsa: qca8k: remove leftover phy accessors Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 063/107] ALSA: rawmidi: Fix potential Spectre v1 vulnerability Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 064/107] ALSA: seq: oss: Fix " Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 065/107] ALSA: pcm: Fix possible OOB access in PCM oss plugins Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 066/107] ALSA: pcm: Dont suspend stream in unrecoverable PCM state Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 067/107] ALSA: hda/realtek - Add support headset mode for DELL WYSE AIO Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 068/107] ALSA: hda/realtek - Add support headset mode for New DELL WYSE NB Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 069/107] kbuild: modversions: Fix relative CRC byte order interpretation Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 070/107] fs/open.c: allow opening only regular files during execve() Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 071/107] ocfs2: fix inode bh swapping mixup in ocfs2_reflink_inodes_lock Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 072/107] scsi: sd: Fix a race between closing an sd device and sd I/O Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 073/107] scsi: sd: Quiesce warning if device does not report optimal I/O size Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 074/107] scsi: zfcp: fix rport unblock if deleted SCSI devices on Scsi_Host Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 075/107] scsi: zfcp: fix scsi_eh host reset with port_forced ERP for non-NPIV FCP devices Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 076/107] tty: atmel_serial: fix a potential NULL pointer dereference Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 077/107] staging: comedi: ni_mio_common: Fix divide-by-zero for DIO cmdtest Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 078/107] staging: vt6655: Remove vif check from vnt_interrupt Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 079/107] staging: vt6655: Fix interrupt race condition on device start up Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 080/107] serial: max310x: Fix to avoid potential NULL pointer dereference Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 081/107] serial: sh-sci: Fix setting SCSCR_TIE while transferring data Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 082/107] USB: serial: cp210x: add new device id Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 083/107] USB: serial: ftdi_sio: add additional NovaTech products Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 084/107] USB: serial: mos7720: fix mos_parport refcount imbalance on error path Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 085/107] USB: serial: option: set driver_info for SIM5218 and compatibles Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 086/107] USB: serial: option: add support for Quectel EM12 Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 087/107] USB: serial: option: add Olicard 600 Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 088/107] Disable kgdboc failed by echo space to /sys/module/kgdboc/parameters/kgdboc Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 089/107] fs/proc/proc_sysctl.c: fix NULL pointer dereference in put_links Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 090/107] drm/vgem: fix use-after-free when drm_gem_handle_create() fails Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 091/107] gpio: exar: add a check for the return value of ida_simple_get fails Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 092/107] gpio: adnp: Fix testing wrong value in adnp_gpio_direction_input Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 093/107] phy: sun4i-usb: Support set_mode to USB_HOST for non-OTG PHYs Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 094/107] usb: mtu3: fix EXTCON dependency Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 095/107] USB: gadget: f_hid: fix deadlock in f_hidg_write() Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 096/107] usb: common: Consider only available nodes for dr_mode Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 097/107] usb: host: xhci-rcar: Add XHCI_TRUST_TX_LENGTH quirk Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 098/107] xhci: Fix port resume done detection for SS ports with LPM enabled Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 099/107] usb: cdc-acm: fix race during wakeup blocking TX traffic Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 100/107] mm/migrate.c: add missing flush_dcache_page for non-mapped page migrate Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 101/107] perf intel-pt: Fix TSC slip Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 102/107] cpu/hotplug: Prevent crash when CPU bringup fails on CONFIG_HOTPLUG_CPU=n Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 103/107] x86/smp: Enforce CONFIG_HOTPLUG_CPU when SMP=y Greg Kroah-Hartman
2019-04-01 17:02 ` [PATCH 4.14 104/107] KVM: Reject device ioctls from processes other than the VMs creator Greg Kroah-Hartman
2019-04-01 17:03 ` [PATCH 4.14 105/107] KVM: x86: Emulate MSR_IA32_ARCH_CAPABILITIES on AMD hosts Greg Kroah-Hartman
2019-04-01 17:03 ` [PATCH 4.14 106/107] Revert "USB: core: only clean up what we allocated" Greg Kroah-Hartman
2019-04-01 17:03 ` [PATCH 4.14 107/107] vfio: ccw: only free cp on final interrupt Greg Kroah-Hartman
2019-04-01 21:03 ` [PATCH 4.14 000/107] 4.14.110-stable review kernelci.org bot
2019-04-02  8:58 ` Naresh Kamboju
2019-04-02  9:03 ` Jon Hunter
2019-04-02 19:05 ` Guenter Roeck
2019-04-02 23:45 ` shuah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190401170046.976692195@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=dnelson@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).