On Wed, 29 Jan 2025 10:54:16 +0200
Shani Peretz <shper...@nvidia.com> wrote:

> +create_pci_dev(const char *name)
> +{
> +     int port_id;
> +     uint8_t slave_mac1[] = {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 };
> +     struct rte_ether_addr *mac_addr = (struct rte_ether_addr *)slave_mac1;

Use different initializer and you can avoid the need for cast here.


>  
> +/**
> + * General device name comparison. Will compare by using the specific bus
> + * compare function or by comparing the names directly.
> + *
> + * @param dev
> + *   Device handle.
> + * @param name
> + *   Name to compare against.
> + * @return
> + *   0 if the device matches the name. Nonzero otherwise.
> + */
> +__rte_internal
> +int rte_cmp_dev_name(const struct rte_device *dev, const void *name);

It would make more sense to me if name was a character not void pointer.

The design might be clearer if bus address was more of an typedef with
a pointer and size together. Treat it more like an object.

Reply via email to