rtnetlink.c (ec28dcc6b4c00b78ad269ad5b85ebd5c2d504825) rtnetlink.c (10708f37ae729baba9b67bd134c3720709d4ae62)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 586 unchanged lines hidden (view full) ---

595 a->tx_aborted_errors = b->tx_aborted_errors;
596 a->tx_carrier_errors = b->tx_carrier_errors;
597 a->tx_fifo_errors = b->tx_fifo_errors;
598 a->tx_heartbeat_errors = b->tx_heartbeat_errors;
599 a->tx_window_errors = b->tx_window_errors;
600
601 a->rx_compressed = b->rx_compressed;
602 a->tx_compressed = b->tx_compressed;
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 586 unchanged lines hidden (view full) ---

595 a->tx_aborted_errors = b->tx_aborted_errors;
596 a->tx_carrier_errors = b->tx_carrier_errors;
597 a->tx_fifo_errors = b->tx_fifo_errors;
598 a->tx_heartbeat_errors = b->tx_heartbeat_errors;
599 a->tx_window_errors = b->tx_window_errors;
600
601 a->rx_compressed = b->rx_compressed;
602 a->tx_compressed = b->tx_compressed;
603};
603}
604
604
605static void copy_rtnl_link_stats64(struct rtnl_link_stats64 *a,
606 const struct net_device_stats *b)
607{
608 a->rx_packets = b->rx_packets;
609 a->tx_packets = b->tx_packets;
610 a->rx_bytes = b->rx_bytes;
611 a->tx_bytes = b->tx_bytes;
612 a->rx_errors = b->rx_errors;
613 a->tx_errors = b->tx_errors;
614 a->rx_dropped = b->rx_dropped;
615 a->tx_dropped = b->tx_dropped;
616
617 a->multicast = b->multicast;
618 a->collisions = b->collisions;
619
620 a->rx_length_errors = b->rx_length_errors;
621 a->rx_over_errors = b->rx_over_errors;
622 a->rx_crc_errors = b->rx_crc_errors;
623 a->rx_frame_errors = b->rx_frame_errors;
624 a->rx_fifo_errors = b->rx_fifo_errors;
625 a->rx_missed_errors = b->rx_missed_errors;
626
627 a->tx_aborted_errors = b->tx_aborted_errors;
628 a->tx_carrier_errors = b->tx_carrier_errors;
629 a->tx_fifo_errors = b->tx_fifo_errors;
630 a->tx_heartbeat_errors = b->tx_heartbeat_errors;
631 a->tx_window_errors = b->tx_window_errors;
632
633 a->rx_compressed = b->rx_compressed;
634 a->tx_compressed = b->tx_compressed;
635}
636
605static inline int rtnl_vfinfo_size(const struct net_device *dev)
606{
607 if (dev->dev.parent && dev_is_pci(dev->dev.parent))
608 return dev_num_vf(dev->dev.parent) *
609 sizeof(struct ifla_vf_info);
610 else
611 return 0;
612}

--- 80 unchanged lines hidden (view full) ---

693 attr = nla_reserve(skb, IFLA_STATS,
694 sizeof(struct rtnl_link_stats));
695 if (attr == NULL)
696 goto nla_put_failure;
697
698 stats = dev_get_stats(dev);
699 copy_rtnl_link_stats(nla_data(attr), stats);
700
637static inline int rtnl_vfinfo_size(const struct net_device *dev)
638{
639 if (dev->dev.parent && dev_is_pci(dev->dev.parent))
640 return dev_num_vf(dev->dev.parent) *
641 sizeof(struct ifla_vf_info);
642 else
643 return 0;
644}

--- 80 unchanged lines hidden (view full) ---

725 attr = nla_reserve(skb, IFLA_STATS,
726 sizeof(struct rtnl_link_stats));
727 if (attr == NULL)
728 goto nla_put_failure;
729
730 stats = dev_get_stats(dev);
731 copy_rtnl_link_stats(nla_data(attr), stats);
732
733 attr = nla_reserve(skb, IFLA_STATS64,
734 sizeof(struct rtnl_link_stats64));
735 if (attr == NULL)
736 goto nla_put_failure;
737
738 stats = dev_get_stats(dev);
739 copy_rtnl_link_stats64(nla_data(attr), stats);
740
701 if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) {
702 int i;
703 struct ifla_vf_info ivi;
704
705 NLA_PUT_U32(skb, IFLA_NUM_VF, dev_num_vf(dev->dev.parent));
706 for (i = 0; i < dev_num_vf(dev->dev.parent); i++) {
707 if (dev->netdev_ops->ndo_get_vf_config(dev, i, &ivi))
708 break;

--- 832 unchanged lines hidden ---
741 if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) {
742 int i;
743 struct ifla_vf_info ivi;
744
745 NLA_PUT_U32(skb, IFLA_NUM_VF, dev_num_vf(dev->dev.parent));
746 for (i = 0; i < dev_num_vf(dev->dev.parent); i++) {
747 if (dev->netdev_ops->ndo_get_vf_config(dev, i, &ivi))
748 break;

--- 832 unchanged lines hidden ---