diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 66 |
1 files changed, 10 insertions, 56 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 2210fec65669..e13824570b0f 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -857,18 +857,6 @@ static inline void sock_rps_record_flow_hash(__u32 hash) | |||
857 | #endif | 857 | #endif |
858 | } | 858 | } |
859 | 859 | ||
860 | static inline void sock_rps_reset_flow_hash(__u32 hash) | ||
861 | { | ||
862 | #ifdef CONFIG_RPS | ||
863 | struct rps_sock_flow_table *sock_flow_table; | ||
864 | |||
865 | rcu_read_lock(); | ||
866 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | ||
867 | rps_reset_sock_flow(sock_flow_table, hash); | ||
868 | rcu_read_unlock(); | ||
869 | #endif | ||
870 | } | ||
871 | |||
872 | static inline void sock_rps_record_flow(const struct sock *sk) | 860 | static inline void sock_rps_record_flow(const struct sock *sk) |
873 | { | 861 | { |
874 | #ifdef CONFIG_RPS | 862 | #ifdef CONFIG_RPS |
@@ -876,28 +864,18 @@ static inline void sock_rps_record_flow(const struct sock *sk) | |||
876 | #endif | 864 | #endif |
877 | } | 865 | } |
878 | 866 | ||
879 | static inline void sock_rps_reset_flow(const struct sock *sk) | ||
880 | { | ||
881 | #ifdef CONFIG_RPS | ||
882 | sock_rps_reset_flow_hash(sk->sk_rxhash); | ||
883 | #endif | ||
884 | } | ||
885 | |||
886 | static inline void sock_rps_save_rxhash(struct sock *sk, | 867 | static inline void sock_rps_save_rxhash(struct sock *sk, |
887 | const struct sk_buff *skb) | 868 | const struct sk_buff *skb) |
888 | { | 869 | { |
889 | #ifdef CONFIG_RPS | 870 | #ifdef CONFIG_RPS |
890 | if (unlikely(sk->sk_rxhash != skb->hash)) { | 871 | if (unlikely(sk->sk_rxhash != skb->hash)) |
891 | sock_rps_reset_flow(sk); | ||
892 | sk->sk_rxhash = skb->hash; | 872 | sk->sk_rxhash = skb->hash; |
893 | } | ||
894 | #endif | 873 | #endif |
895 | } | 874 | } |
896 | 875 | ||
897 | static inline void sock_rps_reset_rxhash(struct sock *sk) | 876 | static inline void sock_rps_reset_rxhash(struct sock *sk) |
898 | { | 877 | { |
899 | #ifdef CONFIG_RPS | 878 | #ifdef CONFIG_RPS |
900 | sock_rps_reset_flow(sk); | ||
901 | sk->sk_rxhash = 0; | 879 | sk->sk_rxhash = 0; |
902 | #endif | 880 | #endif |
903 | } | 881 | } |
@@ -1374,29 +1352,6 @@ void sk_prot_clear_portaddr_nulls(struct sock *sk, int size); | |||
1374 | #define SOCK_BINDADDR_LOCK 4 | 1352 | #define SOCK_BINDADDR_LOCK 4 |
1375 | #define SOCK_BINDPORT_LOCK 8 | 1353 | #define SOCK_BINDPORT_LOCK 8 |
1376 | 1354 | ||
1377 | /* sock_iocb: used to kick off async processing of socket ios */ | ||
1378 | struct sock_iocb { | ||
1379 | struct list_head list; | ||
1380 | |||
1381 | int flags; | ||
1382 | int size; | ||
1383 | struct socket *sock; | ||
1384 | struct sock *sk; | ||
1385 | struct scm_cookie *scm; | ||
1386 | struct msghdr *msg, async_msg; | ||
1387 | struct kiocb *kiocb; | ||
1388 | }; | ||
1389 | |||
1390 | static inline struct sock_iocb *kiocb_to_siocb(struct kiocb *iocb) | ||
1391 | { | ||
1392 | return (struct sock_iocb *)iocb->private; | ||
1393 | } | ||
1394 | |||
1395 | static inline struct kiocb *siocb_to_kiocb(struct sock_iocb *si) | ||
1396 | { | ||
1397 | return si->kiocb; | ||
1398 | } | ||
1399 | |||
1400 | struct socket_alloc { | 1355 | struct socket_alloc { |
1401 | struct socket socket; | 1356 | struct socket socket; |
1402 | struct inode vfs_inode; | 1357 | struct inode vfs_inode; |
@@ -1826,27 +1781,25 @@ static inline void sk_nocaps_add(struct sock *sk, netdev_features_t flags) | |||
1826 | } | 1781 | } |
1827 | 1782 | ||
1828 | static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb, | 1783 | static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb, |
1829 | char __user *from, char *to, | 1784 | struct iov_iter *from, char *to, |
1830 | int copy, int offset) | 1785 | int copy, int offset) |
1831 | { | 1786 | { |
1832 | if (skb->ip_summed == CHECKSUM_NONE) { | 1787 | if (skb->ip_summed == CHECKSUM_NONE) { |
1833 | int err = 0; | 1788 | __wsum csum = 0; |
1834 | __wsum csum = csum_and_copy_from_user(from, to, copy, 0, &err); | 1789 | if (csum_and_copy_from_iter(to, copy, &csum, from) != copy) |
1835 | if (err) | 1790 | return -EFAULT; |
1836 | return err; | ||
1837 | skb->csum = csum_block_add(skb->csum, csum, offset); | 1791 | skb->csum = csum_block_add(skb->csum, csum, offset); |
1838 | } else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) { | 1792 | } else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) { |
1839 | if (!access_ok(VERIFY_READ, from, copy) || | 1793 | if (copy_from_iter_nocache(to, copy, from) != copy) |
1840 | __copy_from_user_nocache(to, from, copy)) | ||
1841 | return -EFAULT; | 1794 | return -EFAULT; |
1842 | } else if (copy_from_user(to, from, copy)) | 1795 | } else if (copy_from_iter(to, copy, from) != copy) |
1843 | return -EFAULT; | 1796 | return -EFAULT; |
1844 | 1797 | ||
1845 | return 0; | 1798 | return 0; |
1846 | } | 1799 | } |
1847 | 1800 | ||
1848 | static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb, | 1801 | static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb, |
1849 | char __user *from, int copy) | 1802 | struct iov_iter *from, int copy) |
1850 | { | 1803 | { |
1851 | int err, offset = skb->len; | 1804 | int err, offset = skb->len; |
1852 | 1805 | ||
@@ -1858,7 +1811,7 @@ static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb, | |||
1858 | return err; | 1811 | return err; |
1859 | } | 1812 | } |
1860 | 1813 | ||
1861 | static inline int skb_copy_to_page_nocache(struct sock *sk, char __user *from, | 1814 | static inline int skb_copy_to_page_nocache(struct sock *sk, struct iov_iter *from, |
1862 | struct sk_buff *skb, | 1815 | struct sk_buff *skb, |
1863 | struct page *page, | 1816 | struct page *page, |
1864 | int off, int copy) | 1817 | int off, int copy) |
@@ -2262,6 +2215,7 @@ bool sk_net_capable(const struct sock *sk, int cap); | |||
2262 | extern __u32 sysctl_wmem_max; | 2215 | extern __u32 sysctl_wmem_max; |
2263 | extern __u32 sysctl_rmem_max; | 2216 | extern __u32 sysctl_rmem_max; |
2264 | 2217 | ||
2218 | extern int sysctl_tstamp_allow_data; | ||
2265 | extern int sysctl_optmem_max; | 2219 | extern int sysctl_optmem_max; |
2266 | 2220 | ||
2267 | extern __u32 sysctl_wmem_default; | 2221 | extern __u32 sysctl_wmem_default; |