[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpUpUdd-SnrLOffVoGnW3ocKxDtefUAjktEs1KxE2-Gmvw@mail.gmail.com>
Date: Sun, 19 Sep 2021 18:14:05 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Liu Jian <liujian56@...wei.com>
Cc: John Fastabend <john.fastabend@...il.com>,
Daniel Borkmann <daniel@...earbox.net>,
Jakub Sitnicki <jakub@...udflare.com>,
Lorenz Bauer <lmb@...udflare.com>,
David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH v2] skmsg: lose offset info in sk_psock_skb_ingress
On Fri, Sep 17, 2021 at 3:05 AM Liu Jian <liujian56@...wei.com> wrote:
> @@ -624,6 +635,13 @@ static void sk_psock_backlog(struct work_struct *work)
> while ((skb = skb_dequeue(&psock->ingress_skb))) {
> len = skb->len;
> off = 0;
> +#if IS_ENABLED(CONFIG_BPF_STREAM_PARSER)
> + if (psock->sk->sk_data_ready == sk_psock_strp_data_ready) {
> + stm = strp_msg(skb);
> + off = stm->offset;
> + len = stm->full_len;
> + }
> +#endif
How does this work? You are testing psock->sk->sk_data_ready here
but it is already the dest sock here, so, if we redirect a strp_msg() from
strp socket to non-strp socket, this does not work at all?
And this code looks ugly itself. If you want to distinguish this type of
packet from others, you can add a bit in, for example skb->_sk_redir.
Thanks.
Powered by blists - more mailing lists