From patchwork Wed Feb 7 15:49:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 870452 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="bpGE5cEb"; 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 3zc5V13VWWz9s7F for ; Thu, 8 Feb 2018 02:54:01 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 15D90122D; Wed, 7 Feb 2018 15:50:19 +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 4708D122F for ; Wed, 7 Feb 2018 15:50:17 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0C1B53F9 for ; Wed, 7 Feb 2018 15:50:16 +0000 (UTC) Received: by mail-pl0-f67.google.com with SMTP id 13-v6so252905plb.5 for ; Wed, 07 Feb 2018 07:50:16 -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=dVzje0Wii/OJHeBFc6bTiF3Y4cDSfh+A31vTsBTNGgI=; b=bpGE5cEbMWMD6YhFt9cJC6dk6U7XRE0gZKCrJcjtl0xFe8EvP7a7r2TyP3djFqiiWl 2xctJsa45xCDEpBz1DWVnvfzcMz4JasAF+6VFS45dyrZVuJRDAeqwUvlV+jH3p4IpNyO kO8KoBSE23Oqpo7pEZMJt+fM6iX9Wi3sofha7E4ksl7w/m0VzjRqPB2zjbrujwp09Epg /sDoBRMGHHeSqp87XijfiGdeSn71EpFkM/7WqpoixyPuI3y7B/ixg2p778fmStahmKdk r7H+tpZuWvnaCuunTs7b+/NkIjnrruDYzHBhdjiZZ8IPKsGQdYtR3rYYBXQGOiUPnxeU NcNQ== 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=dVzje0Wii/OJHeBFc6bTiF3Y4cDSfh+A31vTsBTNGgI=; b=fL1aTda/L7CQy1ngM2dycI8us2Oe117HEL5sMeIH5Q8nbswNRWnak9JO46lct5H+OS +lkl9DHAaBddRq0C3wUvrdxTCfx7PbvP8qub7MD2kTRayNpnWewx4UpJ9VkTlYtwjEcI UmMq/zFqa6vyEKcqgOHh2pLEZvT0wry+Vt1fOosauoJbK+hc+u+ibzu+zwZVMvSluNu7 d215jCzFdMtgMyHRGnfQcX5ZwBSmpV1GfZMj0lMvHtoVDwZ/qpdPohaJbnb+MWRux2Hh 64+EAfXQb6AvBdDr+KfCSNx4abmmxV7eLDh3t/4hSeOntEhe3wzZ9MntLXKmA5ynbCEF 2t+Q== X-Gm-Message-State: APf1xPBrJlrMI6jwLc6s/45fLg/WLrW2J+KzZ3J2X0BKUVjDBLs5vL27 s3rYxeesyr1582vCx9uGofe4DQ== X-Google-Smtp-Source: AH8x227K+mKA4oLF9dWZXwAmF+jMd6LLexvkw4zN17sgSDmBjQoSkxHSDlOprPRG8DThbDL1AnN4sg== X-Received: by 2002:a17:902:5814:: with SMTP id m20-v6mr6334784pli.434.1518018616227; Wed, 07 Feb 2018 07:50:16 -0800 (PST) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id x15sm4924096pff.55.2018.02.07.07.50.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 07:50:15 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Wed, 7 Feb 2018 07:49:56 -0800 Message-Id: <1518018601-31980-7-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518018601-31980-1-git-send-email-gvrose8192@gmail.com> References: <1518018601-31980-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 v2 06/11] 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 bc940ae..7b9391d 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,