DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1 0/4] ethdev: callback process API
@ 2017-05-19 11:03 Bernard Iremonger
  2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 1/4] ethdev: modify " Bernard Iremonger
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Bernard Iremonger @ 2017-05-19 11:03 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard.Iremonger

From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>

At present the _rte_eth_dev_callback_process function is
using the cb_arg parameter to return data to the caller.
The cb_arg parameter is an input parameter and should not
be used to return data to the caller.

In this patchset the return type of
_rte_eth_dev_callback_process has been changed from void
to int to allow return of a return value to the caller
and an extra parameter void *ret_param has been added to
return data to caller.

All references to _rte_eth_dev_callback_process have
been updated for these API changes.

Bernard.Iremonger (4):
  ethdev: modify callback process API
  test: callback process API changes
  examples: callback process API changes
  doc: remove deprecation notice

 app/test-pmd/testpmd.c                     | 13 +++++++-----
 doc/guides/rel_notes/deprecation.rst       |  4 ----
 drivers/net/bonding/rte_eth_bond_pmd.c     | 34 ++++++++++++++++++------------
 drivers/net/bonding/rte_eth_bond_private.h |  4 ++--
 drivers/net/e1000/em_ethdev.c              |  2 +-
 drivers/net/e1000/igb_ethdev.c             |  6 ++++--
 drivers/net/enic/enic_main.c               |  2 +-
 drivers/net/i40e/i40e_ethdev.c             |  2 +-
 drivers/net/i40e/i40e_ethdev_vf.c          |  3 ++-
 drivers/net/i40e/i40e_pf.c                 | 19 +++++++++--------
 drivers/net/ixgbe/ixgbe_ethdev.c           |  8 ++++---
 drivers/net/ixgbe/ixgbe_pf.c               | 22 ++++++++++---------
 drivers/net/nfp/nfp_net.c                  |  2 +-
 drivers/net/sfc/sfc_intr.c                 |  6 ++++--
 drivers/net/thunderx/nicvf_ethdev.c        |  3 ++-
 drivers/net/vhost/rte_eth_vhost.c          |  9 +++++---
 drivers/net/virtio/virtio_ethdev.c         |  3 ++-
 examples/link_status_interrupt/main.c      | 10 ++++++---
 lib/librte_ether/rte_ethdev.c              | 15 ++++++++-----
 lib/librte_ether/rte_ethdev.h              | 21 ++++++++----------
 lib/librte_ether/rte_ether_version.map     |  7 ++++++
 test/test/test_link_bonding.c              |  8 +++++--
 test/test/virtual_pmd.c                    |  3 ++-
 23 files changed, 122 insertions(+), 84 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v1 1/4] ethdev: modify callback process API
  2017-05-19 11:03 [dpdk-dev] [PATCH v1 0/4] ethdev: callback process API Bernard Iremonger
@ 2017-05-19 11:03 ` Bernard Iremonger
  2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 2/4] test: callback process API changes Bernard Iremonger
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Bernard Iremonger @ 2017-05-19 11:03 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard.Iremonger

From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>

Change the rte_eth_dev_callback_process function to return int,
and add a void *ret_param parameter.

Modify the following PMD's for rte_eth_dev_callback_process
API changes:

net/bonding
net/nfp
net/enic
net/vhost
net/virtio
net/thunderx
net/e1000: e1000 and igb
net/sfc
net/ixgbe
net/i40e

Modify testpmd for rte_eth_dev_callback_process API changes
app/testpmd

Signed-off-by: Bernard.Iremonger <Bernard.iremonger@intel.com>
---
 app/test-pmd/testpmd.c                     | 13 +++++++-----
 drivers/net/bonding/rte_eth_bond_pmd.c     | 34 ++++++++++++++++++------------
 drivers/net/bonding/rte_eth_bond_private.h |  4 ++--
 drivers/net/e1000/em_ethdev.c              |  2 +-
 drivers/net/e1000/igb_ethdev.c             |  6 ++++--
 drivers/net/enic/enic_main.c               |  2 +-
 drivers/net/i40e/i40e_ethdev.c             |  2 +-
 drivers/net/i40e/i40e_ethdev_vf.c          |  3 ++-
 drivers/net/i40e/i40e_pf.c                 | 19 +++++++++--------
 drivers/net/ixgbe/ixgbe_ethdev.c           |  8 ++++---
 drivers/net/ixgbe/ixgbe_pf.c               | 22 ++++++++++---------
 drivers/net/nfp/nfp_net.c                  |  2 +-
 drivers/net/sfc/sfc_intr.c                 |  6 ++++--
 drivers/net/thunderx/nicvf_ethdev.c        |  3 ++-
 drivers/net/vhost/rte_eth_vhost.c          |  9 +++++---
 drivers/net/virtio/virtio_ethdev.c         |  3 ++-
 lib/librte_ether/rte_ethdev.c              | 15 ++++++++-----
 lib/librte_ether/rte_ethdev.h              | 21 ++++++++----------
 lib/librte_ether/rte_ether_version.map     |  7 ++++++
 19 files changed, 107 insertions(+), 74 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index d1041af..142d56f 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -378,9 +378,9 @@ struct rte_fdir_conf fdir_conf = {
 /* Forward function declarations */
 static void map_port_queue_stats_mapping_registers(uint8_t pi, struct rte_port *port);
 static void check_all_ports_link_status(uint32_t port_mask);
-static void eth_event_callback(uint8_t port_id,
-			       enum rte_eth_event_type type,
-			       void *param);
+static int eth_event_callback(uint8_t port_id,
+			      enum rte_eth_event_type type,
+			      void *param, void *ret_param);
 
 /*
  * Check if all the ports are started.
@@ -1826,8 +1826,9 @@ struct pmd_test_command {
 }
 
 /* This function is used by the interrupt thread */
-static void
-eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param)
+static int
+eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param,
+		  void *ret_param)
 {
 	static const char * const event_desc[] = {
 		[RTE_ETH_EVENT_UNKNOWN] = "Unknown",
@@ -1841,6 +1842,7 @@ struct pmd_test_command {
 	};
 
 	RTE_SET_USED(param);
+	RTE_SET_USED(ret_param);
 
 	if (type >= RTE_ETH_EVENT_MAX) {
 		fprintf(stderr, "\nPort %" PRIu8 ": %s called upon invalid event %d\n",
@@ -1861,6 +1863,7 @@ struct pmd_test_command {
 	default:
 		break;
 	}
+	return 0;
 }
 
 static int
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 82959ab..e89a28c 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1438,7 +1438,8 @@ struct bwg_slave {
 	if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
 		slave_eth_dev->dev_ops->link_update(slave_eth_dev, 0);
 		bond_ethdev_lsc_event_callback(slave_eth_dev->data->port_id,
-			RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id);
+			RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id,
+			NULL);
 	}
 
 	return 0;
@@ -1849,7 +1850,8 @@ struct bwg_slave {
 
 				bond_ethdev_lsc_event_callback(internals->slaves[i].port_id,
 						RTE_ETH_EVENT_INTR_LSC,
-						&bonded_ethdev->data->port_id);
+						&bonded_ethdev->data->port_id,
+						NULL);
 			}
 		}
 		rte_spinlock_unlock(&internals->lock);
@@ -1995,35 +1997,36 @@ struct bwg_slave {
 		return;
 
 	_rte_eth_dev_callback_process((struct rte_eth_dev *)arg,
-			RTE_ETH_EVENT_INTR_LSC, NULL);
+			RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 }
 
-void
+int
 bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type,
-		void *param)
+		void *param, void *ret_param __rte_unused)
 {
 	struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev;
 	struct bond_dev_private *internals;
 	struct rte_eth_link link;
+	int rc = -1;
 
 	int i, valid_slave = 0;
 	uint8_t active_pos;
 	uint8_t lsc_flag = 0;
 
 	if (type != RTE_ETH_EVENT_INTR_LSC || param == NULL)
-		return;
+		return rc;
 
 	bonded_eth_dev = &rte_eth_devices[*(uint8_t *)param];
 	slave_eth_dev = &rte_eth_devices[port_id];
 
 	if (check_for_bonded_ethdev(bonded_eth_dev))
-		return;
+		return rc;
 
 	internals = bonded_eth_dev->data->dev_private;
 
 	/* If the device isn't started don't handle interrupts */
 	if (!bonded_eth_dev->data->dev_started)
-		return;
+		return rc;
 
 	/* verify that port_id is a valid slave of bonded port */
 	for (i = 0; i < internals->slave_count; i++) {
@@ -2034,7 +2037,7 @@ struct bwg_slave {
 	}
 
 	if (!valid_slave)
-		return;
+		return rc;
 
 	/* Search for port in active port list */
 	active_pos = find_slave_by_id(internals->active_slaves,
@@ -2043,7 +2046,7 @@ struct bwg_slave {
 	rte_eth_link_get_nowait(port_id, &link);
 	if (link.link_status) {
 		if (active_pos < internals->active_slave_count)
-			return;
+			return rc;
 
 		/* if no active slave ports then set this port to be primary port */
 		if (internals->active_slave_count < 1) {
@@ -2065,7 +2068,7 @@ struct bwg_slave {
 				RTE_LOG(ERR, PMD,
 					"port %u invalid speed/duplex\n",
 					port_id);
-				return;
+				return rc;
 			}
 		}
 
@@ -2077,7 +2080,7 @@ struct bwg_slave {
 			bond_ethdev_primary_set(internals, port_id);
 	} else {
 		if (active_pos == internals->active_slave_count)
-			return;
+			return rc;
 
 		/* Remove from active slave list */
 		deactivate_slave(bonded_eth_dev, port_id);
@@ -2116,7 +2119,8 @@ struct bwg_slave {
 						(void *)bonded_eth_dev);
 			else
 				_rte_eth_dev_callback_process(bonded_eth_dev,
-						RTE_ETH_EVENT_INTR_LSC, NULL);
+						RTE_ETH_EVENT_INTR_LSC,
+						NULL, NULL);
 
 		} else {
 			if (internals->link_down_delay_ms > 0)
@@ -2125,9 +2129,11 @@ struct bwg_slave {
 						(void *)bonded_eth_dev);
 			else
 				_rte_eth_dev_callback_process(bonded_eth_dev,
-						RTE_ETH_EVENT_INTR_LSC, NULL);
+						RTE_ETH_EVENT_INTR_LSC,
+						NULL, NULL);
 		}
 	}
+	return 0;
 }
 
 static int
diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h
index b76385f..6c77d20 100644
--- a/drivers/net/bonding/rte_eth_bond_private.h
+++ b/drivers/net/bonding/rte_eth_bond_private.h
@@ -263,9 +263,9 @@ struct bond_dev_private {
 bond_ethdev_primary_set(struct bond_dev_private *internals,
 		uint8_t slave_port_id);
 
-void
+int
 bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type,
-		void *param);
+		void *param, void *ret_param);
 
 int
 bond_ethdev_parse_slave_port_kvarg(const char *key,
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 57eb017..cc16fe8 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1671,7 +1671,7 @@ static int eth_em_pci_remove(struct rte_pci_device *pci_dev)
 
 	eth_em_interrupt_get_status(dev);
 	eth_em_interrupt_action(dev, dev->intr_handle);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 }
 
 static int
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 6f9b253..f7dd54a 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -2870,7 +2870,8 @@ static int eth_igb_rxq_interrupt_setup(struct rte_eth_dev *dev)
 		E1000_WRITE_REG(hw, E1000_TCTL, tctl);
 		E1000_WRITE_REG(hw, E1000_RCTL, rctl);
 		E1000_WRITE_FLUSH(hw);
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 
 	return 0;
@@ -2929,7 +2930,8 @@ void igbvf_mbx_process(struct rte_eth_dev *dev)
 
 	/* PF reset VF event */
 	if (in_msg == E1000_PF_CONTROL_MSG)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+					      NULL, NULL);
 }
 
 static int
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index d026241..d6dee7d 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -430,7 +430,7 @@ int enic_link_update(struct enic *enic)
 	vnic_intr_return_all_credits(&enic->intr);
 
 	enic_link_update(enic);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 	enic_log_q_error(enic);
 }
 
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4c49673..3e81c5d 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -5780,7 +5780,7 @@ struct i40e_vsi *
 			ret = i40e_dev_link_update(dev, 0);
 			if (!ret)
 				_rte_eth_dev_callback_process(dev,
-					RTE_ETH_EVENT_INTR_LSC, NULL);
+					RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 			break;
 		default:
 			PMD_DRV_LOG(DEBUG, "Request %u is not supported yet",
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index a33ab14..5811793 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1328,7 +1328,8 @@ static int i40evf_dev_xstats_get(struct rte_eth_dev *dev,
 	switch (pf_msg->event) {
 	case I40E_VIRTCHNL_EVENT_RESET_IMPENDING:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event");
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+					      NULL, NULL);
 		break;
 	case I40E_VIRTCHNL_EVENT_LINK_CHANGE:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event");
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 0758503..a21fae1 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -1231,7 +1231,7 @@
 	struct i40e_pf_vf *vf;
 	/* AdminQ will pass absolute VF id, transfer to internal vf id */
 	uint16_t vf_id = abs_vf_id - hw->func_caps.vf_base_id;
-	struct rte_pmd_i40e_mb_event_param cb_param;
+	struct rte_pmd_i40e_mb_event_param ret_param;
 	bool b_op = TRUE;
 
 	if (vf_id > pf->vf_num - 1 || !pf->vfs) {
@@ -1251,22 +1251,23 @@
 	 * initialise structure to send to user application
 	 * will return response from user in retval field
 	 */
-	cb_param.retval = RTE_PMD_I40E_MB_EVENT_PROCEED;
-	cb_param.vfid = vf_id;
-	cb_param.msg_type = opcode;
-	cb_param.msg = (void *)msg;
-	cb_param.msglen = msglen;
+	ret_param.retval = RTE_PMD_I40E_MB_EVENT_PROCEED;
+	ret_param.vfid = vf_id;
+	ret_param.msg_type = opcode;
+	ret_param.msg = (void *)msg;
+	ret_param.msglen = msglen;
 
 	/**
 	 * Ask user application if we're allowed to perform those functions.
-	 * If we get cb_param.retval == RTE_PMD_I40E_MB_EVENT_PROCEED,
+	 * If we get ret_param.retval == RTE_PMD_I40E_MB_EVENT_PROCEED,
 	 * then business as usual.
 	 * If RTE_PMD_I40E_MB_EVENT_NOOP_ACK or RTE_PMD_I40E_MB_EVENT_NOOP_NACK,
 	 * do nothing and send not_supported to VF. As PF must send a response
 	 * to VF and ACK/NACK is not defined.
 	 */
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);
-	if (cb_param.retval != RTE_PMD_I40E_MB_EVENT_PROCEED) {
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX,
+				      NULL, &ret_param);
+	if (ret_param.retval != RTE_PMD_I40E_MB_EVENT_PROCEED) {
 		PMD_DRV_LOG(WARNING, "VF to PF message(%d) is not permitted!",
 			    opcode);
 		b_op = FALSE;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 269c8a5..dd78212 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4166,12 +4166,13 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 		ixgbe_dev_link_update(dev, 0);
 		intr->flags &= ~IXGBE_FLAG_NEED_LINK_UPDATE;
 		ixgbe_dev_link_status_print(dev);
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 
 	if (intr->flags & IXGBE_FLAG_MACSEC) {
 		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_MACSEC,
-					      NULL);
+					      NULL, NULL);
 		intr->flags &= ~IXGBE_FLAG_MACSEC;
 	}
 
@@ -7879,7 +7880,8 @@ static void ixgbevf_mbx_process(struct rte_eth_dev *dev)
 
 	/* PF reset VF event */
 	if (in_msg == IXGBE_PF_CONTROL_MSG)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+					      NULL, NULL);
 }
 
 static int
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index 6f30c42..7a7b64d 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -683,7 +683,7 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ixgbe_vf_info *vfinfo =
 		*IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
-	struct rte_pmd_ixgbe_mb_event_param cb_param;
+	struct rte_pmd_ixgbe_mb_event_param ret_param;
 
 	retval = ixgbe_read_mbx(hw, msgbuf, mbx_size, vf);
 	if (retval) {
@@ -702,10 +702,10 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)
 	 * initialise structure to send to user application
 	 * will return response from user in retval field
 	 */
-	cb_param.retval = RTE_PMD_IXGBE_MB_EVENT_PROCEED;
-	cb_param.vfid = vf;
-	cb_param.msg_type = msgbuf[0] & 0xFFFF;
-	cb_param.msg = (void *)msgbuf;
+	ret_param.retval = RTE_PMD_IXGBE_MB_EVENT_PROCEED;
+	ret_param.vfid = vf;
+	ret_param.msg_type = msgbuf[0] & 0xFFFF;
+	ret_param.msg = (void *)msgbuf;
 
 	/* perform VF reset */
 	if (msgbuf[0] == IXGBE_VF_RESET) {
@@ -714,20 +714,22 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)
 		vfinfo[vf].clear_to_send = true;
 
 		/* notify application about VF reset */
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX,
+					      NULL, &ret_param);
 		return ret;
 	}
 
 	/**
 	 * ask user application if we allowed to perform those functions
-	 * if we get cb_param.retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED
+	 * if we get ret_param.retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED
 	 * then business as usual,
 	 * if 0, do nothing and send ACK to VF
-	 * if cb_param.retval > 1, do nothing and send NAK to VF
+	 * if ret_param.retval > 1, do nothing and send NAK to VF
 	 */
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX,
+				      NULL, &ret_param);
 
-	retval = cb_param.retval;
+	retval = ret_param.retval;
 
 	/* check & process VF to PF mailbox message */
 	switch ((msgbuf[0] & 0xFFFF)) {
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 5c5cba1..6b0aca6 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1334,7 +1334,7 @@ static void nfp_net_read_mac(struct nfp_net_hw *hw)
 	struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
 
 	nfp_net_link_update(dev, 0);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 
 	nfp_net_dev_link_status_print(dev);
 
diff --git a/drivers/net/sfc/sfc_intr.c b/drivers/net/sfc/sfc_intr.c
index 7eb4b86..26a9c03 100644
--- a/drivers/net/sfc/sfc_intr.c
+++ b/drivers/net/sfc/sfc_intr.c
@@ -111,7 +111,8 @@
 			 sa->eth_dev->data->dev_link.link_status ?
 			 "UP" : "DOWN");
 		_rte_eth_dev_callback_process(sa->eth_dev,
-					      RTE_ETH_EVENT_INTR_LSC, NULL);
+					      RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 }
 
@@ -152,7 +153,8 @@
 	if (lsc_seq != sa->port.lsc_seq) {
 		sfc_info(sa, "link status change event");
 		_rte_eth_dev_callback_process(sa->eth_dev,
-					      RTE_ETH_EVENT_INTR_LSC, NULL);
+					      RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 }
 
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index ddcfaba..fb9c4c9 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -111,7 +111,8 @@ static void nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic,
 	if (nicvf_reg_poll_interrupts(nic) == NIC_MBOX_MSG_BGX_LINK_CHANGE) {
 		if (dev->data->dev_conf.intr_conf.lsc)
 			nicvf_set_eth_link_status(nic, &dev->data->dev_link);
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 
 	rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000,
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 257bf6d..98b3675 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -607,7 +607,8 @@ struct vhost_xstats_name_off {
 
 	RTE_LOG(INFO, PMD, "New connection established\n");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC,
+				      NULL, NULL);
 
 	return 0;
 }
@@ -661,7 +662,8 @@ struct vhost_xstats_name_off {
 
 	RTE_LOG(INFO, PMD, "Connection closed\n");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC,
+				      NULL, NULL);
 }
 
 static int
@@ -690,7 +692,8 @@ struct vhost_xstats_name_off {
 	RTE_LOG(INFO, PMD, "vring%u is %s\n",
 			vring, enable ? "enabled" : "disabled");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_QUEUE_STATE, NULL);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_QUEUE_STATE,
+				      NULL, NULL);
 
 	return 0;
 }
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 763fef5..256b19a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1229,7 +1229,8 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev,
 	if (isr & VIRTIO_PCI_ISR_CONFIG) {
 		if (virtio_dev_link_update(dev, 0) == 0)
 			_rte_eth_dev_callback_process(dev,
-						      RTE_ETH_EVENT_INTR_LSC, NULL);
+						      RTE_ETH_EVENT_INTR_LSC,
+						      NULL, NULL);
 	}
 
 }
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 83898a8..bdb56ba 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -129,6 +129,7 @@ struct rte_eth_dev_callback {
 	TAILQ_ENTRY(rte_eth_dev_callback) next; /**< Callbacks list */
 	rte_eth_dev_cb_fn cb_fn;                /**< Callback address */
 	void *cb_arg;                           /**< Parameter for callback */
+	void *ret_param;                        /**< Return parameter */
 	enum rte_eth_event_type event;          /**< Interrupt event type */
 	uint32_t active;                        /**< Callback is executing */
 };
@@ -2718,12 +2719,13 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 	return ret;
 }
 
-void
+int
 _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
-	enum rte_eth_event_type event, void *cb_arg)
+	enum rte_eth_event_type event, void *cb_arg, void *ret_param)
 {
 	struct rte_eth_dev_callback *cb_lst;
 	struct rte_eth_dev_callback dev_cb;
+	int rc = 0;
 
 	rte_spinlock_lock(&rte_eth_dev_cb_lock);
 	TAILQ_FOREACH(cb_lst, &(dev->link_intr_cbs), next) {
@@ -2733,14 +2735,17 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 		cb_lst->active = 1;
 		if (cb_arg != NULL)
 			dev_cb.cb_arg = cb_arg;
+		if (ret_param != NULL)
+			dev_cb.ret_param = ret_param;
 
 		rte_spinlock_unlock(&rte_eth_dev_cb_lock);
-		dev_cb.cb_fn(dev->data->port_id, dev_cb.event,
-						dev_cb.cb_arg);
+		rc = dev_cb.cb_fn(dev->data->port_id, dev_cb.event,
+				dev_cb.cb_arg, dev_cb.ret_param);
 		rte_spinlock_lock(&rte_eth_dev_cb_lock);
 		cb_lst->active = 0;
 	}
 	rte_spinlock_unlock(&rte_eth_dev_cb_lock);
+	return rc;
 }
 
 int
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 0f38b45..fad6ae5 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -3401,8 +3401,8 @@ enum rte_eth_event_type {
 	RTE_ETH_EVENT_MAX       /**< max value of this enum */
 };
 
-typedef void (*rte_eth_dev_cb_fn)(uint8_t port_id, \
-		enum rte_eth_event_type event, void *cb_arg);
+typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id,
+		enum rte_eth_event_type event, void *cb_arg, void *ret_param);
 /**< user application callback to be registered for interrupts */
 
 
@@ -3419,11 +3419,6 @@ typedef void (*rte_eth_dev_cb_fn)(uint8_t port_id, \
  * @param cb_arg
  *  Pointer to the parameters for the registered callback.
  *
- *  The user data is overwritten in the case of RTE_ETH_EVENT_VF_MBOX.
- *	This even occurs when a message from the VF is received by the PF.
- *	The user data is overwritten with struct rte_pmd_ixgbe_mb_event_param.
- *	This struct is defined in rte_pmd_ixgbe.h.
- *
  * @return
  *  - On success, zero.
  *  - On failure, a negative value.
@@ -3463,15 +3458,17 @@ int rte_eth_dev_callback_unregister(uint8_t port_id,
  * @param event
  *  Eth device interrupt event type.
  * @param cb_arg
- *  Update callback parameter to pass data back to user application.
+ *  callback parameter.
+ * @param ret_param
+ *  To pass data back to user application.
  *  This allows the user application to decide if a particular function
  *  is permitted or not.
  *
  * @return
- *  void
+ *  int
  */
-void _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
-				enum rte_eth_event_type event, void *cb_arg);
+int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
+		enum rte_eth_event_type event, void *cb_arg, void *ret_param);
 
 /**
  * When there is no rx packet coming in Rx Queue for a long time, we can
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index d6726bb..77df47a 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -156,3 +156,10 @@ DPDK_17.05 {
 	rte_eth_xstats_get_names_by_id;
 
 } DPDK_17.02;
+
+DPDK_17.08 {
+	global:
+
+	_rte_eth_dev_callback_process;
+
+} DPDK_17.05;
-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v1 2/4] test: callback process API changes
  2017-05-19 11:03 [dpdk-dev] [PATCH v1 0/4] ethdev: callback process API Bernard Iremonger
  2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 1/4] ethdev: modify " Bernard Iremonger
@ 2017-05-19 11:03 ` Bernard Iremonger
  2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 3/4] examples: " Bernard Iremonger
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Bernard Iremonger @ 2017-05-19 11:03 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard.Iremonger

