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 6C93D45C50; Sat, 2 Nov 2024 02:01:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 549ED402B7; Sat, 2 Nov 2024 02:01:55 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2055.outbound.protection.outlook.com [40.107.237.55]) by mails.dpdk.org (Postfix) with ESMTP id F40F54029A for ; Sat, 2 Nov 2024 02:01:53 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wro0l89DZwHBFaEO8pcTbEeh2sAUfJpHQg6GiQ65jlsMIrzNfa8BZQbjcv0xQ/DOANglOtIHJfjiJcvtLULuWHO7Y3pQSnH3odSXI62YSter/9dmBs+OtubowT0tPtqmgfxrnR8q31Gl4KQ0/ehpE7bEp+P9KoiCyPtLFSlypiXrAm2xVEt76fUWdK+yUkCTfIDhgjlRmJ3cXJz6sUYpvC76uVxt9kn/Q+a+fZuHko0G4ATo/t4zLwcYJbtY9UsQiiXqv1W5vN4aHF5vYRQ0Dm7LlfHJKoutxJoctBX6c+5gK1ohITzM0KY2yy+Ju4mMVzdv5cZixmtWCq74F3y47w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=jRb3IgnmThUSW7eF39iw1BZVbgDOYD/zUFUMGtcZMAA=; b=lfb9DoG1V5jAd0xIM0nPSC+hkFb6XIZxsH3JO6AhsGrchGYwSvsjJ7IEpjFfWoo0N+W0FXrfPgvVB00UzNpPI5NPMpRZzaIP2mzZjO9NDjPzKiyPLvODWh87uO6JTAl6ojVOinY2JETRx0GxAjugQonBhrD5wbCm6k3K4VRcbzLxtnWcaO1v1k/1v/DA4WkoVGtRwUMhkcYQ06Fal6LTuY7TXC6lNZSZ/9pWafSnCjA0cZppXb/bA0vruopKlkfPVyLwUCaMuFSZkhZ34PEcoQxQge+ovEZYBW0nQJuCkZbWuETwfhkdbiY6OhJc2UG+F2SKWvufuhn1dinl0fzzhw== 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=jRb3IgnmThUSW7eF39iw1BZVbgDOYD/zUFUMGtcZMAA=; b=JDqXWUB5w1I9kD9vQ0q3A3IpIqdlLH6v5g7OikulxHNZhdgqxORLgkj3aKlz+Rxwzq178Vb+mOzJye02FvZZ6rpzKeG3FAwCiohBwIfBJHXtoXP9b2adVcjdLDyK+ArOQTD0A8S5k40VwXnsDzcONnzTFbd9arDCJlf4B/St6pQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) by SA1PR12MB8920.namprd12.prod.outlook.com (2603:10b6:806:38e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.23; Sat, 2 Nov 2024 01:01:52 +0000 Received: from SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055]) by SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055%4]) with mapi id 15.20.8114.015; Sat, 2 Nov 2024 01:01:51 +0000 Message-ID: <6f7f0c69-a645-4cdc-af34-2605dbae39b4@amd.com> Date: Sat, 2 Nov 2024 01:01:46 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 3/9] net/zxdh: add zxdh device pci init implementation To: Junlong Wang , dev@dpdk.org Cc: wang.yong19@zte.com.cn References: <20241030090124.2540776-2-wang.junlong1@zte.com.cn> <20241101062156.2637339-1-wang.junlong1@zte.com.cn> <20241101062156.2637339-4-wang.junlong1@zte.com.cn> Content-Language: en-US From: Ferruh Yigit In-Reply-To: <20241101062156.2637339-4-wang.junlong1@zte.com.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0035.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ae::11) To SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8830:EE_|SA1PR12MB8920:EE_ X-MS-Office365-Filtering-Correlation-Id: c71ff9f4-4648-4c15-3490-08dcfad9efb1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?WmxET01uTFBCUXM4TjY4dXhMSHB0MG8rUGJ0SGRYZUZWdXBIWWh1VDhLM2Nu?= =?utf-8?B?ejQyV1VaYUEzNzFaaUlReFd3TGpuV05Ieno2L1lPQm83N3ZZaWVDU1R2MUdB?= =?utf-8?B?NS84czBib2RBdVpyNnRnNWlYdEFIdHZveUFCNTd6K2NITW1EekpnS3FDOWxZ?= =?utf-8?B?Ymx6RjNLVUtUUkFKd1JOdVl3OXdxVFpaSHpvbmVqMS9vci83ZEZXOHpRMzJ2?= =?utf-8?B?RTY2OUFCU3k4VlVHaFBuaXFHQU9NMDVQekpUK3ZTMmF6RTdrVEdMM25WdEV2?= =?utf-8?B?NGNXb09ZanFJM21GaVZMaDZQd241QkhMZVVt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9xdGhMb1V2VU1DYkFFTU81VHBNSW1uK0JybXRkN2dVSVF1TG5X?= =?utf-8?B?TnZQSk1PVDNTYXF5eUZkaXk3cjdjSzByMnNwSDR3Mkh1MDkwNUtoUVFsbzdk?= =?utf-8?B?VW83UHpUQVlmajJvSzJDVlVpeUNmTDZVbnVMS0crQTVrMFE1NG5uV3p1QVd5?= =?utf-8?B?RnBFTHdSMzgzbUhiQ3hGQlQ5M2dxWXExeGtKVFZVQ2hTSGdva0FvRjVTTCsr?= =?utf-8?B?amRyTDYyWVNMRHdXQ2RFOGFGNTg4UjBmVHZaMGJoeklDQndSamJ5NHMvaHE0?= =?utf-8?B?QitJL05OdUg3TzB4bnlOOElGVGdaNkkybXVra3h0Z1VYclNmanJVTVhJWXpJ?= =?utf-8?B?bGg1ZkUzTnM1ZWgyUnE5TWZmY2hxSkRqaGlCWWdXdjd5US9mTHZVZ0JtRnpw?= =?utf-8?B?OWkwMDI5UUdEREVVVlNxaTR0aTFCeTRkRFdHek5ZT3RGQ1J6elpTQm1CbzFE?= =?utf-8?B?OGxrbi9rMmlraHcwUTBuS2xzeW8vR0k3ajF1cjl2MVhFeVA1V3diY1hwdklL?= =?utf-8?Q?87WnaKm677vcoIfwlw=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR12MB8830.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZUpZc1lMSVF4blNiMnJOcWhmbFA2d21SbklZNEdZUWdLU2g3dGY2TnBTNTg2?= =?utf-8?B?ekFmTHFEMjdrcmRyRXdRUjJMWVNjdUdxdmRtdFJ6OVpRWFd1d0pPWi95bFJV?= =?utf-8?B?VEhmSVFnVEdiOThmbVlWcXRaWkdtQlBzWGZSY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8?B?MGxobmFoS21ROTJ3ODFqcVhvR3VsVHdtOGdpZlpZVjM2WXJnTjc2aktPdDBl?= =?utf-8?B?YmZxSEJHL0lENnpGYkJQQ1AwbGNrZEZnY0dsS1piZlA2OXBDQzZMbWpHdk4x?= =?utf-8?B?U3JJTGJ4SVRjdkE2a0xvLytyZ3QxcWZhTHEyTndBMXFVWnN0MFdVRTMxbzFO?= =?utf-8?Q?kQuwRzh7nG7w7caPqFWa30to9?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c71ff9f4-4648-4c15-3490-08dcfad9efb1 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8830.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2024 01:01:51.7970 (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: ZWenjJr1799dPjusU1RQbDyWWGDLkgXO09nALe1yTDd34HBEIaZC5gKsVQSmRkfR X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8920 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 11/1/2024 6:21 AM, Junlong Wang wrote: > Add device pci init implementation, > to obtain PCI capability and read configuration, etc. > > Signed-off-by: Junlong Wang  > --- >  drivers/net/zxdh/meson.build   |   1 + >  drivers/net/zxdh/zxdh_ethdev.c |  43 +++++ >  drivers/net/zxdh/zxdh_ethdev.h |  18 ++- >  drivers/net/zxdh/zxdh_pci.c    | 278 +++++++++++++++++++++++++++++++++ >  drivers/net/zxdh/zxdh_pci.h    | 138 ++++++++++++++++ >  drivers/net/zxdh/zxdh_queue.h  | 109 +++++++++++++ >  drivers/net/zxdh/zxdh_rxtx.h   |  55 +++++++ > zxdh_queue.h & zxdh_rxtx.h seems not used in this patch, and they are not indeed related to the PCI init, or PCI at all. Can you add them in the patch that they are used? <...> > +#define ZXDH_PMD_DEFAULT_GUEST_FEATURES   \ > +    (1ULL << ZXDH_NET_F_MRG_RXBUF | \ > +     1ULL << ZXDH_NET_F_STATUS    | \ > +     1ULL << ZXDH_NET_F_MQ        | \ > +     1ULL << ZXDH_F_ANY_LAYOUT    | \ > +     1ULL << ZXDH_F_VERSION_1     | \ > +     1ULL << ZXDH_F_RING_PACKED   | \ > +     1ULL << ZXDH_F_IN_ORDER      | \ > +     1ULL << ZXDH_F_NOTIFICATION_DATA | \ > +     1ULL << ZXDH_NET_F_MAC) > + > +static void zxdh_read_dev_config(struct zxdh_hw *hw, > +                                   size_t offset, > +                                   void *dst, > +                                   int32_t length) > Syntax issue, with tab stop = 8, above lines looks wrong can you please check? <...> > +struct zxdh_virtqueue { > +    struct zxdh_hw  *hw; /**< zxdh_hw structure pointer. */ > +    struct { > +        /**< vring keeping descs and events */ > +        struct zxdh_vring_packed ring; > +        uint8_t used_wrap_counter; > +        uint8_t rsv; > +        uint16_t cached_flags; /**< cached flags for descs */ > +        uint16_t event_flags_shadow; > +        uint16_t rsv1; > +    } __rte_packed vq_packed; > +    uint16_t vq_used_cons_idx; /**< last consumed descriptor */ > +    uint16_t vq_nentries;  /**< vring desc numbers */ > +    uint16_t vq_free_cnt;  /**< num of desc available */ > +    uint16_t vq_avail_idx; /**< sync until needed */ > +    uint16_t vq_free_thresh; /**< free threshold */ > +    uint16_t rsv2; > + > +    void *vq_ring_virt_mem;  /**< linear address of vring*/ > +    uint32_t vq_ring_size; > + > +    union { > +        struct zxdh_virtnet_rx rxq; > +        struct zxdh_virtnet_tx txq; > +    }; > + > +    /** < physical address of vring, > +     * or virtual address > +     **/ > '/**' is doxygen syntax, I don't know if you are using doxgen. But '/**<' is doxygen sytax to say comment is for the code before it, not after. So it is used wrong above. If you don't have any specific reason, why not using regular comments (non doxygen syntax), and leave first line empty, and terminate with '*/', so above becomes: /* * physical address of vring, or virtual address */ This comment is for all comment code in all the series. It looks like there is a mixture of the usage.