diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2019-03-04 11:44:01 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-03-04 11:44:00 -0800 |
| commit | 914ff0d90ac5af2e1e3ee726cc2582192d0da9b0 (patch) | |
| tree | 1536cc19ac189c79d0109361d91f29597f976649 /include | |
| parent | 52df3df93df4c519f3e67a2038e40427edcf4949 (diff) | |
| parent | 567c084d6267ecef2d65ca2be5b359857a6305d8 (diff) | |
Merge "Merge android-4.4.176 (cf84cdc) into msm-4.4"
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/netdev_features.h | 24 | ||||
| -rw-r--r-- | include/net/ax25.h | 12 | ||||
| -rw-r--r-- | include/net/inetpeer.h | 1 | ||||
| -rw-r--r-- | include/net/tcp.h | 1 |
4 files changed, 36 insertions, 2 deletions
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index f0d87347df19..0508fcc67480 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -11,6 +11,8 @@ #define _LINUX_NETDEV_FEATURES_H #include <linux/types.h> +#include <linux/bitops.h> +#include <asm/byteorder.h> typedef u64 netdev_features_t; @@ -125,8 +127,26 @@ enum { #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) -#define for_each_netdev_feature(mask_addr, bit) \ - for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) +/* Finds the next feature with the highest number of the range of start till 0. + */ +static inline int find_next_netdev_feature(u64 feature, unsigned long start) +{ + /* like BITMAP_LAST_WORD_MASK() for u64 + * this sets the most significant 64 - start to 0. + */ + feature &= ~0ULL >> (-start & ((sizeof(feature) * 8) - 1)); + + return fls64(feature) - 1; +} + +/* This goes for the MSB to the LSB through the set feature bits, + * mask_addr should be a u64 and bit an int + */ +#define for_each_netdev_feature(mask_addr, bit) \ + for ((bit) = find_next_netdev_feature((mask_addr), \ + NETDEV_FEATURE_COUNT); \ + (bit) >= 0; \ + (bit) = find_next_netdev_feature((mask_addr), (bit) - 1)) /* Features valid for ethtool to change */ /* = all defined minus driver/device-class-related */ diff --git a/include/net/ax25.h b/include/net/ax25.h index e602f8177ebf..b507ce2b1952 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -199,6 +199,18 @@ static inline void ax25_hold_route(ax25_route *ax25_rt) void __ax25_put_route(ax25_route *ax25_rt); +extern rwlock_t ax25_route_lock; + +static inline void ax25_route_lock_use(void) +{ + read_lock(&ax25_route_lock); +} + +static inline void ax25_route_lock_unuse(void) +{ + read_unlock(&ax25_route_lock); +} + static inline void ax25_put_route(ax25_route *ax25_rt) { if (atomic_dec_and_test(&ax25_rt->refcount)) diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 235c7811a86a..408d76f47bd2 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h @@ -40,6 +40,7 @@ struct inet_peer { u32 metrics[RTAX_MAX]; u32 rate_tokens; /* rate limiting for ICMP */ + u32 n_redirects; unsigned long rate_last; union { struct list_head gc_list; diff --git a/include/net/tcp.h b/include/net/tcp.h index 976f38280309..dd161b625cd7 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1475,6 +1475,7 @@ static inline void tcp_write_queue_purge(struct sock *sk) sk_wmem_free_skb(sk, skb); sk_mem_reclaim(sk); tcp_clear_all_retrans_hints(tcp_sk(sk)); + inet_csk(sk)->icsk_backoff = 0; } static inline struct sk_buff *tcp_write_queue_head(const struct sock *sk) |
