[dpdk-dev] [PATCH 02/20] thunderx/nicvf: add pmd skeleton
Pattan, Reshma
reshma.pattan at intel.com
Wed May 11 14:23:01 CEST 2016
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Jerin Jacob
> Sent: Saturday, May 7, 2016 4:16 PM
> To: dev at dpdk.org
> Cc: thomas.monjalon at 6wind.com; Richardson, Bruce
> <bruce.richardson at intel.com>; Jerin Jacob
> <jerin.jacob at caviumnetworks.com>; Maciej Czekaj
> <maciej.czekaj at caviumnetworks.com>; Kamil Rytarowski
> <Kamil.Rytarowski at caviumnetworks.com>; Zyta Szpak
> <zyta.szpak at semihalf.com>; Slawomir Rosek <slawomir.rosek at semihalf.com>;
> Radoslaw Biernacki <rad at semihalf.com>
> Subject: [dpdk-dev] [PATCH 02/20] thunderx/nicvf: add pmd skeleton
>
> Introduce driver initialization and enable build infrastructure for nicvf pmd
> driver.
>
> By default, It is enabled only for defconfig_arm64-thunderx-* config as it is an
> inbuilt NIC device.
>
> ---
> diff --git a/drivers/net/thunderx/nicvf_ethdev.c
> b/drivers/net/thunderx/nicvf_ethdev.c
> new file mode 100644
> index 0000000..3c545b4
> +static int
> +nicvf_periodic_alarm_stop(struct nicvf *nic) {
> + int ret;
> +
> + ret = rte_intr_callback_unregister(&nic->intr_handle,
> + nicvf_interrupt, nic);
> + ret |= close(nic->intr_handle.fd);
> + return ret;
> +}
> +
> +
You can remove extra blank line
> +/* Initialise and register driver with DPDK Application */ static const
Typo Initialise.
> +
> + nic->device_id = pci_dev->id.device_id;
> + nic->vendor_id = pci_dev->id.vendor_id;
> + nic->subsystem_device_id = pci_dev->id.subsystem_device_id;
> + nic->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
> + nic->eth_dev = eth_dev;
> +
> + PMD_INIT_LOG(DEBUG, "nicvf: device (%x:%x) %u:%u:%u:%u",
> + pci_dev->id.vendor_id, pci_dev->id.device_id,
> + pci_dev->addr.domain, pci_dev->addr.bus,
> + pci_dev->addr.devid, pci_dev->addr.function);
I see some indentation issue mix of tabs + spaces here in LOG.
> +
> + if (nic->sqs_mode) {
> + PMD_INIT_LOG(INFO, "Unsupported SQS VF detected,
> Detaching...");
> + /* Detach port by returning postive error number */
typo, should be Positive.
> diff --git a/drivers/net/thunderx/nicvf_ethdev.h
> b/drivers/net/thunderx/nicvf_ethdev.h
> new file mode 100644
> index 0000000..6431329
> --- /dev/null
> +++ b/drivers/net/thunderx/nicvf_ethdev.h
> @@ -0,0 +1,49 @@
> +
> +#ifndef __THUNDERX_NICVF_ETHDEV_H__
> +#define __THUNDERX_NICVF_ETHDEV_H__
> +
> +#include <rte_ethdev.h>
> +
> +#define THUNDERX_NICVF_PMD_VERSION "1.0"
> +
> +#define NICVF_INTR_POLL_INTERVAL_MS 50
> +
> +static inline struct nicvf*
Should follow (foo *) not foo*
> +nicvf_pmd_priv(struct rte_eth_dev *eth_dev) {
> + return (struct nicvf *)eth_dev->data->dev_private; }
> +
> +
> +#endif /* __THUNDERX_NICVF_ETHDEV_H__ */
multiple blank lines before #endif
> +++ b/drivers/net/thunderx/nicvf_struct.h
> +
> +#ifndef _THUNDERX_NICVF_STRUCT_H
> +#define _THUNDERX_NICVF_STRUCT_H
> +
> +#include <stdint.h>
> +#include <rte_spinlock.h>
> +#include <rte_mempool.h>
> +#include <rte_mbuf.h>
> +#include <rte_interrupts.h>
> +#include <rte_ethdev.h>
> +#include <rte_memory.h>
Should leave blank line between standard library headers and rte headers.
Thanks,
Reshma
More information about the dev
mailing list