From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 77B505905 for ; Thu, 28 Aug 2014 15:42:44 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 28 Aug 2014 06:33:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,418,1406617200"; d="scan'208";a="594555871" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 28 Aug 2014 06:39:58 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 28 Aug 2014 06:39:57 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 28 Aug 2014 06:39:57 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.17]) by shsmsx102.ccr.corp.intel.com ([169.254.2.246]) with mapi id 14.03.0195.001; Thu, 28 Aug 2014 21:39:55 +0800 From: "Wu, Jingjing" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v2 2/7] ethdev: define new ethdev API rx_classification_filter_ctl Thread-Index: AQHPwZyfQaobU/kb/0yOC0EzU412AZvj+3OAgAFZloD///7jAIAAq21Q Date: Thu, 28 Aug 2014 13:39:54 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F8ADC20D@SHSMSX104.ccr.corp.intel.com> References: <1409105634-29980-1-git-send-email-jingjing.wu@intel.com> <3024593.z48vgEy6Ts@xps13> <9BB6961774997848B5B42BEC655768F8ADBEF0@SHSMSX104.ccr.corp.intel.com> <1793573.SnjKVZ6loZ@xps13> In-Reply-To: <1793573.SnjKVZ6loZ@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 2/7] ethdev: define new ethdev API rx_classification_filter_ctl X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Aug 2014 13:42:45 -0000 Hi, Thomas Please see my comments below.=20 Thanks a lot. > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Thursday, August 28, 2014 6:56 PM > To: Wu, Jingjing > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 2/7] ethdev: define new ethdev API > rx_classification_filter_ctl >=20 > 2014-08-28 03:30, Wu, Jingjing: > > We want to implement several common API for NIC specific features, > > to avoid creating quite a lot of ops in 'struct eth_dev_ops'. > > The idea came from ioctl. >=20 > The approach can be interesting. Yes, we have discussed this approach inside. And some other Fortville Features are also based on it, such as RSS hash function support, mac vlan filters. Maybe it a good chance to discuss in open forum now. >=20 > > Because about flow director feature, there is large gap between i40e > > and ixgbe. The existed flow director APIs looks specific to IXGBE, > > so I choose this new API to implement i40e's flow director feature. >=20 > The API is not OK for you so you create another one. > I'm OK to change APIs but you should remove the old one, or at least, > implement your new API in existing drivers to allow deprecation of the > old API. > I think it would help if you start by doing ixgbe work and then apply it > to i40e. >=20 Yes, it will be perfect if we can use this new API to achieve flow director= =20 setting all types of NICs. But the concern is downward compatibility.=20 Users who is planning update DPDK version need to change their code to adapt such changes. That's why we choose a new API instead of modifying current APIs. And=20 Of course, the ideal plan is adding such XXX_ctl function in Ixgbe and Igb to moving smoothly without removing current APIs. I'm not sure whether I understanding correctly about the importance of compatibility.=20 > > The API is like below: > > typedef int (*eth_rx_classification_filter_ctl_t)(struct rte_eth_dev *d= ev, > > enum rte_eth_command cmd, > > void *arg); > > Define a head file called rte_i40e.h in lib/librte_pmd_i40e, which cont= ains > > the definition about structures specific to i40e, linked to the arg > > parameters above. > > Define a head file called rte_eth_features.h in lib/librte_ether, which > > contains the commands' definition linked to cmd parameters above. >=20 > Why creating a rte_eth_features.h? Don't you think rte_ethdev.h is a good= place? >=20 > > And if user want to use i40e specific features, then the head file > > rte_i40e.h need to be included user's application, for example, test-pm= d. > > And user can encode these structures and call XXX_ctl API to configure > > their features. >=20 > OK, but the question is to know what is a specific feature? > I don't think flow director is a specific feature. We shouldn't have > to care if port is i40e or ixgbe to setup flow director. > Is it possible to have a common API and maybe an inheritance of the > common structure with PMD specific fields? >=20 Yes, flow director is not a specific feature. Even ixgbe and i40 use the sa= me=20 name. But the context and key have much difference. That's why I called it specific. > Example: >=20 > struct fdir_entry { > fdir_input input; > fdir_action action; > enum rte_driver driver; > }; > fdir_entry_generic fdir_entry =3D {.driver =3D RTE_DRIVER_GENERIC}; > filter_ctl(port, FDIR_RULE_ADD, fdir_entry); >=20 > struct i40e_fdir_entry { > struct fdir_entry generic; > i40e_fdir_input i40e_input; > }; >=20 > So i40e_input will be handled by the PMD if driver =3D=3D RTE_DRIVER_I40E= . >=20 > It's just an idea, comments are welcome. Yes, it's a good idea about an inheritance of the common structure. I think= it may support new NIC integration in future. We can do it with the new API=20 architecture. But the concern is still how to be compatible with old versio= n. > -- > Thomas