[dpdk-dev,v3,2/4] eventdev: Add eth Rx adapter caps callback to SW evdev

Message ID 1505219369-2493-3-git-send-email-nikhil.rao@intel.com
State Superseded, archived
Headers show

Checks

Context Check Description
checkpatch success coding style OK
Intel-compilation success Compilation OK

Commit Message

Nikhil Rao Sept. 12, 2017, 12:29 p.m.
The SW event device always uses a EAL service function for packet
transfer from the eth device to the event device, this function is
capable of generating a event flow ID which is the IPv4/6 RSS hash.

The caps function returns RTE_EVENT_ETH_RX_ADAPTER_SW_CAP which is
currently set to RTE_EVENT_ETH_RX_ADAPTER_CAP_FLOW_ID.

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
---
 lib/librte_eventdev/rte_eventdev_pmd.h |  6 ++++++
 drivers/event/sw/sw_evdev.c            | 13 +++++++++++++
 2 files changed, 19 insertions(+)

Comments

Nipun Gupta Sept. 13, 2017, 1:36 p.m.
> -----Original Message-----
> From: Nikhil Rao [mailto:nikhil.rao@intel.com]
> Sent: Tuesday, September 12, 2017 17:59
> To: jerin.jacob@caviumnetworks.com; bruce.richardson@intel.com
> Cc: gage.eads@intel.com; dev@dpdk.org; thomas@monjalon.net;
> harry.van.haaren@intel.com; Hemant Agrawal <hemant.agrawal@nxp.com>;
> Nipun Gupta <nipun.gupta@nxp.com>; narender.vangati@intel.com;
> erik.g.carrillo@intel.com; abhinandan.gujjar@intel.com; Nikhil Rao
> <nikhil.rao@intel.com>
> Subject: [PATCH v3 2/4] eventdev: Add eth Rx adapter caps callback to SW evdev
> 
> The SW event device always uses a EAL service function for packet
> transfer from the eth device to the event device, this function is
> capable of generating a event flow ID which is the IPv4/6 RSS hash.
> 
> The caps function returns RTE_EVENT_ETH_RX_ADAPTER_SW_CAP which is
> currently set to RTE_EVENT_ETH_RX_ADAPTER_CAP_FLOW_ID.
> 
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> ---
>  lib/librte_eventdev/rte_eventdev_pmd.h |  6 ++++++
>  drivers/event/sw/sw_evdev.c            | 13 +++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h
> b/lib/librte_eventdev/rte_eventdev_pmd.h
> index 4cc9671..3cbc063 100644
> --- a/lib/librte_eventdev/rte_eventdev_pmd.h
> +++ b/lib/librte_eventdev/rte_eventdev_pmd.h
> @@ -83,6 +83,12 @@ extern "C" {
>  	} \
>  } while (0)
> 
> +#define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP \
> +		RTE_EVENT_ETH_RX_ADAPTER_CAP_FLOW_ID
> +/**< Ethernet Rx adapter cap to return If the packet transfers from
> + * the ethdev to eventdev use a SW service function
> + */

Hi Nikhil,

Maybe it makes more sense to have RTE_EVENT_ETH_RX_ADAPTER_SW_CAP #define in 'sw_evdev.h' file?

Regards,
Nipun

> +
>  #define RTE_EVENTDEV_DETACHED  (0)
>  #define RTE_EVENTDEV_ATTACHED  (1)
> 
> diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
> index da6ac30..1344c17 100644
> --- a/drivers/event/sw/sw_evdev.c
> +++ b/drivers/event/sw/sw_evdev.c
> @@ -437,6 +437,17 @@ sw_dev_configure(const struct rte_eventdev *dev)
>  	return 0;
>  }
> 
> +static int
> +sw_eth_rx_adapter_caps_get(const struct rte_eventdev *dev,
> +			uint8_t eth_port_id,
> +			uint32_t *caps)
> +{
> +	RTE_SET_USED(dev);
> +	RTE_SET_USED(eth_port_id);
> +	*caps = RTE_EVENT_ETH_RX_ADAPTER_SW_CAP;
> +	return 0;
> +}
> +
>  static void
>  sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info)
>  {
> @@ -751,6 +762,8 @@ sw_probe(struct rte_vdev_device *vdev)
>  			.port_link = sw_port_link,
>  			.port_unlink = sw_port_unlink,
> 
> +			.eth_rx_adapter_caps_get =
> sw_eth_rx_adapter_caps_get,
> +
>  			.xstats_get = sw_xstats_get,
>  			.xstats_get_names = sw_xstats_get_names,
>  			.xstats_get_by_name = sw_xstats_get_by_name,
> --
> 2.7.4
Nikhil Rao Sept. 14, 2017, 3:04 a.m.
On 9/13/2017 7:06 PM, Nipun Gupta wrote:
> 
> 
>> -----Original Message-----
>> From: Nikhil Rao [mailto:nikhil.rao@intel.com]
>> ---
>>   lib/librte_eventdev/rte_eventdev_pmd.h |  6 ++++++
>>   drivers/event/sw/sw_evdev.c            | 13 +++++++++++++
>>   2 files changed, 19 insertions(+)
>>
>> diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h
>> b/lib/librte_eventdev/rte_eventdev_pmd.h
>> index 4cc9671..3cbc063 100644
>> --- a/lib/librte_eventdev/rte_eventdev_pmd.h
>> +++ b/lib/librte_eventdev/rte_eventdev_pmd.h
>> @@ -83,6 +83,12 @@ extern "C" {
>>   	} \
>>   } while (0)
>>
>> +#define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP \
>> +		RTE_EVENT_ETH_RX_ADAPTER_CAP_FLOW_ID
>> +/**< Ethernet Rx adapter cap to return If the packet transfers from
>> + * the ethdev to eventdev use a SW service function
>> + */
> 
> Hi Nikhil,
> 
> Maybe it makes more sense to have RTE_EVENT_ETH_RX_ADAPTER_SW_CAP #define in 'sw_evdev.h' file?
> 
The usage of this #define is not intended to be restricted to sw_evdev.c.