From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>

Modify the following test code for rte_eth_dev_callback_process
API changes:

virtual_pmd
test_link_bonding

Signed-off-by: Bernard.Iremonger <Bernard.iremonger@intel.com>
---
 test/test/test_link_bonding.c | 8 ++++++--
 test/test/virtual_pmd.c       | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/test/test/test_link_bonding.c b/test/test/test_link_bonding.c
index 52d2d05..0c67f04 100644
--- a/test/test/test_link_bonding.c
+++ b/test/test/test_link_bonding.c
@@ -1173,15 +1173,19 @@ struct rte_fdir_conf fdir_conf = {
 int test_lsc_interrupt_count;
 
 
-static void
+static int
 test_bonding_lsc_event_callback(uint8_t port_id __rte_unused,
-		enum rte_eth_event_type type  __rte_unused, void *param __rte_unused)
+		enum rte_eth_event_type type  __rte_unused,
+		void *param __rte_unused,
+		void *ret_param __rte_unused)
 {
 	pthread_mutex_lock(&mutex);
 	test_lsc_interrupt_count++;
 
 	pthread_cond_signal(&cvar);
 	pthread_mutex_unlock(&mutex);
+
+	return 0;
 }
 
 static inline int
diff --git a/test/test/virtual_pmd.c b/test/test/virtual_pmd.c
index e9dd8ac..78ed7c0 100644
--- a/test/test/virtual_pmd.c
+++ b/test/test/virtual_pmd.c
@@ -484,7 +484,8 @@ static void  virtual_ethdev_stop(struct rte_eth_dev *eth_dev __rte_unused)
 
 	vrtl_eth_dev->data->dev_link.link_status = link_status;
 
-	_rte_eth_dev_callback_process(vrtl_eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(vrtl_eth_dev, RTE_ETH_EVENT_INTR_LSC,
+				      NULL, NULL);
 }
 
 int
-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v1 3/4] examples: callback process API changes
  2017-05-19 11:03 [dpdk-dev] [PATCH v1 0/4] ethdev: callback process API Bernard Iremonger
  2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 1/4] ethdev: modify " Bernard Iremonger
  2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 2/4] test: callback process API changes Bernard Iremonger
