From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id BDD652BFF for ; Fri, 7 Jul 2017 08:21:06 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 06 Jul 2017 23:21:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,320,1496127600"; d="scan'208";a="124243004" Received: from nikhilr-mobl.amr.corp.intel.com (HELO [10.106.152.149]) ([10.106.152.149]) by fmsmga006.fm.intel.com with ESMTP; 06 Jul 2017 23:21:02 -0700 To: Jerin Jacob Cc: gage.eads@intel.com, dev@dpdk.org, thomas@monjalon.net, bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, narender.vangati@intel.com, Abhinandan Gujjar References: <29140c16-909a-1b9a-7391-481f900bd13c@intel.com> <1499377952-5306-1-git-send-email-nikhil.rao@intel.com> <20170706141829.GA5260@jerin> From: "Rao, Nikhil" Message-ID: <02aef899-da84-9281-e4a4-2871237ea20e@intel.com> Date: Fri, 7 Jul 2017 11:51:01 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170706141829.GA5260@jerin> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/2] eventdev: add event adapter for ethernet Rx queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jul 2017 06:21:07 -0000 On 7/6/2017 7:48 PM, Jerin Jacob wrote: > -----Original Message----- >> Date: Fri, 7 Jul 2017 03:22:31 +0530 >> From: Nikhil Rao >> To: jerin.jacob@caviumnetworks.com >> CC: gage.eads@intel.com, dev@dpdk.org, thomas@monjalon.net, >> bruce.richardson@intel.com, harry.van.haaren@intel.com, >> hemant.agrawal@nxp.com, nipun.gupta@nxp.com, narender.vangati@intel.com, >> Nikhil Rao , Abhinandan Gujjar >> >> Subject: [PATCH 1/2] eventdev: add event adapter for ethernet Rx queues >> X-Mailer: git-send-email 2.7.4 >> >> Signed-off-by: Abhinandan Gujjar >> --- > > Thanks Nikhil for the patch. > > Looks like you missed this email? > http://dpdk.org/ml/archives/dev/2017-June/068142.html > > Can we make it as function pointer based approach(keeping all adapter functions > function prototype required for SW PMD) so that each PMD > can register the ops for adapter_create etc so that same API can be used > for software and hardware PMDs(the scheme like rte_flow() or rte_tm() > approach) > > Can discuss more on that to finalize the approach? >>Yes, I did miss that email :-( (I am including the relevant extract below) > > /* adapter has inbuilt port, no need to create producer port */ > #define RTE_EVENT_ETHDEV_CAP_INBUILT_PORT (1ULL << 0) > /* adapter does not need service function */ > #define RTE_EVENT_ETHDEV_CAP_NO_SERVICE_FUNC (1ULL << 1) > > struct rte_event_eth_rx_adap_info { > char name[32]; > uint32_t adapter_cap; > /**< Ethdev RX adapter capabilities(RTE_EVENT_ETHDEV_CAP_)*/ > } > > > struct rte_event_eth_rx_adap_cfg { > uint8_t rx_event_port_id; > /**< Event port identifier, the adapter enqueues mbuf events to this > * port, Ignored when RTE_EVENT_ETHDEV_CAP_INBUILT_PORT > */ > > } > > struct rte_eth_rx_event_adapter_queue_config { > uint32_t rx_queue_flags; > /**< Flags for handling received packets */ > uint16_t servicing_weight; > /**< Relative polling frequency of ethernet receive queue, if this > * is set to zero, the Rx queue is interrupt driven > * Ignored if RTE_EVENT_ETHDEV_CAP_NO_SERVICE_FUNC set > */ > struct rte_event ev; > /**< > * The values from the following event fields will be used when > * enqueuing mbuf events: > * - event_queue_id: Targeted event queue ID for received packets. > * - event_priority: Event priority of packets from this Rx queue in > * the event queue relative to other events. > * - sched_type: Scheduling type for packets from this Rx queue. > * - flow_id: If the RTE_ETH_RX_EVENT_ADAPTER_QUEUE_FLOW_ID_VALID bit > * is set in rx_queue_flags, this flow_id is used for all > * packets received from this queue. Otherwise the flow ID > * is set to the RSS hash. > */ > }; > > int rte_event_eth_rx_adapter_create(uint8_t id, uint8_t dev_id, uint8_t eth_port_id); > int rte_event_eth_rx_adapter_get_info(uint8_t id, struct rte_event_eth_rx_adap_info *info); > int rte_event_eth_rx_adapter_configure(uint8_t id, struct rte_event_eth_rx_adap_config *cfg); > int rte_event_eth_rx_adapter_queue_add(uint8_t id, int32_t rx_queue_id, const struct rte_eth_rx_event_adapter_queue_config *config); > int rte_event_eth_rx_adapter_queue_del(uint8_t id, int32_t rx_queue_id) > int rte_event_eth_rx_adapter_run(); > int rte_event_eth_rx_adapter_free(uint8_t id); > If I understood your idea, the function pointer struct would look something like this. struct rte_eventdev_rx_adapter_ops { rx_adapter_create_t create, rx_adapter_get_info_t info, rx_adapter_configure_t configure, rx_adapter_queue_add_t queue_add, rx_adapter_queue_del_t queue_del, rx_adapter_queue_free_t queue_free, rx_adapter_free_t free }; struct rte_eventdev { .. const struct rte_eventdev_rx_adapter_ops *rx_adapter_ops; .. }; int rte_event_eth_rx_adapter_create(uint8_t id, uint8_t dev_id, uint8_t eth_port_id) { eventdev_ops = ... /* access through dev_id */ void *priv; uint64_t cap; if (eventdev_ops->rx_adapter_ops) { rc = eventdev_ops->rx_adapter_ops->rx_adapter_create(dev, &priv, eth_port_id, &caps)) } if (!rc) { /* eventdev adapter for eth_port_id -> dev_id */ rx_adapter[id].info.adapter_cap = RTE_EVENT_ETHDEV_CAP_NO_SERVICE_FUNC | caps ; } else { /* create SW adapter for eth_port_id->dev_id */ rx_adapter[id].info.adapter_cap = 0; } } According to the code above rx_adapter_get_info should be able to fill in RTE_EVENT_ETHDEV_CAP_INBUILT_PORT after rx_adapter_create, so that info() can retrieve it. But from previous emails (see struct rte_event_dev_producer_conf below), it appears that the rx queue id and event information would be needed to create the adapter that enqueues from the ethdev queue id to the event pmd, however that information is available only at queue add time - thoughts ? +struct rte_event_dev_producer_conf { + uint32_t event_type:4; + /**< Event type to classify the event source. + * @see RTE_EVENT_TYPE_ETHDEV, (RTE_EVENT_TYPE_*) + */ + uint8_t sched_type:2; + /**< Scheduler synchronization type (RTE_SCHED_TYPE_*) + * associated with flow id on a given event queue for the enqueue + * operation. + */ + uint8_t priority; + /**< Event priority relative to other events in the + * event queue. The requested priority should in the + * range of [RTE_EVENT_DEV_PRIORITY_HIGHEST, + * RTE_EVENT_DEV_PRIORITY_LOWEST]. + * The implementation shall normalize the requested + * priority to supported priority value. + * Valid when the device has + * RTE_EVENT_DEV_CAP_EVENT_QOS capability. + */ + union { + struct rte_event_ethdev_producer { + uint16_t ethdev_port; + /**< The port identifier of the Ethernet device */ + int32_t rx_queue_id; + /**< The index of the receive queue from which to + * retrieve the input packets and inject to eventdev. + * The value -1 denotes all the Rx queues configured + * for the given ethdev_port are selected for retrieving + * the input packets and then injecting the + * events/packets to eventdev. + * The rte_eth_rx_burst() result is undefined + * if application invokes on bounded ethdev_port and + * rx_queue_id. + */ + } ethdev; /* RTE_EVENT_TYPE_ETHDEV */ + /**< Valid when event_type == RTE_EVENT_TYPE_ETHDEV. + * Implementation may use mbuff's rss->hash value as + * flow_id for the enqueue operation. + */ + }; +};