aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <[email protected]>2017-08-01 15:26:19 -0700
committerDavid S. Miller <[email protected]>2017-08-01 15:26:19 -0700
commit2e674381be84311dc88de61b9c9bb39e67fc4f2c (patch)
tree33ac457d4f2fe6464309310015674afb6d553724 /include/linux
parent29fda25a2d31098044f8dfa177c4d2834071828e (diff)
parentbbb03029a899679d73e62d7e6ae80348cc5d0054 (diff)
Merge branch 'kzproxy-next'
Tom Herbert says: ==================== net: Infrastructure changes for [kz]proxy This patch set contains some general infrastructure enhancements that will be used by kernel proxy and zero proxy. The changes are: - proto_ops: Add locked versions of sendmsg and sendpage - skb_send_sock: Allow sending and skb on a socket within the kernel - Generalize strparser. Allow it to be used in other contexts than just in the read_sock path. This will be used in the transmit path of zero proxy. Some nice future work (which I've been discussing with John Fastabend) will be to make some of the related functions to allow gifting of skbs We should be able to do that with skb_send_sock and strp_process. I'd also like this feature in the read_sock callbeck. Tested: Ran modified kernel without incident. Tested new functionality using zero proxy (in development). ==================== Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/net.h12
-rw-r--r--include/linux/skbuff.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/net.h b/include/linux/net.h
index dda2cc939a53..b5c15b31709b 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -190,8 +190,16 @@ struct proto_ops {
struct pipe_inode_info *pipe, size_t len, unsigned int flags);
int (*set_peek_off)(struct sock *sk, int val);
int (*peek_len)(struct socket *sock);
+
+ /* The following functions are called internally by kernel with
+ * sock lock already held.
+ */
int (*read_sock)(struct sock *sk, read_descriptor_t *desc,
sk_read_actor_t recv_actor);
+ int (*sendpage_locked)(struct sock *sk, struct page *page,
+ int offset, size_t size, int flags);
+ int (*sendmsg_locked)(struct sock *sk, struct msghdr *msg,
+ size_t size);
};
#define DECLARE_SOCKADDR(type, dst, src) \
@@ -279,6 +287,8 @@ do { \
int kernel_sendmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec,
size_t num, size_t len);
+int kernel_sendmsg_locked(struct sock *sk, struct msghdr *msg,
+ struct kvec *vec, size_t num, size_t len);
int kernel_recvmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec,
size_t num, size_t len, int flags);
@@ -297,6 +307,8 @@ int kernel_setsockopt(struct socket *sock, int level, int optname, char *optval,
unsigned int optlen);
int kernel_sendpage(struct socket *sock, struct page *page, int offset,
size_t size, int flags);
+int kernel_sendpage_locked(struct sock *sk, struct page *page, int offset,
+ size_t size, int flags);
int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg);
int kernel_sock_shutdown(struct socket *sock, enum sock_shutdown_cmd how);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 4093552be1de..18e76bf9574e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3113,6 +3113,9 @@ __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
int skb_splice_bits(struct sk_buff *skb, struct sock *sk, unsigned int offset,
struct pipe_inode_info *pipe, unsigned int len,
unsigned int flags);
+int skb_send_sock_locked(struct sock *sk, struct sk_buff *skb, int offset,
+ int len);
+int skb_send_sock(struct sock *sk, struct sk_buff *skb, int offset, int len);
void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
unsigned int skb_zerocopy_headlen(const struct sk_buff *from);
int skb_zerocopy(struct sk_buff *to, struct sk_buff *from,