DPDK patches and discussions
 help / color / mirror / Atom feed
From: "lihuisong (C)" <lihuisong@huawei.com>
To: "John Daley (johndale)" <johndale@cisco.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: David Marchand <david.marchand@redhat.com>,
	"chenbox@nvidia.com" <chenbox@nvidia.com>,
	Jerin Jacob <jerinj@marvell.com>,
	Michal Krawczyk <mk@semihalf.com>,
	Shai Brandes <shaibran@amazon.com>,
	Evgeny Schemeilin <evgenys@amazon.com>,
	Igor Chauskin <igorch@amazon.com>,
	Ron Beider <rbeider@amazon.com>,
	"Hyong Youb Kim (hyonkim)" <hyonkim@cisco.com>,
	Ziyang Xuan <xuanziyang2@huawei.com>,
	Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>,
	Guoyang Zhou <zhouguoyang@huawei.com>,
	Matan Azrad <matan@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Ori Kam <orika@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
	Maciej Czekaj <mczekaj@marvell.com>
Subject: Re: [PATCH 1/2] drivers: use macro for PCI address format
Date: Fri, 20 Oct 2023 11:30:15 +0800	[thread overview]
Message-ID: <0fc36bc6-6fdd-9efd-d26e-6cfb3d1f3c43@huawei.com> (raw)
In-Reply-To: <BYAPR11MB253579FF533D1057E68351F2CFDBA@BYAPR11MB2535.namprd11.prod.outlook.com>

lgtm,
Acked-by: Huisong Li <lihuisong@huawei.com>