@ 2017-05-19 11:03 ` Bernard Iremonger
  2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 4/4] doc: remove deprecation notice Bernard Iremonger
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Bernard Iremonger @ 2017-05-19 11:03 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard.Iremonger

From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>

Modify the link_status_interrupt sample application for
the rte_eth_dev_callback_process API changes.

Signed-off-by: Bernard.Iremonger <Bernard.iremonger@intel.com>
---
 examples/link_status_interrupt/main.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 25da28e..d585789 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -469,14 +469,16 @@ struct lsi_port_statistics {
  *  Pointer to(address of) the parameters.
  *
  * @return
- *  void.
+ *  int.
  */
-static void
-lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param)
+static int
+lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param,
+		    void *ret_param)
 {
 	struct rte_eth_link link;
 
 	RTE_SET_USED(param);
+	RTE_SET_USED(ret_param);
 
 	printf("\n\nIn registered callback...\n");
 	printf("Event type: %s\n", type == RTE_ETH_EVENT_INTR_LSC ? "LSC interrupt" : "unknown event");
@@ -488,6 +490,8 @@ struct lsi_port_statistics {
 				("full-duplex") : ("half-duplex"));
 	} else
 		printf("Port %d Link Down\n\n", port_id);
+
+	return 0;
 }
 
 /* Check the link status of all ports in up to 9s, and print them finally */
-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v1 4/4] doc: remove deprecation notice
  2017-05-19 11:03 [dpdk-dev] [PATCH v1 0/4] ethdev: callback process API Bernard Iremonger
                   ` (2 preceding siblings ...)
  2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 3/4] examples: " Bernard Iremonger
@ 2017-05-19 11:03 ` Bernard Iremonger
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 0/4] ethdev: callback process API Bernard Iremonger
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Bernard Iremonger @ 2017-05-19 11:03 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard.Iremonger

From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>

Remove deprecation notice for rte_eth_dev_callback_process
API changes.

Signed-off-by: Bernard.Iremonger <Bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index ba9b5a2..d28c44d 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -34,10 +34,6 @@ Deprecation Notices
 * The struct ``rte_pci_driver`` is planned to be removed from
   ``rte_cryptodev_driver`` and ``rte_eventdev_driver`` in 17.08.
 
-* ethdev: An API change is planned for 17.08 for the function
-  ``_rte_eth_dev_callback_process``. In 17.08 the function will return an ``int``
-  instead of ``void`` and a fourth parameter ``void *ret_param`` will be added.
-
 * ethdev: for 17.08 it is planned to deprecate the following nine rte_eth_dev_*
   functions and move them into the ixgbe PMD:
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 0/4] ethdev: callback process API
  2017-05-19 11:03 [dpdk-dev] [PATCH v1 0/4] ethdev: callback process API Bernard Iremonger
                   ` (3 preceding siblings ...)
  2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 4/4] doc: remove deprecation notice Bernard Iremonger
@ 2017-06-12 15:18 ` Bernard Iremonger
  2017-06-15 12:29   ` [dpdk-dev] [PATCH v3] " Bernard Iremonger
  2017-06-15 12:29   ` [dpdk-dev] [PATCH v3] ethdev: modify " Bernard Iremonger
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 1/4] " Bernard Iremonger
                   ` (3 subsequent siblings)
  8 siblings, 2 replies; 24+ messages in thread
From: Bernard Iremonger @ 2017-06-12 15:18 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard.Iremonger

From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>

At present the _rte_eth_dev_callback_process function is
using the cb_arg parameter to return data to the caller.
The cb_arg parameter is an input parameter and should not
be used to return data to the caller.

In this patchset the return type of
_rte_eth_dev_callback_process has been changed from void
to int to allow return of a return value to the caller
and an extra parameter void *ret_param has been added to
return data to caller.

All references to _rte_eth_dev_callback_process have
been updated for these API changes.

Changes in v2:
Rebase to latest dpdk-next-net.
Modify mlx4, mlx5 and bnxt PMD's.

