From patchwork Mon Oct 5 20:34:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 288971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5963C4363A for ; Mon, 5 Oct 2020 20:35:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A031D21548 for ; Mon, 5 Oct 2020 20:35:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729082AbgJEUfY (ORCPT ); Mon, 5 Oct 2020 16:35:24 -0400 Received: from mailrelay115.isp.belgacom.be ([195.238.20.142]:49393 "EHLO mailrelay115.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbgJEUfY (ORCPT ); Mon, 5 Oct 2020 16:35:24 -0400 IronPort-SDR: 3j7vIEqw4oUy9+ktbwqeJp/JZR1dToNBtZJlZZIB+hfTqV++roT2YOBD09MAhR4p4cwpKqcfQ+ ihiSOAitIy9M3FlmsekrIUPl8IEHp6VO2IuMH9F4Rf7jsZvKesqtF0NaS11jn99OvGS/pPUa4k EOVW+yMtpEIemvaqWl2et4UAYFT20UULqWTN5bc1Zzag7lPS0gsfBPWXQpCkpzQgv8YNiAqaM1 eJCUnajL3eZOvO7VIEZkoRLZrgAfRTdbrisHi+NdJhGewhxlqnUK2eql9u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I/v4vI/WLZIINuzb9NuMq6OT1gH86h1AdZ6+p0oUTaHyiGfRmOUqZa2L2gtgdCWcKohY+TOvyhV2ETzFTe2u9ULwi5jwgFoKmApnMRpq3jLyCwii7BJtWaX5CClyWFnfobYqEUe8WaC2OOs9hjiAEVb+5Ro8vzx6hrwH6xqF8LurX+iwYs4zs1MRv6+LIix5hvQBzWsiUzWyIZ219gG4NQzg4wOZ5rFA5glSe26FQgPFCE9FXofRTXUNyM5PAw+FkI879VxiHfdqTTluiBNK8DmIfVNU0lvEHaUd0HZ2MlB3P0jCrCLxdw7KCDpIc6aHN2XXtYcxwnSWVnJI9hkUrF5McfVatgbRyolDe X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C8CADggntf/xCltltgHAEBAQEBAQcBARIBAQQEAQFHgUgCgRyCUV+NP5JWilmFMYF8CwEBAQEBAQEBATUBAgQBAYRKgjsmOgQNAgMBAQEDAgUBAQYBAQEBAQEFBAGGD0WCNyKDRwsBIyOBPxKDJoJYKaoXM4QQgUSDR4FCgTiIMoUagUE/gRGDToo0BLdNgnGDE4RrklQPIqEfLZJnoiwNgWpNIBiDJFAZDY4rF44mQjA3AgYKAQEDCVcBPQGNMgEB X-IPAS-Result: A2C8CADggntf/xCltltgHAEBAQEBAQcBARIBAQQEAQFHgUgCgRyCUV+NP5JWilmFMYF8CwEBAQEBAQEBATUBAgQBAYRKgjsmOgQNAgMBAQEDAgUBAQYBAQEBAQEFBAGGD0WCNyKDRwsBIyOBPxKDJoJYKaoXM4QQgUSDR4FCgTiIMoUagUE/gRGDToo0BLdNgnGDE4RrklQPIqEfLZJnoiwNgWpNIBiDJFAZDY4rF44mQjA3AgYKAQEDCVcBPQGNMgEB Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 05 Oct 2020 22:35:21 +0200 From: Fabian Frederick To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org Cc: Fabian Frederick Subject: [PATCH 3/9 net-next] geneve: use dev_sw_netstats_rx_add() Date: Mon, 5 Oct 2020 22:34:58 +0200 Message-Id: <20201005203458.55228-1-fabf@skynet.be> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org use new helper for netstats settings Signed-off-by: Fabian Frederick --- drivers/net/geneve.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index 974a244f45ba0..d07008a818df6 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -217,7 +217,6 @@ static void geneve_rx(struct geneve_dev *geneve, struct geneve_sock *gs, { struct genevehdr *gnvh = geneve_hdr(skb); struct metadata_dst *tun_dst = NULL; - struct pcpu_sw_netstats *stats; unsigned int len; int err = 0; void *oiph; @@ -296,13 +295,9 @@ static void geneve_rx(struct geneve_dev *geneve, struct geneve_sock *gs, len = skb->len; err = gro_cells_receive(&geneve->gro_cells, skb); - if (likely(err == NET_RX_SUCCESS)) { - stats = this_cpu_ptr(geneve->dev->tstats); - u64_stats_update_begin(&stats->syncp); - stats->rx_packets++; - stats->rx_bytes += len; - u64_stats_update_end(&stats->syncp); - } + if (likely(err == NET_RX_SUCCESS)) + dev_sw_netstats_rx_add(geneve->dev, len); + return; drop: /* Consume bad packet */