mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00

* kernel: bump 5.15 to 5.15.89 * kernel: bump 6.1 to 6.1.7 * kernel: bump 5.4 to 5.4.229 * kernel: bump 5.10 to 5.10.164
105 lines
3.9 KiB
Diff
105 lines
3.9 KiB
Diff
From 4df2e1c28e8e3baadd50bdafa40fb35ea99cc52f Mon Sep 17 00:00:00 2001
|
|
From: Murat Sezgin <msezgin@codeaurora.org>
|
|
Date: Fri, 26 Feb 2016 14:59:20 -0800
|
|
Subject: net: ppp: rx/tx error and dropped pkt stats support
|
|
|
|
ppp_update_stats functions accepts rx/tx errors and dropped
|
|
pkt stats args.
|
|
|
|
Change-Id: Iba2f6ea2114d8a4678254332fec0ef7bc35bed2c
|
|
Signed-off-by: ratheesh kannoth <rkannoth@codeaurora.org>
|
|
Signed-off-by: Murat Sezgin <msezgin@codeaurora.org>
|
|
---
|
|
drivers/net/ppp/ppp_generic.c | 8 +++++++-
|
|
include/linux/ppp_channel.h | 4 +++-
|
|
net/l2tp/l2tp_core.c | 24 ++++++++++++++++++++++++
|
|
net/l2tp/l2tp_core.h | 2 ++
|
|
4 files changed, 36 insertions(+), 2 deletions(-)
|
|
|
|
--- a/drivers/net/ppp/ppp_generic.c
|
|
+++ b/drivers/net/ppp/ppp_generic.c
|
|
@@ -3378,7 +3378,9 @@ static void *unit_find(struct idr *p, in
|
|
/* Updates the PPP interface statistics. */
|
|
void ppp_update_stats(struct net_device *dev, unsigned long rx_packets,
|
|
unsigned long rx_bytes, unsigned long tx_packets,
|
|
- unsigned long tx_bytes)
|
|
+ unsigned long tx_bytes, unsigned long rx_errors,
|
|
+ unsigned long tx_errors, unsigned long rx_dropped,
|
|
+ unsigned long tx_dropped)
|
|
{
|
|
struct ppp *ppp;
|
|
|
|
@@ -3393,11 +3395,15 @@ void ppp_update_stats(struct net_device
|
|
ppp_xmit_lock(ppp);
|
|
ppp->stats64.tx_packets += tx_packets;
|
|
ppp->stats64.tx_bytes += tx_bytes;
|
|
+ ppp->dev->stats.tx_errors += tx_errors;
|
|
+ ppp->dev->stats.tx_dropped += tx_dropped;
|
|
ppp_xmit_unlock(ppp);
|
|
|
|
ppp_recv_lock(ppp);
|
|
ppp->stats64.rx_packets += rx_packets;
|
|
ppp->stats64.rx_bytes += rx_bytes;
|
|
+ ppp->dev->stats.rx_errors += rx_errors;
|
|
+ ppp->dev->stats.rx_dropped += rx_dropped;
|
|
ppp_recv_unlock(ppp);
|
|
}
|
|
|
|
--- a/include/linux/ppp_channel.h
|
|
+++ b/include/linux/ppp_channel.h
|
|
@@ -82,7 +82,9 @@ extern int ppp_is_multilink(struct net_d
|
|
*/
|
|
extern void ppp_update_stats(struct net_device *dev, unsigned long rx_packets,
|
|
unsigned long rx_bytes, unsigned long tx_packets,
|
|
- unsigned long tx_bytes);
|
|
+ unsigned long tx_bytes, unsigned long rx_errors,
|
|
+ unsigned long tx_errors, unsigned long rx_dropped,
|
|
+ unsigned long tx_dropped);
|
|
|
|
/* Called by the channel when it can send some more data. */
|
|
extern void ppp_output_wakeup(struct ppp_channel *);
|
|
--- a/net/l2tp/l2tp_core.c
|
|
+++ b/net/l2tp/l2tp_core.c
|
|
@@ -355,6 +355,30 @@ err_tlock:
|
|
}
|
|
EXPORT_SYMBOL_GPL(l2tp_session_register);
|
|
|
|
+void l2tp_stats_update(struct l2tp_tunnel *tunnel,
|
|
+ struct l2tp_session *session,
|
|
+ struct l2tp_stats *stats)
|
|
+{
|
|
+ atomic_long_add(atomic_long_read(&stats->rx_packets),
|
|
+ &tunnel->stats.rx_packets);
|
|
+ atomic_long_add(atomic_long_read(&stats->rx_bytes),
|
|
+ &tunnel->stats.rx_bytes);
|
|
+ atomic_long_add(atomic_long_read(&stats->tx_packets),
|
|
+ &tunnel->stats.tx_packets);
|
|
+ atomic_long_add(atomic_long_read(&stats->tx_bytes),
|
|
+ &tunnel->stats.tx_bytes);
|
|
+
|
|
+ atomic_long_add(atomic_long_read(&stats->rx_packets),
|
|
+ &session->stats.rx_packets);
|
|
+ atomic_long_add(atomic_long_read(&stats->rx_bytes),
|
|
+ &session->stats.rx_bytes);
|
|
+ atomic_long_add(atomic_long_read(&stats->tx_packets),
|
|
+ &session->stats.tx_packets);
|
|
+ atomic_long_add(atomic_long_read(&stats->tx_bytes),
|
|
+ &session->stats.tx_bytes);
|
|
+}
|
|
+EXPORT_SYMBOL_GPL(l2tp_stats_update);
|
|
+
|
|
/*****************************************************************************
|
|
* Receive data handling
|
|
*****************************************************************************/
|
|
--- a/net/l2tp/l2tp_core.h
|
|
+++ b/net/l2tp/l2tp_core.h
|
|
@@ -200,6 +200,8 @@ struct l2tp_session *l2tp_session_get(co
|
|
struct l2tp_session *l2tp_session_get_nth(struct l2tp_tunnel *tunnel, int nth);
|
|
struct l2tp_session *l2tp_session_get_by_ifname(const struct net *net,
|
|
const char *ifname);
|
|
+void l2tp_stats_update(struct l2tp_tunnel *tunnel, struct l2tp_session *session,
|
|
+ struct l2tp_stats *stats);
|
|
|
|
int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id,
|
|
u32 peer_tunnel_id, struct l2tp_tunnel_cfg *cfg,
|