dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Missing use of macro rte_eth_dev_is_valid_port()
@ 2015-02-26 14:00 Keith Wiles
       [not found] ` <1424959232-60341-1-git-send-email-keith.wiles-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Wiles @ 2015-02-26 14:00 UTC (permalink / raw)
  To: dev-VfR2kkLFssw

Signed-off-by: Keith Wiles <keith.wiles-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 lib/librte_ether/rte_ethdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index bb94ccb..6fd89d7 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3541,7 +3541,7 @@ rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id,
 	return NULL;
 #endif
 	/* check input parameters */
-	if (port_id >= nb_ports || fn == NULL ||
+	if (!rte_eth_dev_is_valid_port(port_id) || fn == NULL ||
 		    queue_id >= rte_eth_devices[port_id].data->nb_rx_queues) {
 		rte_errno = EINVAL;
 		return NULL;
@@ -3570,7 +3570,7 @@ rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id,
 	return NULL;
 #endif
 	/* check input parameters */
-	if (port_id >= nb_ports || fn == NULL ||
+	if (!rte_eth_dev_is_valid_port(port_id) || fn == NULL ||
 		    queue_id >= rte_eth_devices[port_id].data->nb_tx_queues) {
 		rte_errno = EINVAL;
 		return NULL;
@@ -3598,7 +3598,7 @@ rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id,
 	return (-ENOTSUP);
 #endif
 	/* Check input parameters. */
-	if (port_id >= nb_ports || user_cb == NULL ||
+	if (!rte_eth_dev_is_valid_port(port_id) || user_cb == NULL ||
 		    queue_id >= rte_eth_devices[port_id].data->nb_rx_queues) {
 		return (-EINVAL);
 	}
@@ -3637,7 +3637,7 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id,
 	return (-ENOTSUP);
 #endif
 	/* Check input parameters. */
-	if (port_id >= nb_ports || user_cb == NULL ||
+	if (!rte_eth_dev_is_valid_port(port_id) || user_cb == NULL ||
 		    queue_id >= rte_eth_devices[port_id].data->nb_tx_queues) {
 		return (-EINVAL);
 	}
-- 
2.3.0

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

* Re: [PATCH] Missing use of macro rte_eth_dev_is_valid_port()
       [not found] ` <1424959232-60341-1-git-send-email-keith.wiles-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2015-03-05 17:26   ` Mcnamara, John
       [not found]     ` <B27915DBBA3421428155699D51E4CFE2ECB6F7-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Mcnamara, John @ 2015-03-05 17:26 UTC (permalink / raw)
  To: Wiles, Keith, dev-VfR2kkLFssw@public.gmane.org

> -----Original Message-----
> From: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] On Behalf Of Keith Wiles
> Sent: Thursday, February 26, 2015 2:01 PM
> To: dev-VfR2kkLFssw@public.gmane.org
> Subject: [dpdk-dev] [PATCH] Missing use of macro rte_eth_dev_is_valid_port()
> 
> Signed-off-by: Keith Wiles <keith.wiles-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Acked-by: John McNamara <john.mcnamara-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

-- 

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

* Re: [PATCH] Missing use of macro rte_eth_dev_is_valid_port()
       [not found]     ` <B27915DBBA3421428155699D51E4CFE2ECB6F7-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2015-03-05 19:26       ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-03-05 19:26 UTC (permalink / raw)
  To: Wiles, Keith; +Cc: dev-VfR2kkLFssw

> > Signed-off-by: Keith Wiles <keith.wiles-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
> Acked-by: John McNamara <john.mcnamara-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Some checks with rte_eth_dev_is_valid_port() were missed when merging
hotplug and callbacks features.
    
Fixes: c282abd2a6cd ("ethdev: remove assumption that port will not be detached")

Applied, thanks

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

end of thread, other threads:[~2015-03-05 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-26 14:00 [PATCH] Missing use of macro rte_eth_dev_is_valid_port() Keith Wiles
     [not found] ` <1424959232-60341-1-git-send-email-keith.wiles-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-05 17:26   ` Mcnamara, John
     [not found]     ` <B27915DBBA3421428155699D51E4CFE2ECB6F7-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-05 19:26       ` Thomas Monjalon

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).