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 4313F5930 for ; Thu, 24 Jul 2014 10:47:42 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 24 Jul 2014 01:43:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,722,1400050800"; d="scan'208";a="548283655" Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36]) by orsmga001.jf.intel.com with ESMTP; 24 Jul 2014 01:49:07 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.19.9.29) by FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 24 Jul 2014 01:49:07 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx120.amr.corp.intel.com (10.19.9.29) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 24 Jul 2014 01:49:07 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.204]) by shsmsx102.ccr.corp.intel.com ([169.254.2.120]) with mapi id 14.03.0123.003; Thu, 24 Jul 2014 16:49:05 +0800 From: "Zhang, Helin" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH 2/5] ethdev: add new ops of 'check_command_supported' and 'rx_classification_filter_ctl' Thread-Index: AQHPpxTpD7BvbobRU0iF6EBVBYBd5Zuu50Ug Date: Thu, 24 Jul 2014 08:49:04 +0000 Message-ID: References: <1406184149-11531-1-git-send-email-helin.zhang@intel.com> <1406184149-11531-3-git-send-email-helin.zhang@intel.com> <1794712.d8vW817aRs@xps13> In-Reply-To: <1794712.d8vW817aRs@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 2/5] ethdev: add new ops of 'check_command_supported' and '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, 24 Jul 2014 08:47:42 -0000 > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Thursday, July 24, 2014 3:57 PM > To: Zhang, Helin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 2/5] ethdev: add new ops of > 'check_command_supported' and 'rx_classification_filter_ctl' >=20 > 2014-07-24 14:42, Helin Zhang: > > Two ops of 'check_command_supported' and 'rx_classification_filter_ctl' > > are added. > > * 'check_command_supported' is for capability discovery. In anothoer > > word, it is to check if specific feature/command is supported by > > the specific port. >=20 > This generic service is really needed to add NIC-specific functions. > I'd suggest to name it "is_supported". >=20 I tried to name it as the same style of rte_cpu_check_supported(). As you indicated, 'is_commmand_supported' might be a better name. > > * 'rx_classification_filter_ctl' is for receive classifcation filter > > configuring. e.g. hash function configuration, flow director > > configuration. It is a common API where a lot of commands can > > be implemented for different sub features. >=20 > Not sure about this one. You are hiding specific API in an opaque structu= re. > By the way, it should be in another patch. >=20 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. > > +/** > > + * Check if the command is supported by an Ethernet device. > > + * > > + * @param port_id > > + * The port identifier of the Ethernet device. > > + * @param cmd > > + * The command. > > + * > > + * @return > > + * - (> 0) The command is supported. > > + * - (0) The command is not supported. > > + * - (-ENOTSUP) if hardware doesn't support. > > + * - (-ENODEV) if is invalid. > > + */ > > +int rte_eth_dev_check_command_supported(uint8_t port_id, uint32_t > cmd); >=20 > What are the possible commands? > You should define enum/constants here. >=20 The idea came from ioctl(). Enum could be a choice. The commands was define= d in rte_eth_features.h. Comments should be added here for telling that. > -- > Thomas