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 E032CA0032; Fri, 21 Oct 2022 11:52:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0AE342BA6; Fri, 21 Oct 2022 11:52:13 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2054.outbound.protection.outlook.com [40.107.220.54]) by mails.dpdk.org (Postfix) with ESMTP id 387D742BA4 for ; Fri, 21 Oct 2022 11:52:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=acOnyMrk2qBnrmRTYUQKBiwCeMfehyubVK7zMO+wwAZnQI0ALrCkgSELuphWfHHvumwIUT14e7nB4Jyh0uoRxGf1yZY52JlzlKp3Q8cFFlAkc1ozFBk+xlmYbcCcvGZoILS2a8DZJs1CdLfJr6ZwLFpPOoQx3QT3OlTRx7cNT7ql+8o3qqKebo5FFNHkH0xTWf11JAXmdyqBOQVmHX/DV1qis5c1S21ax/mzsOzLwIBEj6B00uNU2nThG7vj1TXxrXQl08JEc8ZQmznmiYlZgCEGxTGt9Fytf8kkFDIR3QsPwEoQhM597lTg5qfHoDuB8vJmMFjoDBjxCcjeAlj/OA== 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=zSMsA8WE+ggL4Ixy7SP8/zkr8A8A2XkJBjQ7SxU2xK0=; b=OrMWmMc9mTBBaPKr85eW5gF6eepL+jjkDDb2390XalU9aBtnfUvXAGLNOrxNG6Ii0B60TuWtPphdJaYhc3RLrX44M9KTCbcHk+W3l2jm7tF12CzAQNe9kNhuXkU2zYPHHAJ5M42GSItkhV8gACb5GdN+b07AocizjYNVJNODEmA0+1Ii9knp+2r+MJKGg7d43Oxuc5FLw71Z260dA4QOUEIGB4D5/y4MMrlkOh1c+6D+Ya6FUuYDn2FbbgvlstnKA2b1UWL6TVPdM68NWO7ggi73/poZJgR15FZ3d3ORZkWhDwFUKUZScQPDdKuNZEFwhQReV/X46TaPrl0NBr+qbQ== 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=zSMsA8WE+ggL4Ixy7SP8/zkr8A8A2XkJBjQ7SxU2xK0=; b=gN1Jc5XELQ5snkR8RnZcQoVOP92rvrxkNXBKW9X4yLSaxBDXhWUWWVeFPBA6oTcrImBzfHcjv2EEnhMQA5N72Gt8gGvVFHFjOcvX9pTU2firCF7FTz91Wg6CbAObRtUR7XFGRB7Pbt782MlsSU/mRK+q/esh7zIdLWxwpNVjPK8= 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 DS0PR12MB6582.namprd12.prod.outlook.com (2603:10b6:8:d2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Fri, 21 Oct 2022 09:52:10 +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; Fri, 21 Oct 2022 09:52:10 +0000 Message-ID: <690afa67-a5b4-e282-089b-f20f7e3fb085@amd.com> Date: Fri, 21 Oct 2022 10:52:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v7 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, ferruh.yigit@xilinx.com, beilei.xing@intel.com Cc: dev@dpdk.org, xiaoyun.li@intel.com, awogbemila@google.com, bruce.richardson@intel.com, hemant.agrawal@nxp.com, stephen@networkplumber.org, chenbo.xia@intel.com, helin.zhang@intel.com References: <20221020103656.1068036-1-junfeng.guo@intel.com> <20221021091928.2674471-1-junfeng.guo@intel.com> <20221021091928.2674471-9-junfeng.guo@intel.com> From: Ferruh Yigit In-Reply-To: <20221021091928.2674471-9-junfeng.guo@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0095.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::35) To DM6PR12MB4297.namprd12.prod.outlook.com (2603:10b6:5:211::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4297:EE_|DS0PR12MB6582:EE_ X-MS-Office365-Filtering-Correlation-Id: 16dd588c-ba41-42ab-66da-08dab349ec28 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0XeTsP5Yd0TMfDL+bJJjHx/y3sbPpzb+N2S/HkqiphQWt0b/q9hVeGykHVGly5yHCuKGzJQp0aWxzkBWgNZ9gMtAK+6B7Ow2s7e3DmTHeMrw8u43WyL6gEZjHy7GfrGMelhO2HeEAIa7sEc3bSYkncPNQ1aLP29Y1+59n3Uvsk4MgQzmwqLQdimyLTJesR/egNWeu/YVr7PAerMz2ldY6j133/AOWJMG4JOXkzhnMPfhgzWgQBFDuquUwIQva0cIButKBuuaYbymI7wwMQZFwiekSj/Pqpx6ERc+qaiqV8Mvvyb8ljixvjU3qLk1/+saR9plKcKdxtuo0+3vxny0t5b+BXcrHLI8Fqhnt30Csc1shuCjvhfkBNNW9Qf8K7Npg6Im2o07jEkh2aEKcjjcMYck0fbTt+PNeo8+eCdIVOSbeGMkLydG07MBKUDS4AZmvW8vP+MRY1fO0+2VlDl5F/xI56mGMmGQSxcR5SZVNDgi6Mrgu/lCrgYqQfjfyzVcFAAmbijTM6pai3N9JN96spk6w5je3+fYHhEVF8NPT5oU0XiGCR4fvNhBVNNOFcimk+InSzJedAE/Xwdi1/1MyBmfW8tpdsQlHJ98WI2qO1YwkPvfECC5lxYZp5gbo/rNVAUy0uRoBrptF93LdzzAcj9sZI8dMgGeakbGmdXHXt6m9M6/LbosrS944bD35BCRWqzGsMHinf/A5F4gKqLCxdVK9wiQHEGSZZlXgXUkbMykqmJPoluBwwL4vEdGwgqAqvdrdCDi4IMpTZu2FJpTWvLbfk/Tdo9cKepZQDPkoJY= 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)(376002)(396003)(346002)(39860400002)(136003)(366004)(451199015)(86362001)(36756003)(31696002)(38100700002)(31686004)(186003)(66946007)(83380400001)(7416002)(5660300002)(2616005)(44832011)(53546011)(26005)(6506007)(478600001)(6512007)(6666004)(2906002)(41300700001)(66476007)(316002)(6486002)(8676002)(4326008)(66556008)(8936002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VXdBYlNHYTVaQjgrNjlvRSt0MUE1aWxISTdKYkttT3FTM2poRGg5ci9BRzVV?= =?utf-8?B?Qnh0MjMwZW1NaTQ1ZUVLNkxUa3AzZnNLT1Uvc2I3M1VWcm83RlhhbnRHc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E96MGduS2N0NVRCMUFtcFQ2SmtMNzkvcCt3Qys2UGxNYzd6?= =?utf-8?B?NkhuL2FkKzA4RENPcVk1UmdFSWdQcjVBUUxnTGI1MWFSb3NEaWI2V1UxRWVS?= =?utf-8?B?Y1RlNDNOSWREcjUwUVFjTnNlY0xWQ25TaU1SNS9aWXgzcGxJYzU0NWFIUjg3?= =?utf-8?B?cnE0TjNyRUtPNEIxWVN5TzBxTHlxOFNid3M3K3Q4QVFIaXY2NnpjaG9aRUNj?= =?utf-8?Q?CPILWav2BUjdABgKamiYTus2K?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16dd588c-ba41-42ab-66da-08dab349ec28 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 09:52:10.4600 (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: 5llBXpDNvzX6lx1j5nCGru/2RbThZu/sagU8GwKxeTgpcv6kAfYavVwo0JEESkFX X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6582 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/21/2022 10:19 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 <...> > + > +static inline void > +gve_tx_clean_swr_qpl(struct gve_tx_queue *txq) > +{ > + uint32_t start = txq->sw_ntc; > + uint32_t ntc, nb_clean; > + > + ntc = txq->sw_tail; > + > + if (ntc == start) > + return; > + > + /* if wrap around, free twice. */ > + if (ntc < start) { > + nb_clean = txq->nb_tx_desc - start; > + if (nb_clean > GVE_TX_MAX_FREE_SZ) > + nb_clean = GVE_TX_MAX_FREE_SZ; > + gve_free_bulk_mbuf(&txq->sw_ring[start], nb_clean); > + > + txq->sw_nb_free += nb_clean; > + start += nb_clean; > + if (start == txq->nb_tx_desc) > + start = 0; > + txq->sw_ntc = start; > + } > + > + if (ntc > start) { > + nb_clean = ntc - start; > + if (nb_clean > GVE_TX_MAX_FREE_SZ) > + nb_clean = GVE_TX_MAX_FREE_SZ; > + gve_free_bulk_mbuf(&txq->sw_ring[start], nb_clean); > + txq->sw_nb_free += nb_clean; > + start += nb_clean; > + txq->sw_ntc = start; > + } > +} [copy/paste from previous version] may be can drop the 'if' block, since "ntc == start" and "ntc < start" cases already covered. <...> > +uint16_t > +gve_tx_burst(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) > +{ > + struct gve_tx_queue *txq = tx_queue; > + > + if (txq->is_gqi_qpl) > + return gve_tx_burst_qpl(tx_queue, tx_pkts, nb_pkts); > + > + return gve_tx_burst_ra(tx_queue, tx_pkts, nb_pkts); > +} > + [copy/paste from previous version] Can there be mix of queue types? If only one queue type is supported in specific config, perhaps burst function can be set during configuration, to prevent if check on datapath. This is optimization and can be done later, it doesn't have to be in the set.