Skip to content

Commit 1470ddf

Browse files
herbertxdavem330
authored andcommitted
inet: Remove explicit write references to sk/inet in ip_append_data
In order to allow simultaneous calls to ip_append_data on the same socket, it must not modify any shared state in sk or inet (other than those that are designed to allow that such as atomic counters). This patch abstracts out write references to sk and inet_sk in ip_append_data and its friends so that we may use the underlying code in parallel. Signed-off-by: Herbert Xu <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5a2ef92 commit 1470ddf

File tree

2 files changed

+154
-107
lines changed

2 files changed

+154
-107
lines changed

include/net/inet_sock.h

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,19 @@ static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk)
8686
return (struct inet_request_sock *)sk;
8787
}
8888

89+
struct inet_cork {
90+
unsigned int flags;
91+
unsigned int fragsize;
92+
struct ip_options *opt;
93+
struct dst_entry *dst;
94+
int length; /* Total length of all frames */
95+
__be32 addr;
96+
struct flowi fl;
97+
struct page *page;
98+
u32 off;
99+
u8 tx_flags;
100+
};
101+
89102
struct ip_mc_socklist;
90103
struct ipv6_pinfo;
91104
struct rtable;
@@ -143,15 +156,7 @@ struct inet_sock {
143156
int mc_index;
144157
__be32 mc_addr;
145158
struct ip_mc_socklist __rcu *mc_list;
146-
struct {
147-
unsigned int flags;
148-
unsigned int fragsize;
149-
struct ip_options *opt;
150-
struct dst_entry *dst;
151-
int length; /* Total length of all frames */
152-
__be32 addr;
153-
struct flowi fl;
154-
} cork;
159+
struct inet_cork cork;
155160
};
156161

157162
#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */

0 commit comments

Comments
 (0)