diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/if_macvlan.h | 1 | ||||
| -rw-r--r-- | include/linux/if_vlan.h | 15 | ||||
| -rw-r--r-- | include/linux/mlx4/qp.h | 11 | ||||
| -rw-r--r-- | include/linux/net.h | 15 | ||||
| -rw-r--r-- | include/linux/netdevice.h | 34 | ||||
| -rw-r--r-- | include/linux/of_mdio.h | 7 | ||||
| -rw-r--r-- | include/linux/rtnetlink.h | 5 |
7 files changed, 68 insertions, 20 deletions
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 7c8b20b120ea..a9a53b12397b 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
| @@ -56,6 +56,7 @@ struct macvlan_dev { | |||
| 56 | int numqueues; | 56 | int numqueues; |
| 57 | netdev_features_t tap_features; | 57 | netdev_features_t tap_features; |
| 58 | int minor; | 58 | int minor; |
| 59 | int nest_level; | ||
| 59 | }; | 60 | }; |
| 60 | 61 | ||
| 61 | static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | 62 | static inline void macvlan_count_rx(const struct macvlan_dev *vlan, |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 13bbbde00e68..b2acc4a1b13c 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
| @@ -73,7 +73,7 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) | |||
| 73 | /* found in socket.c */ | 73 | /* found in socket.c */ |
| 74 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); | 74 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); |
| 75 | 75 | ||
| 76 | static inline int is_vlan_dev(struct net_device *dev) | 76 | static inline bool is_vlan_dev(struct net_device *dev) |
| 77 | { | 77 | { |
| 78 | return dev->priv_flags & IFF_802_1Q_VLAN; | 78 | return dev->priv_flags & IFF_802_1Q_VLAN; |
| 79 | } | 79 | } |
| @@ -159,6 +159,7 @@ struct vlan_dev_priv { | |||
| 159 | #ifdef CONFIG_NET_POLL_CONTROLLER | 159 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 160 | struct netpoll *netpoll; | 160 | struct netpoll *netpoll; |
| 161 | #endif | 161 | #endif |
| 162 | unsigned int nest_level; | ||
| 162 | }; | 163 | }; |
| 163 | 164 | ||
| 164 | static inline struct vlan_dev_priv *vlan_dev_priv(const struct net_device *dev) | 165 | static inline struct vlan_dev_priv *vlan_dev_priv(const struct net_device *dev) |
| @@ -197,6 +198,12 @@ extern void vlan_vids_del_by_dev(struct net_device *dev, | |||
| 197 | const struct net_device *by_dev); | 198 | const struct net_device *by_dev); |
| 198 | 199 | ||
| 199 | extern bool vlan_uses_dev(const struct net_device *dev); | 200 | extern bool vlan_uses_dev(const struct net_device *dev); |
| 201 | |||
| 202 | static inline int vlan_get_encap_level(struct net_device *dev) | ||
| 203 | { | ||
| 204 | BUG_ON(!is_vlan_dev(dev)); | ||
| 205 | return vlan_dev_priv(dev)->nest_level; | ||
| 206 | } | ||
| 200 | #else | 207 | #else |
| 201 | static inline struct net_device * | 208 | static inline struct net_device * |
| 202 | __vlan_find_dev_deep(struct net_device *real_dev, | 209 | __vlan_find_dev_deep(struct net_device *real_dev, |
| @@ -263,6 +270,11 @@ static inline bool vlan_uses_dev(const struct net_device *dev) | |||
| 263 | { | 270 | { |
| 264 | return false; | 271 | return false; |
| 265 | } | 272 | } |
| 273 | static inline int vlan_get_encap_level(struct net_device *dev) | ||
| 274 | { | ||
| 275 | BUG(); | ||
| 276 | return 0; | ||
| 277 | } | ||
| 266 | #endif | 278 | #endif |
| 267 | 279 | ||
| 268 | static inline bool vlan_hw_offload_capable(netdev_features_t features, | 280 | static inline bool vlan_hw_offload_capable(netdev_features_t features, |
| @@ -483,4 +495,5 @@ static inline void vlan_set_encap_proto(struct sk_buff *skb, | |||
| 483 | */ | 495 | */ |
| 484 | skb->protocol = htons(ETH_P_802_2); | 496 | skb->protocol = htons(ETH_P_802_2); |
| 485 | } | 497 | } |
| 498 | |||
| 486 | #endif /* !(_LINUX_IF_VLAN_H_) */ | 499 | #endif /* !(_LINUX_IF_VLAN_H_) */ |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index b66e7610d4ee..7040dc98ff8b 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
| @@ -421,6 +421,17 @@ struct mlx4_wqe_inline_seg { | |||
| 421 | __be32 byte_count; | 421 | __be32 byte_count; |
| 422 | }; | 422 | }; |
| 423 | 423 | ||
| 424 | enum mlx4_update_qp_attr { | ||
| 425 | MLX4_UPDATE_QP_SMAC = 1 << 0, | ||
| 426 | }; | ||
| 427 | |||
| 428 | struct mlx4_update_qp_params { | ||
| 429 | u8 smac_index; | ||
| 430 | }; | ||
| 431 | |||
| 432 | int mlx4_update_qp(struct mlx4_dev *dev, struct mlx4_qp *qp, | ||
| 433 | enum mlx4_update_qp_attr attr, | ||
| 434 | struct mlx4_update_qp_params *params); | ||
| 424 | int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | 435 | int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt, |
| 425 | enum mlx4_qp_state cur_state, enum mlx4_qp_state new_state, | 436 | enum mlx4_qp_state cur_state, enum mlx4_qp_state new_state, |
| 426 | struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar, | 437 | struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar, |
diff --git a/include/linux/net.h b/include/linux/net.h index 94734a6259a4..17d83393afcc 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -248,24 +248,17 @@ do { \ | |||
| 248 | bool __net_get_random_once(void *buf, int nbytes, bool *done, | 248 | bool __net_get_random_once(void *buf, int nbytes, bool *done, |
| 249 | struct static_key *done_key); | 249 | struct static_key *done_key); |
| 250 | 250 | ||
| 251 | #ifdef HAVE_JUMP_LABEL | ||
| 252 | #define ___NET_RANDOM_STATIC_KEY_INIT ((struct static_key) \ | ||
| 253 | { .enabled = ATOMIC_INIT(0), .entries = (void *)1 }) | ||
| 254 | #else /* !HAVE_JUMP_LABEL */ | ||
| 255 | #define ___NET_RANDOM_STATIC_KEY_INIT STATIC_KEY_INIT_FALSE | ||
| 256 | #endif /* HAVE_JUMP_LABEL */ | ||
| 257 | |||
| 258 | #define net_get_random_once(buf, nbytes) \ | 251 | #define net_get_random_once(buf, nbytes) \ |
| 259 | ({ \ | 252 | ({ \ |
| 260 | bool ___ret = false; \ | 253 | bool ___ret = false; \ |
| 261 | static bool ___done = false; \ | 254 | static bool ___done = false; \ |
| 262 | static struct static_key ___done_key = \ | 255 | static struct static_key ___once_key = \ |
| 263 | ___NET_RANDOM_STATIC_KEY_INIT; \ | 256 | STATIC_KEY_INIT_TRUE; \ |
| 264 | if (!static_key_true(&___done_key)) \ | 257 | if (static_key_true(&___once_key)) \ |
| 265 | ___ret = __net_get_random_once(buf, \ | 258 | ___ret = __net_get_random_once(buf, \ |
| 266 | nbytes, \ | 259 | nbytes, \ |
| 267 | &___done, \ | 260 | &___done, \ |
| 268 | &___done_key); \ | 261 | &___once_key); \ |
| 269 | ___ret; \ | 262 | ___ret; \ |
| 270 | }) | 263 | }) |
| 271 | 264 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7ed3a3aa6604..b42d07b0390b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -1144,6 +1144,7 @@ struct net_device_ops { | |||
| 1144 | netdev_tx_t (*ndo_dfwd_start_xmit) (struct sk_buff *skb, | 1144 | netdev_tx_t (*ndo_dfwd_start_xmit) (struct sk_buff *skb, |
| 1145 | struct net_device *dev, | 1145 | struct net_device *dev, |
| 1146 | void *priv); | 1146 | void *priv); |
| 1147 | int (*ndo_get_lock_subclass)(struct net_device *dev); | ||
| 1147 | }; | 1148 | }; |
| 1148 | 1149 | ||
| 1149 | /** | 1150 | /** |
| @@ -2950,7 +2951,12 @@ static inline void netif_addr_lock(struct net_device *dev) | |||
| 2950 | 2951 | ||
| 2951 | static inline void netif_addr_lock_nested(struct net_device *dev) | 2952 | static inline void netif_addr_lock_nested(struct net_device *dev) |
| 2952 | { | 2953 | { |
| 2953 | spin_lock_nested(&dev->addr_list_lock, SINGLE_DEPTH_NESTING); | 2954 | int subclass = SINGLE_DEPTH_NESTING; |
| 2955 | |||
| 2956 | if (dev->netdev_ops->ndo_get_lock_subclass) | ||
| 2957 | subclass = dev->netdev_ops->ndo_get_lock_subclass(dev); | ||
| 2958 | |||
| 2959 | spin_lock_nested(&dev->addr_list_lock, subclass); | ||
| 2954 | } | 2960 | } |
| 2955 | 2961 | ||
| 2956 | static inline void netif_addr_lock_bh(struct net_device *dev) | 2962 | static inline void netif_addr_lock_bh(struct net_device *dev) |
| @@ -3050,10 +3056,19 @@ extern int weight_p; | |||
| 3050 | extern int bpf_jit_enable; | 3056 | extern int bpf_jit_enable; |
| 3051 | 3057 | ||
| 3052 | bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev); | 3058 | bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev); |
| 3059 | struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev, | ||
| 3060 | struct list_head **iter); | ||
| 3053 | struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, | 3061 | struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, |
| 3054 | struct list_head **iter); | 3062 | struct list_head **iter); |
| 3055 | 3063 | ||
| 3056 | /* iterate through upper list, must be called under RCU read lock */ | 3064 | /* iterate through upper list, must be called under RCU read lock */ |
| 3065 | #define netdev_for_each_upper_dev_rcu(dev, updev, iter) \ | ||
| 3066 | for (iter = &(dev)->adj_list.upper, \ | ||
| 3067 | updev = netdev_upper_get_next_dev_rcu(dev, &(iter)); \ | ||
| 3068 | updev; \ | ||
| 3069 | updev = netdev_upper_get_next_dev_rcu(dev, &(iter))) | ||
| 3070 | |||
| 3071 | /* iterate through upper list, must be called under RCU read lock */ | ||
| 3057 | #define netdev_for_each_all_upper_dev_rcu(dev, updev, iter) \ | 3072 | #define netdev_for_each_all_upper_dev_rcu(dev, updev, iter) \ |
| 3058 | for (iter = &(dev)->all_adj_list.upper, \ | 3073 | for (iter = &(dev)->all_adj_list.upper, \ |
| 3059 | updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)); \ | 3074 | updev = netdev_all_upper_get_next_dev_rcu(dev, &(iter)); \ |
| @@ -3077,6 +3092,14 @@ void *netdev_lower_get_next_private_rcu(struct net_device *dev, | |||
| 3077 | priv; \ | 3092 | priv; \ |
| 3078 | priv = netdev_lower_get_next_private_rcu(dev, &(iter))) | 3093 | priv = netdev_lower_get_next_private_rcu(dev, &(iter))) |
| 3079 | 3094 | ||
| 3095 | void *netdev_lower_get_next(struct net_device *dev, | ||
| 3096 | struct list_head **iter); | ||
| 3097 | #define netdev_for_each_lower_dev(dev, ldev, iter) \ | ||
| 3098 | for (iter = &(dev)->adj_list.lower, \ | ||
| 3099 | ldev = netdev_lower_get_next(dev, &(iter)); \ | ||
| 3100 | ldev; \ | ||
| 3101 | ldev = netdev_lower_get_next(dev, &(iter))) | ||
