Message ID | 20220111053303.18162-1-asaini@xilinx.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Maxime Coquelin |
Headers | show |
Series | vdpa/sfc: make MCDI memzone name unique | expand |
Context | Check | Description |
---|---|---|
ci/checkpatch | warning | coding style issues |
ci/iol-testing | warning | apply patch failure |
ci/Intel-compilation | warning | apply issues |
Hi Abhimanyu, > -----Original Message----- > From: abhimanyu.saini@xilinx.com <abhimanyu.saini@xilinx.com> > Sent: Tuesday, January 11, 2022 1:33 PM > To: dev@dpdk.org > Cc: Xia, Chenbo <chenbo.xia@intel.com>; maxime.coquelin@redhat.com; > andrew.rybchenko@oktetlabs.ru; Abhimanyu Saini <asaini@xilinx.com> > Subject: [PATCH] vdpa/sfc: make MCDI memzone name unique > > From: Abhimanyu Saini <asaini@xilinx.com> > > Buffer for MCDI channel is allocated using rte_memzone_reserve_aligned > with zone name 'mcdi'. Since multiple MCDI channels are needed to > support multiple VF(s) and rte_memzone_reserve_aligned expects unique > zone names, append PCI address to zone name to make it unique. > > Signed-off-by: Abhimanyu Saini <asaini@xilinx.com> > --- Could you help with the apply issue and checkpatch issue, then send new version? Thanks, Chenbo
diff --git a/drivers/vdpa/sfc/sfc_vdpa_hw.c b/drivers/vdpa/sfc/sfc_vdpa_hw.c index fd1fee7..a7018b1 100644 --- a/drivers/vdpa/sfc/sfc_vdpa_hw.c +++ b/drivers/vdpa/sfc/sfc_vdpa_hw.c @@ -25,21 +25,30 @@ { uint64_t mcdi_iova; size_t mcdi_buff_size; + char mz_name[RTE_MEMZONE_NAMESIZE]; const struct rte_memzone *mz = NULL; int numa_node = sva->pdev->device.numa_node; int ret; mcdi_buff_size = RTE_ALIGN_CEIL(len, PAGE_SIZE); + ret = snprintf(mz_name, RTE_MEMZONE_NAMESIZE, "%s_%s", + sva->pdev->name, name); + if (ret < 0 || ret >= RTE_MEMZONE_NAMESIZE) { + sfc_vdpa_err(sva, "%s_%s too long to fit in mz_name", + sva->pdev->name, name); + return -EINVAL; + } - sfc_vdpa_log_init(sva, "name=%s, len=%zu", name, len); + sfc_vdpa_log_init(sva, "name=%s, len=%zu", mz_name, len); - mz = rte_memzone_reserve_aligned(name, mcdi_buff_size, + mz = rte_memzone_reserve_aligned(mz_name, mcdi_buff_size, numa_node, RTE_MEMZONE_IOVA_CONTIG, PAGE_SIZE); if (mz == NULL) { sfc_vdpa_err(sva, "cannot reserve memory for %s: len=%#x: %s", - name, (unsigned int)len, rte_strerror(rte_errno)); + mz_name, (unsigned int)len, + rte_strerror(rte_errno)); return -ENOMEM; }