[dpdk-dev] [PATCH v6 2/3] app/test: measure the cost of rx/tx routines by cycle number
Thomas Monjalon
thomas.monjalon at 6wind.com
Wed Nov 12 00:28:57 CET 2014
Hi Cunming,
2014-10-27 09:20, Cunming Liang:
> --- a/lib/librte_ether/rte_ether.h
> +++ b/lib/librte_ether/rte_ether.h
> @@ -45,6 +45,7 @@ extern "C" {
> #endif
>
> #include <stdint.h>
> +#include <stdio.h>
>
> #include <rte_memcpy.h>
> #include <rte_random.h>
> @@ -266,6 +267,30 @@ static inline void ether_addr_copy(const struct ether_addr *ea_from,
> #endif
> }
>
> +#define ETHER_ADDR_FMT_SIZE 18
> +/**
> + * Format 48bits Ethernet address in pattern xx:xx:xx:xx:xx:xx.
> + *
> + * @param buf
> + * A pointer to buffer contains the formatted MAC address.
> + * @param size
> + * The format buffer size.
> + * @param ea_to
> + * A pointer to a ether_addr structure.
> + */
> +static inline void
> +ether_format_addr(char *buf, uint16_t size,
> + const struct ether_addr *eth_addr)
> +{
> + snprintf(buf, size, "%02X:%02X:%02X:%02X:%02X:%02X",
> + eth_addr->addr_bytes[0],
> + eth_addr->addr_bytes[1],
> + eth_addr->addr_bytes[2],
> + eth_addr->addr_bytes[3],
> + eth_addr->addr_bytes[4],
> + eth_addr->addr_bytes[5]);
> +}
Please, could you do a separate patch for this new API?
Could it be used in some apps or PMDs? It would be a nice cleanup.
> --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
> +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
> @@ -1600,6 +1600,9 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
>
> ixgbe_dev_clear_queues(dev);
>
> + /* Clear stored conf */
> + dev->data->scattered_rx = 0;
> +
> /* Clear recorded link status */
> memset(&link, 0, sizeof(link));
> rte_ixgbe_dev_atomic_write_link_status(dev, &link);
> @@ -2888,6 +2891,9 @@ ixgbevf_dev_stop(struct rte_eth_dev *dev)
> */
> ixgbevf_set_vfta_all(dev,0);
>
> + /* Clear stored conf */
> + dev->data->scattered_rx = 0;
> +
> ixgbe_dev_clear_queues(dev);
> }
Please, this patch needs a separate patch with a clear explanation in the log.
Thanks
--
Thomas
More information about the dev
mailing list