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 4A91741E09; Tue, 7 Mar 2023 15:11:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFDE440EDB; Tue, 7 Mar 2023 15:11:31 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2085.outbound.protection.outlook.com [40.107.94.85]) by mails.dpdk.org (Postfix) with ESMTP id 38B2B4067B for ; Tue, 7 Mar 2023 15:11:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ByV+tVXrI1eNztTbt88e+wf3ypmFOpHqXWzZEyTKVPpGno1+d7L7nGsjeSGhlnkLX1mFnY8HehjlvFrnBZnh22JHKBKfT6QxiKALTM3BsnpVu/v85PkEPLMoecO5T4VM8okb28DoVC1LHWaDGwbwcjUHM94gBK9xeQE02WGlG3c4g/bCOmSyHxz4D1eIPF+0yQ6aLCVOqNnpJzAaconpN1bNogGPJ8FMAO+NVsMtpcuoUlYcnK8QFO/IuZ6GekSWsbQkIImyjIderWPj/okpxoamRJgZnqwXTP6EY7khsD4rU3/2YJk1A9nCVPpWfrwoFGtmH7I+yY+kbHcrA63NkQ== 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=TT7wy62kJ9IdOdBGI3J+OmTzaTtQ0ZqbZK/Gw/KCEGQ=; b=gTrjb8JJXhTGWQL71GYe50wZEbvVNgc8qnzltwNCA7CIcAy8bZ36wHXLnneuoHuXPqhOmt/kGtdhAVtZGzRQ7Imz4scfLdP8CODYkzvdYudsV0exZMkxpoWLzu0IoMmAkbX2vRIYITJF9UIXdfk/mLXxjyRkM0OP0/ltlE9NtZVtWuXvBQtZR9Ap5KqhbZ0HvHBHWLnDsYZxQUYiX5nRyCxgqliRpWiU7MKHLMiyt7N+kQdEQhF0PEcHRSmoFLagDpEw5wObgAxv+TVbXOStJJvF+X567QB5+VPZxAKHL9q4nTHsaMD5ja1GUOFOsbZcqLiIsYvwj1Qc3sT4hy68Sw== 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=TT7wy62kJ9IdOdBGI3J+OmTzaTtQ0ZqbZK/Gw/KCEGQ=; b=DeGjDgRJmShjQXQoTKfYfCRgquTa/ugO0Q15tEgaeIRiODkxz5+dTXtAtBQfFKECBXcbCDi3hUq54iAeOg6DNs51voYFYJhF4Dua280Wj69L7I5a5cGY3ky0onHylQeJhRycupFgOzX6/HSu2uTGqU5IDRJGq6qF2auDh543sCE= 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 DM4PR12MB5724.namprd12.prod.outlook.com (2603:10b6:8:5f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Tue, 7 Mar 2023 14:11:27 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640%4]) with mapi id 15.20.6156.029; Tue, 7 Mar 2023 14:11:27 +0000 Message-ID: <1d8452f4-d507-0f62-b595-b1f9e67242ce@amd.com> Date: Tue, 7 Mar 2023 14:11:20 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Mingxia Liu , beilei.xing@intel.com, yuying.zhang@intel.com, Raslan Darawsheh References: <20230302103527.931071-1-mingxia.liu@intel.com> <20230302212057.1114863-1-mingxia.liu@intel.com> <20230302212057.1114863-2-mingxia.liu@intel.com> Cc: dev@dpdk.org From: Ferruh Yigit Subject: Re: [PATCH v9 01/21] net/cpfl: support device initialization In-Reply-To: <20230302212057.1114863-2-mingxia.liu@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0455.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::10) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM4PR12MB5724:EE_ X-MS-Office365-Filtering-Correlation-Id: ff9938f0-f0b4-40b8-0b5a-08db1f15d762 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wPZ0Za04f5BrS3Oh8Tu64a5CV1i2XUFRUssKFD37zujjHmxKYU05lqkS7779VRcuGkxa4sMX66DmfpD4U7YrwpkETJpuKdT+XYQrL+qUNtWRzA3YjFrfl8kGUVlYLGp6OKTgNebZuvZ9Ekd/AOTRYUrIOD6FORBzIxPCu0mYbRPj0zNVMJavHluDqBk2ioI7MCot4VwFra11tpd6oyQhrUhndBKye7pwMWMCGB60cNxo6k0yKikHskjDOH5CTTYMUfgqL0PwvF2ed98TnNfxIAjXiX2qZ/MTRJeQNLzfmwKwwAwQy1NGtPMkmmO+z7820V+Op3g0PJCHoBU3NcJ0BRJxaZvUzy+LXvrXwrwaLfHMmFxwAhtzVcUh9FUVTS0f6zKP2MrMkkTZpCqPUOsvOkGitoIoJV3I4Z/ngtgWEAijNkwnjMFA3dh3qfuRg5R1gD89DvQhFoWQqirBwV1iI/zKz0MFXw0ZRJLn8GnJiCk0J7QVR2p6IkPlZnn3utDSc3xeoHHD+saKXTQO3M7x5u8gOYDYKwnCvI+IPgV61ZKzE9N2Aa5Bn42FJ6E6edrjrr7G/iJ+yPqld7Lu7CdSjis//EVK8rMEdFNnnvKFOU+31JZTHRwe+yg7Loiv4wazrXykurGAOazKpXi0PWq4IYRdxEv5fyTn3HsF70zwvFMBes8m+gBJbe3QoBaxE70JBFODjc917fJztwVTs0NxSV4F5Fgz//pWkPFKxnJAxyY= 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:(13230025)(4636009)(346002)(136003)(396003)(39860400002)(376002)(366004)(451199018)(31686004)(83380400001)(36756003)(478600001)(38100700002)(316002)(5660300002)(6666004)(6512007)(6486002)(2616005)(41300700001)(53546011)(26005)(110136005)(6506007)(186003)(66476007)(44832011)(2906002)(8936002)(66556008)(31696002)(66946007)(4326008)(8676002)(86362001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WGM2RWV6ajhlaG5nMGZtUEx5cUlXS0VTcERWNmdSMnJaRE9CWkcreWE5VGxq?= =?utf-8?B?QWNxQ3IxUnF4VnJuZlBkeVFzckZSb2lONkxlejh4Z0prVUc1Y0NGMGJwQUFi?= =?utf-8?B?ZXRQRGpWUlp0K3hmSFAwQ1JlZ3hCdFlyMm5CamJiWjdScmM3bjQ1TDZRV0xm?= =?utf-8?B?aHQ4Z3BaOFZTMWtTdlozQzNmNzlpWU9WS2trK3R0M0tKQk80TGM1Tlc1Q2x1?= =?utf-8?B?UFpQcmNnMnhY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3d5?= =?utf-8?B?NTZ4R0djdGNKWEY0Tk5yb0RTOVVPeVlCa1YyclZDNEVoRHNkRVJxZXh3RktI?= =?utf-8?Q?BiJF/rledSFBWybQ5XAT9dhmM?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff9938f0-f0b4-40b8-0b5a-08db1f15d762 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 14:11:27.3701 (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: y4ShQztWAjERzYvV6j6YiotQCUwd9QrBr7L4vRtNNkPyGDnilMVGmhxzD1uCSIb7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5724 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 3/2/2023 9:20 PM, Mingxia Liu wrote: > Support device init and add the following dev ops: > - dev_configure > - dev_close > - dev_infos_get > - link_update > - dev_supported_ptypes_get > > Signed-off-by: Mingxia Liu <...> > +static void > +cpfl_handle_virtchnl_msg(struct cpfl_adapter_ext *adapter) > +{ > + struct idpf_adapter *base = &adapter->base; > + struct idpf_dma_mem *dma_mem = NULL; > + struct idpf_hw *hw = &base->hw; > + struct virtchnl2_event *vc_event; > + struct idpf_ctlq_msg ctlq_msg; > + enum idpf_mbx_opc mbx_op; > + struct idpf_vport *vport; > + enum virtchnl_ops vc_op; > + uint16_t pending = 1; > + int ret; > + > + while (pending) { > + ret = idpf_vc_ctlq_recv(hw->arq, &pending, &ctlq_msg); > + if (ret) { > + PMD_DRV_LOG(INFO, "Failed to read msg from virtual channel, ret: %d", ret); > + return; > + } > + > + memcpy(base->mbx_resp, ctlq_msg.ctx.indirect.payload->va, > + IDPF_DFLT_MBX_BUF_SIZE); > + > + mbx_op = rte_le_to_cpu_16(ctlq_msg.opcode); > + vc_op = rte_le_to_cpu_32(ctlq_msg.cookie.mbx.chnl_opcode); > + base->cmd_retval = rte_le_to_cpu_32(ctlq_msg.cookie.mbx.chnl_retval); > + > + switch (mbx_op) { > + case idpf_mbq_opc_send_msg_to_peer_pf: > + if (vc_op == VIRTCHNL2_OP_EVENT) { Raslan reported following build error [1], 'VIRTCHNL2_OP_EVENT' is not an element of "enum virtchnl_ops", can you please check? I guess there are a few options, have a new enum for virtchnl2, like "enum virtchnl2_ops" which inlucde all 'VIRTCHNL2_OP_', OR use 'uint32_t' type (instead of "enum virtchnl_ops") when 'VIRTCHNL2_OP_' opcodes can be used, this seems simpler. BTW, this is same in the idfp driver. [1] drivers/libtmp_rte_net_cpfl.a.p/net_cpfl_cpfl_ethdev.c.o -c ../../root/dpdk/drivers/net/cpfl/cpfl_ethdev.c ../../root/dpdk/drivers/net/cpfl/cpfl_ethdev.c:1118:14: error: comparison of constant 522 with expression of type 'enum virtchnl_ops' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (vc_op == VIRTCHNL2_OP_EVENT) { ~~~~~ ^ ~~~~~~~~~~~~~~~~~~ 1 error generated.