From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 372FC93B0 for ; Tue, 5 Jan 2016 17:35:14 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 05 Jan 2016 08:35:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,525,1444719600"; d="scan'208";a="720655356" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 05 Jan 2016 08:35:01 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u05GZ0tA031463; Tue, 5 Jan 2016 16:35:01 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u05GZ0mJ027400; Tue, 5 Jan 2016 16:35:00 GMT Received: (from reshmapa@localhost) by sivswdev02.ir.intel.com with id u05GZ0F1027396; Tue, 5 Jan 2016 16:35:00 GMT From: Reshma Pattan To: konstantin.ananyev@intel.com, declan.doherty@intel.com, thomas.monjalon@6wind.com Date: Tue, 5 Jan 2016 16:34:56 +0000 Message-Id: <1452011698-27354-2-git-send-email-reshma.pattan@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1452011698-27354-1-git-send-email-reshma.pattan@intel.com> References: <1450873172-21932-1-git-send-email-reshma.pattan@intel.com> <1452011698-27354-1-git-send-email-reshma.pattan@intel.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 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 16:35:14 -0000 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 Signed-off-by: Reshma Pattan --- 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