lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAG88wWbq4Gn-DTTkNNQkzG7p7db1xEUYmPYQNx0oKZP8FetJZA@mail.gmail.com>
Date:	Thu, 10 Nov 2011 10:45:43 -0800
From:	David Decotigny <david.decotigny@...gle.com>
To:	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:	"David S. Miller" <davem@...emloft.net>,
	Ian Campbell <ian.campbell@...rix.com>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
	Ben Hutchings <bhutchings@...arflare.com>,
	David Decotigny <david.decotigny@...gle.com>
Subject: Re: [PATCH net-next v1 4/9] forcedeth: stats for rx_packets based on
 hardware registers

Hi all,

After discussion with original author of patch  "forcedeth: statistics
optimization" (21828163b2b31e0675cb3e66a2a4a231dec06236), I will
revise this strategy, and step back to using software counters to make
the accounting of packets received at software level more accurate.
Will send an update to this series shortly.

Regards,

--
David Decotigny


On Wed, Nov 9, 2011 at 2:09 PM, David Decotigny
<david.decotigny@...gle.com> wrote:
> Use the hardware registers instead of a software implementation to
> account for the number of RX packets.
>
>
>
> Signed-off-by: David Decotigny <david.decotigny@...gle.com>
> ---
>  drivers/net/ethernet/nvidia/forcedeth.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
> index cd7f83d..0071d5c 100644
> --- a/drivers/net/ethernet/nvidia/forcedeth.c
> +++ b/drivers/net/ethernet/nvidia/forcedeth.c
> @@ -1712,6 +1712,7 @@ static struct net_device_stats *nv_get_stats(struct net_device *dev)
>                nv_get_hw_stats(dev);
>
>                /* copy to net_device stats */
> +               dev->stats.rx_packets = np->estats.rx_packets;
>                dev->stats.tx_packets = np->estats.tx_packets;
>                dev->stats.rx_bytes = np->estats.rx_bytes;
>                dev->stats.tx_bytes = np->estats.tx_bytes;
> @@ -2690,7 +2691,6 @@ static int nv_rx_process(struct net_device *dev, int limit)
>                skb_put(skb, len);
>                skb->protocol = eth_type_trans(skb, dev);
>                napi_gro_receive(&np->napi, skb);
> -               dev->stats.rx_packets++;
>  next_pkt:
>                if (unlikely(np->get_rx.orig++ == np->last_rx.orig))
>                        np->get_rx.orig = np->first_rx.orig;
> @@ -2773,7 +2773,6 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
>                                __vlan_hwaccel_put_tag(skb, vid);
>                        }
>                        napi_gro_receive(&np->napi, skb);
> -                       dev->stats.rx_packets++;
>                } else {
>                        dev_kfree_skb(skb);
>                }
> --
> 1.7.3.1
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