Bernard.Iremonger (4):
  ethdev: modify callback process API
  test: callback process API changes
  examples: callback process API changes
  doc: remove deprecation notice

 app/test-pmd/testpmd.c                     | 13 +++++++-----
 doc/guides/rel_notes/deprecation.rst       |  4 ----
 drivers/net/bnxt/rte_pmd_bnxt.c            |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c     | 34 ++++++++++++++++++------------
 drivers/net/bonding/rte_eth_bond_private.h |  4 ++--
 drivers/net/e1000/em_ethdev.c              |  2 +-
 drivers/net/e1000/igb_ethdev.c             |  6 ++++--
 drivers/net/enic/enic_main.c               |  2 +-
 drivers/net/i40e/i40e_ethdev.c             |  2 +-
 drivers/net/i40e/i40e_ethdev_vf.c          |  3 ++-
 drivers/net/i40e/i40e_pf.c                 | 19 +++++++++--------
 drivers/net/ixgbe/ixgbe_ethdev.c           |  8 ++++---
 drivers/net/ixgbe/ixgbe_pf.c               | 22 ++++++++++---------
 drivers/net/mlx4/mlx4.c                    |  6 ++++--
 drivers/net/mlx5/mlx5_ethdev.c             |  6 ++++--
 drivers/net/nfp/nfp_net.c                  |  2 +-
 drivers/net/sfc/sfc_intr.c                 |  6 ++++--
 drivers/net/thunderx/nicvf_ethdev.c        |  3 ++-
 drivers/net/vhost/rte_eth_vhost.c          |  9 +++++---
 drivers/net/virtio/virtio_ethdev.c         |  3 ++-
 examples/link_status_interrupt/main.c      | 10 ++++++---
 lib/librte_ether/rte_ethdev.c              | 15 ++++++++-----
 lib/librte_ether/rte_ethdev.h              | 21 ++++++++----------
 lib/librte_ether/rte_ether_version.map     |  7 ++++++
 test/test/test_link_bonding.c              |  8 +++++--
 test/test/virtual_pmd.c                    |  3 ++-
 26 files changed, 131 insertions(+), 89 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 1/4] ethdev: modify callback process API
  2017-05-19 11:03 [dpdk-dev] [PATCH v1 0/4] ethdev: callback process API Bernard Iremonger
                   ` (4 preceding siblings ...)
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 0/4] ethdev: callback process API Bernard Iremonger
@ 2017-06-12 15:18 ` Bernard Iremonger
  2017-06-14 21:22   ` Thomas Monjalon
  2017-06-15 15:43   ` Stephen Hemminger
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 2/4] test: callback process API changes Bernard Iremonger
                   ` (2 subsequent siblings)
  8 siblings, 2 replies; 24+ messages in thread
From: Bernard Iremonger @ 2017-06-12 15:18 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard.Iremonger

From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>

Change the rte_eth_dev_callback_process function to return int,
and add a void *ret_param parameter.

Modify the following PMD's for rte_eth_dev_callback_process
API changes:

net/bonding
net/nfp
net/enic
net/vhost
net/virtio
net/thunderx
net/e1000: e1000 and igb
net/sfc
net/ixgbe
net/i40e
net/mlx4
net/mlx5
net/bnxt

Modify testpmd for rte_eth_dev_callback_process API changes
app/testpmd

Signed-off-by: Bernard.Iremonger <Bernard.iremonger@intel.com>
---
 app/test-pmd/testpmd.c                     | 13 +++++++-----
 drivers/net/bnxt/rte_pmd_bnxt.c            |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c     | 34 ++++++++++++++++++------------
 drivers/net/bonding/rte_eth_bond_private.h |  4 ++--
 drivers/net/e1000/em_ethdev.c              |  2 +-
 drivers/net/e1000/igb_ethdev.c             |  6 ++++--
 drivers/net/enic/enic_main.c               |  2 +-
 drivers/net/i40e/i40e_ethdev.c             |  2 +-
 drivers/net/i40e/i40e_ethdev_vf.c          |  3 ++-
 drivers/net/i40e/i40e_pf.c                 | 19 +++++++++--------
 drivers/net/ixgbe/ixgbe_ethdev.c           |  8 ++++---
 drivers/net/ixgbe/ixgbe_pf.c               | 22 ++++++++++---------
 drivers/net/mlx4/mlx4.c                    |  6 ++++--
 drivers/net/mlx5/mlx5_ethdev.c             |  6 ++++--
 drivers/net/nfp/nfp_net.c                  |  2 +-
 drivers/net/sfc/sfc_intr.c                 |  6 ++++--
 drivers/net/thunderx/nicvf_ethdev.c        |  3 ++-
 drivers/net/vhost/rte_eth_vhost.c          |  9 +++++---
 drivers/net/virtio/virtio_ethdev.c         |  3 ++-
 lib/librte_ether/rte_ethdev.c              | 15 ++++++++-----
 lib/librte_ether/rte_ethdev.h              | 21 ++++++++----------
 lib/librte_ether/rte_ether_version.map     |  7 ++++++
 22 files changed, 116 insertions(+), 79 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 17ae446..300140d 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -381,9 +381,9 @@ struct rte_fdir_conf fdir_conf = {
 /* Forward function declarations */
 static void map_port_queue_stats_mapping_registers(uint8_t pi, struct rte_port *port);
 static void check_all_ports_link_status(uint32_t port_mask);
-static void eth_event_callback(uint8_t port_id,
-			       enum rte_eth_event_type type,
-			       void *param);
+static int eth_event_callback(uint8_t port_id,
+			      enum rte_eth_event_type type,
+			      void *param, void *ret_param);
 
 /*
  * Check if all the ports are started.
@@ -1829,8 +1829,9 @@ struct pmd_test_command {
 }
 
 /* This function is used by the interrupt thread */
-static void
-eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param)
+static int
+eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param,
+		  void *ret_param)
 {
 	static const char * const event_desc[] = {
 		[RTE_ETH_EVENT_UNKNOWN] = "Unknown",
@@ -1844,6 +1845,7 @@ struct pmd_test_command {
 	};
 
 	RTE_SET_USED(param);
+	RTE_SET_USED(ret_param);
 
 	if (type >= RTE_ETH_EVENT_MAX) {
 		fprintf(stderr, "\nPort %" PRIu8 ": %s called upon invalid event %d\n",
@@ -1864,6 +1866,7 @@ struct pmd_test_command {
 	default:
 		break;
 	}
+	return 0;
 }
 
 static int
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index faeb6f4..fa11d1c 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -57,7 +57,7 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg)
 	cb_param.msg = msg;
 
 	_rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX,
-			&cb_param);
+			&cb_param, NULL);
 
 	/* Default to approve */
 	if (cb_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 82959ab..e89a28c 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1438,7 +1438,8 @@ struct bwg_slave {
 	if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
 		slave_eth_dev->dev_ops->link_update(slave_eth_dev, 0);
 		bond_ethdev_lsc_event_callback(slave_eth_dev->data->port_id,
-			RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id);
+			RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id,
+			NULL);
 	}
 
 	return 0;
@@ -1849,7 +1850,8 @@ struct bwg_slave {
 
 				bond_ethdev_lsc_event_callback(internals->slaves[i].port_id,
 						RTE_ETH_EVENT_INTR_LSC,
-						&bonded_ethdev->data->port_id);
+						&bonded_ethdev->data->port_id,
+						NULL);
 			}
 		}
 		rte_spinlock_unlock(&internals->lock);
@@ -1995,35 +1997,36 @@ struct bwg_slave {
 		return;
 
 	_rte_eth_dev_callback_process((struct rte_eth_dev *)arg,
-			RTE_ETH_EVENT_INTR_LSC, NULL);
+			RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 }
 
-void
+int
 bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type,
-		void *param)
+		void *param, void *ret_param __rte_unused)
 {
 	struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev;
 	struct bond_dev_private *internals;
 	struct rte_eth_link link;
+	int rc = -1;
 
 	int i, valid_slave = 0;
 	uint8_t active_pos;
 	uint8_t lsc_flag = 0;
 
 	if (type != RTE_ETH_EVENT_INTR_LSC || param == NULL)
-		return;
+		return rc;
 
 	bonded_eth_dev = &rte_eth_devices[*(uint8_t *)param];
 	slave_eth_dev = &rte_eth_devices[port_id];
 
 	if (check_for_bonded_ethdev(bonded_eth_dev))
-		return;
+		return rc;
 
 	internals = bonded_eth_dev->data->dev_private;
 
 	/* If the device isn't started don't handle interrupts */
 	if (!bonded_eth_dev->data->dev_started)
-		return;
+		return rc;
 
 	/* verify that port_id is a valid slave of bonded port */
 	for (i = 0; i < internals->slave_count; i++) {
@@ -2034,7 +2037,7 @@ struct bwg_slave {
 	}
 
 	if (!valid_slave)
-		return;
+		return rc;
 
 	/* Search for port in active port list */
 	active_pos = find_slave_by_id(internals->active_slaves,
@@ -2043,7 +2046,7 @@ struct bwg_slave {
 	rte_eth_link_get_nowait(port_id, &link);
 	if (link.link_status) {
 		if (active_pos < internals->active_slave_count)
-			return;
+			return rc;
 
 		/* if no active slave ports then set this port to be primary port */
 		if (internals->active_slave_count < 1) {
@@ -2065,7 +2068,7 @@ struct bwg_slave {
 				RTE_LOG(ERR, PMD,
 					"port %u invalid speed/duplex\n",
 					port_id);
-				return;
+				return rc;
 			}
 		}
 
@@ -2077,7 +2080,7 @@ struct bwg_slave {
 			bond_ethdev_primary_set(internals, port_id);
 	} else {
 		if (active_pos == internals->active_slave_count)
-			return;
+			return rc;
 
 		/* Remove from active slave list */
 		deactivate_slave(bonded_eth_dev, port_id);
@@ -2116,7 +2119,8 @@ struct bwg_slave {
 						(void *)bonded_eth_dev);
 			else
 				_rte_eth_dev_callback_process(bonded_eth_dev,
-						RTE_ETH_EVENT_INTR_LSC, NULL);
+						RTE_ETH_EVENT_INTR_LSC,
+						NULL, NULL);
 
 		} else {
 			if (internals->link_down_delay_ms > 0)
@@ -2125,9 +2129,11 @@ struct bwg_slave {
 						(void *)bonded_eth_dev);
 			else
 				_rte_eth_dev_callback_process(bonded_eth_dev,
-						RTE_ETH_EVENT_INTR_LSC, NULL);
+						RTE_ETH_EVENT_INTR_LSC,
+						NULL, NULL);
 		}
 	}
+	return 0;
 }
 
 static int
diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h
index b76385f..6c77d20 100644
--- a/drivers/net/bonding/rte_eth_bond_private.h
+++ b/drivers/net/bonding/rte_eth_bond_private.h
@@ -263,9 +263,9 @@ struct bond_dev_private {
 bond_ethdev_primary_set(struct bond_dev_private *internals,
 		uint8_t slave_port_id);
 
-void
+int
 bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type,
-		void *param);
+		void *param, void *ret_param);
 
 int
 bond_ethdev_parse_slave_port_kvarg(const char *key,
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index ba505e7..3d4ab93 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1670,7 +1670,7 @@ static int eth_em_pci_remove(struct rte_pci_device *pci_dev)
 
 	eth_em_interrupt_get_status(dev);
 	eth_em_interrupt_action(dev, dev->intr_handle);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 }
 
 static int
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index a0da9d5..da03d9b 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -2898,7 +2898,8 @@ static int eth_igb_rxq_interrupt_setup(struct rte_eth_dev *dev)
 		E1000_WRITE_REG(hw, E1000_TCTL, tctl);
 		E1000_WRITE_REG(hw, E1000_RCTL, rctl);
 		E1000_WRITE_FLUSH(hw);
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 
 	return 0;
@@ -2957,7 +2958,8 @@ void igbvf_mbx_process(struct rte_eth_dev *dev)
 
 	/* PF reset VF event */
 	if (in_msg == E1000_PF_CONTROL_MSG)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+					      NULL, NULL);
 }
 
 static int
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index b4c6264..27a42fc 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -430,7 +430,7 @@ int enic_link_update(struct enic *enic)
 	vnic_intr_return_all_credits(&enic->intr);
 
 	enic_link_update(enic);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 	enic_log_q_error(enic);
 }
 
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index f614949..0e1f556 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -5804,7 +5804,7 @@ struct i40e_vsi *
 			ret = i40e_dev_link_update(dev, 0);
 			if (!ret)
 				_rte_eth_dev_callback_process(dev,
-					RTE_ETH_EVENT_INTR_LSC, NULL);
+					RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 			break;
 		default:
 			PMD_DRV_LOG(DEBUG, "Request %u is not supported yet",
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 2d5a9b5..91c1c0f 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1328,7 +1328,8 @@ static int i40evf_dev_xstats_get(struct rte_eth_dev *dev,
 	switch (pf_msg->event) {
 	case I40E_VIRTCHNL_EVENT_RESET_IMPENDING:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event");
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+					      NULL, NULL);
 		break;
 	case I40E_VIRTCHNL_EVENT_LINK_CHANGE:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event");
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 0758503..a21fae1 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -1231,7 +1231,7 @@
 	struct i40e_pf_vf *vf;
 	/* AdminQ will pass absolute VF id, transfer to internal vf id */
 	uint16_t vf_id = abs_vf_id - hw->func_caps.vf_base_id;
-	struct rte_pmd_i40e_mb_event_param cb_param;
+	struct rte_pmd_i40e_mb_event_param ret_param;
 	bool b_op = TRUE;
 
 	if (vf_id > pf->vf_num - 1 || !pf->vfs) {
@@ -1251,22 +1251,23 @@
 	 * initialise structure to send to user application
 	 * will return response from user in retval field
 	 */
-	cb_param.retval = RTE_PMD_I40E_MB_EVENT_PROCEED;
-	cb_param.vfid = vf_id;
-	cb_param.msg_type = opcode;
-	cb_param.msg = (void *)msg;
-	cb_param.msglen = msglen;
+	ret_param.retval = RTE_PMD_I40E_MB_EVENT_PROCEED;
+	ret_param.vfid = vf_id;
+	ret_param.msg_type = opcode;
+	ret_param.msg = (void *)msg;
+	ret_param.msglen = msglen;
 
 	/**
 	 * Ask user application if we're allowed to perform those functions.
-	 * If we get cb_param.retval == RTE_PMD_I40E_MB_EVENT_PROCEED,
+	 * If we get ret_param.retval == RTE_PMD_I40E_MB_EVENT_PROCEED,
 	 * then business as usual.
 	 * If RTE_PMD_I40E_MB_EVENT_NOOP_ACK or RTE_PMD_I40E_MB_EVENT_NOOP_NACK,
 	 * do nothing and send not_supported to VF. As PF must send a response
 	 * to VF and ACK/NACK is not defined.
 	 */
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);
-	if (cb_param.retval != RTE_PMD_I40E_MB_EVENT_PROCEED) {
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX,
+				      NULL, &ret_param);
+	if (ret_param.retval != RTE_PMD_I40E_MB_EVENT_PROCEED) {
 		PMD_DRV_LOG(WARNING, "VF to PF message(%d) is not permitted!",
 			    opcode);
 		b_op = FALSE;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 504e951..a7ec651 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4155,12 +4155,13 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 		ixgbe_dev_link_update(dev, 0);
 		intr->flags &= ~IXGBE_FLAG_NEED_LINK_UPDATE;
 		ixgbe_dev_link_status_print(dev);
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 
 	if (intr->flags & IXGBE_FLAG_MACSEC) {
 		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_MACSEC,
-					      NULL);
+					      NULL, NULL);
 		intr->flags &= ~IXGBE_FLAG_MACSEC;
 	}
 
@@ -7868,7 +7869,8 @@ static void ixgbevf_mbx_process(struct rte_eth_dev *dev)
 
 	/* PF reset VF event */
 	if (in_msg == IXGBE_PF_CONTROL_MSG)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+					      NULL, NULL);
 }
 
 static int
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index a56b270..c0d86c7 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -683,7 +683,7 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ixgbe_vf_info *vfinfo =
 		*IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
-	struct rte_pmd_ixgbe_mb_event_param cb_param;
+	struct rte_pmd_ixgbe_mb_event_param ret_param;
 
 	retval = ixgbe_read_mbx(hw, msgbuf, mbx_size, vf);
 	if (retval) {
@@ -702,10 +702,10 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)
 	 * initialise structure to send to user application
 	 * will return response from user in retval field
 	 */
-	cb_param.retval = RTE_PMD_IXGBE_MB_EVENT_PROCEED;
-	cb_param.vfid = vf;
-	cb_param.msg_type = msgbuf[0] & 0xFFFF;
-	cb_param.msg = (void *)msgbuf;
+	ret_param.retval = RTE_PMD_IXGBE_MB_EVENT_PROCEED;
+	ret_param.vfid = vf;
+	ret_param.msg_type = msgbuf[0] & 0xFFFF;
+	ret_param.msg = (void *)msgbuf;
 
 	/* perform VF reset */
 	if (msgbuf[0] == IXGBE_VF_RESET) {
@@ -714,20 +714,22 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)
 		vfinfo[vf].clear_to_send = true;
 
 		/* notify application about VF reset */
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX,
+					      NULL, &ret_param);
 		return ret;
 	}
 
 	/**
 	 * ask user application if we allowed to perform those functions
-	 * if we get cb_param.retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED
+	 * if we get ret_param.retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED
 	 * then business as usual,
 	 * if 0, do nothing and send ACK to VF
-	 * if cb_param.retval > 1, do nothing and send NAK to VF
+	 * if ret_param.retval > 1, do nothing and send NAK to VF
 	 */
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX,
+				      NULL, &ret_param);
 
-	retval = cb_param.retval;
+	retval = ret_param.retval;
 
 	/* check & process VF to PF mailbox message */
 	switch ((msgbuf[0] & 0xFFFF)) {
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 5bc2a50..16cafae 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -5411,7 +5411,8 @@ struct txq_mp2mr_mbuf_check_data {
 	ret = priv_dev_status_handler(priv, dev, &events);
 	priv_unlock(priv);
 	if (ret > 0 && events & (1 << RTE_ETH_EVENT_INTR_LSC))
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL,
+					      NULL);
 }
 
 /**
@@ -5440,7 +5441,8 @@ struct txq_mp2mr_mbuf_check_data {
 		     i++) {
 			if (ev & (1 << i)) {
 				ev &= ~(1 << i);
-				_rte_eth_dev_callback_process(dev, i, NULL);
+				_rte_eth_dev_callback_process(dev, i, NULL,
+							      NULL);
 				ret--;
 			}
 		}
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index eadf452..96bccd5 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1262,7 +1262,8 @@ struct priv *
 	ret = priv_dev_link_status_handler(priv, dev);
 	priv_unlock(priv);
 	if (ret)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL,
+					      NULL);
 }
 
 /**
@@ -1284,7 +1285,8 @@ struct priv *
 	ret = priv_dev_link_status_handler(priv, dev);
 	priv_unlock(priv);
 	if (ret)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL,
+					      NULL);
 }
 
 /**
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index ffd0f10..986c2ee 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1334,7 +1334,7 @@ static void nfp_net_read_mac(struct nfp_net_hw *hw)
 	struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
 
 	nfp_net_link_update(dev, 0);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 
 	nfp_net_dev_link_status_print(dev);
 
diff --git a/drivers/net/sfc/sfc_intr.c b/drivers/net/sfc/sfc_intr.c
index dfa453a..ee59cb1 100644
--- a/drivers/net/sfc/sfc_intr.c
+++ b/drivers/net/sfc/sfc_intr.c
@@ -111,7 +111,8 @@
 			 sa->eth_dev->data->dev_link.link_status ?
 			 "UP" : "DOWN");
 		_rte_eth_dev_callback_process(sa->eth_dev,
-					      RTE_ETH_EVENT_INTR_LSC, NULL);
+					      RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 }
 
@@ -152,7 +153,8 @@
 	if (lsc_seq != sa->port.lsc_seq) {
 		sfc_info(sa, "link status change event");
 		_rte_eth_dev_callback_process(sa->eth_dev,
-					      RTE_ETH_EVENT_INTR_LSC, NULL);
+					      RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 }
 
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 520ccc6..6aa798f 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -111,7 +111,8 @@ static void nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic,
 	if (nicvf_reg_poll_interrupts(nic) == NIC_MBOX_MSG_BGX_LINK_CHANGE) {
 		if (dev->data->dev_conf.intr_conf.lsc)
 			nicvf_set_eth_link_status(nic, &dev->data->dev_link);
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 
 	rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000,
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 257bf6d..98b3675 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -607,7 +607,8 @@ struct vhost_xstats_name_off {
 
 	RTE_LOG(INFO, PMD, "New connection established\n");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC,
+				      NULL, NULL);
 
 	return 0;
 }
@@ -661,7 +662,8 @@ struct vhost_xstats_name_off {
 
 	RTE_LOG(INFO, PMD, "Connection closed\n");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC,
+				      NULL, NULL);
 }
 
 static int
@@ -690,7 +692,8 @@ struct vhost_xstats_name_off {
 	RTE_LOG(INFO, PMD, "vring%u is %s\n",
 			vring, enable ? "enabled" : "disabled");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_QUEUE_STATE, NULL);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_QUEUE_STATE,
+				      NULL, NULL);
 
 	return 0;
 }
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 4fcda80..f0d59a8 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1229,7 +1229,8 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev,
 	if (isr & VIRTIO_PCI_ISR_CONFIG) {
 		if (virtio_dev_link_update(dev, 0) == 0)
 			_rte_eth_dev_callback_process(dev,
-						      RTE_ETH_EVENT_INTR_LSC, NULL);
+						      RTE_ETH_EVENT_INTR_LSC,
+						      NULL, NULL);
 	}
 
 }
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 9227ecc..e983d78 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -129,6 +129,7 @@ struct rte_eth_dev_callback {
 	TAILQ_ENTRY(rte_eth_dev_callback) next; /**< Callbacks list */
 	rte_eth_dev_cb_fn cb_fn;                /**< Callback address */
 	void *cb_arg;                           /**< Parameter for callback */
+	void *ret_param;                        /**< Return parameter */
 	enum rte_eth_event_type event;          /**< Interrupt event type */
 	uint32_t active;                        /**< Callback is executing */
 };
@@ -2717,12 +2718,13 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 	return ret;
 }
 
-void
+int
 _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
-	enum rte_eth_event_type event, void *cb_arg)
+	enum rte_eth_event_type event, void *cb_arg, void *ret_param)
 {
 	struct rte_eth_dev_callback *cb_lst;
 	struct rte_eth_dev_callback dev_cb;
+	int rc = 0;
 
 	rte_spinlock_lock(&rte_eth_dev_cb_lock);
 	TAILQ_FOREACH(cb_lst, &(dev->link_intr_cbs), next) {
@@ -2732,14 +2734,17 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 		cb_lst->active = 1;
 		if (cb_arg != NULL)
 			dev_cb.cb_arg = cb_arg;
+		if (ret_param != NULL)
+			dev_cb.ret_param = ret_param;
 
 		rte_spinlock_unlock(&rte_eth_dev_cb_lock);
-		dev_cb.cb_fn(dev->data->port_id, dev_cb.event,
-						dev_cb.cb_arg);
+		rc = dev_cb.cb_fn(dev->data->port_id, dev_cb.event,
+				dev_cb.cb_arg, dev_cb.ret_param);
 		rte_spinlock_lock(&rte_eth_dev_cb_lock);
 		cb_lst->active = 0;
 	}
 	rte_spinlock_unlock(&rte_eth_dev_cb_lock);
+	return rc;
 }
 
 int
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index b0d2353..63f0e06 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -3338,8 +3338,8 @@ enum rte_eth_event_type {
 	RTE_ETH_EVENT_MAX       /**< max value of this enum */
 };
 
-typedef void (*rte_eth_dev_cb_fn)(uint8_t port_id, \
-		enum rte_eth_event_type event, void *cb_arg);
+typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id,
+		enum rte_eth_event_type event, void *cb_arg, void *ret_param);
 /**< user application callback to be registered for interrupts */
 
 
@@ -3356,11 +3356,6 @@ typedef void (*rte_eth_dev_cb_fn)(uint8_t port_id, \
  * @param cb_arg
  *  Pointer to the parameters for the registered callback.
  *
- *  The user data is overwritten in the case of RTE_ETH_EVENT_VF_MBOX.
- *	This even occurs when a message from the VF is received by the PF.
- *	The user data is overwritten with struct rte_pmd_ixgbe_mb_event_param.
- *	This struct is defined in rte_pmd_ixgbe.h.
- *
  * @return
  *  - On success, zero.
  *  - On failure, a negative value.
@@ -3400,15 +3395,17 @@ int rte_eth_dev_callback_unregister(uint8_t port_id,
  * @param event
  *  Eth device interrupt event type.
  * @param cb_arg
- *  Update callback parameter to pass data back to user application.
+ *  callback parameter.
+ * @param ret_param
+ *  To pass data back to user application.
  *  This allows the user application to decide if a particular function
  *  is permitted or not.
  *
  * @return
- *  void
+ *  int
  */
-void _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
-				enum rte_eth_event_type event, void *cb_arg);
+int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
+		enum rte_eth_event_type event, void *cb_arg, void *ret_param);
 
 /**
  * When there is no rx packet coming in Rx Queue for a long time, we can
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index 1d22434..aefc826 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -147,3 +147,10 @@ DPDK_17.05 {
 	rte_eth_xstats_get_names_by_id;
 
 } DPDK_17.02;
+
+DPDK_17.08 {
+	global:
+
+	_rte_eth_dev_callback_process;
+
+} DPDK_17.05;
-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 2/4] test: callback process API changes
  2017-05-19 11:03 [dpdk-dev] [PATCH v1 0/4] ethdev: callback process API Bernard Iremonger
                   ` (5 preceding siblings ...)
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 1/4] " Bernard Iremonger
@ 2017-06-12 15:18 ` Bernard Iremonger
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 3/4] examples: " Bernard Iremonger
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 4/4] doc: remove deprecation notice Bernard Iremonger
  8 siblings, 0 replies; 24+ messages in thread
From: Bernard Iremonger @ 2017-06-12 15:18 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard.Iremonger

From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>

Modify the following test code for rte_eth_dev_callback_process
API changes:

virtual_pmd
test_link_bonding

Signed-off-by: Bernard.Iremonger <Bernard.iremonger@intel.com>
---
 test/test/test_link_bonding.c | 8 ++++++--
 test/test/virtual_pmd.c       | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/test/test/test_link_bonding.c b/test/test/test_link_bonding.c
index 52d2d05..0c67f04 100644
--- a/test/test/test_link_bonding.c
+++ b/test/test/test_link_bonding.c
@@ -1173,15 +1173,19 @@ struct rte_fdir_conf fdir_conf = {
 int test_lsc_interrupt_count;
 
 
-static void
+static int
 test_bonding_lsc_event_callback(uint8_t port_id __rte_unused,
-		enum rte_eth_event_type type  __rte_unused, void *param __rte_unused)
+		enum rte_eth_event_type type  __rte_unused,
+		void *param __rte_unused,
+		void *ret_param __rte_unused)
 {
 	pthread_mutex_lock(&mutex);
 	test_lsc_interrupt_count++;
 
 	pthread_cond_signal(&cvar);
 	pthread_mutex_unlock(&mutex);
+
+	return 0;
 }
 
 static inline int
diff --git a/test/test/virtual_pmd.c b/test/test/virtual_pmd.c
index e9dd8ac..78ed7c0 100644
--- a/test/test/virtual_pmd.c
+++ b/test/test/virtual_pmd.c
@@ -484,7 +484,8 @@ static void  virtual_ethdev_stop(struct rte_eth_dev *eth_dev __rte_unused)
 
 	vrtl_eth_dev->data->dev_link.link_status = link_status;
 
-	_rte_eth_dev_callback_process(vrtl_eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(vrtl_eth_dev, RTE_ETH_EVENT_INTR_LSC,
+				      NULL, NULL);
 }
 
 int
-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 3/4] examples: callback process API changes
  2017-05-19 11:03 [dpdk-dev] [PATCH v1 0/4] ethdev: callback process API Bernard Iremonger
                   ` (6 preceding siblings ...)
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 2/4] test: callback process API changes Bernard Iremonger
@ 2017-06-12 15:18 ` Bernard Iremonger
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 4/4] doc: remove deprecation notice Bernard Iremonger
  8 siblings, 0 replies; 24+ messages in thread
From: Bernard Iremonger @ 2017-06-12 15:18 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard.Iremonger

From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>

Modify the link_status_interrupt sample application for
the rte_eth_dev_callback_process API changes.

Signed-off-by: Bernard.Iremonger <Bernard.iremonger@intel.com>
---
 examples/link_status_interrupt/main.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 25da28e..d585789 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -469,14 +469,16 @@ struct lsi_port_statistics {
  *  Pointer to(address of) the parameters.
  *
  * @return
- *  void.
+ *  int.
  */
-static void
-lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param)
+static int
+lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param,
+		    void *ret_param)
 {
 	struct rte_eth_link link;
 
 	RTE_SET_USED(param);
+	RTE_SET_USED(ret_param);
 
 	printf("\n\nIn registered callback...\n");
 	printf("Event type: %s\n", type == RTE_ETH_EVENT_INTR_LSC ? "LSC interrupt" : "unknown event");
@@ -488,6 +490,8 @@ struct lsi_port_statistics {
 				("full-duplex") : ("half-duplex"));
 	} else
 		printf("Port %d Link Down\n\n", port_id);
+
+	return 0;
 }
 
 /* Check the link status of all ports in up to 9s, and print them finally */
-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v2 4/4] doc: remove deprecation notice
  2017-05-19 11:03 [dpdk-dev] [PATCH v1 0/4] ethdev: callback process API Bernard Iremonger
                   ` (7 preceding siblings ...)
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 3/4] examples: " Bernard Iremonger
@ 2017-06-12 15:18 ` Bernard Iremonger
  2017-06-13  8:52   ` Mcnamara, John
  8 siblings, 1 reply; 24+ messages in thread
