netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: xiangxia.m.yue@gmail.com
To: pshelar@ovn.org, azhou@ovn.org, blp@ovn.org, u9012063@gmail.com
Cc: netdev@vger.kernel.org, dev@openvswitch.org,
	Tonghao Zhang <xiangxia.m.yue@gmail.com>
Subject: [PATCH net-next v4 3/5] net: openvswitch: remove the unnecessary check
Date: Fri, 24 Apr 2020 08:08:04 +0800	[thread overview]
Message-ID: <1587686886-16347-4-git-send-email-xiangxia.m.yue@gmail.com> (raw)
In-Reply-To: <1587686886-16347-1-git-send-email-xiangxia.m.yue@gmail.com>

From: Tonghao Zhang <xiangxia.m.yue@gmail.com>

Before invoking the ovs_meter_cmd_reply_stats, "meter"
was checked, so don't check it agin in that function.

Cc: Pravin B Shelar <pshelar@ovn.org>
Cc: Andy Zhou <azhou@ovn.org>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
---
 net/openvswitch/meter.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c
index 372f4565872d..b7893b0d6423 100644
--- a/net/openvswitch/meter.c
+++ b/net/openvswitch/meter.c
@@ -242,12 +242,11 @@ static int ovs_meter_cmd_reply_stats(struct sk_buff *reply, u32 meter_id,
 	if (nla_put_u32(reply, OVS_METER_ATTR_ID, meter_id))
 		goto error;
 
-	if (!meter)
-		return 0;
-
 	if (nla_put(reply, OVS_METER_ATTR_STATS,
-		    sizeof(struct ovs_flow_stats), &meter->stats) ||
-	    nla_put_u64_64bit(reply, OVS_METER_ATTR_USED, meter->used,
+		    sizeof(struct ovs_flow_stats), &meter->stats))
+		goto error;
+
+	if (nla_put_u64_64bit(reply, OVS_METER_ATTR_USED, meter->used,
 			      OVS_METER_ATTR_PAD))
 		goto error;
 
-- 
2.23.0


  parent reply	other threads:[~2020-04-24  0:09 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 13:10 [PATCH net-next v1 1/3] net: openvswitch: expand the meters number supported xiangxia.m.yue
2020-03-23 13:10 ` [PATCH net-next v1 2/3] net: openvswitch: set max limitation to meters xiangxia.m.yue
2020-03-23 13:10 ` [PATCH net-next v1 3/3] net: openvswitch: remove the unnecessary check xiangxia.m.yue
2020-03-29 16:46 ` [PATCH net-next v1 1/3] net: openvswitch: expand the meters number supported Pravin Shelar
2020-03-30  0:34   ` Tonghao Zhang
2020-03-31  3:57     ` Pravin Shelar
2020-04-01 10:50       ` Tonghao Zhang
2020-04-01 21:12         ` Pravin Shelar
2020-04-08 15:09         ` [ovs-dev] " William Tu
2020-04-08 15:59           ` Tonghao Zhang
2020-04-08 16:01             ` Tonghao Zhang
2020-04-09 21:41             ` William Tu
2020-04-09 23:29               ` Tonghao Zhang
2020-04-11  8:14                 ` Pravin Shelar
2020-04-16 10:16 ` [PATCH net-next v2 0/5] expand meter tables and fix bug xiangxia.m.yue
2020-04-16 10:16   ` [PATCH net-next v2 1/5] net: openvswitch: expand the meters supported number xiangxia.m.yue
2020-04-19 17:29     ` Pravin Shelar
2020-04-20  0:23       ` Tonghao Zhang
2020-04-20 21:43         ` Pravin Shelar
2020-04-16 10:17   ` [PATCH net-next v2 2/5] net: openvswitch: set max limitation to meters xiangxia.m.yue
2020-04-19 17:30     ` Pravin Shelar
2020-04-20  0:28       ` Tonghao Zhang
2020-04-20 21:44         ` Pravin Shelar
2020-04-16 10:17   ` [PATCH net-next v2 3/5] net: openvswitch: remove the unnecessary check xiangxia.m.yue
2020-04-16 10:17   ` [PATCH net-next v2 4/5] net: openvswitch: make EINVAL return value more obvious xiangxia.m.yue
2020-04-16 10:17   ` [PATCH net-next v2 5/5] net: openvswitch: use u64 for meter bucket xiangxia.m.yue
2020-04-18 22:39   ` [PATCH net-next v2 0/5] expand meter tables and fix bug David Miller
2020-04-22 17:08 ` [PATCH net-next v3 " xiangxia.m.yue
2020-04-22 17:08   ` [PATCH net-next v3 1/5] net: openvswitch: expand the meters supported number xiangxia.m.yue
2020-04-23  3:54     ` Pravin Shelar
2020-04-22 17:08   ` [PATCH net-next v3 2/5] net: openvswitch: set max limitation to meters xiangxia.m.yue
2020-04-23  3:54     ` Pravin Shelar
2020-04-22 17:08   ` [PATCH net-next v3 3/5] net: openvswitch: remove the unnecessary check xiangxia.m.yue
2020-04-23  3:54     ` Pravin Shelar
2020-04-22 17:08   ` [PATCH net-next v3 4/5] net: openvswitch: make EINVAL return value more obvious xiangxia.m.yue
2020-04-23  3:54     ` Pravin Shelar
2020-04-22 17:09   ` [PATCH net-next v3 5/5] net: openvswitch: use u64 for meter bucket xiangxia.m.yue
2020-04-23  3:54     ` Pravin Shelar
2020-04-23 19:45   ` [PATCH net-next v3 0/5] expand meter tables and fix bug David Miller
2020-04-23 19:49     ` David Miller
2020-04-23 22:56       ` Tonghao Zhang
2020-04-24  0:08 ` [PATCH net-next v4 " xiangxia.m.yue
2020-04-24  0:08   ` [PATCH net-next v4 1/5] net: openvswitch: expand the meters supported number xiangxia.m.yue
2020-04-24  0:08   ` [PATCH net-next v4 2/5] net: openvswitch: set max limitation to meters xiangxia.m.yue
2020-04-24  0:08   ` xiangxia.m.yue [this message]
2020-04-24  0:08   ` [PATCH net-next v4 4/5] net: openvswitch: make EINVAL return value more obvious xiangxia.m.yue
2020-04-24  0:08   ` [PATCH net-next v4 5/5] net: openvswitch: use u64 for meter bucket xiangxia.m.yue
2020-04-24  1:29   ` [PATCH net-next v4 0/5] expand meter tables and fix bug David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1587686886-16347-4-git-send-email-xiangxia.m.yue@gmail.com \
    --to=xiangxia.m.yue@gmail.com \
    --cc=azhou@ovn.org \
    --cc=blp@ovn.org \
    --cc=dev@openvswitch.org \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@ovn.org \
    --cc=u9012063@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).