diff options
Diffstat (limited to 'net/8021q/vlan_dev.c')
| -rw-r--r-- | net/8021q/vlan_dev.c | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 019efb79708f..ad2ac3c00398 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
| @@ -643,9 +643,9 @@ static netdev_features_t vlan_dev_fix_features(struct net_device *dev, | |||
| 643 | struct net_device *real_dev = vlan_dev_priv(dev)->real_dev; | 643 | struct net_device *real_dev = vlan_dev_priv(dev)->real_dev; |
| 644 | netdev_features_t old_features = features; | 644 | netdev_features_t old_features = features; |
| 645 | 645 | ||
| 646 | features &= real_dev->vlan_features; | 646 | features = netdev_intersect_features(features, real_dev->vlan_features); |
| 647 | features |= NETIF_F_RXCSUM; | 647 | features |= NETIF_F_RXCSUM; |
| 648 | features &= real_dev->features; | 648 | features = netdev_intersect_features(features, real_dev->features); |
| 649 | 649 | ||
| 650 | features |= old_features & NETIF_F_SOFT_FEATURES; | 650 | features |= old_features & NETIF_F_SOFT_FEATURES; |
| 651 | features |= NETIF_F_LLTX; | 651 | features |= NETIF_F_LLTX; |
| @@ -671,38 +671,36 @@ static void vlan_ethtool_get_drvinfo(struct net_device *dev, | |||
| 671 | 671 | ||
| 672 | static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) | 672 | static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) |
| 673 | { | 673 | { |
| 674 | struct vlan_pcpu_stats *p; | ||
| 675 | u32 rx_errors = 0, tx_dropped = 0; | ||
| 676 | int i; | ||
| 674 | 677 | ||
| 675 | if (vlan_dev_priv(dev)->vlan_pcpu_stats) { | 678 | for_each_possible_cpu(i) { |
| 676 | struct vlan_pcpu_stats *p; | 679 | u64 rxpackets, rxbytes, rxmulticast, txpackets, txbytes; |
| 677 | u32 rx_errors = 0, tx_dropped = 0; | 680 | unsigned int start; |
| 678 | int i; | 681 | |
| 679 | 682 | p = per_cpu_ptr(vlan_dev_priv(dev)->vlan_pcpu_stats, i); | |
| 680 | for_each_possible_cpu(i) { | 683 | do { |
| 681 | u64 rxpackets, rxbytes, rxmulticast, txpackets, txbytes; | 684 | start = u64_stats_fetch_begin_irq(&p->syncp); |
| 682 | unsigned int start; | 685 | rxpackets = p->rx_packets; |
| 683 | 686 | rxbytes = p->rx_bytes; | |
| 684 | p = per_cpu_ptr(vlan_dev_priv(dev)->vlan_pcpu_stats, i); | 687 | rxmulticast = p->rx_multicast; |
| 685 | do { | 688 | txpackets = p->tx_packets; |
| 686 | start = u64_stats_fetch_begin_irq(&p->syncp); | 689 | txbytes = p->tx_bytes; |
| 687 | rxpackets = p->rx_packets; | 690 | } while (u64_stats_fetch_retry_irq(&p->syncp, start)); |
| 688 | rxbytes = p->rx_bytes; | 691 | |
| 689 | rxmulticast = p->rx_multicast; | 692 | stats->rx_packets += rxpackets; |
| 690 | txpackets = p->tx_packets; | 693 | stats->rx_bytes += rxbytes; |
| 691 | txbytes = p->tx_bytes; | 694 | stats->multicast += rxmulticast; |
| 692 | } while (u64_stats_fetch_retry_irq(&p->syncp, start)); | 695 | stats->tx_packets += txpackets; |
| 693 | 696 | stats->tx_bytes += txbytes; | |
| 694 | stats->rx_packets += rxpackets; | 697 | /* rx_errors & tx_dropped are u32 */ |
| 695 | stats->rx_bytes += rxbytes; | 698 | rx_errors += p->rx_errors; |
| 696 | stats->multicast += rxmulticast; | 699 | tx_dropped += p->tx_dropped; |
| 697 | stats->tx_packets += txpackets; | ||
| 698 | stats->tx_bytes += txbytes; | ||
| 699 | /* rx_errors & tx_dropped are u32 */ | ||
| 700 | rx_errors += p->rx_errors; | ||
| 701 | tx_dropped += p->tx_dropped; | ||
| 702 | } | ||
| 703 | stats->rx_errors = rx_errors; | ||
| 704 | stats->tx_dropped = tx_dropped; | ||
| 705 | } | 700 | } |
| 701 | stats->rx_errors = rx_errors; | ||
| 702 | stats->tx_dropped = tx_dropped; | ||
| 703 | |||
| 706 | return stats; | 704 | return stats; |
| 707 | } | 705 | } |
| 708 | 706 | ||
