Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1592601rdb; Tue, 20 Feb 2024 00:25:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJv8exEya9kAckQDeCcVcGwYBH/8V6ar8uc3n3ixGmm+uqeL4KDyMMazJ/jRrSMHoxw5s4Aob33NlSDQM4MbtLOoegxiWIJF21X1oaRQ== X-Google-Smtp-Source: AGHT+IGsJJCUDNc1tehutS+pJT5ba97DY8dleiTuEOw/O8WVrmjG0mOQYsKoPJeRNGvY0gPDFmOx X-Received: by 2002:a05:622a:50e:b0:42c:5c56:bbd7 with SMTP id l14-20020a05622a050e00b0042c5c56bbd7mr19229258qtx.58.1708417547411; Tue, 20 Feb 2024 00:25:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708417547; cv=pass; d=google.com; s=arc-20160816; b=hPv8JgatmB72X4DLCcdZA/FLiT8NDleD6x0OYksws5v80xrpsf5VAgo/lOprc4UVCk mgTn/6d/GMk7ip/Mv/Opsb7PIL006UwIuwBDvqs1gSuFLdsEmCf3Y1sZmdMdjw4bjQAC UF7BtYX26W6ZmRaSrkdrQizQKY6zkArd6nJIHN5hdgv4Ai4Uy+wHHuQL9i5zj35aF8Tq /uoi3AGA66ewi7Kt+pX6zLqY4NAsPue0w5IfbGPpQnpmq5C9g7Llc+SwpDlky7QyaS22 cOUSBOpp4+QKCig4qX4F2Wr988G3VGe2Zd8dX05SoqR8wyjMPMjsWHKHg1n16pabpIAR A+fQ== 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=CcpFd7WSqITFKvmcu7fBkMC0OFeNVME2wAmTJARK3O8=; fh=wev17V6zO4SsTygeysrUJquweJVSB4bTv6PRUfTqFGg=; b=YjP8hRVY6vhzGW9ujGsQkTlkQD37lxSK+Lhv620FNviKH+OA0Irg7F51kmbyRCKuGe Tx5dtDF4DmTIsqmO5xrTmr78FNyoo5FN/KAP9xJRT0TwcS9a2V++fz9JBrvcdPMCoB9+ QaIz+qLxlU0h6BlpuZEu9OwQI9Qi8IHi4PR2Z1zTJZmXpgXIdAQP14CMoMmepniiPEam QwQglmoCwuc7aKnncWcOjoy/uPN90tDKuucrLAsNRsjyVYmlZAV5glv/+vcrQmfL7Ybj TwsbcxScJeglqejwaQgbEFBrVoAzytOnTSClOf0WHTacTVLSBbsUQtCQxiVtgZc3pFEZ 7dLg==; 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-72546-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72546-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p3-20020a05622a00c300b0042e22cf08e0si2006803qtw.209.2024.02.20.00.25.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 00:25:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72546-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-72546-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72546-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 AFA7D1C2276C for ; Tue, 20 Feb 2024 08:25:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23D8E5D48E; Tue, 20 Feb 2024 08:25:06 +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 8DEFB5C8E5; Tue, 20 Feb 2024 08:24: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=1708417505; cv=none; b=EbAJ3nMFSaoUl+uRIr4RLu2fUGrxVL/w9eg6rP4dt4CpdfUDDVqbyO3YAOKviUYc2Q1RYq7hmlTojtd/x9ISm9KiRSGzN8Sm9IUUvB5Ncr73uoCs0+Fy7dEFuiktofzlDJDqfOiz51GGEnqCoKj5dMHK2H2KyhYICxvykTwRMDA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708417505; c=relaxed/simple; bh=ReuleouYnuzsUZPagxclzFw7E1W2ioD+wkHnlAUNSQc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sNNE5oOSFpAJhb/GkR/zaxP6rPvkIfOGN3l3Q8CGA1mNM0AnTU0hSE0w1cF06mQDz3lu7m7EJVjXBocjihjqWJKdm4vPGNGUKWpZWBrfP99aft1wm17iVkOe5B+vzOlTuJJMV09VScY2yJQqRpABHscy5byjcktrOHPDuFl18aE= 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: e97d3e886b344174aa31eec5022e6eb4-20240220 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:80761d99-db20-4992-a924-713ab21de6fe,IP:10, URL:0,TC:0,Content:-5,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,AC TION:release,TS:15 X-CID-INFO: VERSION:1.1.35,REQID:80761d99-db20-4992-a924-713ab21de6fe,IP:10,UR L:0,TC:0,Content:-5,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:15 X-CID-META: VersionHash:5d391d7,CLOUDID:b4fc9780-4f93-4875-95e7-8c66ea833d57,B ulkID:240220153655KYLGABEG,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: e97d3e886b344174aa31eec5022e6eb4-20240220 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1641455968; Tue, 20 Feb 2024 15:36:55 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 087D9E000EBC; Tue, 20 Feb 2024 15:36:55 +0800 (CST) X-ns-mid: postfix-65D45696-85943521 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 40744E000EBD; Tue, 20 Feb 2024 15:36:54 +0800 (CST) From: Kunwu Chan To: 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, jiri@resnulli.us, Kunwu Chan , Michal Swiatkowski Subject: [PATCH net-next v2 4/5] ipv4: Simplify the allocation of slab caches in ip_rt_init Date: Tue, 20 Feb 2024 15:36:45 +0800 Message-Id: <20240220073646.102033-5-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240220073646.102033-1-chentao@kylinos.cn> References: <20240220073646.102033-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_dst_cache' to 'rtable'. Signed-off-by: Kunwu Chan Reviewed-by: Michal Swiatkowski --- net/ipv4/route.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 16615d107cf0..b512288d6fcc 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -3693,9 +3693,8 @@ int __init ip_rt_init(void) panic("IP: failed to allocate ip_rt_acct\n"); #endif =20 - ipv4_dst_ops.kmem_cachep =3D - kmem_cache_create("ip_dst_cache", sizeof(struct rtable), 0, - SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); + ipv4_dst_ops.kmem_cachep =3D KMEM_CACHE(rtable, + SLAB_HWCACHE_ALIGN | SLAB_PANIC); =20 ipv4_dst_blackhole_ops.kmem_cachep =3D ipv4_dst_ops.kmem_cachep; =20 --=20 2.39.2