From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFB66C43217 for ; Sat, 5 Nov 2022 11:07:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229741AbiKELHm (ORCPT ); Sat, 5 Nov 2022 07:07:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbiKELHl (ORCPT ); Sat, 5 Nov 2022 07:07:41 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FE09FCE3; Sat, 5 Nov 2022 04:07:41 -0700 (PDT) Received: from canpemm500007.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4N4F432pPLzpW8R; Sat, 5 Nov 2022 19:04:03 +0800 (CST) Received: from [10.174.179.215] (10.174.179.215) by canpemm500007.china.huawei.com (7.192.104.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 5 Nov 2022 19:07:38 +0800 Subject: Re: [PATCH] selftests/xsk: Fix unsigned comparison with less than zero To: , , , , , , , , , , , , , , , , , CC: , , , References: <20221105110443.23872-1-yuehaibing@huawei.com> From: YueHaibing Message-ID: Date: Sat, 5 Nov 2022 19:07:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20221105110443.23872-1-yuehaibing@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500007.china.huawei.com (7.192.104.62) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org someone has post a fix, pls ignore this. On 2022/11/5 19:04, YueHaibing wrote: > poll() may return negative on error, 'ret' should be int. > > Fixes: 3143d10b0945 ("selftests/xsk: Update poll test cases") > Signed-off-by: YueHaibing > --- > tools/testing/selftests/bpf/xskxceiver.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c > index 681a5db80dae..162d3a516f2c 100644 > --- a/tools/testing/selftests/bpf/xskxceiver.c > +++ b/tools/testing/selftests/bpf/xskxceiver.c > @@ -1006,7 +1006,8 @@ static int __send_pkts(struct ifobject *ifobject, u32 *pkt_nb, struct pollfd *fd > { > struct xsk_socket_info *xsk = ifobject->xsk; > bool use_poll = ifobject->use_poll; > - u32 i, idx = 0, ret, valid_pkts = 0; > + u32 i, idx = 0, valid_pkts = 0; > + int ret; > > while (xsk_ring_prod__reserve(&xsk->tx, BATCH_SIZE, &idx) < BATCH_SIZE) { > if (use_poll) {