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 BD360A034C; Wed, 21 Sep 2022 09:47:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 626EE40697; Wed, 21 Sep 2022 09:47:26 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2125.outbound.protection.outlook.com [40.107.243.125]) by mails.dpdk.org (Postfix) with ESMTP id A7ABD4014F for ; Wed, 21 Sep 2022 09:47:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GoWRzLKd2MuHBXjVWkvTaSNpZk8QtZbLY0oUxYS1q9Pmz5Npgfqqwqv6DjWAoJczg7DnEIRnDMQ1P6QGC44GyHQQu2QwpsEr4Ysy7MCZE4WzPnAAl0rzXixDCjI6XIUQGh2sgSQAqOXhJ1K73gXycZZhH8EgcUwPsjdKAdgzOWk96L0bTddq19Ab/uU6u1lwq/HuQA8DmiBI/Rq6y38eeSyYmjGdWgzJhJLn5UqL92fuEWACyj3dUWKiRstHTZLwmiWbPDO7q41jEjt5ZQxILuYSdEHW0TDOWluZO2FwCQrneYjN0+rwwDtm88sCBGWDOXxC6jgmJeSIYLzVdJR1fw== 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=/NW2NWINLFb4SKEQFXR8NcnLgaihs3V4URhMMfEYAeE=; b=Hp4X1tIl52NCw5OHaMdRdaplGKPik5KNT/lianhIZp5cYlXzen9bGrOsasbll/kDB42VhMBHFCa614g6rz6Ip0tL12nUEMwa+0AAvCt3DMo+VK2I+VeDBrVyDeGRuuNfsDDPDnL/KOioM3KZkP5NFrCQJQGoIlvtd/HAV02jD9GmzWPsuYlx61ddQ5S7kAWAmFCz5neb6myYgN2WkZdT/UOintsfGJpwbpSSIYb7zYiomYzVkSEhe/7ZxZtr5B7CMhU4YdXhMU36FxQ8+6aKwd4VETYb8ZQSO6qypKiA5h8nQj+qLc0HOCRHezZ4GcjCSZNRg1zAygwQLu4dVj2eUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/NW2NWINLFb4SKEQFXR8NcnLgaihs3V4URhMMfEYAeE=; b=pT7yNAbxf+9+vjpKwD2rb/BV+o2D7bvNv8HIdbhZfwHLJ/3QVKtco+VNYE6P1macvnlOClZVf/a2Olucf9ERiHkiEf9ytf4XzJYjPreAXapRYAI5xzH0ZaCiEq2pU+MYrLkN8MrYapySGh7u+WL1pVirFL3sdp9QhaK8ZQ+rnzs= Received: from PH0PR13MB5568.namprd13.prod.outlook.com (2603:10b6:510:12b::16) by PH0PR13MB5613.namprd13.prod.outlook.com (2603:10b6:510:142::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14; Wed, 21 Sep 2022 07:47:21 +0000 Received: from PH0PR13MB5568.namprd13.prod.outlook.com ([fe80::21a8:2a67:d4fb:bb3d]) by PH0PR13MB5568.namprd13.prod.outlook.com ([fe80::21a8:2a67:d4fb:bb3d%7]) with mapi id 15.20.5612.005; Wed, 21 Sep 2022 07:47:21 +0000 From: Chaoyong He To: Thomas Monjalon , Ferruh Yigit , "dev@dpdk.org" , Ian Stokes , David Marchand CC: oss-drivers , Niklas Soderlund , Andrew Rybchenko , Jerin Jacob Kollanukkaran Subject: RE: [PATCH v9 05/12] net/nfp: add flower PF setup logic Thread-Topic: [PATCH v9 05/12] net/nfp: add flower PF setup logic Thread-Index: AQHYyPAzPasg7FiNkUSHWOMIdTZQLq3ocKYAgAC6TWCAAFyvgIAAAgGQ Date: Wed, 21 Sep 2022 07:47:20 +0000 Message-ID: References: <1663238669-12244-1-git-send-email-chaoyong.he@corigine.com> <831874198.0ifERbkFSE@thomas> In-Reply-To: <831874198.0ifERbkFSE@thomas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR13MB5568:EE_|PH0PR13MB5613:EE_ x-ms-office365-filtering-correlation-id: bb31a73a-a878-4c11-a87e-08da9ba583d1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vcq3/3Kr6sbjhBsN70bvWJLgMqprmlD4YYvYAedQzwTZ4njURqeeqsiWDy/qUVWNvYERWGVHHn8MLkILvGDgoSnfte4htM5p8xb6EyL/jb0vj2pLaMWWcnGVWsG1Vqk/e6ITKaXpinqgxLIzBWbmQKHnUSXjUsE4GPI6iycWiB6GJ0FxxHAwjnukxUuzZx8mcXV1NYu15KJKExgZblpKF++eo67BwX1sCDc7RF5UXFg6LQ7lgZEA/SI7lvy4cKNPcZKuji8r9DMgrXlm8n2Mxyct4sAIo5FO7VnXs7krWrV/ne7SFIfUhgoE77kbhEnJgsx4yvWyQpcIgeRzcluHYCEwwFU2p6xCBwLph4GzGQ3Pshu/vM2yy7A1V3rjymyrrnyOiV5VDQ1G2Dmw3YNgkOBk9ba67HRq7fs0rtyG89WbdMxXPN5PxBtBgrG8KPLpkWeWsfHIt6ETbVCricR0/Kc3mkWvtfBZFRec8x+RpmUnohav+YpW74phYY9sG7HezU5vqV9QqLenB6v3R4r7ai/XyHM0GwEL12PAbQAoqRukQtT1i7YOlU8ofhDsuWoaZ4l3fkN81hqpQQchwGg46AUqFgPMl3gWKZGYRLfi5rtWAW2PQ/83nillGASQvlib4pqEv0nDjsZtd0XJ7Cwk43x+9ER8BxHJnS3bI23J56fRUcBTJegkUQD1lZndfrN6vvwj8diCPsYLGI8HaG6yS7P4GI0XbpujUe5CqmXAj9ct0+GgBwShViYP23wJ7snCN9yiy0YhM96rIvzlBPFLLQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR13MB5568.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(136003)(376002)(396003)(346002)(366004)(39830400003)(451199015)(83380400001)(2906002)(478600001)(54906003)(110136005)(44832011)(8676002)(76116006)(4326008)(66476007)(66556008)(316002)(33656002)(64756008)(66446008)(66946007)(5660300002)(41300700001)(71200400001)(86362001)(8936002)(52536014)(6506007)(7696005)(53546011)(9686003)(26005)(186003)(38070700005)(38100700002)(55016003)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9UygNY1Yp1lznEPdpAazb9j7ZNxu7jgw9A817NL67oBiZQL+J9lP4sYVBF2T?= =?us-ascii?Q?64WtvvBp6zaMOZvDdSoO6xBQEbSiXRXmILAA6eop4ur13VeaGcU0lm8WkLou?= =?us-ascii?Q?xKD0OwTYCKS59LTwZalgJyErqHw+Pick4QvuovpTqYjyagZaCzYwpLo9kMB3?= =?us-ascii?Q?m5xfnkkJWVfluAofiPaJ7eTu8U3XltqOmfofeRmD0V4v/rz9LWYkzOddFz55?= =?us-ascii?Q?BnupLW3xHfvWs+h2fgtUDIO8nLfN7RQWxs/hU6G8iZL5lv7IBNClj3gHJB5H?= =?us-ascii?Q?LKsNzKF8DDYywbkD959ll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ascii?Q?hf2mjIB8twKa9EE5W2TfrCdKb9j2NGUwZR9LnF8Ilzuhi4eAzQuYTfgK29E8?= =?us-ascii?Q?LFAjgHX+m+YOAZxJub52Ou6sfVOHXoIe12BKm/T1/LOowqyjezFGpfVt9ftC?= =?us-ascii?Q?RFI+dfaEUO0S7/dk2RwiwNvTCFg7QJDa70FH+c+x1YBvc3x8zlYSW6xF6++m?= =?us-ascii?Q?jrNc0EE7uV+ZDJhLOUzpc2W6xIxYSdPtbEXFHlcP+BspmWjs8qhngedIN0Ty?= =?us-ascii?Q?dx9BeUYIbRMg0XiECOSPHlOW+xcq2gb0zkSv3gxQjgOGC9d6RZuqgilUIycp?= =?us-ascii?Q?uttXG44E8XyrSqnfjdAUQgQoTeZZo1CBWRNp4HrPKV9qViiy7Ha/gkobIn1X?= =?us-ascii?Q?JBLyMxyAbtKef40UAIftsVDEjUFXQXpaknAemQEi?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB5568.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb31a73a-a878-4c11-a87e-08da9ba583d1 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2022 07:47:20.9498 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: B4UyVIIqyJXa3dx8nQ9RuDJM2U8KsBVMkbWRp/wuVzFA+KgxSKN1ZefQH2h3kqWjbSoWlS74MvxlN6gb4xREkoERlcjl6qSbTZtwCKs5UKY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB5613 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 > Subject: Re: [PATCH v9 05/12] net/nfp: add flower PF setup logic >=20 > I don't understand your logic fully, > but I understand you need special code to make your hardware work with > OvS, > meaning: > - OvS must have a special handling for your HW > - other applications won't work > Tell me I misunderstand, > but I feel we should not accept this patch, there is probably a better wa= y to > manage the specific of your HW. OvS need not do anything special handling for our HW. Other applications won't work -- Sorry I don't understand your mean at this= point. > You said "NFP PMD can work with up to 8 ports on the same PF device." > Let's imagine you have 8 ports for 1 PF device. > Do you allocate 8 ethdev ports? > If yes, then each ethdev should do the internal work, and nothing is need= ed > at application level. No, we still just create 1 PF vNIC to handle the feedback traffic. Of course we will 8 representor port for physical port. =20 > 21/09/2022 04:50, Chaoyong He: > > > On 9/15/2022 11:44 AM, Chaoyong He wrote: > > > Hi Chaoyong, > > > > > > Again, similar comment to previous versions, what I understand is > > > this new flower FW supports HW flow filter and intended use case is > > > for OvS HW acceleration. > > > But is DPDK driver need to know OvS data structures, like "struct > > > dp_packet", can it be transparent to application, I am sure there > > > are other devices offloading some OvS task to HW. > > > > > > @Ian, @David, > > > > > > Can you please comment on above usage, do you guys see any way to > > > escape from OvS specific code in the driver? > > > > Firstly, I'll explain why we must include some OvS specific code in the= driver. > > If we don't set the `pkt->source =3D 3`, the OvS will coredump like thi= s: > > ``` > > (gdb) bt > > #0 0x00007fe1d48fd387 in raise () from /lib64/libc.so.6 > > #1 0x00007fe1d48fea78 in abort () from /lib64/libc.so.6 > > #2 0x00007fe1d493ff67 in __libc_message () from /lib64/libc.so.6 > > #3 0x00007fe1d4948329 in _int_free () from /lib64/libc.so.6 > > #4 0x000000000049c006 in dp_packet_uninit (b=3D0x1f262db80) at > > lib/dp-packet.c:135 > > #5 0x000000000061440a in dp_packet_delete (b=3D0x1f262db80) at > > lib/dp-packet.h:261 > > #6 0x0000000000619aa0 in dpdk_copy_batch_to_mbuf > (netdev=3D0x1f0a04a80, > > batch=3D0x7fe1b40050c0) at lib/netdev-dpdk.c:274 > > #7 0x0000000000619b46 in netdev_dpdk_common_send > (netdev=3D0x1f0a04a80, > > batch=3D0x7fe1b40050c0, stats=3D0x7fe1be7321f0) at > > #8 0x000000000061a0ba in netdev_dpdk_eth_send (netdev=3D0x1f0a04a80, > > qid=3D0, batch=3D0x7fe1b40050c0, concurrent_txq=3Dtrue) > > #9 0x00000000004fbd10 in netdev_send (netdev=3D0x1f0a04a80, qid=3D0, > > batch=3D0x7fe1b40050c0, concurrent_txq=3Dtrue) at lib/n > > #10 0x00000000004aa663 in dp_netdev_pmd_flush_output_on_port > > (pmd=3D0x7fe1be735010, p=3D0x7fe1b4005090) at lib/dpif-netde > > #11 0x00000000004aa85d in dp_netdev_pmd_flush_output_packets > > (pmd=3D0x7fe1be735010, force=3Dfalse) at lib/dpif-netdev.c:5 > > #12 0x00000000004aaaef in dp_netdev_process_rxq_port > > (pmd=3D0x7fe1be735010, rxq=3D0x16f3f80, port_no=3D3) at lib/dpif-netde > > #13 0x00000000004af17a in pmd_thread_main (f_=3D0x7fe1be735010) at > > lib/dpif-netdev.c:6958 > > #14 0x000000000057da80 in ovsthread_wrapper (aux_=3D0x1608b30) at > > lib/ovs-thread.c:422 > > #15 0x00007fe1d51a6ea5 in start_thread () from /lib64/libpthread.so.0 > > #16 0x00007fe1d49c5b0d in clone () from /lib64/libc.so.6 ``` The logic > > in function `dp_packet_delete()` run into the wrong branch. > > > > Then, why just our PMD need do this, and other PMDs don't? > > Generally, it's greatly dependent on the hardware. > > > > The Netronome's Network Flow Processor 4xxx (NFP-4xxx) card is the > target card of these series patches. > > Which only has one PF but has 2 physical ports, and the NFP PMD can wor= k > with up to 8 ports on the same PF device. > > Other PMDs hardware seems all 'one PF <--> one physical port'. > > > > For the use case of OvS, we should add the representor port of 'physica= l > port' to the bridge, not the representor port of PF like other PMDs. > > > > We use a two-layer poll mode architecture. (Other PMDs are simple poll > > mode architecture) In the RX direction: > > 1. When the physical port or vf receives pkts, the firmware will prepen= d a > meta-data(indicating the input port) into the pkt. > > 2. We use the PF vNIC as a multiplexer, which keeps polling pkts from t= he > firmware. > > 3. The PF vNIC will parse the meta-data, and enqueue the pkt into the > corresponding rte_ring of the representor port of physical port or vf. > > 4. The OVS will polling pkts from the RX function of representor port, = which > dequeue pkts from the rte_ring. > > In the TX direction: > > 1. The OVS send the pkts from the TX functions of representor port. > > 2. The representor port will prepend a meta-data(indicating the output > port) into the pkt and send the pkt to firmware through the queue 0 of PF > vNIC. > > 3. The firmware will parse the meta-data, and forward the pkt to the > corresponding physical port or vf. > > > > So the OvS won't create the mempool for us and we must create it > ourselves for the PF vNIC to use. > > > > Hopefully, I explained the things clearly. Thanks. >=20 >=20