From: Bernard Iremonger @ 2017-06-12 15:18 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard.Iremonger

From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>

Remove deprecation notice for rte_eth_dev_callback_process
API changes.

Signed-off-by: Bernard.Iremonger <Bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 1786a59..308cb41 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -34,10 +34,6 @@ Deprecation Notices
 * The struct ``rte_pci_driver`` is planned to be removed from
   ``rte_cryptodev_driver`` and ``rte_eventdev_driver`` in 17.08.
 
-* ethdev: An API change is planned for 17.08 for the function
-  ``_rte_eth_dev_callback_process``. In 17.08 the function will return an ``int``
-  instead of ``void`` and a fourth parameter ``void *ret_param`` will be added.
-
 * The mbuf flags PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated and
   are respectively replaced by PKT_RX_VLAN_STRIPPED and
   PKT_RX_QINQ_STRIPPED, that are better described. The old flags and
-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v2 4/4] doc: remove deprecation notice
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 4/4] doc: remove deprecation notice Bernard Iremonger
@ 2017-06-13  8:52   ` Mcnamara, John
  0 siblings, 0 replies; 24+ messages in thread
From: Mcnamara, John @ 2017-06-13  8:52 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, thomas; +Cc: Iremonger, Bernard



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bernard Iremonger
> Sent: Monday, June 12, 2017 4:18 PM
> To: dev@dpdk.org; thomas@monjalon.net
> Cc: Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [dpdk-dev] [PATCH v2 4/4] doc: remove deprecation notice
> 
> From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>
> 
> Remove deprecation notice for rte_eth_dev_callback_process API changes.
> 
> Signed-off-by: Bernard.Iremonger <Bernard.iremonger@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: modify callback process API
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 1/4] " Bernard Iremonger
@ 2017-06-14 21:22   ` Thomas Monjalon
  2017-06-15 10:56     ` Iremonger, Bernard
  2017-06-15 15:43   ` Stephen Hemminger
  1 sibling, 1 reply; 24+ messages in thread
From: Thomas Monjalon @ 2017-06-14 21:22 UTC (permalink / raw)
  To: bernard.iremonger; +Cc: dev

Hi,

12/06/2017 17:18, Bernard Iremonger:
> Change the rte_eth_dev_callback_process function to return int,
> and add a void *ret_param parameter.

You should squash tests and examples changes in this change to avoid
breaking compilation.
Doc patch can also be squashed.

> --- a/lib/librte_ether/rte_ether_version.map
> +++ b/lib/librte_ether/rte_ether_version.map
> +DPDK_17.08 {
> +	global:
> +
> +	_rte_eth_dev_callback_process;
> +
> +} DPDK_17.05;

You should remove the original function from 2.2 ABI block.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: modify callback process API
  2017-06-14 21:22   ` Thomas Monjalon
@ 2017-06-15 10:56     ` Iremonger, Bernard
  0 siblings, 0 replies; 24+ messages in thread
From: Iremonger, Bernard @ 2017-06-15 10:56 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

Hi Thomas,

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Wednesday, June 14, 2017 10:22 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: modify callback process API
> 
> Hi,
> 
> 12/06/2017 17:18, Bernard Iremonger:
> > Change the rte_eth_dev_callback_process function to return int, and
> > add a void *ret_param parameter.
> 
> You should squash tests and examples changes in this change to avoid
> breaking compilation.
> Doc patch can also be squashed.
> 

I will squash patches into one patch.

> > --- a/lib/librte_ether/rte_ether_version.map
> > +++ b/lib/librte_ether/rte_ether_version.map
> > +DPDK_17.08 {
> > +	global:
> > +
> > +	_rte_eth_dev_callback_process;
> > +
> > +} DPDK_17.05;
> 
> You should remove the original function from 2.2 ABI block.

I will remove from 2.2 ABI block.

Thanks for the review.

Regards,

Bernard.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v3] ethdev: callback process API
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 0/4] ethdev: callback process API Bernard Iremonger
@ 2017-06-15 12:29   ` Bernard Iremonger
  2017-06-15 12:29   ` [dpdk-dev] [PATCH v3] ethdev: modify " Bernard Iremonger
  1 sibling, 0 replies; 24+ messages in thread
From: Bernard Iremonger @ 2017-06-15 12:29 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard Iremonger

At present the _rte_eth_dev_callback_process function is
using the cb_arg parameter to return data to the caller.
The cb_arg parameter is an input parameter and should not
be used to return data to the caller.

In this patchset the return type of
_rte_eth_dev_callback_process has been changed from void
to int to allow return of a return value to the caller
and an extra parameter void *ret_param has been added to
return data to caller.

All references to _rte_eth_dev_callback_process have
been updated for these API changes.

Changes in v3:
Rebase to latest dpdk-next-net.
All four patches squashed into one.
Fix to rte_ether_version.map

Changes in v2:
Rebase to latest dpdk-next-net.
Modify mlx4, mlx5 and bnxt PMD's.

