- ``rte_eth_allmulticast_enable`` and ``rte_eth_allmulticast_disable``
- ``rte_eth_dev_stop``
- ``rte_eth_dev_close``
- - ``rte_eth_macaddr_get``
- ``rte_eth_dev_owner_delete``
* ethdev: New offload flags ``DEV_RX_OFFLOAD_RSS_HASH`` and
return value from ``void`` to ``int`` to provide a way to report various
error conditions.
+* ethdev: changed ``rte_eth_macaddr_get`` return value from ``void`` to
+ ``int`` to provide a way to report various error conditions.
+
ABI Changes
-----------
return retval;
/* Display the port MAC address. */
- rte_eth_macaddr_get(port, &addr);
+ retval = rte_eth_macaddr_get(port, &addr);
+ if (retval < 0)
+ return retval;
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
port,
return j;
}
-void
+int
rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
{
struct rte_eth_dev *dev;
- RTE_ETH_VALID_PORTID_OR_RET(port_id);
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
dev = &rte_eth_devices[port_id];
rte_ether_addr_copy(&dev->data->mac_addrs[0], mac_addr);
+
+ return 0;
}
* @param mac_addr
* A pointer to a structure of type *ether_addr* to be filled with
* the Ethernet address of the Ethernet device.
+ * @return
+ * - (0) if successful
+ * - (-ENODEV) if *port_id* invalid.
*/
-void rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr);
+int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr);
/**
* Retrieve the contextual information of an Ethernet device.