Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp5654lqh; Fri, 3 May 2024 11:30:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXao5B9+xM2bB6vbiuLoUH0apxoXeSiDky6wxCGdQakXP8dQgyMgecZgEpTtbTLIyrnmiKAF5IovrvEuUYFnegoD6kzXIwAIWDMP2/55Q== X-Google-Smtp-Source: AGHT+IGF7N6NqNuXPtTE8W241PMJ+lq/PZ4UsubU5cZWfLYujyX0hGJ30SwVXp/dKOjRZgyBCKkP X-Received: by 2002:a17:907:1b09:b0:a59:9a28:f1b9 with SMTP id mp9-20020a1709071b0900b00a599a28f1b9mr1678263ejc.67.1714761043692; Fri, 03 May 2024 11:30:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714761043; cv=pass; d=google.com; s=arc-20160816; b=ZrrHZ+wqlTpwiCyuKAdPkUdMW5GqlxKqyJCubaZcBuGOp6xLfJVMjsiqs87GbzOJoB xxxbMNtq0GR7gF5rxV8P4PkIxlLrdtgAJ0WSA+qAuL4013gQq0mg0SmqupjgfUaM2QUx jP4IBs1cIGYLgZHzMl3KaIZWBQinSPUR68qfJaGFnr9vY786+QqVG+4in+wg/AbS7kub S7bpqqCbWvETb3MxU5NeOMKqBBUrNeW9TKsYeNgnDUz5xGyhoSAKBG2OAwLC9+0D2ktR kVodasLWZIsnFq1UXVfRp2iL7zRILK7FKo9W5YYHKrAOPwTWZWMb+uW4rrbiTEXkRYKq pNzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=oD7RGOip8UU5tOqDcDr5U4zAaPpFJ3hsGwy+4VIdr1c=; fh=mRMHo6FEBd+e0N/0wwmt9BaEcwCnNTE8npQn9DDRWX4=; b=k8lChQndA94+xeoXUGkAV9j9fLoxnqnJ9TK7Uxe9BgBm2f2EXEProWQrUhz6zm4eRs +tOcZo6vPC+H4ZelGtrq3spUoAi/ldiOplcxm7BnidqmM+xQi8zTuUtcpyvJPBGdNIhu CXll8akErJKZWPe/eINVoOsT4rwKUHI+T8Os4XhIQCkHRQsIxxnbubghjBxCKnMs8caB IT+vs9tW+kpkJ1N2rC5HsPZqNkMov9wp/EvGbWCC+fZ0uK92Yb6yRbx3bEUjLK5HoFZh qiNFb+QcoPbjpIfCjvWd2lR1VSoBrmfv0jgqYXjhyt2lCkhESKiuSOHFQqmkuiGsO6c9 3m0A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=D6tJjx30; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=2g1qQerk; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-168054-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168054-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n13-20020a170906b30d00b00a599fc730e3si248281ejz.718.2024.05.03.11.30.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 11:30:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168054-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=D6tJjx30; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=2g1qQerk; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-168054-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168054-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6C8D21F219C4 for ; Fri, 3 May 2024 18:30:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4216158D69; Fri, 3 May 2024 18:30:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="D6tJjx30"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2g1qQerk" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49842158866; Fri, 3 May 2024 18:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714761009; cv=none; b=j5BVZdj+kmbpp8LHHl2sOBV6hYaQxrfNDC3hWtB58IGarfO1DMlf0UzY/e6udXI99a/RIKDy4mXFXX7oh0tY0b1NPEc/FUkPUNjjMbHzcT5t51z7GSONOQBq097DxV+NqdaiZ6TlY1Y0hUHUOfTBXrNPD34ammkmuzWSM0n+W2o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714761009; c=relaxed/simple; bh=yrTjq6I9F4tvJDSchi3W1D6EoEX8ecSy8/O3MSsUTBc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bMMZzzMfzipNaHYyjzNxEN/1rAj4aXCIi+2IqAtYJogBgNT9Tzduc0hrFnXUHwvoT/CEFJHwA/y+UIvAnDsrZl8u24gqDDmc6uBt5Bcj7LrXlgnxZ43gzcT8M49p7DC/4Rad6V0oLrJQGOSfNN0ATBfIfLMFszKkAVbhjf03cc0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=D6tJjx30; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2g1qQerk; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1714761006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oD7RGOip8UU5tOqDcDr5U4zAaPpFJ3hsGwy+4VIdr1c=; b=D6tJjx30NRzffTkKAqPkisdJQCPnRO4mJh3Wcb/ErQjw30+FSPEpOoHD5b9aJeVOzO4Ijz 34EGfDKaQvlvEoAesT03UJNeWrddtPGmIfjfkcKbeY7632hel+KGyVfxnhyYP9Vy/p+4gj E0rqS/uBmoNjUoKp7mYqZB5fpXmi6pOObeBy9qFfnAuI7h/nJL73HXmF6ytBdDk3sm78XN Fh5vqiM234mcYgDWnVtNhALoHdtV2ZyFQKBf2SDrtQAZOqfEFH2yNXLhh1dly7xSJn8MFr sStx5oJ2+0rntuhxbyizL8U55kC4wnDkYiz05njvAOBAEUY21nV3qvgPlic4jg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1714761006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oD7RGOip8UU5tOqDcDr5U4zAaPpFJ3hsGwy+4VIdr1c=; b=2g1qQerkfskhwQlDA9yoByrlSmRNXtWLAnixjwn0fom7Ie4H8qdCoHPCPs5RcxAu0ovqS8 pex8BGioCbm+0KAw== To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: "David S. Miller" , Boqun Feng , Daniel Borkmann , Eric Dumazet , Frederic Weisbecker , Ingo Molnar , Jakub Kicinski , Paolo Abeni , Peter Zijlstra , Thomas Gleixner , Waiman Long , Will Deacon , Sebastian Andrzej Siewior Subject: [PATCH net-next 03/15] net: Use __napi_alloc_frag_align() instead of open coding it. Date: Fri, 3 May 2024 20:25:07 +0200 Message-ID: <20240503182957.1042122-4-bigeasy@linutronix.de> In-Reply-To: <20240503182957.1042122-1-bigeasy@linutronix.de> References: <20240503182957.1042122-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The else condition within __netdev_alloc_frag_align() is an open coded __napi_alloc_frag_align(). Use __napi_alloc_frag_align() instead of open coding it. Move fragsz assignment before page_frag_alloc_align() invocation because __napi_alloc_frag_align() also contains this statement. Signed-off-by: Sebastian Andrzej Siewior --- net/core/skbuff.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 28cd640a6ea97..c4479d5721a2a 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -318,19 +318,15 @@ void *__netdev_alloc_frag_align(unsigned int fragsz, = unsigned int align_mask) { void *data; =20 - fragsz =3D SKB_DATA_ALIGN(fragsz); if (in_hardirq() || irqs_disabled()) { struct page_frag_cache *nc =3D this_cpu_ptr(&netdev_alloc_cache); =20 + fragsz =3D SKB_DATA_ALIGN(fragsz); data =3D __page_frag_alloc_align(nc, fragsz, GFP_ATOMIC, align_mask); } else { - struct napi_alloc_cache *nc; - local_bh_disable(); - nc =3D this_cpu_ptr(&napi_alloc_cache); - data =3D __page_frag_alloc_align(&nc->page, fragsz, GFP_ATOMIC, - align_mask); + data =3D __napi_alloc_frag_align(fragsz, align_mask); local_bh_enable(); } return data; --=20 2.43.0