From patchwork Mon Dec 11 21:50:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 847252 X-Patchwork-Delegate: jpettit@nicira.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YzWKmnea"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ywcFk4Ytxz9sxR for ; Tue, 12 Dec 2017 08:55:22 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1EFB4D9D; Mon, 11 Dec 2017 21:51:10 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 9229DD8D for ; Mon, 11 Dec 2017 21:51:07 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 40A1250E for ; Mon, 11 Dec 2017 21:51:07 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id l24so12574051pfj.6 for ; Mon, 11 Dec 2017 13:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4riKLc+vI245wKLcNKErQTQgY7gnFILMfkoHO7sKWgs=; b=YzWKmneaoDhjEzDIGrvojS2/hkpt1ay63/oB1Gnd0WBSDJz9FtiKaAN/E6Q5wxP7lo h3rSeUCjZwFnSf9dqO1Nruv5DeQKhpWX6zByH7dFZ0rbocPoPgSjeEAegx8WKc7VAqpS D11WbhujZY2IPcTn2QjBXsIOxZ8pHfwaTSv1GrHNkSDAMgxpxOSoRqNS3cPFgLig6SqK NQfOVLhpvvrErj0s2NgEU+CahlQ98umr6a+7cUhgN1eSLYWT5RwAaTAXEf8iyRdkAueY 3wF3HEoxtokB9PfkNV0U2thlXE6XaABSHEJ9EDxpWTRHhY7aiO8qDffwS05F+O84e2Jl JcFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4riKLc+vI245wKLcNKErQTQgY7gnFILMfkoHO7sKWgs=; b=QQxqHHqr3u0ffuxW95As6TCoxA6Sj127xtn8N0GQ2szgpJkRq6oZC9jh18Os0Flpcp gvhrlItCEXNUgCKl39bhl60vZDMc2xsPoT4PkL6WvsPREvynKZUg/4+aWbvbHsQMC0J2 mYY5nzhHCYKgvMydUg9WF3o29BuYUP+O09KGoKKC6SAwgHStOtaAjho+Q0SAQaFSsHUL x7rAs0T7x3t0bki4mtQpJJtTxADs/ksaYqfwSkdrD8Cv0KkHR212Brx1qyalH+aOtZBL 2CVKzYf+7xj3XteamEJEoISZ1Oq2z7krH+btXuccB5cTX7E5T6Oqz6kyB8y6xfE0CPLp SUYg== X-Gm-Message-State: AKGB3mLgaUADJUe8LPrV/oGcnKaSLDpAVNvcUrSjrM8jr6car/uijZ0F se7n2zmgCQA4alptG5EZTnA7E4c7 X-Google-Smtp-Source: ACJfBotBV/AHQKAj+L7oFPhaIEOTGSSnQrK6/lQUK9psKSC4XNyB8Djgx96XbkHfSkDE/1bGp2zEYw== X-Received: by 10.98.159.135 with SMTP id v7mr1693612pfk.162.1513029066531; Mon, 11 Dec 2017 13:51:06 -0800 (PST) Received: from gizo.domain (67-5-143-47.ptld.qwest.net. [67.5.143.47]) by smtp.gmail.com with ESMTPSA id c185sm25572799pfb.48.2017.12.11.13.51.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 13:51:05 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Mon, 11 Dec 2017 13:50:28 -0800 Message-Id: <1513029033-9087-8-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1513029033-9087-1-git-send-email-gvrose8192@gmail.com> References: <1513029033-9087-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Wei Yongjun Subject: [ovs-dev] [PATCH 07/12] datapath: Using kfree_rcu() to simplify the code X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Wei Yongjun Upstream commit: commit 6dc14dc40a1d1dafd8491c349b5f3e15aabc4edb Author: Wei Yongjun Date: Tue Nov 14 06:27:12 2017 +0000 openvswitch: Using kfree_rcu() to simplify the code The callback function of call_rcu() just calls a kfree(), so we can use kfree_rcu() instead of call_rcu() + callback function. Signed-off-by: Wei Yongjun Acked-by: Pravin B Shelar Signed-off-by: David S. Miller Cc: Wei Yongjun Signed-off-by: Greg Rose --- datapath/meter.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/datapath/meter.c b/datapath/meter.c index 2e58b6c..52ddd6c 100644 --- a/datapath/meter.c +++ b/datapath/meter.c @@ -42,19 +42,12 @@ static const struct nla_policy band_policy[OVS_BAND_ATTR_MAX + 1] = { [OVS_BAND_ATTR_STATS] = { .len = sizeof(struct ovs_flow_stats) }, }; -static void rcu_free_ovs_meter_callback(struct rcu_head *rcu) -{ - struct dp_meter *meter = container_of(rcu, struct dp_meter, rcu); - - kfree(meter); -} - static void ovs_meter_free(struct dp_meter *meter) { if (!meter) return; - call_rcu(&meter->rcu, rcu_free_ovs_meter_callback); + kfree_rcu(meter, rcu); } static struct hlist_head *meter_hash_bucket(const struct datapath *dp,