Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp864698rdb; Tue, 30 Jan 2024 00:17:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzzghRsK2dPSWKDNoWG5KQha8K5txG5twOmqNFTO9FPlfrPnuaRweiJbQobmqtlyOeScYG X-Received: by 2002:a05:6214:19c6:b0:68c:5e0d:6a21 with SMTP id j6-20020a05621419c600b0068c5e0d6a21mr1312070qvc.131.1706602634549; Tue, 30 Jan 2024 00:17:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706602634; cv=pass; d=google.com; s=arc-20160816; b=cLaKLriZCZxKdZUjxn+aKTVuw7J1tHrneDFEYAAP2wqN+YHSiKRlZVg08LC4DIM4up AWMMdWjmteOXntSQ+eOQ4/Q1bgQzGZ5kHg4E4XKtkzHzXuC1DRFkKVofPCkdC/6S2bwT rl+N/HlnzGLaxky45gaiNVrhQjpdlTrFGM4dYZD9ROzuIg4C0lqr+Dmc9bN0JODnr4XK cvQdUbvLVS6F4hwDSvMAGJEPKcxvVhV0kJ334vaZllBUEpaXu0aoGJrYgTzk3Nw0WmYU fzaZW9zLJHi4xUeknQ1A6BcUuIwfJCUbKoYCOas7UoN6BpfaQWZkrW8Z+20XkYc8e+QA EFqg== 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=5MGZ9XK127a9egn8g8dAWXnYHfXsKfdrU6gmNrXlObs=; fh=iYQsHzPOL/k8kR7GOjvaOg4g6jcALEFBcL5dNHXnvek=; b=S+YeYbnWLOZDQ2vq3toUWvCxrJV/kCJ4L/KLLrZVKkqj9vwqadpXssOjxCL3o592YI n2T1CyXVcl0gu73xmUPh4TkhudnKsj6j9KQkbjz4RoUsIxp7TKSW9QWuxfDnpegZywzj nnClywVM77gOtTwXMVhjEIPOP+8qJtJCq8jn+OEyIr3O/r28vDKFE7fosFKVd8ukfmpi cKxoogqRabcO1k9qL6T1FTrqfTlJpfEenNEG7vt/U3MBTgOgJJU6GvndwJT3oF3xE6Gf 5Yzx8e0Ax/gJOWCZ2san2llAPNEBASODUxjRCaEp5bthQa1Rgm3aj6oW5MfQz2AVYbs+ es/w== 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-44108-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44108-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o4-20020ad45c84000000b006819257ceaesi10212618qvh.81.2024.01.30.00.17.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 00:17:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44108-linux.lists.archive=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-44108-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44108-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 55CFF1C2637C for ; Tue, 30 Jan 2024 08:16:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16FD060B8D; Tue, 30 Jan 2024 08:14:35 +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 3A5F1605D8; Tue, 30 Jan 2024 08:14:30 +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=1706602474; cv=none; b=W7q1ijeZQs7R2y4m9m6lHn2FLdDG19nKSTQFJJT3lsSJdXthbGp06wISvjsWRlhzmwCWz+zldvz+Ac2cr2PEL9raqx4+aOvEUVdeCgKLYOzei5LHHydnq5wM/11LxXP2B2nGJinR6RyK7tPRaVNr3KIAI4/r0aYPUrdcDol3uGU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706602474; c=relaxed/simple; bh=2X8SIWoitl+VKVgntwPYWRKMalIKKPmqONWJZDOtlBc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WbJPcDi3+Rxogbpg/x45k4W92TFWQzNcN6ynHS6GcUq9D+1/45BN4XAZDvn2+5RDuXyN8EL8zeomHhPcjYhXJvCb+eVgdALMuGRnlfWgL9LslC90IkCr4Ov/mpA9l9UHqgaD5S2sKooqV/oi3dWm4zSwcd660XPxVRwDUou1ekU= 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: 8038e5d20ca848c3927a7be67658d64c-20240130 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:f1c4e82b-a40f-43e6-aa2a-683b630f6be4,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:f1c4e82b-a40f-43e6-aa2a-683b630f6be4,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:5f136983-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:240130161419ZQQNJ2TK,BulkQuantity:0,Recheck:0,SF:24|17|19|44|66|38|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: 8038e5d20ca848c3927a7be67658d64c-20240130 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 409578972; Tue, 30 Jan 2024 16:14:17 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 8CD10E000EBB; Tue, 30 Jan 2024 16:14:17 +0800 (CST) X-ns-mid: postfix-65B8AFD9-367288681 Received: from kernel.. (unknown [172.20.15.213]) by mail.kylinos.cn (NSMail) with ESMTPA id 1A722E000EB9; Tue, 30 Jan 2024 16:14:13 +0800 (CST) From: Kunwu Chan To: steffen.klassert@secunet.com, herbert@gondor.apana.org.au, davem@davemloft.net, 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] xfrm: Simplify the allocation of slab caches in xfrm_policy_init Date: Tue, 30 Jan 2024 16:14:11 +0800 Message-Id: <20240130081411.58246-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 Content-Transfer-Encoding: quoted-printable commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation") introduces a new macro. 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/xfrm/xfrm_policy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 7351f32052dc..6ac97e0b66cb 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -4025,10 +4025,7 @@ static int __net_init xfrm_policy_init(struct net = *net) int dir, err; =20 if (net_eq(net, &init_net)) { - xfrm_dst_cache =3D kmem_cache_create("xfrm_dst_cache", - sizeof(struct xfrm_dst), - 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, - NULL); + xfrm_dst_cache =3D KMEM_CACHE(xfrm_dst, SLAB_HWCACHE_ALIGN | SLAB_PANI= C); err =3D rhashtable_init(&xfrm_policy_inexact_table, &xfrm_pol_inexact_params); BUG_ON(err); --=20 2.39.2