DPDK patches and discussions
 help / color / mirror / Atom feed
From: Reshma Pattan <reshma.pattan@intel.com>
To: konstantin.ananyev@intel.com, declan.doherty@intel.com,
	thomas.monjalon@6wind.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3 1/3] librte_ether: remove RTE_PROC_PRIMARY_OR_ERR_RET and RTE_PROC_PRIMARY_OR_RET
Date: Tue,  5 Jan 2016 16:34:56 +0000	[thread overview]
Message-ID: <1452011698-27354-2-git-send-email-reshma.pattan@intel.com> (raw)
In-Reply-To: <1452011698-27354-1-git-send-email-reshma.pattan@intel.com>

Macros RTE_PROC_PRIMARY_OR_ERR_RET and RTE_PROC_PRIMARY_OR_RET
are blocking the secondary process from using the APIs.
API access should be given to both secondary and primary.

Reported-by: Sean Harte <sean.harte@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
v3:
* Removed checkpatch fixes of lib/librte_ether/rte_ethdev.h from this patch

 lib/librte_ether/rte_ethdev.c |   50 +----------------------------------------
 1 files changed, 1 insertions(+), 49 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index ed971b4..5849102 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -711,10 +711,6 @@ rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id)
 {
 	struct rte_eth_dev *dev;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
-
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
 	dev = &rte_eth_devices[port_id];
@@ -741,10 +737,6 @@ rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id)
 {
 	struct rte_eth_dev *dev;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
-
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
 	dev = &rte_eth_devices[port_id];
@@ -771,10 +763,6 @@ rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id)
 {
 	struct rte_eth_dev *dev;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
-
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
 	dev = &rte_eth_devices[port_id];
@@ -801,10 +789,6 @@ rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id)
 {
 	struct rte_eth_dev *dev;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
-
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
 	dev = &rte_eth_devices[port_id];
@@ -874,10 +858,6 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 	struct rte_eth_dev_info dev_info;
 	int diag;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
-
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
 	if (nb_rx_q > RTE_MAX_QUEUES_PER_PORT) {
@@ -1059,10 +1039,6 @@ rte_eth_dev_start(uint8_t port_id)
 	struct rte_eth_dev *dev;
 	int diag;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
-
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
 	dev = &rte_eth_devices[port_id];
@@ -1096,10 +1072,6 @@ rte_eth_dev_stop(uint8_t port_id)
 {
 	struct rte_eth_dev *dev;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_RET();
-
 	RTE_ETH_VALID_PORTID_OR_RET(port_id);
 	dev = &rte_eth_devices[port_id];
 
@@ -1121,10 +1093,6 @@ rte_eth_dev_set_link_up(uint8_t port_id)
 {
 	struct rte_eth_dev *dev;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
-
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
 	dev = &rte_eth_devices[port_id];
@@ -1138,10 +1106,6 @@ rte_eth_dev_set_link_down(uint8_t port_id)
 {
 	struct rte_eth_dev *dev;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
-
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
 	dev = &rte_eth_devices[port_id];
@@ -1155,10 +1119,6 @@ rte_eth_dev_close(uint8_t port_id)
 {
 	struct rte_eth_dev *dev;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_RET();
-
 	RTE_ETH_VALID_PORTID_OR_RET(port_id);
 	dev = &rte_eth_devices[port_id];
 
@@ -1183,10 +1143,6 @@ rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
-
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
 	dev = &rte_eth_devices[port_id];
@@ -1266,10 +1222,6 @@ rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 
-	/* This function is only safe when called from the primary process
-	 * in a multi-process setup*/
-	RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);
-
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
 
 	dev = &rte_eth_devices[port_id];
@@ -2479,7 +2431,7 @@ rte_eth_dev_callback_register(uint8_t port_id,
 	/* create a new callback. */
 	if (user_cb == NULL)
 		user_cb = rte_zmalloc("INTR_USER_CALLBACK",
-		                      sizeof(struct rte_eth_dev_callback), 0);
+					sizeof(struct rte_eth_dev_callback), 0);
 	if (user_cb != NULL) {
 		user_cb->cb_fn = cb_fn;
 		user_cb->cb_arg = cb_arg;
-- 
1.7.4.1

  reply	other threads:[~2016-01-05 16:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23 12:19 [dpdk-dev] [PATCH " Reshma Pattan
2015-12-23 12:19 ` [dpdk-dev] [PATCH 2/3] librte_cryptodev: remove RTE_PROC_PRIMARY_OR_RET Reshma Pattan
2015-12-23 12:19 ` [dpdk-dev] [PATCH 3/3] librte_ether: fix rte_eth_dev_configure Reshma Pattan
2015-12-24  8:01 ` [dpdk-dev] [PATCH 1/3] librte_ether: remove RTE_PROC_PRIMARY_OR_ERR_RET and RTE_PROC_PRIMARY_OR_RET Qiu, Michael
2015-12-24 17:40   ` Pattan, Reshma
2015-12-28  4:40     ` Qiu, Michael
2016-01-05 10:58 ` [dpdk-dev] [PATCH v2 " Reshma Pattan
2016-01-05 16:34 ` [dpdk-dev] [PATCH v3 0/3] fix RTE_PROC_PRIMARY_OR_ERR_RET RTE_PROC_PRIMARY_OR_RET Reshma Pattan
2016-01-05 16:34   ` Reshma Pattan [this message]
2016-01-05 16:34   ` [dpdk-dev] [PATCH v3 2/3] librte_cryptodev: remove RTE_PROC_PRIMARY_OR_RET Reshma Pattan
2016-01-05 16:34   ` [dpdk-dev] [PATCH v3 3/3] librte_ether: fix rte_eth_dev_configure Reshma Pattan
2016-01-06 13:41   ` [dpdk-dev] [PATCH v3 0/3] fix RTE_PROC_PRIMARY_OR_ERR_RET RTE_PROC_PRIMARY_OR_RET Ananyev, Konstantin
2016-02-24 18:25     ` Thomas Monjalon
2016-02-05  9:43   ` Thomas Monjalon
2016-02-05 14:58     ` Pattan, Reshma
2016-02-05 15:05       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452011698-27354-2-git-send-email-reshma.pattan@intel.com \
    --to=reshma.pattan@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).