diff options
Diffstat (limited to 'include/linux/skmsg.h')
| -rw-r--r-- | include/linux/skmsg.h | 19 | 
1 files changed, 17 insertions, 2 deletions
| diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h index 14ab0c0bc924..b4256847c707 100644 --- a/include/linux/skmsg.h +++ b/include/linux/skmsg.h @@ -128,6 +128,7 @@ int sk_msg_memcopy_from_iter(struct sock *sk, struct iov_iter *from,  			     struct sk_msg *msg, u32 bytes);  int sk_msg_recvmsg(struct sock *sk, struct sk_psock *psock, struct msghdr *msg,  		   int len, int flags); +bool sk_msg_is_readable(struct sock *sk);  static inline void sk_msg_check_to_free(struct sk_msg *msg, u32 i, u32 bytes)  { @@ -508,8 +509,22 @@ static inline bool sk_psock_strp_enabled(struct sk_psock *psock)  #if IS_ENABLED(CONFIG_NET_SOCK_MSG) -/* We only have one bit so far. */ -#define BPF_F_PTR_MASK ~(BPF_F_INGRESS) +#define BPF_F_STRPARSER	(1UL << 1) + +/* We only have two bits so far. */ +#define BPF_F_PTR_MASK ~(BPF_F_INGRESS | BPF_F_STRPARSER) + +static inline bool skb_bpf_strparser(const struct sk_buff *skb) +{ +	unsigned long sk_redir = skb->_sk_redir; + +	return sk_redir & BPF_F_STRPARSER; +} + +static inline void skb_bpf_set_strparser(struct sk_buff *skb) +{ +	skb->_sk_redir |= BPF_F_STRPARSER; +}  static inline bool skb_bpf_ingress(const struct sk_buff *skb)  { |