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 3BEABA00C4; Thu, 6 Oct 2022 16:24:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2FB7F42C67; Thu, 6 Oct 2022 16:24:46 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2079.outbound.protection.outlook.com [40.107.244.79]) by mails.dpdk.org (Postfix) with ESMTP id E99FB42C66 for ; Thu, 6 Oct 2022 16:24:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lvmrwBfsE5XwPjjVHeMTv5AMKpP4LbI4Vf0UAM0mNMNykKJrIAH8jSn4NzBmqY0t9vSCvGjdPcM+I9MZnRhzlwFi+5IxLbNxTBHxd3Rgmzhu/AhGyHvzw8VwJ6iAvA5aNHmWeMxboN+2ugEonmk9Sm4Lp43YaCakZsYsDISIb4Tt/amcfNr+6AJaPoMuSyUrGLsPGHCggNDGR/i8LA8iNUtsG1I+sRVZX8H2m2y2bl96EIIkQ7G6xSYg1cHNjCd4sapzXO7iohjopi+HykMApccdvhoH+OuV7pvgWYcpkCulgr0lbf+CK9GvK9XE+h31TzR8tGTTm/NDQSrhsksJww== 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=4SQdtme/XudDy9ASUmtIducWCmFlIKxev7WB8CeV3kk=; b=G1W6WBjc2s4L8c2LfY3qI37w9qM/cjFbtTOS8sEv/oLjC4I/ajbyC9lHvC1RU+TZt6q5DbIarnSL//u/f5oM9X7w67CD24z3HdhV8+Z5dTGMTKTSPpDqQWKam0hshmx4NDwna1sHcer+1eOqjgPqb2PWzYQOFt1pl19VXGSYq+t6ETwcgFV9STsR1YBApxqg5D/MpRGLn2GrcdyFq9MpA2VoovOlZUHO/+nlYvQJOldwILcJaOMKBXsjLXJxqlWhmydeFoE3P/h+tfUGoVMIIUfIvLO3jgffO8rvZAv5F3LY0FreTPvYJ9XVcoQjjnnIGMK5J+ggH8CkDY9TrdHHWw== 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=4SQdtme/XudDy9ASUmtIducWCmFlIKxev7WB8CeV3kk=; b=mVC2sFiMcnUySrLUxeXE4KzzsqDNoJ5tAc4pWvPU58wJ51zeR5ha3Hn3qLbo+hUIhByTcysprbrolEciYigd/dIAmj0UabcGTX4Ze2ktupgiVjtwqwmn0UVN4L7u/HB6iAnMiJakTAhBqxEZnhcpOgLdFoGWmx/uJvDZTR++2lA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by CY8PR12MB7755.namprd12.prod.outlook.com (2603:10b6:930:87::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Thu, 6 Oct 2022 14:24:36 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::d07a:463f:6f93:337f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::d07a:463f:6f93:337f%7]) with mapi id 15.20.5676.036; Thu, 6 Oct 2022 14:24:36 +0000 Message-ID: <3e2e6a34-168f-b939-2dc3-6af319d3471a@amd.com> Date: Thu, 6 Oct 2022 15:24:31 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v4 7/9] 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: <20220923093829.3019525-2-junfeng.guo@intel.com> <20220927073255.1803892-1-junfeng.guo@intel.com> <20220927073255.1803892-8-junfeng.guo@intel.com> From: Ferruh Yigit In-Reply-To: <20220927073255.1803892-8-junfeng.guo@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0164.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18a::7) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CY8PR12MB7755:EE_ X-MS-Office365-Filtering-Correlation-Id: e1a865c2-650d-4b81-b550-08daa7a67f0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FH54JFVKHucIr1GGTihi6ON7Bm7z9WwN5EbVf0MMxptcyZ+l9kPcCnVXoAA1+K0WCGCryUnTwjLdHB3h4K/FLOvdENuC+iVWWsYGu07ZqmfNvgcI/G99tDOYIZ8txi3KFRdtHh5IiK1iTsEjZ9bQPqItU4Fydgehqz2OT+j60aJsT8vuQzZ8SuRu5ilyHwe1EqDcgl6G+qDXIkQsMO7dfE+x03kXfxP9OETcZwlOxWYBfWkpnNUvlPlX8qq+1Gukb9jHBB7J2htL5mwSwVPys0e16yc56L2f6AY37vki1xbB3GRy5WqwJKGJSI+e4+O1c3wjPJZBBJ1cgDWsjQ2HgjogtKr6cLEj/EsOedigu7Z8ck7SqCqwURErj3Ayd3p5dbfUUqbD7gtBsHxvpzJVmGArOdaOTJHTqR0bxVlgAYuC1vRC+vcDi0MO60FaQuCoFUDmfTObS3I+ZFPoNRgc1AZSRsOyuhF+g6P1K4UHSTAhvFJ38UIZiY2vY74Ck1R1fKzn2qg1xTadSFIueajGFrlqW4B84o4Vru0U8JIyqtUo1tcNVHLwZ9pG0WipyekJBipibfSqgoUgQUsiHNecmOLzwJ1HrZvAwoanmMC4gB96plbbMOjo9BiwP763TLodp+dwpg3KF5C0CE3Zbdn07fnbuRa3DeLYSJ5zHvq5GgiyUIMTYu/wa42GFK6FnTvpbX8KftaFJyVtVE/btKurjYoTJgmRbvX7G34q+ddhS1DAZH5cj2aKcJc6RSQ78BeGXhhGzD3VFri0z6/fm261LQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(366004)(39860400002)(136003)(396003)(346002)(376002)(451199015)(31686004)(8676002)(86362001)(316002)(6486002)(6506007)(66476007)(2616005)(36756003)(6666004)(44832011)(2906002)(66556008)(8936002)(6512007)(66946007)(53546011)(31696002)(478600001)(41300700001)(5660300002)(186003)(4326008)(26005)(38100700002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MkhuTm56OXBsQW8vV2kxOVlIOEgwZjBONDd1NHh2a1hPaDFtNnMvcGd2NkdC?= =?utf-8?B?d25aWXpuVjF2dFp3eHNqQkZzOThpdDltbkJLelJ0VHZuY2xPWHJnTExNK0x0?= =?utf-8?B?OVJTY2IrSkI2NHl4NEhXUXZWWTI4aFMvR0Q2MVQrQzRlY2NKbzV1L3k4Q01y?= =?utf-8?B?SnVX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Q2VDOHQ2Rk1qSHZ6?= =?utf-8?B?SldFNytaL2h0U2dISmlLQWlsMWVxNXpxN0IvRkJSZVhQWFdPVFNqSXpYMzBH?= =?utf-8?B?czFtUW5aM2c3clY5Nk94RWRtZmtObU1EZXc2SnRoeVdqOWZ4SXNONXlReWVo?= =?utf-8?Q?3jb2dgsE2ua5zWq2qvZTllIgj?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1a865c2-650d-4b81-b550-08daa7a67f0f X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2022 14:24:36.6679 (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: hsrBlQ9IkRFUrMPhMl51EPhqeSufnzpH8x26EKXoNIJSbXODuFjYfGiZ3CJzaYgc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7755 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 9/27/2022 8:32 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 <...> > --- a/drivers/net/gve/gve_ethdev.c > +++ b/drivers/net/gve/gve_ethdev.c > @@ -583,6 +583,11 @@ gve_dev_init(struct rte_eth_dev *eth_dev) > if (err) > return err; > > + if (gve_is_gqi(priv)) { > + eth_dev->rx_pkt_burst = gve_rx_burst; > + eth_dev->tx_pkt_burst = gve_tx_burst; > + } > + What do you think to add a log here for 'else' case, to inform user why datapath is not working? <...> > +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; > + > + len = rte_be_to_cpu_16(rxd->len) - GVE_RX_PAD; > + rxe = rxq->sw_ring[rx_id]; > + rxe->data_off = RTE_PKTMBUF_HEADROOM; > + if (rxq->is_gqi_qpl) { > + addr = (uint64_t)(rxq->qpl->mz->addr) + rx_id * PAGE_SIZE + GVE_RX_PAD; > + rte_memcpy((void *)((size_t)rxe->buf_addr + rxe->data_off), > + (void *)(size_t)addr, len); Why a 'memcpy' is needed? Can't it DMA to mbuf data buffer? > + } > + rxe->nb_segs = 1; > + rxe->next = NULL; > + rxe->pkt_len = len; > + rxe->data_len = len; > + rxe->port = rxq->port_id; > + rxe->packet_type = 0; > + rxe->ol_flags = 0; > + As far as I can see 'sw_ring[]' filled using 'rte_pktmbuf_alloc_bulk()' API, which should reset mbuf fields to default values, so some of the assignment above can be redundant. > + if (rxd->flags_seq & GVE_RXF_TCP) > + rxe->packet_type |= RTE_PTYPE_L4_TCP; > + if (rxd->flags_seq & GVE_RXF_UDP) > + rxe->packet_type |= RTE_PTYPE_L4_UDP; > + if (rxd->flags_seq & GVE_RXF_IPV4) > + rxe->packet_type |= RTE_PTYPE_L3_IPV4; > + if (rxd->flags_seq & GVE_RXF_IPV6) > + rxe->packet_type |= RTE_PTYPE_L3_IPV6; > + If you are setting packet_type, it is better to implement 'dev_supported_ptypes_get()' dev_ops too, to announce host which packet type parsin supporting. (+ dev_ptypes_set() dev_ops) And later driver can announce "Packet type parsing" feature in .ini file.