aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/if_macvlan.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/if_macvlan.h')
-rw-r--r--include/linux/if_macvlan.h37
1 files changed, 4 insertions, 33 deletions
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 84ba5ac39e03..7c8b20b120ea 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -2,6 +2,7 @@
2#define _LINUX_IF_MACVLAN_H 2#define _LINUX_IF_MACVLAN_H
3 3
4#include <linux/if_link.h> 4#include <linux/if_link.h>
5#include <linux/if_vlan.h>
5#include <linux/list.h> 6#include <linux/list.h>
6#include <linux/netdevice.h> 7#include <linux/netdevice.h>
7#include <linux/netlink.h> 8#include <linux/netlink.h>
@@ -24,28 +25,6 @@ static inline struct socket *macvtap_get_socket(struct file *f)
24struct macvlan_port; 25struct macvlan_port;
25struct macvtap_queue; 26struct macvtap_queue;
26 27
27/**
28 * struct macvlan_pcpu_stats - MACVLAN percpu stats
29 * @rx_packets: number of received packets
30 * @rx_bytes: number of received bytes
31 * @rx_multicast: number of received multicast packets
32 * @tx_packets: number of transmitted packets
33 * @tx_bytes: number of transmitted bytes
34 * @syncp: synchronization point for 64bit counters
35 * @rx_errors: number of rx errors
36 * @tx_dropped: number of tx dropped packets
37 */
38struct macvlan_pcpu_stats {
39 u64 rx_packets;
40 u64 rx_bytes;
41 u64 rx_multicast;
42 u64 tx_packets;
43 u64 tx_bytes;
44 struct u64_stats_sync syncp;
45 u32 rx_errors;
46 u32 tx_dropped;
47};
48
49/* 28/*
50 * Maximum times a macvtap device can be opened. This can be used to 29 * Maximum times a macvtap device can be opened. This can be used to
51 * configure the number of receive queue, e.g. for multiqueue virtio. 30 * configure the number of receive queue, e.g. for multiqueue virtio.
@@ -62,15 +41,13 @@ struct macvlan_dev {
62 struct macvlan_port *port; 41 struct macvlan_port *port;
63 struct net_device *lowerdev; 42 struct net_device *lowerdev;
64 void *fwd_priv; 43 void *fwd_priv;
65 struct macvlan_pcpu_stats __percpu *pcpu_stats; 44 struct vlan_pcpu_stats __percpu *pcpu_stats;
66 45
67 DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); 46 DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ);
68 47
69 netdev_features_t set_features; 48 netdev_features_t set_features;
70 enum macvlan_mode mode; 49 enum macvlan_mode mode;
71 u16 flags; 50 u16 flags;
72 int (*receive)(struct sk_buff *skb);
73 int (*forward)(struct net_device *dev, struct sk_buff *skb);
74 /* This array tracks active taps. */ 51 /* This array tracks active taps. */
75 struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES]; 52 struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES];
76 /* This list tracks all taps (both enabled and disabled) */ 53 /* This list tracks all taps (both enabled and disabled) */
@@ -86,7 +63,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
86 bool multicast) 63 bool multicast)
87{ 64{
88 if (likely(success)) { 65 if (likely(success)) {
89 struct macvlan_pcpu_stats *pcpu_stats; 66 struct vlan_pcpu_stats *pcpu_stats;
90 67
91 pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); 68 pcpu_stats = this_cpu_ptr(vlan->pcpu_stats);
92 u64_stats_update_begin(&pcpu_stats->syncp); 69 u64_stats_update_begin(&pcpu_stats->syncp);
@@ -103,10 +80,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
103extern void macvlan_common_setup(struct net_device *dev); 80extern void macvlan_common_setup(struct net_device *dev);
104 81
105extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, 82extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
106 struct nlattr *tb[], struct nlattr *data[], 83 struct nlattr *tb[], struct nlattr *data[]);
107 int (*receive)(struct sk_buff *skb),
108 int (*forward)(struct net_device *dev,
109 struct sk_buff *skb));
110 84
111extern void macvlan_count_rx(const struct macvlan_dev *vlan, 85extern void macvlan_count_rx(const struct macvlan_dev *vlan,
112 unsigned int len, bool success, 86 unsigned int len, bool success,
@@ -116,9 +90,6 @@ extern void macvlan_dellink(struct net_device *dev, struct list_head *head);
116 90
117extern int macvlan_link_register(struct rtnl_link_ops *ops); 91extern int macvlan_link_register(struct rtnl_link_ops *ops);
118 92
119extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
120 struct net_device *dev);
121
122#if IS_ENABLED(CONFIG_MACVLAN) 93#if IS_ENABLED(CONFIG_MACVLAN)
123static inline struct net_device * 94static inline struct net_device *
124macvlan_dev_real_dev(const struct net_device *dev) 95macvlan_dev_real_dev(const struct net_device *dev)