Message ID | 20240131084549.142595-1-chentao@kylinos.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-46056-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1755507dyb; Wed, 31 Jan 2024 00:55:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmLEf1Up3z4Vt/Ggh1FF5HBRnK3mvopBV+mKJU3yULToigkJgHEC2U4QMQ6pYa0fO9zV7l X-Received: by 2002:a17:906:80cc:b0:a34:d426:1bec with SMTP id a12-20020a17090680cc00b00a34d4261becmr601297ejx.12.1706691305042; Wed, 31 Jan 2024 00:55:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706691305; cv=pass; d=google.com; s=arc-20160816; b=bR6ZUpsTvyVmLinm5eeIPz0pEYrOML3N0MKqGNgfaWbNJSGenY+c9axHWDe03kntpj //ljPNALI7Ubd4P+BImOxDTyXYajwIMDqkVSqVbtvd6KwywAnAxuorRZxMMCYq9NBHxf n77PEp8f+Mavpw0XVUv6DGuZzUGQwmxjO/MlmaQ/JbCGUbqPuC5XL0gWraUZ13zFQTek DwF/KL6uEvbPlxskk/vcOkva0RZ+pyH3HpwW6gX6whdpMzW/q72x8S7eTEQJ2y2OfHI8 R5d0Q3L0Esph0hb2QT9kCCE0nTTo1BTCo49/ZM1blfcHawhUlMAHyAq3aHVurRbWInJm 2XKQ== 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=Ya382KAe9UraDRrATFl8k2RBdzOTZVwid2Pi7mvM/1M=; fh=OVCLrxGVHeUpFs/NPCXRk5vs3I9heC63tMyLG8O+NuM=; b=Hq6b3VII8mXB+SFJi4XFL/rsjS2om6MWuplCX42C3QJCE0WG0d/uhcgsGYHC0ZkdF4 DCGbFR1kfcrhj1Qw6LuGv0VFFi52cnUnRWhyiYFcuV8i563q4SJcvrBVEzr6v7XL6Kjx zKmNGhY1T0gCkKFdpi4rFVx1c+s6vwaNGdHcIaAn5M/rE5pP1Ysr+3HIzn/NBOo+qAOa 9w+W5VxmCvEI6iD2XlWuOiR6d8FLISncVIvUEuPMm41WxrrnR7EyWwsB5bnh4IRHRfI2 xYxl9nsE2IWcl9gcDh4JJPfjVtEo+f5AmZ/V9jmczoUr18j3ZsmFPdMvYEi7UeuviTWd fHcQ==; 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-46056-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46056-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCV3SgWa8udeI0fAGDCfNVBnh9owDBGcO2JXhKIEy71G0oMzoTuQXn8HHflfw0F1TolrhmXuEq+lan39tvuXYMMCWybIkw== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l23-20020a1709061c5700b00a3673976f68si424481ejg.976.2024.01.31.00.55.04 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 00:55:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46056-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-46056-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46056-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A526B1F2C28E for <ouuuleilei@gmail.com>; Wed, 31 Jan 2024 08:55:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E1C669D0D; Wed, 31 Jan 2024 08:46:12 +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 09A3C69968; Wed, 31 Jan 2024 08:46:05 +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=1706690770; cv=none; b=udLkXsKhcRsuw1ngQIaX9ufaqOz5vSc1JAosGAo/3R32VxXvbj6/PdD2+obQ4f2BOg/wY4W8hG9AG8EUBp/PR19lePrOWDIBKKhTmG62QMNGjINXq0tFKQLiB7sk3X4pPL09KFHu1mrkkw6QtUm5agaAXBEUPRp6WRAmFPjyiw4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706690770; c=relaxed/simple; bh=C9y3ndyXZaoRbRNXMuMZ3OsYWUjmAu76jF09AJo+whE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=YUHv2FL7qHPFTzrT5o0hA2UKVValyUZDXQA1sypjR6fc3iQR7FU6YDlVGIfMoGXw5Zj9vI5nBgO7eSo2h9iGhikHO0eHVG3/e2hGnFc7/s0b59H2G1MEL17AxvR/K7SCEKL3j94AMNDBcTTG+Tm38c5N8zlhEAl3nwLlJ8B57mk= 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: cae85ecc1fd4424483f295ce66f8324a-20240131 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:95ae698e-1567-481c-90aa-ee649a018903,IP:20, URL:0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACT ION:release,TS:30 X-CID-INFO: VERSION:1.1.35,REQID:95ae698e-1567-481c-90aa-ee649a018903,IP:20,UR L:0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:30 X-CID-META: VersionHash:5d391d7,CLOUDID:baf7f47f-4f93-4875-95e7-8c66ea833d57,B ulkID:2401311645553AHGQ76V,BulkQuantity:0,Recheck:0,SF:66|38|24|17|19|44|1 02,TC:nil,Content:0,EDM:5,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL :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: cae85ecc1fd4424483f295ce66f8324a-20240131 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from <chentao@kylinos.cn>) (Generic MTA) with ESMTP id 1902976999; Wed, 31 Jan 2024 16:45:52 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 1775FE000EB9; Wed, 31 Jan 2024 16:45:52 +0800 (CST) X-ns-mid: postfix-65BA08BF-893949752 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 4AA0BE000EB9; Wed, 31 Jan 2024 16:45:51 +0800 (CST) From: Kunwu Chan <chentao@kylinos.cn> To: marcelo.leitner@gmail.com, lucien.xin@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan <chentao@kylinos.cn> Subject: [PATCH net-next] sctp: Simplify the allocation of slab caches Date: Wed, 31 Jan 2024 16:45:49 +0800 Message-Id: <20240131084549.142595-1-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789595542102030994 X-GMAIL-MSGID: 1789595542102030994 |
Series |
[net-next] sctp: Simplify the allocation of slab caches
|
|
Commit Message
Kunwu Chan
Jan. 31, 2024, 8:45 a.m. UTC
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 <chentao@kylinos.cn>
---
net/sctp/protocol.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
Comments
Wed, Jan 31, 2024 at 09:45:49AM CET, chentao@kylinos.cn wrote: >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 <chentao@kylinos.cn> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
On Wed, Jan 31, 2024 at 3:46 AM Kunwu Chan <chentao@kylinos.cn> wrote: > > 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 <chentao@kylinos.cn> Acked-by: Xin Long <lucien.xin@gmail.com>
Hello: This patch was applied to netdev/net-next.git (main) by David S. Miller <davem@davemloft.net>: On Wed, 31 Jan 2024 16:45:49 +0800 you wrote: > 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 <chentao@kylinos.cn> > > [...] Here is the summary with links: - [net-next] sctp: Simplify the allocation of slab caches https://git.kernel.org/netdev/net-next/c/fa33b35f86b8 You are awesome, thank you!
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 94c6dd53cd62..e849f368ed91 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -1495,17 +1495,11 @@ static __init int sctp_init(void) /* Allocate bind_bucket and chunk caches. */ status = -ENOBUFS; - sctp_bucket_cachep = kmem_cache_create("sctp_bind_bucket", - sizeof(struct sctp_bind_bucket), - 0, SLAB_HWCACHE_ALIGN, - NULL); + sctp_bucket_cachep = KMEM_CACHE(sctp_bind_bucket, SLAB_HWCACHE_ALIGN); if (!sctp_bucket_cachep) goto out; - sctp_chunk_cachep = kmem_cache_create("sctp_chunk", - sizeof(struct sctp_chunk), - 0, SLAB_HWCACHE_ALIGN, - NULL); + sctp_chunk_cachep = KMEM_CACHE(sctp_chunk, SLAB_HWCACHE_ALIGN); if (!sctp_chunk_cachep) goto err_chunk_cachep;