Bernard.Iremonger (1):
  ethdev: modify callback process API

 app/test-pmd/testpmd.c                     | 13 +++++++-----
 doc/guides/rel_notes/deprecation.rst       |  4 ----
 drivers/net/bnxt/rte_pmd_bnxt.c            |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c     | 34 ++++++++++++++++++------------
 drivers/net/bonding/rte_eth_bond_private.h |  4 ++--
 drivers/net/e1000/em_ethdev.c              |  2 +-
 drivers/net/e1000/igb_ethdev.c             |  6 ++++--
 drivers/net/enic/enic_main.c               |  2 +-
 drivers/net/i40e/i40e_ethdev.c             |  2 +-
 drivers/net/i40e/i40e_ethdev_vf.c          |  3 ++-
 drivers/net/i40e/i40e_pf.c                 | 19 +++++++++--------
 drivers/net/ixgbe/ixgbe_ethdev.c           |  8 ++++---
 drivers/net/ixgbe/ixgbe_pf.c               | 22 ++++++++++---------
 drivers/net/mlx4/mlx4.c                    |  6 ++++--
 drivers/net/mlx5/mlx5_ethdev.c             |  6 ++++--
 drivers/net/nfp/nfp_net.c                  |  2 +-
 drivers/net/sfc/sfc_intr.c                 |  6 ++++--
 drivers/net/thunderx/nicvf_ethdev.c        |  3 ++-
 drivers/net/vhost/rte_eth_vhost.c          |  9 +++++---
 drivers/net/virtio/virtio_ethdev.c         |  3 ++-
 examples/link_status_interrupt/main.c      | 10 ++++++---
 lib/librte_ether/rte_ethdev.c              | 15 ++++++++-----
 lib/librte_ether/rte_ethdev.h              | 21 ++++++++----------
 lib/librte_ether/rte_ether_version.map     |  2 +-
 test/test/test_link_bonding.c              |  8 +++++--
 test/test/virtual_pmd.c                    |  3 ++-
 26 files changed, 125 insertions(+), 90 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH v3] ethdev: modify callback process API
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 0/4] ethdev: callback process API Bernard Iremonger
  2017-06-15 12:29   ` [dpdk-dev] [PATCH v3] " Bernard Iremonger
@ 2017-06-15 12:29   ` Bernard Iremonger
  2017-07-01 15:19     ` Thomas Monjalon
  1 sibling, 1 reply; 24+ messages in thread
From: Bernard Iremonger @ 2017-06-15 12:29 UTC (permalink / raw)
  To: dev, thomas; +Cc: Bernard.Iremonger, Bernard Iremonger

From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>

Change the rte_eth_dev_callback_process function to return int,
and add a void *ret_param parameter.
Update version map

Modify the following PMD's for rte_eth_dev_callback_process
API changes:

net/bonding
net/nfp
net/enic
net/vhost
net/virtio
net/thunderx
net/e1000: e1000 and igb
net/sfc
net/ixgbe
net/i40e
net/mlx4
net/mlx5
net/bnxt

Modify testpmd for rte_eth_dev_callback_process API changes
app/testpmd

Modify the following test code for rte_eth_dev_callback_process
API changes:
test/virtual_pmd
test/test_link_bonding

Modify the link_status_interrupt sample application for
the rte_eth_dev_callback_process API changes.
examples/link_status_interrupt

Remove deprecation notice for rte_eth_dev_callback_process
API changes.
doc/guides/rel_notes

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/testpmd.c                     | 13 +++++++-----
 doc/guides/rel_notes/deprecation.rst       |  4 ----
 drivers/net/bnxt/rte_pmd_bnxt.c            |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c     | 34 ++++++++++++++++++------------
 drivers/net/bonding/rte_eth_bond_private.h |  4 ++--
 drivers/net/e1000/em_ethdev.c              |  2 +-
 drivers/net/e1000/igb_ethdev.c             |  6 ++++--
 drivers/net/enic/enic_main.c               |  2 +-
 drivers/net/i40e/i40e_ethdev.c             |  2 +-
 drivers/net/i40e/i40e_ethdev_vf.c          |  3 ++-
 drivers/net/i40e/i40e_pf.c                 | 19 +++++++++--------
 drivers/net/ixgbe/ixgbe_ethdev.c           |  8 ++++---
 drivers/net/ixgbe/ixgbe_pf.c               | 22 ++++++++++---------
 drivers/net/mlx4/mlx4.c                    |  6 ++++--
 drivers/net/mlx5/mlx5_ethdev.c             |  6 ++++--
 drivers/net/nfp/nfp_net.c                  |  2 +-
 drivers/net/sfc/sfc_intr.c                 |  6 ++++--
 drivers/net/thunderx/nicvf_ethdev.c        |  3 ++-
 drivers/net/vhost/rte_eth_vhost.c          |  9 +++++---
 drivers/net/virtio/virtio_ethdev.c         |  3 ++-
 examples/link_status_interrupt/main.c      | 10 ++++++---
 lib/librte_ether/rte_ethdev.c              | 15 ++++++++-----
 lib/librte_ether/rte_ethdev.h              | 21 ++++++++----------
 lib/librte_ether/rte_ether_version.map     |  2 +-
 test/test/test_link_bonding.c              |  8 +++++--
 test/test/virtual_pmd.c                    |  3 ++-
 26 files changed, 125 insertions(+), 90 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index d32cbb9..2e3ae5a 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -381,9 +381,9 @@ struct rte_fdir_conf fdir_conf = {
 /* Forward function declarations */
 static void map_port_queue_stats_mapping_registers(uint8_t pi, struct rte_port *port);
 static void check_all_ports_link_status(uint32_t port_mask);
-static void eth_event_callback(uint8_t port_id,
-			       enum rte_eth_event_type type,
-			       void *param);
+static int eth_event_callback(uint8_t port_id,
+			      enum rte_eth_event_type type,
+			      void *param, void *ret_param);
 
 /*
  * Check if all the ports are started.
@@ -1829,8 +1829,9 @@ struct pmd_test_command {
 }
 
 /* This function is used by the interrupt thread */
-static void
-eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param)
+static int
+eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param,
+		  void *ret_param)
 {
 	static const char * const event_desc[] = {
 		[RTE_ETH_EVENT_UNKNOWN] = "Unknown",
@@ -1844,6 +1845,7 @@ struct pmd_test_command {
 	};
 
 	RTE_SET_USED(param);
+	RTE_SET_USED(ret_param);
 
 	if (type >= RTE_ETH_EVENT_MAX) {
 		fprintf(stderr, "\nPort %" PRIu8 ": %s called upon invalid event %d\n",
@@ -1864,6 +1866,7 @@ struct pmd_test_command {
 	default:
 		break;
 	}
+	return 0;
 }
 
 static int
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 1786a59..308cb41 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -34,10 +34,6 @@ Deprecation Notices
 * The struct ``rte_pci_driver`` is planned to be removed from
   ``rte_cryptodev_driver`` and ``rte_eventdev_driver`` in 17.08.
 
-* ethdev: An API change is planned for 17.08 for the function
-  ``_rte_eth_dev_callback_process``. In 17.08 the function will return an ``int``
-  instead of ``void`` and a fourth parameter ``void *ret_param`` will be added.
-
 * The mbuf flags PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated and
   are respectively replaced by PKT_RX_VLAN_STRIPPED and
   PKT_RX_QINQ_STRIPPED, that are better described. The old flags and
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index faeb6f4..fa11d1c 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -57,7 +57,7 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg)
 	cb_param.msg = msg;
 
 	_rte_eth_dev_callback_process(bp->eth_dev, RTE_ETH_EVENT_VF_MBOX,
-			&cb_param);
+			&cb_param, NULL);
 
 	/* Default to approve */
 	if (cb_param.retval == RTE_PMD_BNXT_MB_EVENT_PROCEED)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 37f3d43..4a65f1d 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1438,7 +1438,8 @@ struct bwg_slave {
 	if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
 		slave_eth_dev->dev_ops->link_update(slave_eth_dev, 0);
 		bond_ethdev_lsc_event_callback(slave_eth_dev->data->port_id,
-			RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id);
+			RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id,
+			NULL);
 	}
 
 	return 0;
@@ -1849,7 +1850,8 @@ struct bwg_slave {
 
 				bond_ethdev_lsc_event_callback(internals->slaves[i].port_id,
 						RTE_ETH_EVENT_INTR_LSC,
-						&bonded_ethdev->data->port_id);
+						&bonded_ethdev->data->port_id,
+						NULL);
 			}
 		}
 		rte_spinlock_unlock(&internals->lock);
@@ -1995,35 +1997,36 @@ struct bwg_slave {
 		return;
 
 	_rte_eth_dev_callback_process((struct rte_eth_dev *)arg,
-			RTE_ETH_EVENT_INTR_LSC, NULL);
+			RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 }
 
-void
+int
 bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type,
-		void *param)
+		void *param, void *ret_param __rte_unused)
 {
 	struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev;
 	struct bond_dev_private *internals;
 	struct rte_eth_link link;
+	int rc = -1;
 
 	int i, valid_slave = 0;
 	uint8_t active_pos;
 	uint8_t lsc_flag = 0;
 
 	if (type != RTE_ETH_EVENT_INTR_LSC || param == NULL)
-		return;
+		return rc;
 
 	bonded_eth_dev = &rte_eth_devices[*(uint8_t *)param];
 	slave_eth_dev = &rte_eth_devices[port_id];
 
 	if (check_for_bonded_ethdev(bonded_eth_dev))
-		return;
+		return rc;
 
 	internals = bonded_eth_dev->data->dev_private;
 
 	/* If the device isn't started don't handle interrupts */
 	if (!bonded_eth_dev->data->dev_started)
-		return;
+		return rc;
 
 	/* verify that port_id is a valid slave of bonded port */
 	for (i = 0; i < internals->slave_count; i++) {
@@ -2034,7 +2037,7 @@ struct bwg_slave {
 	}
 
 	if (!valid_slave)
-		return;
+		return rc;
 
 	/* Search for port in active port list */
 	active_pos = find_slave_by_id(internals->active_slaves,
@@ -2043,7 +2046,7 @@ struct bwg_slave {
 	rte_eth_link_get_nowait(port_id, &link);
 	if (link.link_status) {
 		if (active_pos < internals->active_slave_count)
-			return;
+			return rc;
 
 		/* if no active slave ports then set this port to be primary port */
 		if (internals->active_slave_count < 1) {
@@ -2065,7 +2068,7 @@ struct bwg_slave {
 				RTE_LOG(ERR, PMD,
 					"port %u invalid speed/duplex\n",
 					port_id);
-				return;
+				return rc;
 			}
 		}
 
@@ -2077,7 +2080,7 @@ struct bwg_slave {
 			bond_ethdev_primary_set(internals, port_id);
 	} else {
 		if (active_pos == internals->active_slave_count)
-			return;
+			return rc;
 
 		/* Remove from active slave list */
 		deactivate_slave(bonded_eth_dev, port_id);
@@ -2116,7 +2119,8 @@ struct bwg_slave {
 						(void *)bonded_eth_dev);
 			else
 				_rte_eth_dev_callback_process(bonded_eth_dev,
-						RTE_ETH_EVENT_INTR_LSC, NULL);
+						RTE_ETH_EVENT_INTR_LSC,
+						NULL, NULL);
 
 		} else {
 			if (internals->link_down_delay_ms > 0)
@@ -2125,9 +2129,11 @@ struct bwg_slave {
 						(void *)bonded_eth_dev);
 			else
 				_rte_eth_dev_callback_process(bonded_eth_dev,
-						RTE_ETH_EVENT_INTR_LSC, NULL);
+						RTE_ETH_EVENT_INTR_LSC,
+						NULL, NULL);
 		}
 	}
+	return 0;
 }
 
 static int
diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h
index 71067da..1460e82 100644
--- a/drivers/net/bonding/rte_eth_bond_private.h
+++ b/drivers/net/bonding/rte_eth_bond_private.h
@@ -263,9 +263,9 @@ struct bond_dev_private {
 bond_ethdev_primary_set(struct bond_dev_private *internals,
 		uint8_t slave_port_id);
 
-void
+int
 bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type,
-		void *param);
+		void *param, void *ret_param);
 
 int
 bond_ethdev_parse_slave_port_kvarg(const char *key,
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index ba505e7..3d4ab93 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1670,7 +1670,7 @@ static int eth_em_pci_remove(struct rte_pci_device *pci_dev)
 
 	eth_em_interrupt_get_status(dev);
 	eth_em_interrupt_action(dev, dev->intr_handle);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 }
 
 static int
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index a0da9d5..da03d9b 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -2898,7 +2898,8 @@ static int eth_igb_rxq_interrupt_setup(struct rte_eth_dev *dev)
 		E1000_WRITE_REG(hw, E1000_TCTL, tctl);
 		E1000_WRITE_REG(hw, E1000_RCTL, rctl);
 		E1000_WRITE_FLUSH(hw);
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 
 	return 0;
@@ -2957,7 +2958,8 @@ void igbvf_mbx_process(struct rte_eth_dev *dev)
 
 	/* PF reset VF event */
 	if (in_msg == E1000_PF_CONTROL_MSG)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+					      NULL, NULL);
 }
 
 static int
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 2192c7f..40dbec7 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -430,7 +430,7 @@ int enic_link_update(struct enic *enic)
 	vnic_intr_return_all_credits(&enic->intr);
 
 	enic_link_update(enic);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 	enic_log_q_error(enic);
 }
 
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4ee1113..e02fbb1 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -5804,7 +5804,7 @@ struct i40e_vsi *
 			ret = i40e_dev_link_update(dev, 0);
 			if (!ret)
 				_rte_eth_dev_callback_process(dev,
-					RTE_ETH_EVENT_INTR_LSC, NULL);
+					RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 			break;
 		default:
 			PMD_DRV_LOG(DEBUG, "Request %u is not supported yet",
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 2d5a9b5..91c1c0f 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1328,7 +1328,8 @@ static int i40evf_dev_xstats_get(struct rte_eth_dev *dev,
 	switch (pf_msg->event) {
 	case I40E_VIRTCHNL_EVENT_RESET_IMPENDING:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event");
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+					      NULL, NULL);
 		break;
 	case I40E_VIRTCHNL_EVENT_LINK_CHANGE:
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event");
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 0758503..a21fae1 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -1231,7 +1231,7 @@
 	struct i40e_pf_vf *vf;
 	/* AdminQ will pass absolute VF id, transfer to internal vf id */
 	uint16_t vf_id = abs_vf_id - hw->func_caps.vf_base_id;
-	struct rte_pmd_i40e_mb_event_param cb_param;
+	struct rte_pmd_i40e_mb_event_param ret_param;
 	bool b_op = TRUE;
 
 	if (vf_id > pf->vf_num - 1 || !pf->vfs) {
@@ -1251,22 +1251,23 @@
 	 * initialise structure to send to user application
 	 * will return response from user in retval field
 	 */
-	cb_param.retval = RTE_PMD_I40E_MB_EVENT_PROCEED;
-	cb_param.vfid = vf_id;
-	cb_param.msg_type = opcode;
-	cb_param.msg = (void *)msg;
-	cb_param.msglen = msglen;
+	ret_param.retval = RTE_PMD_I40E_MB_EVENT_PROCEED;
+	ret_param.vfid = vf_id;
+	ret_param.msg_type = opcode;
+	ret_param.msg = (void *)msg;
+	ret_param.msglen = msglen;
 
 	/**
 	 * Ask user application if we're allowed to perform those functions.
-	 * If we get cb_param.retval == RTE_PMD_I40E_MB_EVENT_PROCEED,
+	 * If we get ret_param.retval == RTE_PMD_I40E_MB_EVENT_PROCEED,
 	 * then business as usual.
 	 * If RTE_PMD_I40E_MB_EVENT_NOOP_ACK or RTE_PMD_I40E_MB_EVENT_NOOP_NACK,
 	 * do nothing and send not_supported to VF. As PF must send a response
 	 * to VF and ACK/NACK is not defined.
 	 */
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);
-	if (cb_param.retval != RTE_PMD_I40E_MB_EVENT_PROCEED) {
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX,
+				      NULL, &ret_param);
+	if (ret_param.retval != RTE_PMD_I40E_MB_EVENT_PROCEED) {
 		PMD_DRV_LOG(WARNING, "VF to PF message(%d) is not permitted!",
 			    opcode);
 		b_op = FALSE;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index ebc5467..39c7440 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4155,12 +4155,13 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev,
 		ixgbe_dev_link_update(dev, 0);
 		intr->flags &= ~IXGBE_FLAG_NEED_LINK_UPDATE;
 		ixgbe_dev_link_status_print(dev);
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 
 	if (intr->flags & IXGBE_FLAG_MACSEC) {
 		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_MACSEC,
-					      NULL);
+					      NULL, NULL);
 		intr->flags &= ~IXGBE_FLAG_MACSEC;
 	}
 
@@ -7868,7 +7869,8 @@ static void ixgbevf_mbx_process(struct rte_eth_dev *dev)
 
 	/* PF reset VF event */
 	if (in_msg == IXGBE_PF_CONTROL_MSG)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+					      NULL, NULL);
 }
 
 static int
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index a56b270..c0d86c7 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -683,7 +683,7 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ixgbe_vf_info *vfinfo =
 		*IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
-	struct rte_pmd_ixgbe_mb_event_param cb_param;
+	struct rte_pmd_ixgbe_mb_event_param ret_param;
 
 	retval = ixgbe_read_mbx(hw, msgbuf, mbx_size, vf);
 	if (retval) {
@@ -702,10 +702,10 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)
 	 * initialise structure to send to user application
 	 * will return response from user in retval field
 	 */
-	cb_param.retval = RTE_PMD_IXGBE_MB_EVENT_PROCEED;
-	cb_param.vfid = vf;
-	cb_param.msg_type = msgbuf[0] & 0xFFFF;
-	cb_param.msg = (void *)msgbuf;
+	ret_param.retval = RTE_PMD_IXGBE_MB_EVENT_PROCEED;
+	ret_param.vfid = vf;
+	ret_param.msg_type = msgbuf[0] & 0xFFFF;
+	ret_param.msg = (void *)msgbuf;
 
 	/* perform VF reset */
 	if (msgbuf[0] == IXGBE_VF_RESET) {
@@ -714,20 +714,22 @@ int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)
 		vfinfo[vf].clear_to_send = true;
 
 		/* notify application about VF reset */
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX,
+					      NULL, &ret_param);
 		return ret;
 	}
 
 	/**
 	 * ask user application if we allowed to perform those functions
-	 * if we get cb_param.retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED
+	 * if we get ret_param.retval == RTE_PMD_IXGBE_MB_EVENT_PROCEED
 	 * then business as usual,
 	 * if 0, do nothing and send ACK to VF
-	 * if cb_param.retval > 1, do nothing and send NAK to VF
+	 * if ret_param.retval > 1, do nothing and send NAK to VF
 	 */
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX, &cb_param);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_VF_MBOX,
+				      NULL, &ret_param);
 
-	retval = cb_param.retval;
+	retval = ret_param.retval;
 
 	/* check & process VF to PF mailbox message */
 	switch ((msgbuf[0] & 0xFFFF)) {
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 5bc2a50..16cafae 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -5411,7 +5411,8 @@ struct txq_mp2mr_mbuf_check_data {
 	ret = priv_dev_status_handler(priv, dev, &events);
 	priv_unlock(priv);
 	if (ret > 0 && events & (1 << RTE_ETH_EVENT_INTR_LSC))
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL,
+					      NULL);
 }
 
 /**
@@ -5440,7 +5441,8 @@ struct txq_mp2mr_mbuf_check_data {
 		     i++) {
 			if (ev & (1 << i)) {
 				ev &= ~(1 << i);
-				_rte_eth_dev_callback_process(dev, i, NULL);
+				_rte_eth_dev_callback_process(dev, i, NULL,
+							      NULL);
 				ret--;
 			}
 		}
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index eadf452..96bccd5 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1262,7 +1262,8 @@ struct priv *
 	ret = priv_dev_link_status_handler(priv, dev);
 	priv_unlock(priv);
 	if (ret)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL,
+					      NULL);
 }
 
 /**
@@ -1284,7 +1285,8 @@ struct priv *
 	ret = priv_dev_link_status_handler(priv, dev);
 	priv_unlock(priv);
 	if (ret)
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL,
+					      NULL);
 }
 
 /**
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 0ee7fb8..3b41e2e 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1334,7 +1334,7 @@ static void nfp_net_read_mac(struct nfp_net_hw *hw)
 	struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
 
 	nfp_net_link_update(dev, 0);
-	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
 
 	nfp_net_dev_link_status_print(dev);
 
diff --git a/drivers/net/sfc/sfc_intr.c b/drivers/net/sfc/sfc_intr.c
index dfa453a..ee59cb1 100644
--- a/drivers/net/sfc/sfc_intr.c
+++ b/drivers/net/sfc/sfc_intr.c
@@ -111,7 +111,8 @@
 			 sa->eth_dev->data->dev_link.link_status ?
 			 "UP" : "DOWN");
 		_rte_eth_dev_callback_process(sa->eth_dev,
-					      RTE_ETH_EVENT_INTR_LSC, NULL);
+					      RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 }
 
@@ -152,7 +153,8 @@
 	if (lsc_seq != sa->port.lsc_seq) {
 		sfc_info(sa, "link status change event");
 		_rte_eth_dev_callback_process(sa->eth_dev,
-					      RTE_ETH_EVENT_INTR_LSC, NULL);
+					      RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 }
 
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 471cc16..e963673 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -111,7 +111,8 @@ static void nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic,
 	if (nicvf_reg_poll_interrupts(nic) == NIC_MBOX_MSG_BGX_LINK_CHANGE) {
 		if (dev->data->dev_conf.intr_conf.lsc)
 			nicvf_set_eth_link_status(nic, &dev->data->dev_link);
-		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+		_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
+					      NULL, NULL);
 	}
 
 	rte_eal_alarm_set(NICVF_INTR_POLL_INTERVAL_MS * 1000,
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 257bf6d..98b3675 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -607,7 +607,8 @@ struct vhost_xstats_name_off {
 
 	RTE_LOG(INFO, PMD, "New connection established\n");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC,
+				      NULL, NULL);
 
 	return 0;
 }
@@ -661,7 +662,8 @@ struct vhost_xstats_name_off {
 
 	RTE_LOG(INFO, PMD, "Connection closed\n");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC,
+				      NULL, NULL);
 }
 
 static int
@@ -690,7 +692,8 @@ struct vhost_xstats_name_off {
 	RTE_LOG(INFO, PMD, "vring%u is %s\n",
 			vring, enable ? "enabled" : "disabled");
 
-	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_QUEUE_STATE, NULL);
+	_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_QUEUE_STATE,
+				      NULL, NULL);
 
 	return 0;
 }
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 4fcda80..f0d59a8 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1229,7 +1229,8 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev,
 	if (isr & VIRTIO_PCI_ISR_CONFIG) {
 		if (virtio_dev_link_update(dev, 0) == 0)
 			_rte_eth_dev_callback_process(dev,
-						      RTE_ETH_EVENT_INTR_LSC, NULL);
+						      RTE_ETH_EVENT_INTR_LSC,
+						      NULL, NULL);
 	}
 
 }
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 25da28e..d585789 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -469,14 +469,16 @@ struct lsi_port_statistics {
  *  Pointer to(address of) the parameters.
  *
  * @return
- *  void.
+ *  int.
  */
-static void
-lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param)
+static int
+lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param,
+		    void *ret_param)
 {
 	struct rte_eth_link link;
 
 	RTE_SET_USED(param);
+	RTE_SET_USED(ret_param);
 
 	printf("\n\nIn registered callback...\n");
 	printf("Event type: %s\n", type == RTE_ETH_EVENT_INTR_LSC ? "LSC interrupt" : "unknown event");
@@ -488,6 +490,8 @@ struct lsi_port_statistics {
 				("full-duplex") : ("half-duplex"));
 	} else
 		printf("Port %d Link Down\n\n", port_id);
+
+	return 0;
 }
 
 /* Check the link status of all ports in up to 9s, and print them finally */
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 81a45c0..71a576c 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -129,6 +129,7 @@ struct rte_eth_dev_callback {
 	TAILQ_ENTRY(rte_eth_dev_callback) next; /**< Callbacks list */
 	rte_eth_dev_cb_fn cb_fn;                /**< Callback address */
 	void *cb_arg;                           /**< Parameter for callback */
+	void *ret_param;                        /**< Return parameter */
 	enum rte_eth_event_type event;          /**< Interrupt event type */
 	uint32_t active;                        /**< Callback is executing */
 };
@@ -2717,12 +2718,13 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 	return ret;
 }
 
-void
+int
 _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
-	enum rte_eth_event_type event, void *cb_arg)
+	enum rte_eth_event_type event, void *cb_arg, void *ret_param)
 {
 	struct rte_eth_dev_callback *cb_lst;
 	struct rte_eth_dev_callback dev_cb;
+	int rc = 0;
 
 	rte_spinlock_lock(&rte_eth_dev_cb_lock);
 	TAILQ_FOREACH(cb_lst, &(dev->link_intr_cbs), next) {
@@ -2732,14 +2734,17 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 		cb_lst->active = 1;
 		if (cb_arg != NULL)
 			dev_cb.cb_arg = cb_arg;
+		if (ret_param != NULL)
+			dev_cb.ret_param = ret_param;
 
 		rte_spinlock_unlock(&rte_eth_dev_cb_lock);
-		dev_cb.cb_fn(dev->data->port_id, dev_cb.event,
-						dev_cb.cb_arg);
+		rc = dev_cb.cb_fn(dev->data->port_id, dev_cb.event,
+				dev_cb.cb_arg, dev_cb.ret_param);
 		rte_spinlock_lock(&rte_eth_dev_cb_lock);
 		cb_lst->active = 0;
 	}
 	rte_spinlock_unlock(&rte_eth_dev_cb_lock);
+	return rc;
 }
 
 int
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index f6e6c74..c6ab4c0 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -3337,8 +3337,8 @@ enum rte_eth_event_type {
 	RTE_ETH_EVENT_MAX       /**< max value of this enum */
 };
 
-typedef void (*rte_eth_dev_cb_fn)(uint8_t port_id, \
-		enum rte_eth_event_type event, void *cb_arg);
+typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id,
+		enum rte_eth_event_type event, void *cb_arg, void *ret_param);
 /**< user application callback to be registered for interrupts */
 
 
@@ -3355,11 +3355,6 @@ typedef void (*rte_eth_dev_cb_fn)(uint8_t port_id, \
  * @param cb_arg
  *  Pointer to the parameters for the registered callback.
  *
- *  The user data is overwritten in the case of RTE_ETH_EVENT_VF_MBOX.
- *	This even occurs when a message from the VF is received by the PF.
- *	The user data is overwritten with struct rte_pmd_ixgbe_mb_event_param.
- *	This struct is defined in rte_pmd_ixgbe.h.
- *
  * @return
  *  - On success, zero.
  *  - On failure, a negative value.
@@ -3399,15 +3394,17 @@ int rte_eth_dev_callback_unregister(uint8_t port_id,
  * @param event
  *  Eth device interrupt event type.
  * @param cb_arg
- *  Update callback parameter to pass data back to user application.
+ *  callback parameter.
+ * @param ret_param
+ *  To pass data back to user application.
  *  This allows the user application to decide if a particular function
  *  is permitted or not.
  *
  * @return
- *  void
+ *  int
  */
-void _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
-				enum rte_eth_event_type event, void *cb_arg);
+int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
+		enum rte_eth_event_type event, void *cb_arg, void *ret_param);
 
 /**
  * When there is no rx packet coming in Rx Queue for a long time, we can
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index 805e6de..1d653a4 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -1,7 +1,6 @@
 DPDK_2.2 {
 	global:
 
-	_rte_eth_dev_callback_process;
 	rte_eth_add_rx_callback;
 	rte_eth_add_tx_callback;
 	rte_eth_allmulticast_disable;
@@ -151,6 +150,7 @@ DPDK_17.05 {
 DPDK_17.08 {
 	global:
 
+	_rte_eth_dev_callback_process;
 	rte_flow_isolate;
 
 } DPDK_17.05;
diff --git a/test/test/test_link_bonding.c b/test/test/test_link_bonding.c
index 5783039..aa2a1a2 100644
--- a/test/test/test_link_bonding.c
+++ b/test/test/test_link_bonding.c
@@ -1173,15 +1173,19 @@ struct rte_fdir_conf fdir_conf = {
 int test_lsc_interrupt_count;
 
 
-static void
+static int
 test_bonding_lsc_event_callback(uint8_t port_id __rte_unused,
-		enum rte_eth_event_type type  __rte_unused, void *param __rte_unused)
+		enum rte_eth_event_type type  __rte_unused,
+		void *param __rte_unused,
+		void *ret_param __rte_unused)
 {
 	pthread_mutex_lock(&mutex);
 	test_lsc_interrupt_count++;
 
 	pthread_cond_signal(&cvar);
 	pthread_mutex_unlock(&mutex);
+
+	return 0;
 }
 
 static inline int
diff --git a/test/test/virtual_pmd.c b/test/test/virtual_pmd.c
index e9dd8ac..78ed7c0 100644
--- a/test/test/virtual_pmd.c
+++ b/test/test/virtual_pmd.c
@@ -484,7 +484,8 @@ static void  virtual_ethdev_stop(struct rte_eth_dev *eth_dev __rte_unused)
 
 	vrtl_eth_dev->data->dev_link.link_status = link_status;
 
-	_rte_eth_dev_callback_process(vrtl_eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+	_rte_eth_dev_callback_process(vrtl_eth_dev, RTE_ETH_EVENT_INTR_LSC,
+				      NULL, NULL);
 }
 
 int
-- 
1.9.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: modify callback process API
  2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 1/4] " Bernard Iremonger
  2017-06-14 21:22   ` Thomas Monjalon
