lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <80cf7ceb-b28a-0f8d-14f8-4b31eb06d6b2@redhat.com>
Date:   Sat, 27 Nov 2021 10:48:40 +0100
From:   Jesper Dangaard Brouer <jbrouer@...hat.com>
To:     Ong Boon Leong <boon.leong.ong@...el.com>, bpf@...r.kernel.org,
        netdev@...r.kernel.org
Cc:     brouer@...hat.com, bjorn@...nel.org,
        Magnus Karlsson <magnus.karlsson@...el.com>,
        Jonathan Lemon <jonathan.lemon@...il.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        KP Singh <kpsingh@...nel.org>
Subject: Re: [PATCH bpf-next 4/4] samples/bpf: xdpsock: add time-out for
 cleaning Tx



On 24/11/2021 10.18, Ong Boon Leong wrote:
> When user sets tx-pkt-count and in case where there are invalid Tx frame,
> the complete_tx_only_all() process polls indefinitely. So, this patch
> adds a time-out mechanism into the process so that the application
> can terminate automatically after it retries 3*polling interval duration.
> 
>   sock0@...0s29f1:2 txonly xdp-drv
>                     pps            pkts           1.00
> rx                 0              0
> tx                 136383         1000000
> rx dropped         0              0
> rx invalid         0              0
> tx invalid         35             245
> rx queue full      0              0
> fill ring empty    0              1
> tx ring empty      957            7011
> 
>   sock0@...0s29f1:2 txonly xdp-drv
>                     pps            pkts           1.00
> rx                 0              0
> tx                 0              1000000
> rx dropped         0              0
> rx invalid         0              0
> tx invalid         0              245
> rx queue full      0              0
> fill ring empty    0              1
> tx ring empty      1              7012
> 
>   sock0@...0s29f1:2 txonly xdp-drv
>                     pps            pkts           1.00
> rx                 0              0
> tx                 0              1000000
> rx dropped         0              0
> rx invalid         0              0
> tx invalid         0              245
> rx queue full      0              0
> fill ring empty    0              1
> tx ring empty      1              7013
> 
>   sock0@...0s29f1:2 txonly xdp-drv
>                     pps            pkts           1.00
> rx                 0              0
> tx                 0              1000000
> rx dropped         0              0
> rx invalid         0              0
> tx invalid         0              245
> rx queue full      0              0
> fill ring empty    0              1
> tx ring empty      1              7014
> 
>   sock0@...0s29f1:2 txonly xdp-drv
>                     pps            pkts           1.00
> rx                 0              0
> tx                 0              1000000
> rx dropped         0              0
> rx invalid         0              0
> tx invalid         0              245
> rx queue full      0              0
> fill ring empty    0              1
> tx ring empty      0              7014
> 
>   sock0@...0s29f1:2 txonly xdp-drv
>                     pps            pkts           0.00
> rx                 0              0
> tx                 0              1000000
> rx dropped         0              0
> rx invalid         0              0
> tx invalid         0              245
> rx queue full      0              0
> fill ring empty    0              1
> tx ring empty      0              7014
> 
> Signed-off-by: Ong Boon Leong <boon.leong.ong@...el.com>
> ---
>   samples/bpf/xdpsock_user.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c
> index 61d4063f11a..9c3311329ec 100644
> --- a/samples/bpf/xdpsock_user.c
> +++ b/samples/bpf/xdpsock_user.c
> @@ -1410,6 +1410,7 @@ static inline int get_batch_size(int pkt_cnt)
>   
>   static void complete_tx_only_all(void)
>   {
> +	u32 retries = 3;
>   	bool pending;
>   	int i;
>   
> @@ -1421,7 +1422,8 @@ static void complete_tx_only_all(void)
>   				pending = !!xsks[i]->outstanding_tx;
>   			}
>   		}
> -	} while (pending);
> +		sleep(opt_interval);

Why/how is this connected with the 'opt_interval' ?

(Which is used by the pthtread 'poller' dumping stats)

> +	} while (pending && retries-- > 0);
>   }
>   
>   static void tx_only_all(void)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