aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-05 15:31:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-05 15:31:59 -0400
commit5518b69b76680a4f2df96b1deca260059db0c2de (patch)
treef33cd1519c8efb4590500f2f9617400be233238c /net/unix/af_unix.c
parent8ad06e56dcbc1984ef0ff8f6e3c19982c5809f73 (diff)
parent0e72582270c07850b92cac351c8b97d4f9c123b9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Reasonably busy this cycle, but perhaps not as busy as in the 4.12 merge window: 1) Several optimizations for UDP processing under high load from Paolo Abeni. 2) Support pacing internally in TCP when using the sch_fq packet scheduler for this is not practical. From Eric Dumazet. 3) Support mutliple filter chains per qdisc, from Jiri Pirko. 4) Move to 1ms TCP timestamp clock, from Eric Dumazet. 5) Add batch dequeueing to vhost_net, from Jason Wang. 6) Flesh out more completely SCTP checksum offload support, from Davide Caratti. 7) More plumbing of extended netlink ACKs, from David Ahern, Pablo Neira Ayuso, and Matthias Schiffer. 8) Add devlink support to nfp driver, from Simon Horman. 9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa Prabhu. 10) Add stack depth tracking to BPF verifier and use this information in the various eBPF JITs. From Alexei Starovoitov. 11) Support XDP on qed device VFs, from Yuval Mintz. 12) Introduce BPF PROG ID for better introspection of installed BPF programs. From Martin KaFai Lau. 13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann. 14) For loads, allow narrower accesses in bpf verifier checking, from Yonghong Song. 15) Support MIPS in the BPF selftests and samples infrastructure, the MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David Daney. 16) Support kernel based TLS, from Dave Watson and others. 17) Remove completely DST garbage collection, from Wei Wang. 18) Allow installing TCP MD5 rules using prefixes, from Ivan Delalande. 19) Add XDP support to Intel i40e driver, from Björn Töpel 20) Add support for TC flower offload in nfp driver, from Simon Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub Kicinski, and Bert van Leeuwen. 21) IPSEC offloading support in mlx5, from Ilan Tayari. 22) Add HW PTP support to macb driver, from Rafal Ozieblo. 23) Networking refcount_t conversions, From Elena Reshetova. 24) Add sock_ops support to BPF, from Lawrence Brako. This is useful for tuning the TCP sockopt settings of a group of applications, currently via CGROUPs" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits) net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap cxgb4: Support for get_ts_info ethtool method cxgb4: Add PTP Hardware Clock (PHC) support cxgb4: time stamping interface for PTP nfp: default to chained metadata prepend format nfp: remove legacy MAC address lookup nfp: improve order of interfaces in breakout mode net: macb: remove extraneous return when MACB_EXT_DESC is defined bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case bpf: fix return in load_bpf_file mpls: fix rtm policy in mpls_getroute net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t net, ax25: convert ax25_route.refcount from atomic_t to refcount_t net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t ...
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index c77ced0109b7..7b52a380d710 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -212,7 +212,7 @@ EXPORT_SYMBOL_GPL(unix_peer_get);
212 212
213static inline void unix_release_addr(struct unix_address *addr) 213static inline void unix_release_addr(struct unix_address *addr)
214{ 214{
215 if (atomic_dec_and_test(&addr->refcnt)) 215 if (refcount_dec_and_test(&addr->refcnt))
216 kfree(addr); 216 kfree(addr);
217} 217}
218 218
@@ -442,7 +442,7 @@ static int unix_dgram_peer_wake_me(struct sock *sk, struct sock *other)
442static int unix_writable(const struct sock *sk) 442static int unix_writable(const struct sock *sk)
443{ 443{
444 return sk->sk_state != TCP_LISTEN && 444 return sk->sk_state != TCP_LISTEN &&
445 (atomic_read(&sk->sk_wmem_alloc) << 2) <= sk->sk_sndbuf; 445 (refcount_read(&sk->sk_wmem_alloc) << 2) <= sk->sk_sndbuf;
446} 446}
447 447
448static void unix_write_space(struct sock *sk) 448static void unix_write_space(struct sock *sk)
@@ -487,7 +487,7 @@ static void unix_sock_destructor(struct sock *sk)
487 487
488 skb_queue_purge(&sk->sk_receive_queue); 488 skb_queue_purge(&sk->sk_receive_queue);
489 489
490 WARN_ON(atomic_read(&sk->sk_wmem_alloc)); 490 WARN_ON(refcount_read(&sk->sk_wmem_alloc));
491 WARN_ON(!sk_unhashed(sk)); 491 WARN_ON(!sk_unhashed(sk));
492 WARN_ON(sk->sk_socket); 492 WARN_ON(sk->sk_socket);
493 if (!sock_flag(sk, SOCK_DEAD)) { 493 if (!sock_flag(sk, SOCK_DEAD)) {
@@ -864,7 +864,7 @@ static int unix_autobind(struct socket *sock)
864 goto out; 864 goto out;
865 865
866 addr->name->sun_family = AF_UNIX; 866 addr->name->sun_family = AF_UNIX;
867 atomic_set(&addr->refcnt, 1); 867 refcount_set(&addr->refcnt, 1);
868 868
869retry: 869retry:
870 addr->len = sprintf(addr->name->sun_path+1, "%05x", ordernum) + 1 + sizeof(short); 870 addr->len = sprintf(addr->name->sun_path+1, "%05x", ordernum) + 1 + sizeof(short);
@@ -1040,7 +1040,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
1040 memcpy(addr->name, sunaddr, addr_len); 1040 memcpy(addr->name, sunaddr, addr_len);
1041 addr->len = addr_len; 1041 addr->len = addr_len;
1042 addr->hash = hash ^ sk->sk_type; 1042 addr->hash = hash ^ sk->sk_type;
1043 atomic_set(&addr->refcnt, 1); 1043 refcount_set(&addr->refcnt, 1);
1044 1044
1045 if (sun_path[0]) { 1045 if (sun_path[0]) {
1046 addr->hash = UNIX_HASH_SIZE; 1046 addr->hash = UNIX_HASH_SIZE;
@@ -1335,7 +1335,7 @@ restart:
1335 1335
1336 /* copy address information from listening to new sock*/ 1336 /* copy address information from listening to new sock*/
1337 if (otheru->addr) { 1337 if (otheru->addr) {
1338 atomic_inc(&otheru->addr->refcnt); 1338 refcount_inc(&otheru->addr->refcnt);
1339 newu->addr = otheru->addr; 1339 newu->addr = otheru->addr;
1340 } 1340 }
1341 if (otheru->path.dentry) { 1341 if (otheru->path.dentry) {
@@ -2033,7 +2033,7 @@ alloc_skb:
2033 skb->len += size; 2033 skb->len += size;
2034 skb->data_len += size; 2034 skb->data_len += size;
2035 skb->truesize += size; 2035 skb->truesize += size;
2036 atomic_add(size, &sk->sk_wmem_alloc); 2036 refcount_add(size, &sk->sk_wmem_alloc);
2037 2037
2038 if (newskb) { 2038 if (newskb) {
2039 err = unix_scm_to_skb(&scm, skb, false); 2039 err = unix_scm_to_skb(&scm, skb, false);
@@ -2847,7 +2847,7 @@ static int unix_seq_show(struct seq_file *seq, void *v)
2847 2847
2848 seq_printf(seq, "%pK: %08X %08X %08X %04X %02X %5lu", 2848 seq_printf(seq, "%pK: %08X %08X %08X %04X %02X %5lu",
2849 s, 2849 s,
2850 atomic_read(&s->sk_refcnt), 2850 refcount_read(&s->sk_refcnt),
2851 0, 2851 0,
2852 s->sk_state == TCP_LISTEN ? __SO_ACCEPTCON : 0, 2852 s->sk_state == TCP_LISTEN ? __SO_ACCEPTCON : 0,
2853 s->sk_type, 2853 s->sk_type,