From patchwork Wed Jan 24 06:31:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunwu Chan X-Patchwork-Id: 191381 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp808952dyi; Tue, 23 Jan 2024 22:32:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGSubnry2lTkMVmWbouGa5xx0wuzefr2LEryMowt1xFF29upOeFEU05GlGCdAkcIOVApiFg X-Received: by 2002:a05:620a:1499:b0:783:1558:d1b0 with SMTP id w25-20020a05620a149900b007831558d1b0mr8043361qkj.82.1706077952228; Tue, 23 Jan 2024 22:32:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706077952; cv=pass; d=google.com; s=arc-20160816; b=QV+n3j7WIGXIJX0to7pTBQ06kI5y3Jx0GFulhB+jE8+PhhhP1x8GZD4Y4OJooHQodD BKp5Z3z5e/FZL38lrW1syNJha1OA74waxeIzFPEEuA6uLhf46EuZI5+MmCRW7RZplDRG VBQ2NMPm3T0ul5WCV0KZS1qzGpDQgiudU+/+9ckMBZGBqqimNJ3BO/ntoOFe5n6LDiHI NhAwKK55jIMLunlHZ7/aMFZJSAAXVmDDYQcsFEhp6FZST8FpmAMuGBTZc7E0iBsGLPmG JqENf+6aPMDv/AcRUyN+D05PSHCkM80p4Aluh67OmOwNcQwgjBjTR7q+UT4A0m8Ga5XQ bxCQ== 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:message-id:date:subject:cc:to :from; bh=+wqzc1RgKcKwMKf2TXcM0q+Zkg2TIwXz7RBZOTadoMI=; fh=MsUkAeNwaRQSG09bRSFoyeRfGJ2Pu+MKNAoJoX0dqYM=; b=B9CVOjPYlVOdqDAYTJSv70elEbjYHCcupcWjk0QG182b5YpuYLeCZRM4O8rEO2qqHp E7kB9915LDQhBOaHBDhzoxypmHVOANGzWsQo0QRqPyAczEhU8uyc/1GXV20emAFNQev+ hxExKN3DL5AoSgzOdUaXdAAIw8XI99fQsB1l2JWRbuJn3/1SF4PKEz6u9dhflpW58m9N GyymR9WWaSumx24f0Mxjv0IrUsfdVKHoCYZP+jJ4mb3OWo0BtLwrtPEmw8cve3gc9mvZ Wldwb/9hxly5xA+7RsMJWLI0GS4+e0Dxs9IrsPRANSLLG+LH5k7UiahyptIb5tlHid8W 3FFQ== 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-36509-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36509-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c8-20020a05620a268800b00781935ddd47si10025697qkp.402.2024.01.23.22.32.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 22:32:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36509-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-36509-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36509-ouuuleilei=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 0A2331C245F5 for ; Wed, 24 Jan 2024 06:32:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4C2D1427B; Wed, 24 Jan 2024 06:32:13 +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 2876E628; Wed, 24 Jan 2024 06:31:59 +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=1706077932; cv=none; b=awpcNBhcmMAjIbfTMjDllziVlqbtBdX27+NYtW34Ifa1SUnvUg8SVfwyr5MIWi9kFqHr4DHLjeJ6bCrkClCC5Oeoe1pLnkQKVfF3RKs180KSjkBjqT+OKeN9uFJrVsmC+sj542o7ccRZvQrkJrrGzP/8Olb0OvNozDtUp1bQplU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706077932; c=relaxed/simple; bh=NvCcD3W3GSdtW3pNjgJjBbWGVqSOk97olzUAFiThvuY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ezr1Gh3oRDRD7njjPoolOe+yskFSNgAcBOc3A7r0/ca7JQyhb/wIqJg+4GI8Ene7cPHApqy/ypsOt+vkXjTsWivNUQkiWC/MYtmzhcPu6+TbujGxPcJ+OshMBqf2mum3ar4vQVrEaSHikXXq1JTjsq9nBnZBlKzGII25+ntjNKo= 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: 66264f1f20144503a1659c927b204992-20240124 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:a7a4f507-c00e-4fc7-9273-f8a515d1704b,IP:10, URL:0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACT ION:release,TS:-10 X-CID-INFO: VERSION:1.1.35,REQID:a7a4f507-c00e-4fc7-9273-f8a515d1704b,IP:10,UR L:0,TC:0,Content:-5,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-10 X-CID-META: VersionHash:5d391d7,CLOUDID:69c1988e-e2c0-40b0-a8fe-7c7e47299109,B ulkID:2401241431565TKGFV73,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: 66264f1f20144503a1659c927b204992-20240124 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 978852981; Wed, 24 Jan 2024 14:31:55 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 92849E000EB9; Wed, 24 Jan 2024 14:31:55 +0800 (CST) X-ns-mid: postfix-65B0AEDB-395396169 Received: from kernel.. (unknown [172.20.15.234]) by mail.kylinos.cn (NSMail) with ESMTPA id CBC81E000EB9; Wed, 24 Jan 2024 14:31:51 +0800 (CST) From: Kunwu Chan To: steffen.klassert@secunet.com, herbert@gondor.apana.org.au, 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, Kunwu Chan Subject: [PATCH ipsec-next] xfrm6_tunnel: Use KMEM_CACHE instead of kmem_cache_create Date: Wed, 24 Jan 2024 14:31:50 +0800 Message-Id: <20240124063150.466037-1-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788952394712911604 X-GMAIL-MSGID: 1788952394712911604 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/xfrm6_tunnel.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index 1323f2f6928e..0f3df26878a3 100644 --- a/net/ipv6/xfrm6_tunnel.c +++ b/net/ipv6/xfrm6_tunnel.c @@ -355,10 +355,7 @@ static int __init xfrm6_tunnel_init(void) { int rv; - xfrm6_tunnel_spi_kmem = kmem_cache_create("xfrm6_tunnel_spi", - sizeof(struct xfrm6_tunnel_spi), - 0, SLAB_HWCACHE_ALIGN, - NULL); + xfrm6_tunnel_spi_kmem = KMEM_CACHE(xfrm6_tunnel_spi, SLAB_HWCACHE_ALIGN); if (!xfrm6_tunnel_spi_kmem) return -ENOMEM; rv = register_pernet_subsys(&xfrm6_tunnel_net_ops);