From patchwork Mon Dec 16 15:51:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13909923 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28E90E7717F for ; Mon, 16 Dec 2024 15:51:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF4A76B00B3; Mon, 16 Dec 2024 10:51:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AA5716B00B4; Mon, 16 Dec 2024 10:51:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 96B836B00B9; Mon, 16 Dec 2024 10:51:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 793FF6B00B3 for ; Mon, 16 Dec 2024 10:51:37 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1AF1E426A5 for ; Mon, 16 Dec 2024 15:51:37 +0000 (UTC) X-FDA: 82901261940.14.79027BC Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 1FC302000D for ; Mon, 16 Dec 2024 15:51:05 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=tMgyEsFk; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734364281; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=uErsYTN3fuqgzH3wySCa9nVJafSXiODQbBwQOglZQGA=; b=WACHzpsdYjlQlRIGA7rz3cOf3g16WVHKQ9vgVtSUgctKG7Lxmq1eq71rtVueKZPmsjzK1x 1UYACJ/JoYLzrv9aG+PfVMV3GCWnw3H/Shhpk5nO14p3/kVx9JMvvewg+eBkO0ZB9DGY0M GpgV2amCZ2u7LYRpGns5lOlyl2URa+w= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734364281; a=rsa-sha256; cv=none; b=zPK6KN0g0qORe4yX6OkD8H78sFU5uuQ6igqMhf2STjuG5+fEseyZuqsIRXv+sSC7alobmK 00cRROCNlfXQpGFXMcaITe1V3EUczsE5ZBw4FqwCSFyc/qJEXmeJoKQ3wRG2PmqBAeyGnq 9h4Ci5Q8AM7g35fykFxnjb2EvzqBRJM= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=tMgyEsFk; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=uErsYTN3fuqgzH3wySCa9nVJafSXiODQbBwQOglZQGA=; b=tMgyEsFkw0A24FaJ1CHiKtL7qX Oussf5AD1yKgduMJDSjhvvbvbPdOY+SZOFPGN5Jf2o+G4ZqaB5xVMm8SPzlNDgd+bOeKg3Ru7NaLQ vuFwV/lCbz1UzRcm/VkAdsU+JQlZdSDzQc9to/bw08W3cE3fJF56zap4bU0dlwV+Os80CB7k0NQ7A iFIErl6FLuKsi8A9xZOt8jgLWfWYs/JreeDiWqyYlRYdxWqiAU2gnixaGd0lw6nLY41yiy925njr9 huWCJ76ZwoRIvfQoUW8rccSFDaOHdKJi9m1ABWHbIydiZ3ej7Lvqw9GqyX28MapR7BYbSiI4q7WVp Gw0JVmHg==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tNDNW-000000000oy-3cOc; Mon, 16 Dec 2024 15:51:26 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Lunn Cc: "Matthew Wilcox (Oracle)" , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH] niu: Use page->private instead of page->index Date: Mon, 16 Dec 2024 15:51:22 +0000 Message-ID: <20241216155124.3114-1-willy@infradead.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 1FC302000D X-Stat-Signature: ccau8z9ju8hwugaq5j37tgknfz8wbnyf X-Rspam-User: X-HE-Tag: 1734364265-850309 X-HE-Meta: U2FsdGVkX19wPrpmCxvh2UQy/lkcvG/L08WUrqJNV1T7RemREwVhqYxGb+Dta5qAOZolzK6viWeoHN+2RdknVpMoyiRDCxPkL7DDyjGeIKtwFtHDxFJ3avk1+42Xb/+xmbQxRUcvNjcPlmmJ+SusyN/r5dYxtReetmVj7pw9I7m5RdTnV3RjsjMDoDBfVYGTrJ2QMxO6oll74rZQfRz8kp7IqolD8EN22IPEZnDnP+Kz9udtuD6ftft3hsLtxpnkabvm/sK6D4ELokwqixi4cUe6Zz+hd9RMwkU/5vj1p1Baj+jLGvSQ58MyOD3DDIm+PnN0+QFozTvUdRK9ZAsBRC+VPbx8TzW7LEDwXhJyMfSuWc7rMEyvx0Y9guoezN4aNRGcDAKi7WFqZeoZ9ZVyMucABnusQqNLSq+y/mCTeF9NOS7IxgO9YuW8iML57WFfYMjG4hsqhiKyv6hQ/iCKlj7ojpYC5ZLYlKM/ahI84xlpwuo1OikgfXmEySFDudXrbKBgihNOm2e07YG6P1VZNojxPIi8AtxBlJXHgnlBm9AvRncu8fjk2P0OTcPNadFfaXC2tjywrZIGfhEQrXIylS9eUdtd80z8q7WAYNsQ61BEfLSznJZbkRN/ZvQ3JE5xAtQxiW2vEWFl1cV2HgCqGrwZ1NUcnfX9ZUtSgH7L1kWomqV3EWc70VtlSF8Gb49/w+QIfqDq13/PpJNyCVk/sqgzD5OF3js7tKQATNXKlzIhTJDVRujO+YdI74PKmeackEdVqd4YvkHtiFKzKsKIWWemVwz72WFdUcPaDARp+s7KAiYfNbCSpU6QxKkS1mlfUQqquw0xxBzkjQkz1WZ77mCIc6WYJclGJ0BB7XUtiAq0Xf+3yc71256uizf+ewXgIs7F/sPnetMOaUyoR7dApkItx2VwNL/E2yafByNiZ5o71tG+amVfQmFQuUDTPOzDMwHKGOIasN4B1e6gt3T 1SmtdpQK UOz0+e88CPZQtgLck6Mx8S7IWMA8Yzg1J6OsGOiiAq+fHGQqHXaC7bA0eUmZUk02wYtCY1gMJYZgBr1DDi1XN40L4OtI+bG2zxfzSrUy4hPPC/o1n3XR6UXGYFaVIP/zqhrOf2gN8VzFuPMeJn8OMC3iKYSCuNnsgegoHhV/vB4OVxc/GMoeuTZDkDeJx6p5yfsGH/zLEvUPGQkBXGun94ihRqTJs+2nBqrRieUxc5BrBPoQNQ8ZYaZ4Bfamf4BXAm2Hzl/egnfRVFmxQfUrycrWptHVMdfeEQBsDUR1A+9kQUy/VqNAIPZYsKWs7RRaYx/jm X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: We are close to removing page->index. Use page->private instead, which is least likely to be removed. Signed-off-by: Matthew Wilcox (Oracle) --- drivers/net/ethernet/sun/niu.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index df6d35d41b97..d7459866d24c 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c @@ -3303,7 +3303,7 @@ static struct page *niu_find_rxpage(struct rx_ring_info *rp, u64 addr, addr &= PAGE_MASK; pp = &rp->rxhash[h]; for (; (p = *pp) != NULL; pp = &niu_next_page(p)) { - if (p->index == addr) { + if (p->private == addr) { *link = pp; goto found; } @@ -3318,7 +3318,7 @@ static void niu_hash_page(struct rx_ring_info *rp, struct page *page, u64 base) { unsigned int h = niu_hash_rxaddr(rp, base); - page->index = base; + page->private = base; niu_next_page(page) = rp->rxhash[h]; rp->rxhash[h] = page; } @@ -3400,11 +3400,11 @@ static int niu_rx_pkt_ignore(struct niu *np, struct rx_ring_info *rp) rcr_size = rp->rbr_sizes[(val & RCR_ENTRY_PKTBUFSZ) >> RCR_ENTRY_PKTBUFSZ_SHIFT]; - if ((page->index + PAGE_SIZE) - rcr_size == addr) { + if ((page->private + PAGE_SIZE) - rcr_size == addr) { *link = niu_next_page(page); - np->ops->unmap_page(np->device, page->index, + np->ops->unmap_page(np->device, page->private, PAGE_SIZE, DMA_FROM_DEVICE); - page->index = 0; + page->private = 0; niu_next_page(page) = NULL; __free_page(page); rp->rbr_refill_pending++; @@ -3469,11 +3469,11 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np, append_size = append_size - skb->len; niu_rx_skb_append(skb, page, off, append_size, rcr_size); - if ((page->index + rp->rbr_block_size) - rcr_size == addr) { + if ((page->private + rp->rbr_block_size) - rcr_size == addr) { *link = niu_next_page(page); - np->ops->unmap_page(np->device, page->index, + np->ops->unmap_page(np->device, page->private, PAGE_SIZE, DMA_FROM_DEVICE); - page->index = 0; + page->private = 0; niu_next_page(page) = NULL; rp->rbr_refill_pending++; } else @@ -3538,11 +3538,11 @@ static void niu_rbr_free(struct niu *np, struct rx_ring_info *rp) page = rp->rxhash[i]; while (page) { struct page *next = niu_next_page(page); - u64 base = page->index; + u64 base = page->private; np->ops->unmap_page(np->device, base, PAGE_SIZE, DMA_FROM_DEVICE); - page->index = 0; + page->private = 0; niu_next_page(page) = NULL; __free_page(page); @@ -6460,7 +6460,7 @@ static void niu_reset_buffers(struct niu *np) page = rp->rxhash[j]; while (page) { struct page *next = niu_next_page(page); - u64 base = page->index; + u64 base = page->private; base = base >> RBR_DESCR_ADDR_SHIFT; rp->rbr[k++] = cpu_to_le32(base); page = next;