RE: [PATCH v2] skmsg: lose offset info in sk_psock_skb_ingress

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Cong Wang [mailto:xiyou.wangcong@xxxxxxxxx]
> Sent: Monday, September 20, 2021 9:14 AM
> To: liujian (CE) <liujian56@xxxxxxxxxx>
> Cc: John Fastabend <john.fastabend@xxxxxxxxx>; Daniel Borkmann
> <daniel@xxxxxxxxxxxxx>; Jakub Sitnicki <jakub@xxxxxxxxxxxxxx>; Lorenz
> Bauer <lmb@xxxxxxxxxxxxxx>; David Miller <davem@xxxxxxxxxxxxx>; Jakub
> Kicinski <kuba@xxxxxxxxxx>; Linux Kernel Network Developers
> <netdev@xxxxxxxxxxxxxxx>; bpf <bpf@xxxxxxxxxxxxxxx>
> 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@xxxxxxxxxx> 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?
> 
Yes, it is not work in this case, I did not consider this case.

> 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.
It looks better this way. 
I will send v3 later. Thank you~
> 
> Thanks.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux