[dpdk-dev,v6,3/7] eventdev: add eth Rx adapter caps function to SW PMD

Message ID 1507674097-19597-4-git-send-email-nikhil.rao@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply patch file failure

Commit Message

Rao, Nikhil Oct. 10, 2017, 10:21 p.m. UTC
  Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
---
 lib/librte_eventdev/rte_eventdev_pmd.h |  8 ++++++++
 drivers/event/sw/sw_evdev.c            | 15 +++++++++++++++
 2 files changed, 23 insertions(+)
  

Comments

Thomas Monjalon Oct. 10, 2017, 11:16 p.m. UTC | #1
Hi,

11/10/2017 00:21, Nikhil Rao:
> --- a/lib/librte_eventdev/rte_eventdev_pmd.h
> +++ b/lib/librte_eventdev/rte_eventdev_pmd.h
> @@ -83,6 +83,14 @@ extern "C" {
>         } \
>  } while (0)
>  
> +#define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP \
> +               ((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) | \
> +                       (RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ))
> +
> +/**< Ethernet Rx adapter cap to return If the packet transfers from
> + * the ethdev to eventdev use a SW service function
> + */

It is a value specific to the SW driver.
I think it should not be defined in librte_eventdev.

Do you mind to move it for RC2?
  
Jerin Jacob Oct. 11, 2017, 2:57 a.m. UTC | #2
-----Original Message-----
> Date: Wed, 11 Oct 2017 01:16:25 +0200
> From: Thomas Monjalon <thomas@monjalon.net>
> To: Nikhil Rao <nikhil.rao@intel.com>
> Cc: dev@dpdk.org, jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com
> Subject: Re: [dpdk-dev] [PATCH v6 3/7] eventdev: add eth Rx adapter caps
>  function to SW PMD
> 
> Hi,
> 
> 11/10/2017 00:21, Nikhil Rao:
> > --- a/lib/librte_eventdev/rte_eventdev_pmd.h
> > +++ b/lib/librte_eventdev/rte_eventdev_pmd.h
> > @@ -83,6 +83,14 @@ extern "C" {
> >         } \
> >  } while (0)
> >  
> > +#define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP \
> > +               ((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) | \
> > +                       (RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ))
> > +
> > +/**< Ethernet Rx adapter cap to return If the packet transfers from
> > + * the ethdev to eventdev use a SW service function
> > + */
> 
> It is a value specific to the SW driver.
> I think it should not be defined in librte_eventdev.

It should be defined in librte_eventdev as HW drivers use this flag
if HW adapter needs to use SW for fallback.

Already discussed this at
http://dpdk.org/ml/archives/dev/2017-September/075302.html

See HW driver usage as example for dpaa2.
http://dpdk.org/ml/archives/dev/2017-October/078391.html
function: dpaa2_eventdev_eth_caps_get

> 
> Do you mind to move it for RC2?
  

Patch

diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h
index 9f3188fc8..4369d9b8c 100644
--- a/lib/librte_eventdev/rte_eventdev_pmd.h
+++ b/lib/librte_eventdev/rte_eventdev_pmd.h
@@ -83,6 +83,14 @@  extern "C" {
 	} \
 } while (0)
 
+#define RTE_EVENT_ETH_RX_ADAPTER_SW_CAP \
+		((RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) | \
+			(RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ))
+
+/**< 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 da6ac30f4..aed8b728f 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -437,6 +437,19 @@  sw_dev_configure(const struct rte_eventdev *dev)
 	return 0;
 }
 
+struct rte_eth_dev;
+
+static int
+sw_eth_rx_adapter_caps_get(const struct rte_eventdev *dev,
+			const struct rte_eth_dev *eth_dev,
+			uint32_t *caps)
+{
+	RTE_SET_USED(dev);
+	RTE_SET_USED(eth_dev);
+	*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 +764,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,