Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2244811rdb; Sun, 4 Feb 2024 23:31:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IFV5xSgxJOBGtSuNTRyPYv5P3MvJC13B8Lz2mYJVjbJaVvjy6oUsomtpR4AuRrbDJ2kDumV X-Received: by 2002:a05:6870:1d11:b0:218:f7c4:2ca2 with SMTP id pa17-20020a0568701d1100b00218f7c42ca2mr8300870oab.31.1707118279693; Sun, 04 Feb 2024 23:31:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707118279; cv=pass; d=google.com; s=arc-20160816; b=MIU4Tx+H+w7nJ9DGZpQYyDwJu3i3FSGhxP8UY211q36rka3rFMl87uDGOldi5kYmE1 QCKPSOV6s6f/2qeX13p/sl68f+ctMVri0qILa7gXJ+h9n88I5UkhNRR3eZLjg4tMvX6n YoGQn4Oe1WRlKtKQQiELkq+t4zDJ0SrMcQj1f7V+x0FwOOcagbUSG4xVjlAiATweaDJs WbNfqDmdONNxWPu4J9z0PT4VSixizoRQEsxAGRgZRyZXaHinbd03d9U4CQW6rK5PO3ZF rkhJz9W2nkXN1+ayttS9pyt5YIdvQCwqWRqf6myJVvtvhgLdwIR+8SznOfjHv+8QpGzr 97/A== 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=KN1iT4RmpN0KBfizualkMGBCGrGGafunUDJXVsvR8qs=; fh=KnMgbqTkfKTfQx22O/OoAcwMfP2Ok4ssaLJ7OfqxOTk=; b=CqrinssCJd9xNqBEz0gSdnm0/BDpXKm8vM4B6xFeJyvpLfFM2XmFmt9DICgyocbrGK /CzMmEY8tnqai6m3+Fm+Zq8qbXyEpIVPJTOqtVMMCQKhR5yTFCbsTthVJuQP49sLC5ct /b5w4KnJFN/fnm//s/z4iy5nc9JH90lmJo1a6z/ArtszZ6VyEu8vXeNfhAyPAtQXMx0h cew1kbniVbheG9sHPvDFb1g5XqWxC+FqrrEspirbxIbl8hkRhvkU2UNP5SDVGA7d/7Vf oeDDNE4oHAIKxv+eUET/CbhD5RjthJB2PdTmxrB6WgynzeTcTLrxdHxzxRaHxLgTxMCq 0BGg==; 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-52128-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52128-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUBBrlnqqVkXDi8zNFJF7M2WB84SbCKlgV34tCu3HaxKo2lqu4exAowaUgeccwx5cJWgGGfyhKDqMwpnloD2reMUjJ6mUQI4h83cfYdgg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id g12-20020a63200c000000b005d8baa20a39si5623112pgg.312.2024.02.04.23.31.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 23:31:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52128-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-52128-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52128-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 C116FB20D39 for ; Mon, 5 Feb 2024 07:22:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3636513AE3; Mon, 5 Feb 2024 07:20:49 +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 29CFE10A25; Mon, 5 Feb 2024 07:20:45 +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=1707117648; cv=none; b=T0vRCpp7XotnTsEzrzIc65MLupnQNw9UQ/FwARcw4H3DMVOF+uVtvoYCMpNoj531Z34ZN+UEaWvkPr8ULNjHHWqHHipzOukxyqc3dZ63OXHTGAkIcODspI+pvd2ebcoPUuVsbn14xyjdNGjClyXK0M1q7tTgHCjyXuOi95ypj60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707117648; c=relaxed/simple; bh=biOCybBNDhjOReD9xZnf1JAj6jSi0ruvZfoR2nzth48=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XRCHNzd3k2Js60C4wMFybSS9bDtNDTDB9JIEW6mzTWgbyLNut22DCrCQNeI7tPmrJXliumjXRXGvACrxaOptgBmMDhlckC83+wjPzL4ZUDzYu8dwfIknOkZNVOiHDgAZU0+z1K87tkH9doUWm5O/Y0joxkE8WQRvhr+THFF+pDI= 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: fddf02a90dd44ab288f898ab8ea2abeb-20240205 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:50d1ff59-2439-4ffe-8ed1-576131a8fe74,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:50d1ff59-2439-4ffe-8ed1-576131a8fe74,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:23af078f-e2c0-40b0-a8fe-7c7e47299109,B ulkID:240205152044NCROXGAD,BulkQuantity:0,Recheck:0,SF:44|66|38|24|17|19|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: fddf02a90dd44ab288f898ab8ea2abeb-20240205 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 2072795595; Mon, 05 Feb 2024 15:20:42 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 597F8E000EBD; Mon, 5 Feb 2024 15:20:42 +0800 (CST) X-ns-mid: postfix-65C08C4A-16642375 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id A0048E000EBC; Mon, 5 Feb 2024 15:20:41 +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 3/6] ipmr: Simplify the allocation of slab caches Date: Mon, 5 Feb 2024 15:20:10 +0800 Message-Id: <20240205072013.427639-4-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. And change cache name from 'ip_mrt_cache' to 'mfc_cache'. Signed-off-by: Kunwu Chan --- 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