Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1592666rdb; Tue, 20 Feb 2024 00:25:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXXdrYMfEIJFIJOsI/nirPjJPK1F7Q44iZYpOzOQdBHK9HHPPU6m24moetq0NBRGQnx3ZzIF3DeOBMG3MbtRq/pYYdsr3amEtsPJHZFHg== X-Google-Smtp-Source: AGHT+IHNQGyodhRzyL0g/ZWcQXrlxlZnFxxujhw5vY7tSVD5smJupf0CGg/978w5nu5ZLKLwEBgf X-Received: by 2002:a05:622a:4d4:b0:42c:3889:7eec with SMTP id q20-20020a05622a04d400b0042c38897eecmr30001203qtx.17.1708417557139; Tue, 20 Feb 2024 00:25:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708417557; cv=pass; d=google.com; s=arc-20160816; b=cN0O2MOAjjlGQwhlY30c79Hl88pu5eQvujHr3c7jni5NbCWpwIKt4TMjTwvJokL5xv dffL49xRRR0P513hDlLejeDB4YVpHHNlstWtas7AXQe9CwMr7VCKmgBaijBAvkrdrg3g v/emTDyB0BDF6UBqx/Y+Yt3i5kf4SUf1pvF9XQ8yT5VT64uVQTDmnm9f+tfdIk6al1O8 1NhACr0IVIp90AJIKX7EJdmBbnyCZqkHjUNFL7qTQ+WhAvl1aXF9wsoY/UkP8z/WKutt zlhRVC55jP9hxYCgk6Nw+8W/3aMOLNX4U6ypHW7xSpJhvtmonsrMDytPWV1MHzxs7Nei dCcQ== 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:from; bh=xuxkfTpLgn3G4F4z6pIzU8U3G6fIl0TcR4GNGjRivHE=; fh=wev17V6zO4SsTygeysrUJquweJVSB4bTv6PRUfTqFGg=; b=f/XEkD7X0r7LDzFzz3eMEl0wQiMQWr15/AK7hWzU9+ez6QBmx1QdO7z5OCHuW16x3c /NMjf2Rsvp+SaP5Nt7/d++L5YL5CVFWjWIPTFKBq6L7SEzGdxUSwzCHt1kegSpvFJJRp Ye9QS3ftyRT/lcbh01kukZ5NmpLzMDp0Y+lWompcoagNtGjrwe6vCK645WBP2kxgM2q3 12PiaHuseYSMoQlVGwicEeZnRVeA15X1/RoOTeYkRsQzuT8T5vGk1hvt7dzCKIg7/abB giWY8uMjlQ7szSlctMA0FFq0HCoimc6TLMPHSvejD1MDh8ci3RD2mC+kDewK3KOa4LZA PaBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-72547-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72547-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p3-20020a05622a00c300b0042e22cf08e0si2006803qtw.209.2024.02.20.00.25.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 00:25:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72547-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-72547-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72547-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 87B431C20CCD for ; Tue, 20 Feb 2024 08:25:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA6DD5D8E4; Tue, 20 Feb 2024 08:25:06 +0000 (UTC) Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (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 1D2BD5C8E4; Tue, 20 Feb 2024 08:24:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708417505; cv=none; b=lwKXbdchDwQnjy4OXyLoWdpbnVYpQA1BWRgRHVli99KjLpYxhWYx4kF2mgs0TPPrdD/guDG0WgXagAhHzo93w6ScoBpol5od72+oroAGFYqsiJRDypWmJbJXtfKH5FsugyQTcNmQQE0uKkgxe1Nh0clDRNYli6L/hLpuQM0OIDY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708417505; c=relaxed/simple; bh=Ewm9aE8os5thGL+1GTINypV4Lp9agL4EjjAFq7lE0iU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PZqx61zQ0l5pxVDWvkcxQFvkrqX3nLlTfPDiGzmQRQmitLo4MftGF3vh2VnG7yTUrSKY6n443XwbCFsKtTkj1JdZlRalc9Gulh2cD2dTK0XxvctrKAbioJgWKvUrG+jxHlInXXvycUgyaI8LgB6zyJQF3HosIsu+s9aZtLmIPMk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 734cc8e160aa41b990c82f18d54a2885-20240220 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:eb562f8f-bc8f-4890-9270-c5c5b1a46118,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-5 X-CID-INFO: VERSION:1.1.35,REQID:eb562f8f-bc8f-4890-9270-c5c5b1a46118,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:5d391d7,CLOUDID:60f67e8f-e2c0-40b0-a8fe-7c7e47299109,B ulkID:240220153655OTY0JWRP,BulkQuantity:1,Recheck:0,SF:66|38|24|17|19|44|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:43,QS:nil,BEC:nil,COL :0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_FSI,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD X-UUID: 734cc8e160aa41b990c82f18d54a2885-20240220 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 113316440; Tue, 20 Feb 2024 15:36:54 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 3015AE000EBC; Tue, 20 Feb 2024 15:36:54 +0800 (CST) X-ns-mid: postfix-65D45696-2075820 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 6A410E000EBD; Tue, 20 Feb 2024 15:36:53 +0800 (CST) From: Kunwu Chan To: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jiri@resnulli.us, Kunwu Chan , Michal Swiatkowski Subject: [PATCH net-next v2 3/5] ipmr: Simplify the allocation of slab caches Date: Tue, 20 Feb 2024 15:36:44 +0800 Message-Id: <20240220073646.102033-4-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240220073646.102033-1-chentao@kylinos.cn> References: <20240220073646.102033-1-chentao@kylinos.cn> 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 Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. And change cache name from 'ip_mrt_cache' to 'mfc_cache'. Signed-off-by: Kunwu Chan Reviewed-by: Michal Swiatkowski --- net/ipv4/ipmr.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 9d6f59531b3a..820c95bee6bb 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -3139,10 +3139,7 @@ int __init ip_mr_init(void) { int err; =20 - mrt_cachep =3D kmem_cache_create("ip_mrt_cache", - sizeof(struct mfc_cache), - 0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, - NULL); + mrt_cachep =3D KMEM_CACHE(mfc_cache, SLAB_HWCACHE_ALIGN | SLAB_PANIC); =20 err =3D register_pernet_subsys(&ipmr_net_ops); if (err) --=20 2.39.2