Revert "xfrm: interface: use DEV_STATS_INC()"
This reverts commit 4ba4eec4f4
which is
commit f7c4e3e5d4f6609b4725a97451948ca2e425379a upstream.
It breaks the build as it relies on a reverted patch. if it is needed
for this branch, it can come back in an abi-safe way.
Change-Id: I18ecdab21ea8a95132d62abac9c189e8589c16b0
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -274,8 +274,8 @@ static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
|
|||||||
skb->dev = dev;
|
skb->dev = dev;
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
DEV_STATS_INC(dev, rx_errors);
|
dev->stats.rx_errors++;
|
||||||
DEV_STATS_INC(dev, rx_dropped);
|
dev->stats.rx_dropped++;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -309,6 +309,7 @@ static int
|
|||||||
xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
|
xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
|
||||||
{
|
{
|
||||||
struct xfrm_if *xi = netdev_priv(dev);
|
struct xfrm_if *xi = netdev_priv(dev);
|
||||||
|
struct net_device_stats *stats = &xi->dev->stats;
|
||||||
struct dst_entry *dst = skb_dst(skb);
|
struct dst_entry *dst = skb_dst(skb);
|
||||||
unsigned int length = skb->len;
|
unsigned int length = skb->len;
|
||||||
struct net_device *tdev;
|
struct net_device *tdev;
|
||||||
@@ -334,7 +335,7 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
|
|||||||
tdev = dst->dev;
|
tdev = dst->dev;
|
||||||
|
|
||||||
if (tdev == dev) {
|
if (tdev == dev) {
|
||||||
DEV_STATS_INC(dev, collisions);
|
stats->collisions++;
|
||||||
net_warn_ratelimited("%s: Local routing loop detected!\n",
|
net_warn_ratelimited("%s: Local routing loop detected!\n",
|
||||||
dev->name);
|
dev->name);
|
||||||
goto tx_err_dst_release;
|
goto tx_err_dst_release;
|
||||||
@@ -377,13 +378,13 @@ xmit:
|
|||||||
tstats->tx_packets++;
|
tstats->tx_packets++;
|
||||||
u64_stats_update_end(&tstats->syncp);
|
u64_stats_update_end(&tstats->syncp);
|
||||||
} else {
|
} else {
|
||||||
DEV_STATS_INC(dev, tx_errors);
|
stats->tx_errors++;
|
||||||
DEV_STATS_INC(dev, tx_aborted_errors);
|
stats->tx_aborted_errors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
tx_err_link_failure:
|
tx_err_link_failure:
|
||||||
DEV_STATS_INC(dev, tx_carrier_errors);
|
stats->tx_carrier_errors++;
|
||||||
dst_link_failure(skb);
|
dst_link_failure(skb);
|
||||||
tx_err_dst_release:
|
tx_err_dst_release:
|
||||||
dst_release(dst);
|
dst_release(dst);
|
||||||
@@ -393,6 +394,7 @@ tx_err_dst_release:
|
|||||||
static netdev_tx_t xfrmi_xmit(struct sk_buff *skb, struct net_device *dev)
|
static netdev_tx_t xfrmi_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct xfrm_if *xi = netdev_priv(dev);
|
struct xfrm_if *xi = netdev_priv(dev);
|
||||||
|
struct net_device_stats *stats = &xi->dev->stats;
|
||||||
struct dst_entry *dst = skb_dst(skb);
|
struct dst_entry *dst = skb_dst(skb);
|
||||||
struct flowi fl;
|
struct flowi fl;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -409,7 +411,7 @@ static netdev_tx_t xfrmi_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
dst = ip6_route_output(dev_net(dev), NULL, &fl.u.ip6);
|
dst = ip6_route_output(dev_net(dev), NULL, &fl.u.ip6);
|
||||||
if (dst->error) {
|
if (dst->error) {
|
||||||
dst_release(dst);
|
dst_release(dst);
|
||||||
DEV_STATS_INC(dev, tx_carrier_errors);
|
stats->tx_carrier_errors++;
|
||||||
goto tx_err;
|
goto tx_err;
|
||||||
}
|
}
|
||||||
skb_dst_set(skb, dst);
|
skb_dst_set(skb, dst);
|
||||||
@@ -425,7 +427,7 @@ static netdev_tx_t xfrmi_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
fl.u.ip4.flowi4_flags |= FLOWI_FLAG_ANYSRC;
|
fl.u.ip4.flowi4_flags |= FLOWI_FLAG_ANYSRC;
|
||||||
rt = __ip_route_output_key(dev_net(dev), &fl.u.ip4);
|
rt = __ip_route_output_key(dev_net(dev), &fl.u.ip4);
|
||||||
if (IS_ERR(rt)) {
|
if (IS_ERR(rt)) {
|
||||||
DEV_STATS_INC(dev, tx_carrier_errors);
|
stats->tx_carrier_errors++;
|
||||||
goto tx_err;
|
goto tx_err;
|
||||||
}
|
}
|
||||||
skb_dst_set(skb, &rt->dst);
|
skb_dst_set(skb, &rt->dst);
|
||||||
@@ -444,8 +446,8 @@ static netdev_tx_t xfrmi_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
|
|
||||||
tx_err:
|
tx_err:
|
||||||
DEV_STATS_INC(dev, tx_errors);
|
stats->tx_errors++;
|
||||||
DEV_STATS_INC(dev, tx_dropped);
|
stats->tx_dropped++;
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user