Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2245209rdb; Sun, 4 Feb 2024 23:32:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6nAF1CNO3RxFz/z2tXw7J6l/pKKZZTQl0+zBA9lIR0sG3bHZGYoYN668Yzg+1q79rkK2V X-Received: by 2002:a17:90a:68c9:b0:296:743c:c745 with SMTP id q9-20020a17090a68c900b00296743cc745mr2951187pjj.45.1707118330177; Sun, 04 Feb 2024 23:32:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707118330; cv=pass; d=google.com; s=arc-20160816; b=UQ6NjCSgKFnQ4Hhw+SEFmufkSOuxvfSqBtFx1QKsTBIMHfi3m6XAjfp1D6x6jR5oKE 5835UPU2J+wrv0kZKr3lggsjNjrBHrbzriKxR4+is0XVJg57VSIifOwmkgjqZb/8F7G+ A7GPPiXBuC0Mp2p63H+3qgmyiFico+q+IEDs7H0crM44tG3j366jgRVsUaFVmse9bcPa oGCapN+Ug64iI1BUwAwDkcqPPCDlEdSn+6vhcJiP9KJvnyHbp/WZkmTb1hhmsHPg5L4u ubrNEF5r4V7Unx1XA8VbWP+oJxuCLml+a+YtWel/8nlCdh8umwVnLz2OSausrRXOlYzz xYzA== 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=DEWgvotS6LQ0EyK7fjKHmSKoTOAO5MS3ZNmibs2vv6c=; fh=OTJml9slhTSax1CYvZPZKBsii8StWL6hX9pQ8B7hl+Y=; b=ZSK+URUyZ56ZmTfzJ53XP6ytQiKjtgVjjomgO0zwmox8HA9NV3gwgAH5OsNUtnD/yx qcjkfK36jvV/Hm9itsiTnDraLKNQhkQ3NsElbh5Bb7ZfCXteLfUbVmJEPIUhyiJSZegF 7d+lomJpc76Z8fHGNPhO+8D9zih2QQ5OHmDwrebhXd/L4bzYKqJcJZQH5c0NgEaYJmxg CxerTBYnEvyRtRtlE9ctYlcnLD1MaYpY+NrNaMJVYQKirFWGT/uO1bma3lg9JZ/0SCnu 2yreEy5oFw/XKUkxkq3Iw00nTIxbaibIKgJEp46ynl+P6+o0p4Iz/KlyuiThgYCEnVdW sfxw==; 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-52131-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52131-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCW0UiKPn8R+2gIBdtQ/WNNpzYFCk9BA7CeWH0MNuY7wNgQN0Ogfh/oN/uMLOograE+FknLmTaMGsPNcLpz61BtPlslt5+YPVDGh03EN8A== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id v2-20020a17090a898200b00290a31c3fcesi4075907pjn.16.2024.02.04.23.32.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 23:32:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52131-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-52131-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52131-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 008E7B24810 for ; Mon, 5 Feb 2024 07:23:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB89614ABA; Mon, 5 Feb 2024 07:21:00 +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 3FEE6111A2; Mon, 5 Feb 2024 07:20:57 +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=1707117660; cv=none; b=QrVjTvFT31LurIGu3jsTRfrC7Ge2duwrXRGwkau/SbhW7HlAHx+73pXnHiXCqyOfWz3N8nlFr44H+HSB1jpMOuN5d0K2FAwuxzh/2uLIzUvwj9KbcMwHxjVpsAXL4vHjMZQqJtzq6F4ENhxbdKGj8JkrztRAlueA2EaMhe5c6uA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707117660; c=relaxed/simple; bh=2RPhHIO24rO7DrKNGK166qDpBMo7ED6D9CiaT+aa0kg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=slDNABwoIz4GBxsgzQfZGbg16AW1HvW8dRHKQgf2Mee4xJlsqdjUT2f9yVSEBv1GA9t2xAiFi8ncT7+b9aAoXHI+SlvKfnqh5fFzeZA9CYqqzHFMoAaj8YRxEL6H4LhEboOUzOPzC7KfH9uNm403Lg4M+XTjxR9qdNwZxxzgdqA= 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: 3c01047df7ec4e4c9cf90160e14ee212-20240205 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:2fe792de-25ed-4861-8503-5727ad80d150,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:2fe792de-25ed-4861-8503-5727ad80d150,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:cbb1a083-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:240205152054PAMNL1WR,BulkQuantity:0,Recheck:0,SF:66|38|24|17|19|44|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L: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_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 3c01047df7ec4e4c9cf90160e14ee212-20240205 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 2062955715; Mon, 05 Feb 2024 15:20:53 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 123C0E000EBC; Mon, 5 Feb 2024 15:20:53 +0800 (CST) X-ns-mid: postfix-65C08C54-87813279 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 5B4D9E000EBD; Mon, 5 Feb 2024 15:20:52 +0800 (CST) From: Kunwu Chan To: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, jiri@resnulli.us Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH net-next 6/6] ipv6: Simplify the allocation of slab caches Date: Mon, 5 Feb 2024 15:20:13 +0800 Message-Id: <20240205072013.427639-7-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240205072013.427639-1-chentao@kylinos.cn> References: <20240205072013.427639-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. Signed-off-by: Kunwu Chan --- net/ipv6/ip6_fib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 4fc2cae0d116..25d7e6d45e6a 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -2444,10 +2444,8 @@ int __init fib6_init(void) { int ret =3D -ENOMEM; =20 - fib6_node_kmem =3D kmem_cache_create("fib6_nodes", - sizeof(struct fib6_node), 0, - SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT, - NULL); + fib6_node_kmem =3D KMEM_CACHE(fib6_node, + SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT); if (!fib6_node_kmem) goto out; =20 --=20 2.39.2