Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8258e6f authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan Committed by Gerrit - the friendly Code Review server
Browse files

net: qualcomm: rmnet: Add support to reset ethtool private stats



Add ethtool private stats handler to reset the statistics of
handling of packets with downlink header and trailer.
“ethtool -r rmnet_data0” will reset the stats.

CRs-Fixed: 2285862
Change-Id: Ib3da8c2b7b23d72de2795f93a90e8c0e3b2ce869
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 60733446
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -231,10 +231,27 @@ static void rmnet_get_ethtool_stats(struct net_device *dev,
	       ARRAY_SIZE(rmnet_port_gstrings_stats) * sizeof(u64));
}

static int rmnet_stats_reset(struct net_device *dev)
{
	struct rmnet_priv *priv = netdev_priv(dev);
	struct rmnet_port_priv_stats *stp;
	struct rmnet_port *port;

	port = rmnet_get_port(priv->real_dev);
	if (!port)
		return -EINVAL;

	stp = &port->stats;

	memset(stp, 0, sizeof(*stp));
	return 0;
}

static const struct ethtool_ops rmnet_ethtool_ops = {
	.get_ethtool_stats = rmnet_get_ethtool_stats,
	.get_strings = rmnet_get_strings,
	.get_sset_count = rmnet_get_sset_count,
	.nway_reset = rmnet_stats_reset,
};

/* Called by kernel whenever a new rmnet<n> device is created. Sets MTU,