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 0E8A1A0540; Fri, 9 Sep 2022 14:13:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D140C40A7E; Fri, 9 Sep 2022 14:13:11 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 8B7E34003F for ; Fri, 9 Sep 2022 14:13:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZAnkYolAJP99jh34LhFQ10Og4J5gYns/kYLWJ1k1QoB39AtJtCh8OEs4iyh41g7Z8DFMb0jOR9LoFJTbKZiqMBLypmqvy7ZLbW64XK8qbqGuSPLewxlGDCJ3o5nJFvpD4cxHsgat878+id9k1WuZjevxLB4GTmwuJIfatGsSBiQxchH4qB+24JLkHdmrt3n87UQio0EJruS4FhdRtGCNu07/Zccz0p4T3C5yL5Ah1vh63bhSrcubpuISf64dfEA+mykvh/oa806jn/0eLmpp8az1Kun4blMZgj9l0JcAgsVZBpnM2lAIpBlcvfzgLKlhrBZv+ZF/1r36zz4u09noGw== 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=UYsRIkSoBTazE+1oPcDWnimnak6t6/EVJqUCUV5Su7g=; b=nUvFttIaamn1RIrvnVvfyzvNFVRrmvBxvl0j+p6hleJUCOOiqgRF6F18JLb9KIqWASY5bj+KkFHZ6qvZ6eC3zktyiBmGIxU2q7tjF4r2EsgnuohhF8FurfWBPSzr7+rHLr8BRx0tdgtCcqlWzgBJh6qa4IzJyxXmKcR6ea4b4EAQC/IYajWGPjd6VeHN4fPabpyE0B+SkiY7DiEWtSGWiQAtpA8UqxzIkn7JtC8OLbo2L1hr/Q5mFnHSxmX3tX8liK7+60PKu8lKm88x2eNk2HxBCQbS4y+UiJMToUzzJOZ8GyWkoI4qNkz2/clT8FuNB9Yim2TAMHtpmWbVU8YUGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=corigine.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UYsRIkSoBTazE+1oPcDWnimnak6t6/EVJqUCUV5Su7g=; b=kVOGl5vj3waT04wQXWbfsMZMVNmGOyUHJxXgAyiX547MvAUD8QyqzTfCU9+HKacaf7QAJItR9DLl0xY6mAXsx6XrrAajoT4C1hSRzYyIWV0NDo051QK9xHp4I60kYMq0qu8C7oqXoTq4W+vfSvZfwuEldW/xIBaYCVryXW0/dkw= Received: from SA0PR11CA0124.namprd11.prod.outlook.com (2603:10b6:806:131::9) by DM4PR02MB8957.namprd02.prod.outlook.com (2603:10b6:8:be::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Fri, 9 Sep 2022 12:13:07 +0000 Received: from SN1NAM02FT0013.eop-nam02.prod.protection.outlook.com (2603:10b6:806:131:cafe::b5) by SA0PR11CA0124.outlook.office365.com (2603:10b6:806:131::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12 via Frontend Transport; Fri, 9 Sep 2022 12:13:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch01.xlnx.xilinx.com; pr=C Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by SN1NAM02FT0013.mail.protection.outlook.com (10.97.4.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Fri, 9 Sep 2022 12:13:07 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 13:13:05 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Fri, 9 Sep 2022 13:13:05 +0100 Envelope-to: chaoyong.he@corigine.com, david.marchand@redhat.com, ian.stokes@intel.com, oss-drivers@corigine.com, niklas.soderlund@corigine.com, dev@dpdk.org Received: from [10.71.194.74] (port=19866) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1oWcsb-00045J-Oo; Fri, 09 Sep 2022 13:13:05 +0100 Message-ID: Date: Fri, 9 Sep 2022 13:13:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH v8 05/12] net/nfp: add flower PF setup logic Content-Language: en-US To: Chaoyong He , David Marchand , Ian Stokes CC: oss-drivers , Niklas Soderlund , "dev@dpdk.org" References: <1662626702-17254-1-git-send-email-chaoyong.he@corigine.com> <1662626702-17254-6-git-send-email-chaoyong.he@corigine.com> <49888fb1-e16a-9d55-9855-7e7807922dea@xilinx.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1NAM02FT0013:EE_|DM4PR02MB8957:EE_ X-MS-Office365-Filtering-Correlation-Id: 93c30c0b-eb36-4660-55a3-08da925ca7b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eL50wJUSy/N5Ty8KzqF2gEqEphCSyjCLb6wD+aDPKw2MqkpMUJXLEQXvVzLVMdcIS0Z5QPzmoct8JZj7jOTIZzV+A7VUsE5j5x0KTg48OJEe5ohS0pWS0CbVLWruiWqktKgDqIQ6rLiX0pvfhhfIxWYZxOWsxYV08Ahqbx6VRos5i7PnD63401UHHcewQ8XiWnGU4Vz3rJKPd0Jnf5zvZR1LvYSGrLT6PWjgDUWnF5+hYB40eUX9/VM0YKvfxKavsMiunYvfx7AoAeqgcBZxMXzipJxoCOwFV3S1kOQlnx44bhrk0CYhLp1wOm9RdyjQbFKTaYdpg3hUqqikP1zpnErZZQ6ChDNtyy4hrmQOqDh11ugVceFiJPkBUYqQY9LgAZD5+LL6UYK+NnR9APInmx37KqmjBULnUZZxz/pkxGK0VNxImbVROnL/EIhQtw6Yw+RdXtinSHjt/fP5WSfJUO8uBPLthGlVhz8kRGSpxMpUsInBosde7fqua4mZf2TZHFY97xuybLBYaWqIXxctslykUeAJYBZzYagSFCrgxHE7MBNyhX3wyvw6UM7Y2YcntX5ILzEVVzCsBKKoV7NysD5idZYoozD7vfvihy9twdH5K5iF0WvxvtFATvZOUJqYxYPXGv1YOoana0VJimdQiyukjWqeI0Gh/zzVtSWLM6vFrj2EwTS1wItDmumra+2nki6wp9teFcPpZ+z9Ha8pSlzIDj7WhKU8a8Fs5992e07VYTJG/yzw9DfM2Y2469EC3c2hKjMjFeQqR3G11VUsHhwFipi7LU1aPj0emxYdHYSGZF2TxZ7ymYwJYvenknUb3AHlxvlz7LDoBFuW5sy7hw== X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(376002)(396003)(39860400002)(346002)(136003)(36840700001)(40470700004)(46966006)(8676002)(478600001)(426003)(4326008)(70586007)(70206006)(44832011)(31696002)(9786002)(336012)(2906002)(40460700003)(53546011)(186003)(26005)(47076005)(8936002)(2616005)(41300700001)(82310400005)(36756003)(7636003)(110136005)(356005)(82740400003)(31686004)(316002)(5660300002)(54906003)(40480700001)(36860700001)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2022 12:13:07.2262 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93c30c0b-eb36-4660-55a3-08da925ca7b4 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0013.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR02MB8957 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/9/2022 3:36 AM, Chaoyong He wrote: >> On 9/8/2022 9:44 AM, Chaoyong He wrote: >>> Adds the vNIC initialization logic for the flower PF vNIC. The flower >>> firmware exposes this vNIC for the purposes of fallback traffic in the >>> switchdev use-case. >>> >>> Adds minimal dev_ops for this PF device. Because the device is being >>> exposed externally to DPDK it should also be configured using DPDK >>> helpers like rte_eth_configure(). For these helpers to work the flower >>> logic needs to implements a minimal set of dev_ops. >>> >>> Signed-off-by: Chaoyong He >>> Reviewed-by: Niklas Söderlund >>> --- >>> drivers/net/nfp/flower/nfp_flower.c | 398 >> ++++++++++++++++++++++++- >>> drivers/net/nfp/flower/nfp_flower.h | 6 + >>> drivers/net/nfp/flower/nfp_flower_ovs_compat.h | 37 +++ >> >> Can you please detail why OVS specific header is required? Having application >> specific code in PMD can be sign of some design issue, that is why can you >> please explain more what it does? >> > > Basically, there exist two layers polling mode to move a pkt from firmware to OVS. > > When our card using flower application firmware receive pkt and find the pkt can't be offloaded, > it will record the input port in a place of the pkt, we call it metadata. > > There exist a rte_ring for each representor port. > > We use the pf device as a multiplexer, which keeps polling pkts from the firmware. > Based on the metadata, it will enqueue the pkt into the rte_ring of the corresponding representor port. > > On the OVS side, it will keeps try to dequeue the pkt from the rte_ring of the representor port. > Once it gets the pkt, the OVS will go its logic and treat the pkt as `struct dp_packet`. > > So we copy the definition of `struct dp_packet` from OVS to prevent the coredump caused by memory read/write out of range. > > Another possible way is defining a big enough mbuf_priv_len using macro to prevent this structure definition from OVS. > Is this the right way? > Thanks for clarification. PMD is creating a mempool to hold 'struct dp_packet', that is why it is duplicating OvS 'struct dp_packet' struct definition to DPDK. But many PMDs are used with OvS, why only nfp need to duplicate the struct or create OvS specific mempool? Having application specific code in driver looks wrong anyway. @Ian, @David, Can you please help on OvS related change in the driver? What is the proper way to support it? Thanks, ferruh