@ 2017-06-15 15:43   ` Stephen Hemminger
  2017-06-21  9:22     ` Iremonger, Bernard
  1 sibling, 1 reply; 24+ messages in thread
From: Stephen Hemminger @ 2017-06-15 15:43 UTC (permalink / raw)
  To: Bernard Iremonger; +Cc: dev, thomas

On Mon, 12 Jun 2017 16:18:08 +0100
Bernard Iremonger <bernard.iremonger@intel.com> wrote:

> From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>
> 
> Change the rte_eth_dev_callback_process function to return int,
> and add a void *ret_param parameter.

What is the motivation for this? What is return value used for?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: modify callback process API
  2017-06-15 15:43   ` Stephen Hemminger
@ 2017-06-21  9:22     ` Iremonger, Bernard
  0 siblings, 0 replies; 24+ messages in thread
From: Iremonger, Bernard @ 2017-06-21  9:22 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, thomas

Hi Stephen,

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Thursday, June 15, 2017 4:43 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; thomas@monjalon.net
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: modify callback process API
> 
> On Mon, 12 Jun 2017 16:18:08 +0100
> Bernard Iremonger <bernard.iremonger@intel.com> wrote:
> 
> > From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>
> >
> > Change the rte_eth_dev_callback_process function to return int, and
> > add a void *ret_param parameter.
> 
> What is the motivation for this? What is return value used for?