在 2023/10/20 9:02, John Daley (johndale) 写道:
>
> Acked-by: John Daley <johndale@cisco.com>
>
> *From: *Thomas Monjalon <thomas@monjalon.net>
> *Date: *Thursday, October 19, 2023 at 8:41 AM
> *To: *dev@dpdk.org <dev@dpdk.org>
> *Cc: *David Marchand <david.marchand@redhat.com>, chenbox@nvidia.com 
> <chenbox@nvidia.com>, Jerin Jacob <jerinj@marvell.com>, Michal 
> Krawczyk <mk@semihalf.com>, Shai Brandes <shaibran@amazon.com>, Evgeny 
> Schemeilin <evgenys@amazon.com>, Igor Chauskin <igorch@amazon.com>, 
> Ron Beider <rbeider@amazon.com>, John Daley (johndale) 
> <johndale@cisco.com>, Hyong Youb Kim (hyonkim) <hyonkim@cisco.com>, 
> Ziyang Xuan <xuanziyang2@huawei.com>, Xiaoyun Wang 
> <cloud.wangxiaoyun@huawei.com>, Guoyang Zhou <zhouguoyang@huawei.com>, 
> Matan Azrad <matan@nvidia.com>, Viacheslav Ovsiienko 
> <viacheslavo@nvidia.com>, Ori Kam <orika@nvidia.com>, Suanming Mou 
> <suanmingm@nvidia.com>, Maciej Czekaj <mczekaj@marvell.com>
> *Subject: *[PATCH 1/2] drivers: use macro for PCI address format
>
> Some places were not using the macro PCI_PRI_FMT
> as print format of a PCI address.
>
> Note: RTE prefix is missing in the name of some PCI macros.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  drivers/event/skeleton/skeleton_eventdev.c | 2 +-
>  drivers/net/ena/ena_ethdev.c               | 2 +-
>  drivers/net/enic/enic.h                    | 3 +--
>  drivers/net/enic/enic_ethdev.c             | 2 +-
>  drivers/net/enic/enic_vf_representor.c     | 2 +-
>  drivers/net/hinic/hinic_pmd_ethdev.c       | 4 ++--
>  drivers/net/mlx5/linux/mlx5_os.c           | 2 +-
>  drivers/net/thunderx/nicvf_ethdev.c        | 2 +-
>  8 files changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/event/skeleton/skeleton_eventdev.c 
> b/drivers/event/skeleton/skeleton_eventdev.c
> index dc9b131641..dd2dab2e27 100644
> --- a/drivers/event/skeleton/skeleton_eventdev.c
> +++ b/drivers/event/skeleton/skeleton_eventdev.c
> @@ -373,7 +373,7 @@ skeleton_eventdev_init(struct rte_eventdev *eventdev)
>          skel->subsystem_device_id = pci_dev->id.subsystem_device_id;
>          skel->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
>
> -       PMD_DRV_LOG(DEBUG, "pci device (%x:%x) %u:%u:%u:%u",
> +       PMD_DRV_LOG(DEBUG, "PCI device (%x:%x) " PCI_PRI_FMT,
>                          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);
> diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
> index 7345e480f8..b39ec629e7 100644
> --- a/drivers/net/ena/ena_ethdev.c
> +++ b/drivers/net/ena/ena_ethdev.c
> @@ -2125,7 +2125,7 @@ static int eth_ena_dev_init(struct rte_eth_dev 
> *eth_dev)
>
>          pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
>
> -       PMD_INIT_LOG(INFO, "Initializing %x:%x:%x.%d\n",
> +       PMD_INIT_LOG(INFO, "Initializing " PCI_PRI_FMT "\n",
>                       pci_dev->addr.domain,
>                       pci_dev->addr.bus,
>                       pci_dev->addr.devid,
> diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
> index 163a1f037e..78778704f2 100644
> --- a/drivers/net/enic/enic.h
> +++ b/drivers/net/enic/enic.h
> @@ -32,7 +32,6 @@
>
>  #define ENICPMD_SETTING(enic, f) ((enic->config.flags & VENETF_##f) ? 
> 1 : 0)
>
> -#define ENICPMD_BDF_LENGTH      13   /* 0000:00:00.0'\0' */
>  #define ENIC_CALC_IP_CKSUM      1
>  #define ENIC_CALC_TCP_UDP_CKSUM 2
>  #define ENIC_MAX_MTU            9000
> @@ -101,7 +100,7 @@ struct enic {
>          bool overlay_offload;
>          struct rte_eth_dev *rte_dev;
>          struct rte_eth_dev_data *dev_data;
> -       char bdf_name[ENICPMD_BDF_LENGTH];
> +       char bdf_name[PCI_PRI_STR_SIZE];
>          int dev_fd;
>          int iommu_group_fd;
>          int iommu_groupid;
> diff --git a/drivers/net/enic/enic_ethdev.c 
> b/drivers/net/enic/enic_ethdev.c
> index a487256fa1..b04b6c9aa1 100644
> --- a/drivers/net/enic/enic_ethdev.c
> +++ b/drivers/net/enic/enic_ethdev.c
> @@ -1274,7 +1274,7 @@ static int eth_enic_dev_init(struct rte_eth_dev 
> *eth_dev,
>          enic->pdev = pdev;
>          addr = &pdev->addr;
>
> -       snprintf(enic->bdf_name, ENICPMD_BDF_LENGTH, "%04x:%02x:%02x.%x",
> +       snprintf(enic->bdf_name, PCI_PRI_STR_SIZE, PCI_PRI_FMT,
>                  addr->domain, addr->bus, addr->devid, addr->function);
>
>          err = enic_check_devargs(eth_dev);
> diff --git a/drivers/net/enic/enic_vf_representor.c 
> b/drivers/net/enic/enic_vf_representor.c
> index 46f85964e9..5d8d29135c 100644
> --- a/drivers/net/enic/enic_vf_representor.c
> +++ b/drivers/net/enic/enic_vf_representor.c
> @@ -707,7 +707,7 @@ int enic_vf_representor_init(struct rte_eth_dev 
> *eth_dev, void *init_params)
>          LIST_INIT(&vf_enic->memzone_list);
> rte_spinlock_init(&vf_enic->memzone_list_lock);
>          addr = &vf->bdf;
> -       snprintf(vf_enic->bdf_name, ENICPMD_BDF_LENGTH, 
> "%04x:%02x:%02x.%x",
> +       snprintf(vf_enic->bdf_name, PCI_PRI_STR_SIZE, PCI_PRI_FMT,
>                   addr->domain, addr->bus, addr->devid, addr->function);
>          return 0;
>  }
> diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c 
> b/drivers/net/hinic/hinic_pmd_ethdev.c
> index adc9f75c81..d4978e0649 100644
> --- a/drivers/net/hinic/hinic_pmd_ethdev.c
> +++ b/drivers/net/hinic/hinic_pmd_ethdev.c
> @@ -3086,7 +3086,7 @@ static int hinic_func_init(struct rte_eth_dev 
> *eth_dev)
>
>          snprintf(nic_dev->proc_dev_name,
>                   sizeof(nic_dev->proc_dev_name),
> -                "hinic-%.4x:%.2x:%.2x.%x",
> +                "hinic-" PCI_PRI_FMT,
>                   pci_dev->addr.domain, pci_dev->addr.bus,
>                   pci_dev->addr.devid, pci_dev->addr.function);
>
> @@ -3202,7 +3202,7 @@ static int hinic_dev_init(struct rte_eth_dev 
> *eth_dev)
>
>          pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
>
> -       PMD_DRV_LOG(INFO, "Initializing pf hinic-%.4x:%.2x:%.2x.%x in 
> %s process",
> +       PMD_DRV_LOG(INFO, "Initializing pf hinic-" PCI_PRI_FMT " in %s 
> process",
>                      pci_dev->addr.domain, pci_dev->addr.bus,
>                      pci_dev->addr.devid, pci_dev->addr.function,
>                      (rte_eal_process_type() == RTE_PROC_PRIMARY) ?
> diff --git a/drivers/net/mlx5/linux/mlx5_os.c 
> b/drivers/net/mlx5/linux/mlx5_os.c
> index d5ef695e6d..0706e9e9b2 100644
> --- a/drivers/net/mlx5/linux/mlx5_os.c
> +++ b/drivers/net/mlx5/linux/mlx5_os.c
> @@ -1952,7 +1952,7 @@ mlx5_device_bond_pci_match(const char *ibdev_name,
>                                  ifindex, bond_info->ifindex, 
> bond_info->ifname);
>          }
>          if (owner == 0 && pf != 0) {
> -               DRV_LOG(INFO, "PCIe instance %04x:%02x:%02x.%x isn't 
> bonding owner",
> +               DRV_LOG(INFO, "PCIe instance " PCI_PRI_FMT " isn't 
> bonding owner",
>                                  pci_dev->domain, pci_dev->bus, 
> pci_dev->devid,
> pci_dev->function);
>          }
> diff --git a/drivers/net/thunderx/nicvf_ethdev.c 
> b/drivers/net/thunderx/nicvf_ethdev.c
> index ab1e714d97..a504d41dfe 100644
> --- a/drivers/net/thunderx/nicvf_ethdev.c
> +++ b/drivers/net/thunderx/nicvf_ethdev.c
> @@ -2218,7 +2218,7 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)
>          nic->subsystem_device_id = pci_dev->id.subsystem_device_id;
>          nic->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
>
> -       PMD_INIT_LOG(DEBUG, "nicvf: device (%x:%x) %u:%u:%u:%u",
> +       PMD_INIT_LOG(DEBUG, "nicvf: device (%x:%x) " PCI_PRI_FMT,
>                          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);
> -- 
> 2.42.0
>

  reply	other threads:[~2023-10-20  3:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19 15:31 [PATCH 0/2] small cleanup - use PCI lib Thomas Monjalon
2023-10-19 15:31 ` [PATCH 1/2] drivers: use macro for PCI address format Thomas Monjalon
2023-10-20  1:02   ` John Daley (johndale)
2023-10-20  3:30     ` lihuisong (C) [this message]
2023-10-19 15:31 ` [PATCH 2/2] drivers: use function to compare PCI addresses Thomas Monjalon
2023-10-19 16:04   ` Long Li
2023-10-29  8:54 ` [PATCH 0/2] small cleanup - use PCI lib Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0fc36bc6-6fdd-9efd-d26e-6cfb3d1f3c43@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=chenbox@nvidia.com \
    --cc=cloud.wangxiaoyun@huawei.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=hyonkim@cisco.com \
    --cc=igorch@amazon.com \
    --cc=jerinj@marvell.com \
    --cc=johndale@cisco.com \
    --cc=matan@nvidia.com \
    --cc=mczekaj@marvell.com \
    --cc=mk@semihalf.com \
    --cc=orika@nvidia.com \
    --cc=rbeider@amazon.com \
    --cc=shaibran@amazon.com \
    --cc=suanmingm@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    --cc=xuanziyang2@huawei.com \
    --cc=zhouguoyang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).