From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B2D7BA0586; Wed, 19 Oct 2022 15:47:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6544427F3; Wed, 19 Oct 2022 15:47:17 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2068.outbound.protection.outlook.com [40.107.95.68]) by mails.dpdk.org (Postfix) with ESMTP id 0AE28410D1 for ; Wed, 19 Oct 2022 15:47:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JflDTAaqB6O91r0MoDPvVO+g60CYs87xpDYsplMeKNu3eVE44E9gnr3sPTnWIyCk92Zg4EnliE1glqNrOAW5GHkDf8WU/3+eS0I71vjEKaP1EYT5M2XoNP07ZhmkvyevwvWxQqW4T888LWGvTikecPA1u4sSHAYKeCX5umA3cQyrOsei7nhNlMcI/CiaTYdPxACKpuH9ctxK4r5GGs0z+lN8nsczJAngDRXFTwKPupvN2AMkWpJiXxNzMNiGMKo3HwnGv0ttEIMelXOZ2R8XYorEERpOJlec2owYBDQGr/1cSnoZRr8ZFwlRi5e9RUveXnqXzBw6B7EfX5g42+WGBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zXir95lVmF+Pk+yahLU038lU55GqNHuR5TWc5qkCMvk=; b=mZG+PzynA2tBvkUK2pIu5ap14XJdhBEjFaO01EU1MPJY88f16fzhtO6KgamO3aUx6U43YrGJjwKwurHBNDta32dB6FhP9hx/VNTDywzVnMGfhPJ/VsvdJdyjZx1/tP+DlFP4dxG7QGGr9TE4JLXvzVTOpSD0oz/KMVEiAzV0yQ49qCMnHNy71Ey7HHnyKKPrwJGz9vv/3VlUEbDYjkSgRdXenY7Whh9cpmQ6rrUGQjkj6m78GkZgj0rElqGPwJodwuCwrK9hgWXdZGW0a6eSTLjYImOCzx0jFJG+IpBUzQFtI5ENGpcJfE70sAXSArZxeMrXP5E/N7AYxXvELRZ2WA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zXir95lVmF+Pk+yahLU038lU55GqNHuR5TWc5qkCMvk=; b=NaWd2DklFAXts+IZI4Ma4hPYfsYq9m/7xrnxpf7oEMacPzusN5COVWOzIltuUT435Bolsb55QQl1V/jwn99/aqJen876dmmouU0r64TItubWZF2CxQzYwyBR1NYXascFC/zFQQEsN3sxhflXWaKDUjD/37pvAY99dv8K4/m93f8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) by DM6PR12MB4401.namprd12.prod.outlook.com (2603:10b6:5:2a9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34; Wed, 19 Oct 2022 13:47:13 +0000 Received: from DM6PR12MB4297.namprd12.prod.outlook.com ([fe80::b9fd:e732:4585:6b25]) by DM6PR12MB4297.namprd12.prod.outlook.com ([fe80::b9fd:e732:4585:6b25%7]) with mapi id 15.20.5723.033; Wed, 19 Oct 2022 13:47:13 +0000 Message-ID: <4af40ab9-6b78-07fe-8701-75cea496859d@amd.com> Date: Wed, 19 Oct 2022 14:47:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v5 8/8] net/gve: add support for Rx/Tx Content-Language: en-US To: Junfeng Guo , qi.z.zhang@intel.com, jingjing.wu@intel.com Cc: ferruh.yigit@xilinx.com, dev@dpdk.org, xiaoyun.li@intel.com, awogbemila@google.com, bruce.richardson@intel.com, xueqin.lin@intel.com References: <20220927073255.1803892-2-junfeng.guo@intel.com> <20221010101757.878317-1-junfeng.guo@intel.com> <20221010101757.878317-9-junfeng.guo@intel.com> From: Ferruh Yigit In-Reply-To: <20221010101757.878317-9-junfeng.guo@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO6P265CA0001.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:339::9) To DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4297:EE_|DM6PR12MB4401:EE_ X-MS-Office365-Filtering-Correlation-Id: e1bc8686-0814-4a6d-55a5-08dab1d86d6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bveh9VxHNqH8jliSzllYCqdoTBGoeEhKxl2K+XgD1zx/9vls4TeO04L0dW1DUuJDHcEKYcoCEJYoKQXQjiL7Fz/BeIzMyqvIHWazrwWVaaGwKNhrCfVaG9dX3ajWB1VrVDRTNqYlwfdWMcMKIwm0W0LPZ2LL2FusFqyEOuyOIcXsBgFIFzSQTrDXak9o+CEyu/CYqnKtmEZaCD+iFYLQw/dfiBKoAU181ST5KBb4Zpp+w3Li+TZ7138VLmlSoKzmfsSGPbJwkhK0sM1X3GVPJ3gnM4gkgQYUrT5GTCkmsWaKePxr3A1vPNixIdSDOpqu23EmPdIazJlyp1pGaTDsJJSvZ29X8utbOIdcCfzGM5xFEa7ZadE0mQnu3MUC/Pyn18Tzy56V70YnQeBzY4rAZ5CEdhfnySdUoDJkKGcW6eyrwZT9x05fBq6Al5D+Q372f3MrnbApFwgYg9ioIV1ROOOUACADYSCcWR/i2HAt9cHgZon2JvJL1xmXNtssQwD1nChkaer1FlybMCQ+WJYwk/ivpc5FqNeZNC3i5b1x4cJKxX4VzmQfNPSjI6g+AiEL0MVFTOA2qig43xWuVDXdgNSzaUf4W7tD7BZ64LC06qPmtLbPNhn4dWg2ijOlQvtgVmlBk1lQYeDYNtq4ZL5cyq3C4/UGKc5GYEOIRReC4NdDJladRCRQmfKe0jqqWgw6iQOdU6CxYQCbEBrmx9vmJsj9SwtpvqOAC43qGWPmKg/BLGkrgW3/F+rU2zl8HMIAvDCSC5kRwDquxb5TcjZgxw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4297.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(366004)(396003)(136003)(39860400002)(376002)(451199015)(44832011)(5660300002)(53546011)(6506007)(8676002)(6666004)(66946007)(66556008)(66476007)(36756003)(4326008)(8936002)(316002)(6512007)(26005)(41300700001)(38100700002)(2616005)(186003)(2906002)(31696002)(86362001)(478600001)(31686004)(6486002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aGNydWtzTlcxOWh3TDRiMHc2T0VDNGFZaWZUQVBUYkduZjJmRDBSMFB4bms2?= =?utf-8?B?bVZIdkIvTnZGczQ0ZW5qdlhkbkhlZDVqVGp3NVluQVEvVzBWMjVWNXBKWVZz?= =?utf-8?B?WkU4Ukl4TERINnFJL1dOclJXSWdKeGc2aWpNdEJsU2hYYURMVjdqTllWVUF2?= =?utf-8?B?TzAxdStrc1Bsb2dBb1ZKclNoVDFRM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UFJRUEEyU253UUxzZnVJTUdvR0kzUHoyS0hkYm0xMTVuTmFOS0NuL2dzMVRP?= =?utf-8?B?YkVnM0VjUkFKR2Mza3BxKzg2cUdub3NsSGo1VkVnRmoybGpFb3QzZUVXMWF5?= =?utf-8?Q?juQHQFDSNfHvoGp3sD6q/1fur?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1bc8686-0814-4a6d-55a5-08dab1d86d6a X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 13:47:13.4958 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Q+QFS88oUD6WPBpGwf+1VA0AOy/bKXZ+tgc2Td/f3OZ+vMS5MF70UdaFWnTV+oEc X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4401 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 10/10/2022 11:17 AM, Junfeng Guo wrote: > > Add Rx/Tx of GQI_QPL queue format and GQI_RDA queue format. > > Signed-off-by: Xiaoyun Li > Signed-off-by: Junfeng Guo <...> > +uint16_t > +gve_rx_burst(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) > +{ > + volatile struct gve_rx_desc *rxr, *rxd; > + struct gve_rx_queue *rxq = rx_queue; > + uint16_t rx_id = rxq->rx_tail; > + struct rte_mbuf *rxe; > + uint16_t nb_rx, len; > + uint64_t addr; > + > + rxr = rxq->rx_desc_ring; > + > + for (nb_rx = 0; nb_rx < nb_pkts; nb_rx++) { > + rxd = &rxr[rx_id]; > + if (GVE_SEQNO(rxd->flags_seq) != rxq->expected_seqno) > + break; > + > + if (rxd->flags_seq & GVE_RXF_ERR) > + continue; > + I think above code wrong. Function returns 'nb_rx', if you continue on error 'nb_rx' kept increased, so application will receive wrong number of packets. Also packets assigned as "rx_pkts[nb_rx] = rxe;", this will cause gaps in the arrays. You can either break on the error, or keep another variable to store number of received packets. > + len = rte_be_to_cpu_16(rxd->len) - GVE_RX_PAD; > + rxe = rxq->sw_ring[rx_id]; > + rxe->data_off = RTE_PKTMBUF_HEADROOM; As far as I can see mbufs allocated using 'rte_pktmbuf_alloc()', if so no need to explicitly set the 'm->data_off'.