Skip to contentSkip to conversation

Missing use of macro rte_eth_dev_is_valid_port()

PATCH Applied Keith Wiles 3 participants 3 messages Feb 26, 2015 – Mar 5, 2015 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Missing use of macro rte_eth_dev_is_valid_port()

---
 lib/librte_ether/rte_ethdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/librte_ether/rte_ethdev.c +4 -4
index bb94ccb..6fd89d7 100644
@@ -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);
 	}
Signature · 1 line
2.3.0

A message that is not in the archive (sent off-list or not yet received): 1424959232-60341-1-git-send-email-keith.wiles-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org

A message that is not in the archive (sent off-list or not yet received): B27915DBBA3421428155699D51E4CFE2ECB6F7-kPTMFJFq+rELt2AQoY/[email protected]