Eventdev PMDs may need to use the SW implementation of ethdev to 
eventdev packet transfer for some eth ports (e.g., veth) while they may 
support a HW transfer mechanism for SoC eth ports, in that case the 
eventdev PMD would need access to this define. Hope that answers your 
question.

Thanks,
Nikhil
Nipun Gupta Sept. 14, 2017, 4:37 a.m.
> -----Original Message-----

> From: Rao, Nikhil [mailto:nikhil.rao@intel.com]

> Sent: Thursday, September 14, 2017 8:34

> To: Nipun Gupta <nipun.gupta@nxp.com>; jerin.jacob@caviumnetworks.com;

> bruce.richardson@intel.com

> Cc: gage.eads@intel.com; dev@dpdk.org; thomas@monjalon.net;

> harry.van.haaren@intel.com; Hemant Agrawal <hemant.agrawal@nxp.com>;

> narender.vangati@intel.com; erik.g.carrillo@intel.com;

> abhinandan.gujjar@intel.com

> Subject: Re: [PATCH v3 2/4] eventdev: Add eth Rx adapter caps callback to SW

> evdev

> 

> On 9/13/2017 7:06 PM, Nipun Gupta wrote:

> >

> >

> >> -----Original Message-----

> >> From: Nikhil Rao [mailto:nikhil.rao@intel.com]

> >> ---

> >>   lib/librte_eventdev/rte_eventdev_pmd.h |  6 ++++++

> >>   drivers/event/sw/sw_evdev.c            | 13 +++++++++++++

> >>   2 files changed, 19 insertions(+)

> >>

> >> diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h

> >> b/lib/librte_eventdev/rte_eventdev_pmd.h

> >> index 4cc9671..3cbc063 100644

> >> --- a/lib/librte_eventdev/rte_eventdev_pmd.h

> >> +++ b/lib/librte_eventdev/rte_eventdev_pmd.h

> >> @@ -83,6 +83,12 @@ extern "C" {

> >>   	} \

> >>   } while (0)

> >>

> >> +#define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP \

> >> +		RTE_EVENT_ETH_RX_ADAPTER_CAP_FLOW_ID

> >> +/**< Ethernet Rx adapter cap to return If the packet transfers from

> >> + * the ethdev to eventdev use a SW service function

> >> + */

> >

> > Hi Nikhil,

> >

> > Maybe it makes more sense to have RTE_EVENT_ETH_RX_ADAPTER_SW_CAP

> #define in 'sw_evdev.h' file?

> >

> The usage of this #define is not intended to be restricted to sw_evdev.c.

> 

> Eventdev PMDs may need to use the SW implementation of ethdev to

> eventdev packet transfer for some eth ports (e.g., veth) while they may

> support a HW transfer mechanism for SoC eth ports, in that case the

> eventdev PMD would need access to this define. Hope that answers your

> question.


Yes, makes sense :) . Thanks.

> 

> Thanks,

> Nikhil

Patch hide | download patch | download mbox

diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h
index 4cc9671..3cbc063 100644
--- a/lib/librte_eventdev/rte_eventdev_pmd.h
+++ b/lib/librte_eventdev/rte_eventdev_pmd.h
@@ -83,6 +83,12 @@  extern "C" {
 	} \
 } while (0)
 
+#define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP \
+		RTE_EVENT_ETH_RX_ADAPTER_CAP_FLOW_ID
+/**< Ethernet Rx adapter cap to return If the packet transfers from
+ * the ethdev to eventdev use a SW service function
+ */
+
 #define RTE_EVENTDEV_DETACHED  (0)
 #define RTE_EVENTDEV_ATTACHED  (1)
 
diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index da6ac30..1344c17 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -437,6 +437,17 @@  sw_dev_configure(const struct rte_eventdev *dev)
 	return 0;
 }
 
+static int
+sw_eth_rx_adapter_caps_get(const struct rte_eventdev *dev,
+			uint8_t eth_port_id,
+			uint32_t *caps)
+{
+	RTE_SET_USED(dev);
+	RTE_SET_USED(eth_port_id);
+	*caps = RTE_EVENT_ETH_RX_ADAPTER_SW_CAP;
+	return 0;
+}
+
 static void
 sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info)
 {
@@ -751,6 +762,8 @@  sw_probe(struct rte_vdev_device *vdev)
 			.port_link = sw_port_link,
 			.port_unlink = sw_port_unlink,
 
+			.eth_rx_adapter_caps_get = sw_eth_rx_adapter_caps_get,
+
 			.xstats_get = sw_xstats_get,
 			.xstats_get_names = sw_xstats_get_names,
 			.xstats_get_by_name = sw_xstats_get_by_name,