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
commitd57a1b7eb3cff2e2d817ff7d4ba3efcf529dcde3 (patch)
treeaa6f1c7850f4eac99c44292b3c77997d217c1ca4
parentf886820211cf1879dc3d695aca29bb0b19ecb5f7 (diff)
thunderx: eliminate extra calls to put_page() for pages held
for recycling (networking-stable-19_03_28). suse-commit: dbe44699702d33a34417938f74a052bddc740208
-rw-r--r--drivers/net/ethernet/cavium/thunder/nicvf_queues.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
index d5a188959dc4..701db93da1d6 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
@@ -364,11 +364,10 @@ static void nicvf_free_rbdr(struct nicvf *nic, struct rbdr *rbdr)
while (head < rbdr->pgcnt) {
pgcache = &rbdr->pgcache[head];
if (pgcache->page && page_ref_count(pgcache->page) != 0) {
- if (!rbdr->is_xdp) {
- put_page(pgcache->page);
- continue;
+ if (rbdr->is_xdp) {
+ page_ref_sub(pgcache->page,
+ pgcache->ref_count - 1);
}
- page_ref_sub(pgcache->page, pgcache->ref_count - 1);
put_page(pgcache->page);
}
head++;