Since DPDK 16.11 the i40e and ixgbe PMD's have been returning data to the calling process using the "void *cb_arg"  parameter of the callback_process API

void _rte_eth_dev_callback_process(struct rte_eth_dev *dev, enum rte_eth_event_type event, void *cb_arg);

This was not considered to be ideal by Thomas who suggested adding a "void *ret_param"   parameter to API to return data to the calling process and at the same time to change the return value from void to int to allow returning an error code if required.  

Regards,

Bernard.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ethdev: modify callback process API
  2017-06-15 12:29   ` [dpdk-dev] [PATCH v3] ethdev: modify " Bernard Iremonger
@ 2017-07-01 15:19     ` Thomas Monjalon
  2017-07-03  9:01       ` Ferruh Yigit
  0 siblings, 1 reply; 24+ messages in thread
From: Thomas Monjalon @ 2017-07-01 15:19 UTC (permalink / raw)
  To: Bernard Iremonger; +Cc: dev

15/06/2017 14:29, Bernard Iremonger:
> From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>
> 
> Change the rte_eth_dev_callback_process function to return int,
> and add a void *ret_param parameter.

Adding this explanation:
	The new parameter is used by ixgbe and i40e instead of abusing
	the user data of the callback.
and this title:
	ethdev: add return values to callback process API                                                                 

And applied, thanks

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ethdev: modify callback process API
  2017-07-01 15:19     ` Thomas Monjalon
@ 2017-07-03  9:01       ` Ferruh Yigit
  2017-07-03  9:04         ` Ferruh Yigit
  0 siblings, 1 reply; 24+ messages in thread
From: Ferruh Yigit @ 2017-07-03  9:01 UTC (permalink / raw)
  To: Bernard Iremonger, Shrikrishna Khare; +Cc: Thomas Monjalon, dev

On 7/1/2017 4:19 PM, Thomas Monjalon wrote:
> 15/06/2017 14:29, Bernard Iremonger:
>> From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>
>>
>> Change the rte_eth_dev_callback_process function to return int,
>> and add a void *ret_param parameter.
> 
> Adding this explanation:
> 	The new parameter is used by ixgbe and i40e instead of abusing
> 	the user data of the callback.
> and this title:
> 	ethdev: add return values to callback process API                                                                 
> 
> And applied, thanks
> 

Hi Bernard, Shrikrishna,

This patch breaks vmxnet3 build, can you please send a patch to fix it?

Thanks,
ferruh

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ethdev: modify callback process API
  2017-07-03  9:01       ` Ferruh Yigit
@ 2017-07-03  9:04         ` Ferruh Yigit
  2017-07-03 11:06           ` Iremonger, Bernard
  0 siblings, 1 reply; 24+ messages in thread
From: Ferruh Yigit @ 2017-07-03  9:04 UTC (permalink / raw)
  To: Bernard Iremonger, Shrikrishna Khare; +Cc: Thomas Monjalon, dev

On 7/3/2017 10:01 AM, Ferruh Yigit wrote:
> On 7/1/2017 4:19 PM, Thomas Monjalon wrote:
>> 15/06/2017 14:29, Bernard Iremonger:
>>> From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>
>>>
>>> Change the rte_eth_dev_callback_process function to return int,
>>> and add a void *ret_param parameter.
>>
>> Adding this explanation:
>> 	The new parameter is used by ixgbe and i40e instead of abusing
>> 	the user data of the callback.
>> and this title:
>> 	ethdev: add return values to callback process API                                                                 
>>
>> And applied, thanks
>>
> 
> Hi Bernard, Shrikrishna,
> 
> This patch breaks vmxnet3 build, can you please send a patch to fix it?

The build error is on next-net. Main repo looks good.

> 
> Thanks,
> ferruh
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ethdev: modify callback process API
  2017-07-03  9:04         ` Ferruh Yigit
@ 2017-07-03 11:06           ` Iremonger, Bernard
  2017-07-03 11:18             ` Ferruh Yigit
  0 siblings, 1 reply; 24+ messages in thread
From: Iremonger, Bernard @ 2017-07-03 11:06 UTC (permalink / raw)
  To: Yigit, Ferruh, Shrikrishna Khare; +Cc: Thomas Monjalon, dev

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Monday, July 3, 2017 10:05 AM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; Shrikrishna Khare
> <skhare@vmware.com>
> Cc: Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3] ethdev: modify callback process API
> 
> On 7/3/2017 10:01 AM, Ferruh Yigit wrote:
> > On 7/1/2017 4:19 PM, Thomas Monjalon wrote:
> >> 15/06/2017 14:29, Bernard Iremonger:
> >>> From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>
> >>>
> >>> Change the rte_eth_dev_callback_process function to return int, and
> >>> add a void *ret_param parameter.
> >>
> >> Adding this explanation:
> >> 	The new parameter is used by ixgbe and i40e instead of abusing
> >> 	the user data of the callback.
> >> and this title:
> >> 	ethdev: add return values to callback process API
> >>
> >> And applied, thanks
> >>
> >
> > Hi Bernard, Shrikrishna,
> >
> > This patch breaks vmxnet3 build, can you please send a patch to fix it?
> 
> The build error is on next-net. Main repo looks good.
> 
> >
> > Thanks,
> > ferruh
> >

In dpdk-next-net a call to _rte_eth_dev_callback_process() has been added in vmxnet3_ethdev.c at line 1321 using the old API.
I can send a patch or could you add an extra NULL parameter at line 1325 in vmxnet3_ethdev.c?

Regards,

Bernard.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ethdev: modify callback process API
  2017-07-03 11:06           ` Iremonger, Bernard
@ 2017-07-03 11:18             ` Ferruh Yigit
  2017-07-03 11:28               ` Iremonger, Bernard
  0 siblings, 1 reply; 24+ messages in thread
From: Ferruh Yigit @ 2017-07-03 11:18 UTC (permalink / raw)
  To: Iremonger, Bernard, Shrikrishna Khare; +Cc: Thomas Monjalon, dev

On 7/3/2017 12:06 PM, Iremonger, Bernard wrote:
> Hi Ferruh,
> 
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Monday, July 3, 2017 10:05 AM
>> To: Iremonger, Bernard <bernard.iremonger@intel.com>; Shrikrishna Khare
>> <skhare@vmware.com>
>> Cc: Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH v3] ethdev: modify callback process API
>>
>> On 7/3/2017 10:01 AM, Ferruh Yigit wrote:
>>> On 7/1/2017 4:19 PM, Thomas Monjalon wrote:
>>>> 15/06/2017 14:29, Bernard Iremonger:
>>>>> From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>
>>>>>
>>>>> Change the rte_eth_dev_callback_process function to return int, and
>>>>> add a void *ret_param parameter.
>>>>
>>>> Adding this explanation:
>>>> 	The new parameter is used by ixgbe and i40e instead of abusing
>>>> 	the user data of the callback.
>>>> and this title:
>>>> 	ethdev: add return values to callback process API
>>>>
>>>> And applied, thanks
>>>>
>>>
>>> Hi Bernard, Shrikrishna,
>>>
>>> This patch breaks vmxnet3 build, can you please send a patch to fix it?
>>
>> The build error is on next-net. Main repo looks good.
>>
>>>
>>> Thanks,
>>> ferruh
>>>
> 
> In dpdk-next-net a call to _rte_eth_dev_callback_process() has been added in vmxnet3_ethdev.c at line 1321 using the old API.
> I can send a patch or could you add an extra NULL parameter at line 1325 in vmxnet3_ethdev.c?

Fix is trivial, but I shouldn't just update the code. It should be done
by a proper process, with a fix patch.

Would you mind sending the patch?

Thanks,
ferruh

> 
> Regards,
> 
> Bernard.
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ethdev: modify callback process API
  2017-07-03 11:18             ` Ferruh Yigit
@ 2017-07-03 11:28               ` Iremonger, Bernard
  2017-07-03 11:40                 ` Thomas Monjalon
  0 siblings, 1 reply; 24+ messages in thread
From: Iremonger, Bernard @ 2017-07-03 11:28 UTC (permalink / raw)
  To: Yigit, Ferruh, Shrikrishna Khare; +Cc: Thomas Monjalon, dev

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Monday, July 3, 2017 12:19 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; Shrikrishna Khare
> <skhare@vmware.com>
> Cc: Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3] ethdev: modify callback process API
> 
> On 7/3/2017 12:06 PM, Iremonger, Bernard wrote:
> > Hi Ferruh,
> >
> >> -----Original Message-----
> >> From: Yigit, Ferruh
> >> Sent: Monday, July 3, 2017 10:05 AM
> >> To: Iremonger, Bernard <bernard.iremonger@intel.com>; Shrikrishna
> >> Khare <skhare@vmware.com>
> >> Cc: Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH v3] ethdev: modify callback process
> >> API
> >>
> >> On 7/3/2017 10:01 AM, Ferruh Yigit wrote:
> >>> On 7/1/2017 4:19 PM, Thomas Monjalon wrote:
> >>>> 15/06/2017 14:29, Bernard Iremonger:
> >>>>> From: "Bernard.Iremonger" <Bernard.iremonger@intel.com>
> >>>>>
> >>>>> Change the rte_eth_dev_callback_process function to return int,
> >>>>> and add a void *ret_param parameter.
> >>>>
> >>>> Adding this explanation:
> >>>> 	The new parameter is used by ixgbe and i40e instead of abusing
> >>>> 	the user data of the callback.
> >>>> and this title:
> >>>> 	ethdev: add return values to callback process API
> >>>>
> >>>> And applied, thanks
> >>>>
> >>>
> >>> Hi Bernard, Shrikrishna,
> >>>
> >>> This patch breaks vmxnet3 build, can you please send a patch to fix it?
> >>
> >> The build error is on next-net. Main repo looks good.
> >>
> >>>
> >>> Thanks,
> >>> ferruh
> >>>
> >
> > In dpdk-next-net a call to _rte_eth_dev_callback_process() has been
> added in vmxnet3_ethdev.c at line 1321 using the old API.
> > I can send a patch or could you add an extra NULL parameter at line 1325 in
> vmxnet3_ethdev.c?
> 
> Fix is trivial, but I shouldn't just update the code. It should be done by a
> proper process, with a fix patch.
> 
> Would you mind sending the patch?
> 
> Thanks,
> ferruh
> 
> >
> > Regards,
> >
> > Bernard.
> >
I can send the patch, however I am seeing the following build error on the dpdk and dpdk-next-net at present:

 CC eal_interrupts.o
/root/dpdk_sforge_origin/lib/librte_eal/linuxapp/eal/eal_memory.c:58:18: fatal error: numa.h: No such file or directory
 #include <numa.h>
                  ^
compilation terminated.

Are you seeing this error?

Regards,

Bernard.







^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ethdev: modify callback process API
  2017-07-03 11:28               ` Iremonger, Bernard
@ 2017-07-03 11:40                 ` Thomas Monjalon
  0 siblings, 0 replies; 24+ messages in thread
From: Thomas Monjalon @ 2017-07-03 11:40 UTC (permalink / raw)
  To: Iremonger, Bernard; +Cc: Yigit, Ferruh, Shrikrishna Khare, dev

03/07/2017 13:28, Iremonger, Bernard:
> I can send the patch, however I am seeing the following build error on the dpdk and dpdk-next-net at present:
> 
>  CC eal_interrupts.o
> /root/dpdk_sforge_origin/lib/librte_eal/linuxapp/eal/eal_memory.c:58:18: fatal error: numa.h: No such file or directory
>  #include <numa.h>
>                   ^
> compilation terminated.
> 
> Are you seeing this error?

Please install libnuma.
I am going to send another email to better advertise this new dependency.

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2017-07-03 11:40 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 11:03 [dpdk-dev] [PATCH v1 0/4] ethdev: callback process API Bernard Iremonger
2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 1/4] ethdev: modify " Bernard Iremonger
2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 2/4] test: callback process API changes Bernard Iremonger
2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 3/4] examples: " Bernard Iremonger
2017-05-19 11:03 ` [dpdk-dev] [PATCH v1 4/4] doc: remove deprecation notice Bernard Iremonger
2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 0/4] ethdev: callback process API Bernard Iremonger
2017-06-15 12:29   ` [dpdk-dev] [PATCH v3] " Bernard Iremonger
2017-06-15 12:29   ` [dpdk-dev] [PATCH v3] ethdev: modify " Bernard Iremonger
2017-07-01 15:19     ` Thomas Monjalon
2017-07-03  9:01       ` Ferruh Yigit
2017-07-03  9:04         ` Ferruh Yigit
2017-07-03 11:06           ` Iremonger, Bernard
2017-07-03 11:18             ` Ferruh Yigit
2017-07-03 11:28               ` Iremonger, Bernard
2017-07-03 11:40                 ` Thomas Monjalon
2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 1/4] " Bernard Iremonger
2017-06-14 21:22   ` Thomas Monjalon
2017-06-15 10:56     ` Iremonger, Bernard
2017-06-15 15:43   ` Stephen Hemminger
2017-06-21  9:22     ` Iremonger, Bernard
2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 2/4] test: callback process API changes Bernard Iremonger
2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 3/4] examples: " Bernard Iremonger
2017-06-12 15:18 ` [dpdk-dev] [PATCH v2 4/4] doc: remove deprecation notice Bernard Iremonger
2017-06-13  8:52   ` Mcnamara, John

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).