Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp227614rdb; Mon, 22 Jan 2024 18:56:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYhJOuZ/MsJUF03oPHR0SYL96VDdTpuAlZixabGNW+AMOVEp7mJ9BIikmjs3TMTeWiYOOa X-Received: by 2002:a05:6402:2936:b0:557:dd03:cd with SMTP id ee54-20020a056402293600b00557dd0300cdmr975840edb.19.1705978588073; Mon, 22 Jan 2024 18:56:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705978588; cv=pass; d=google.com; s=arc-20160816; b=JAah9sS5R3KiAL1O+BbhFQhM/YXlLQ14xOyoYuQl2th4kZhkzwDmaQz6xIrlFtcFbL lEebevfKUkrXmu/tlxJ1UMRyj/KyG/mSR0xcyBGn89/mcJlbQC9tTNjHV40oM8XpE+3y SX0XwtqvCPEDBVr9iEA7sZ1Ijfv79GTnyt3cP+5/PvhJgtW1s71Ma3ciWanRMZoWSnF/ usKh+31Ln2p6ZLRybe2MLmJ4p7ySXu9whNae52i88KEqlwtzv/JIq1RzGpEW6kpJ40XA Opd2gEn4cDbOImFR3ecXb4h184cKi30o6G8YU0fHx1gUny6SO6mXQbAJEB1BhQM5rrpT S5MQ== 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=q+0oPhnh8x9ZDBPaglHHx9ak+KdIQEuyNRY+VOF+UDY=; fh=A3wk83PZnralrrCkvnvQjrz/EdwznkZROqIaWZsMnig=; b=QArOrqfpxZkgwaBqHqu8y5kUUEeTOHsAqj3h1BMN1L/MkHHfODFa+E8WT1iss4MXf1 55n6cuREo/duE0s4xLuYPz6sjGAfKywXFzYUC0854rxnbXAKQ/bWV/fWrsmdWksW0aUG aLLXGmQpsJEwaQMX7eNh9fe00nza4fnTdaB41DxERg+jRFdmrV/J3rQILDzyFPxLy5Pm /ld0fX62qUbDnL+QI2xUytuaDB1vCiuS3uDBOeqKaGNSIMTO6potdv3zsPNKoGBd+pDG WztADUce01UoczYIj1ZrnUtUvtBk7zbTO/YDGa5+xIY8Z5qOTaXCbaG3J6vOTnMpiGuD UXcw== 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-34648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34648-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u13-20020a50c04d000000b0055a85f51cf9si3365670edd.334.2024.01.22.18.56.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 18:56:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-34648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34648-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4D18E1F2AA6D for ; Tue, 23 Jan 2024 02:47:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FF5F17CA; Tue, 23 Jan 2024 02:46: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 069B4374; Tue, 23 Jan 2024 02:46:42 +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=1705978008; cv=none; b=phRw/aHvUmARoZFX4aMo/1JLqEpJK0UmzrWl8tFcB2nC/9EN3Kq1FrMPJZdpA8VzJs3Q7nuEwJwTuVqYdJBhzkQJYnHCT7qcvyzcUtcpvern3eHIO8vmpbUXmJM9GqPz0bYh5j7qXpTULUkdtzPdX8VyYEslkVataX5cnczDVG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705978008; c=relaxed/simple; bh=DgpW2TYFY7FMhpYd9iFluKaHz62UIxRSWXxq6QZHrPQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=KFU1CkJkbishRyIWFdTJlBqaVEomazu8obgyR2uJwehuir/E0eQSGs0c923EnSz7n0DmxcthNNTiRrtnAfJj0kZsS8Oozybj8eG5w8dvSNcQittmkOKDhiyvt/j3zFHgxQ1oMWIZuqsRDsr5N6oYypiKl6F/ChxKv1a5OER/oyg= 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: 5d505d236484480a9e29728173f68199-20240123 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:3ae40562-b553-4881-b1b2-749a43e648c9,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:3ae40562-b553-4881-b1b2-749a43e648c9,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:457fa47f-4f93-4875-95e7-8c66ea833d57,B ulkID:240123104638C5ZVN90J,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_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI,TF_CID_SPAM_SNR X-UUID: 5d505d236484480a9e29728173f68199-20240123 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 2008426615; Tue, 23 Jan 2024 10:46:37 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 100C8E000EB9; Tue, 23 Jan 2024 10:46:37 +0800 (CST) X-ns-mid: postfix-65AF288C-825111420 Received: from kernel.. (unknown [172.20.15.234]) by mail.kylinos.cn (NSMail) with ESMTPA id 379ACE000EB9; Tue, 23 Jan 2024 10:46:33 +0800 (CST) From: Kunwu Chan To: pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: horms@kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH nf-next] netfilter: nf_conncount: Use KMEM_CACHE instead of kmem_cache_create() Date: Tue, 23 Jan 2024 10:46:31 +0800 Message-Id: <20240123024631.396631-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 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/netfilter/nf_conncount.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c index 5d8ed6c90b7e..8715617b02fe 100644 --- a/net/netfilter/nf_conncount.c +++ b/net/netfilter/nf_conncount.c @@ -605,15 +605,11 @@ static int __init nf_conncount_modinit(void) for (i =3D 0; i < CONNCOUNT_SLOTS; ++i) spin_lock_init(&nf_conncount_locks[i]); =20 - conncount_conn_cachep =3D kmem_cache_create("nf_conncount_tuple", - sizeof(struct nf_conncount_tuple), - 0, 0, NULL); + conncount_conn_cachep =3D KMEM_CACHE(nf_conncount_tuple, 0); if (!conncount_conn_cachep) return -ENOMEM; =20 - conncount_rb_cachep =3D kmem_cache_create("nf_conncount_rb", - sizeof(struct nf_conncount_rb), - 0, 0, NULL); + conncount_rb_cachep =3D KMEM_CACHE(nf_conncount_rb, 0); if (!conncount_rb_cachep) { kmem_cache_destroy(conncount_conn_cachep); return -ENOMEM; --=20 2.39.2