diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 36 | ||||
-rw-r--r-- | include/linux/skbuff.h | 17 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 14 |
3 files changed, 50 insertions, 17 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 440a02ee6f92..e8eeebd49a98 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -752,6 +752,9 @@ struct netdev_phys_port_id { | |||
752 | unsigned char id_len; | 752 | unsigned char id_len; |
753 | }; | 753 | }; |
754 | 754 | ||
755 | typedef u16 (*select_queue_fallback_t)(struct net_device *dev, | ||
756 | struct sk_buff *skb); | ||
757 | |||
755 | /* | 758 | /* |
756 | * This structure defines the management hooks for network devices. | 759 | * This structure defines the management hooks for network devices. |
757 | * The following hooks can be defined; unless noted otherwise, they are | 760 | * The following hooks can be defined; unless noted otherwise, they are |
@@ -783,7 +786,7 @@ struct netdev_phys_port_id { | |||
783 | * Required can not be NULL. | 786 | * Required can not be NULL. |
784 | * | 787 | * |
785 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, | 788 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, |
786 | * void *accel_priv); | 789 | * void *accel_priv, select_queue_fallback_t fallback); |
787 | * Called to decide which queue to when device supports multiple | 790 | * Called to decide which queue to when device supports multiple |
788 | * transmit queues. | 791 | * transmit queues. |
789 | * | 792 | * |
@@ -1005,7 +1008,8 @@ struct net_device_ops { | |||
1005 | struct net_device *dev); | 1008 | struct net_device *dev); |
1006 | u16 (*ndo_select_queue)(struct net_device *dev, | 1009 | u16 (*ndo_select_queue)(struct net_device *dev, |
1007 | struct sk_buff *skb, | 1010 | struct sk_buff *skb, |
1008 | void *accel_priv); | 1011 | void *accel_priv, |
1012 | select_queue_fallback_t fallback); | ||
1009 | void (*ndo_change_rx_flags)(struct net_device *dev, | 1013 | void (*ndo_change_rx_flags)(struct net_device *dev, |
1010 | int flags); | 1014 | int flags); |
1011 | void (*ndo_set_rx_mode)(struct net_device *dev); | 1015 | void (*ndo_set_rx_mode)(struct net_device *dev); |
@@ -1551,7 +1555,6 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, | |||
1551 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, | 1555 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, |
1552 | struct sk_buff *skb, | 1556 | struct sk_buff *skb, |
1553 | void *accel_priv); | 1557 | void *accel_priv); |
1554 | u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); | ||
1555 | 1558 | ||
1556 | /* | 1559 | /* |
1557 | * Net namespace inlines | 1560 | * Net namespace inlines |
@@ -2276,6 +2279,26 @@ static inline void netdev_reset_queue(struct net_device *dev_queue) | |||
2276 | } | 2279 | } |
2277 | 2280 | ||
2278 | /** | 2281 | /** |
2282 | * netdev_cap_txqueue - check if selected tx queue exceeds device queues | ||
2283 | * @dev: network device | ||
2284 | * @queue_index: given tx queue index | ||
2285 | * | ||
2286 | * Returns 0 if given tx queue index >= number of device tx queues, | ||
2287 | * otherwise returns the originally passed tx queue index. | ||
2288 | */ | ||
2289 | static inline u16 netdev_cap_txqueue(struct net_device *dev, u16 queue_index) | ||
2290 | { | ||
2291 | if (unlikely(queue_index >= dev->real_num_tx_queues)) { | ||
2292 | net_warn_ratelimited("%s selects TX queue %d, but real number of TX queues is %d\n", | ||
2293 | dev->name, queue_index, | ||
2294 | dev->real_num_tx_queues); | ||
2295 | return 0; | ||
2296 | } | ||
2297 | |||
2298 | return queue_index; | ||
2299 | } | ||
2300 | |||
2301 | /** | ||
2279 | * netif_running - test if up | 2302 | * netif_running - test if up |
2280 | * @dev: network device | 2303 | * @dev: network device |
2281 | * | 2304 | * |
@@ -3068,7 +3091,12 @@ void netdev_change_features(struct net_device *dev); | |||
3068 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, | 3091 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, |
3069 | struct net_device *dev); | 3092 | struct net_device *dev); |
3070 | 3093 | ||
3071 | netdev_features_t netif_skb_features(struct sk_buff *skb); | 3094 | netdev_features_t netif_skb_dev_features(struct sk_buff *skb, |
3095 | const struct net_device *dev); | ||
3096 | static inline netdev_features_t netif_skb_features(struct sk_buff *skb) | ||
3097 | { | ||
3098 | return netif_skb_dev_features(skb, skb->dev); | ||
3099 | } | ||
3072 | 3100 | ||
3073 | static inline bool net_gso_ok(netdev_features_t features, int gso_type) | 3101 | static inline bool net_gso_ok(netdev_features_t features, int gso_type) |
3074 | { | 3102 | { |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f589c9af8cbf..3ebbbe7b6d05 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -2916,5 +2916,22 @@ static inline bool skb_head_is_locked(const struct sk_buff *skb) | |||
2916 | { | 2916 | { |
2917 | return !skb->head_frag || skb_cloned(skb); | 2917 | return !skb->head_frag || skb_cloned(skb); |
2918 | } | 2918 | } |
2919 | |||
2920 | /** | ||
2921 | * skb_gso_network_seglen - Return length of individual segments of a gso packet | ||
2922 | * | ||
2923 | * @skb: GSO skb | ||
2924 | * | ||
2925 | * skb_gso_network_seglen is used to determine the real size of the | ||
2926 | * individual segments, including Layer3 (IP, IPv6) and L4 headers (TCP/UDP). | ||
2927 | * | ||
2928 | * The MAC/L2 header is not accounted for. | ||
2929 | */ | ||
2930 | static inline unsigned int skb_gso_network_seglen(const struct sk_buff *skb) | ||
2931 | { | ||
2932 | unsigned int hdr_len = skb_transport_header(skb) - | ||
2933 | skb_network_header(skb); | ||
2934 | return hdr_len + skb_gso_transport_seglen(skb); | ||
2935 | } | ||
2919 | #endif /* __KERNEL__ */ | 2936 | #endif /* __KERNEL__ */ |
2920 | #endif /* _LINUX_SKBUFF_H */ | 2937 | #endif /* _LINUX_SKBUFF_H */ |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index d992ca3145fe..6ee76c804893 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -1653,17 +1653,6 @@ struct sctp_association { | |||
1653 | /* This is the last advertised value of rwnd over a SACK chunk. */ | 1653 | /* This is the last advertised value of rwnd over a SACK chunk. */ |
1654 | __u32 a_rwnd; | 1654 | __u32 a_rwnd; |
1655 | 1655 | ||
1656 | /* Number of bytes by which the rwnd has slopped. The rwnd is allowed | ||
1657 | * to slop over a maximum of the association's frag_point. | ||
1658 | */ | ||
1659 | __u32 rwnd_over; | ||
1660 | |||
1661 | /* Keeps treack of rwnd pressure. This happens when we have | ||
1662 | * a window, but not recevie buffer (i.e small packets). This one | ||
1663 | * is releases slowly (1 PMTU at a time ). | ||
1664 | */ | ||
1665 | __u32 rwnd_press; | ||
1666 | |||
1667 | /* This is the sndbuf size in use for the association. | 1656 | /* This is the sndbuf size in use for the association. |
1668 | * This corresponds to the sndbuf size for the association, | 1657 | * This corresponds to the sndbuf size for the association, |
1669 | * as specified in the sk->sndbuf. | 1658 | * as specified in the sk->sndbuf. |
@@ -1892,8 +1881,7 @@ void sctp_assoc_update(struct sctp_association *old, | |||
1892 | __u32 sctp_association_get_next_tsn(struct sctp_association *); | 1881 | __u32 sctp_association_get_next_tsn(struct sctp_association *); |
1893 | 1882 | ||
1894 | void sctp_assoc_sync_pmtu(struct sock *, struct sctp_association *); | 1883 | void sctp_assoc_sync_pmtu(struct sock *, struct sctp_association *); |
1895 | void sctp_assoc_rwnd_increase(struct sctp_association *, unsigned int); | 1884 | void sctp_assoc_rwnd_update(struct sctp_association *, bool); |
1896 | void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned int); | ||
1897 | void sctp_assoc_set_primary(struct sctp_association *, | 1885 | void sctp_assoc_set_primary(struct sctp_association *, |
1898 | struct sctp_transport *); | 1886 | struct sctp_transport *); |
1899 | void sctp_assoc_del_nonprimary_peers(struct sctp_association *, | 1887 | void sctp_assoc_del_nonprimary_peers(struct sctp_association *, |