DPDK patches and discussions
 help / color / mirror / Atom feed
From: Amit Prakash Shukla <amitprakashs@marvell.com>
To: fengchengwen <fengchengwen@huawei.com>,
	Thomas Monjalon <thomas@monjalon.net>
Cc: Kevin Laatz <kevin.laatz@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>,
	Vamsi Krishna Attunuru <vattunuru@marvell.com>,
	Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>,
	Anoob Joseph <anoobj@marvell.com>,
	"mb@smartsharesystems.com" <mb@smartsharesystems.com>
Subject: RE: [EXT] Re: [PATCH v2] lib/dmadev: get DMA device using device ID
Date: Fri, 9 Feb 2024 11:05:41 +0000	[thread overview]
Message-ID: <PH0PR18MB516746E466A32A48E4D73D34C84B2@PH0PR18MB5167.namprd18.prod.outlook.com> (raw)
In-Reply-To: <069660f9-2940-23de-4b6a-beaea1acf944@huawei.com>

Hi Thomas and Chengwen,

Thank you for the review and feedback. Please find my comment in-line.

Thanks,
Amit Shukla

> ----------------------------------------------------------------------
> Hi Thomas,
> 
> 
> On 2024/2/9 0:25, Thomas Monjalon wrote:
> > 19/12/2023 12:00, Amit Prakash Shukla:
> >> +struct rte_dma_dev *
> >> +rte_dma_pmd_get_dev_by_id(const int dev_id)
> > const does not make sense here for an int parameter.
> 
> 
> I think it could be OK with const even if the parameter is not pointer.
> 
> However, most DPDK APIs do not have const for simple types (e.g.
> int/uin16_t).
> 
> In this aspect, I think it's also OK to remove const of here for consistency.
> 
> 
> >
> >> +{
> >> +	if (!rte_dma_is_valid(dev_id))
> >> +		return NULL;
> >> +
> >> +	return &rte_dma_devices[dev_id];
> >> +}
> > [...]
> >> +/**
> >> + * @internal
> >> + * Get the rte_dma_dev structure device pointer for the device id.
> >> + *
> >> + * @param dev_id
> >> + *   Device ID value to select the device structure.
> > This comment is not explanatory.
> > What is an ID? Where does it come from?
> > Where can we see such ID for DMA device?
> 
> This new API is used in the event-dma driver of cnxk [1]:
> 
> The rte_event_dma_adapter_vchan_add has parameter of dma_dev_id, and it
> then
> 
> invoke (*dev->dev_ops->dma_adapter_vchan_add)(dev, dma_dev_id, vchan,
> event),
> 
> at cnxk driver, this ops will check whether the DMA is
> cnxk_dmadev_pci_driver.
> 
> I think this is because the cnxk's event-and-dma implement has deep coupling
> 
> (because the cnxk's event device could interact with another vendor's
> dma device).
> 
> 
> Maybe we should think of a better way to solve this kind of coupling
> problem.

Id, is the DMA dev id which is used in looking up DMA dev. This API is in-line with the other libraries.
Crypto library has an api rte_cryptodev_pmd_get_dev to get crypto device based on device id.

> 
> 
> Thanks
> 
> 
> [1]
> https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__patches.dpdk.org_project_dpdk_patch_20231208082835.2817601-
> 2D3-2Damitprakashs-
> 40marvell.com_&d=DwICaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=ALGdXl3fZgF
> GR69VnJLdSnADun7zLaXG1p5Rs7pXihE&m=b0t1Tduh89vXiJ7GQG0eb_yIMN
> k2aEkmL2losNL5qiqNycAqWUi7kLJRmmOunpvy&s=oy9mqDXsDKhXuVG9iy7
> SLmU_shlYhfjrglvjEoEQ4AM&e=
> 
> >
> >> + *
> >> + * @return
> >> + *   - rte_dma_dev structure pointer for the given device ID on success,
> NULL
> >> + *   otherwise.
> >> + */
> >> +__rte_internal
> >> +struct rte_dma_dev *rte_dma_pmd_get_dev_by_id(const int dev_id);
> > Again, const does not make sense here.
> >
> > Chengwen, please can you comment this patch as you maintain dmadev?
> >
> >

  reply	other threads:[~2024-02-09 11:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  7:55 [PATCH] " Amit Prakash Shukla
2023-12-09  7:11 ` fengchengwen
2023-12-18 10:41   ` [EXT] " Amit Prakash Shukla
2023-12-11 10:23 ` Bruce Richardson
2023-12-18 11:27   ` [EXT] " Amit Prakash Shukla
2023-12-19 11:00 ` [PATCH v2] " Amit Prakash Shukla
2024-01-08 14:47   ` Anoob Joseph
2024-02-06  6:24     ` Amit Prakash Shukla
2024-02-08 16:25   ` Thomas Monjalon
2024-02-09  8:18     ` fengchengwen
2024-02-09 11:05       ` Amit Prakash Shukla [this message]
2024-02-09 11:18         ` [EXT] " Thomas Monjalon
2024-02-09 11:30           ` Amit Prakash Shukla
2024-02-09 17:36             ` 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=PH0PR18MB516746E466A32A48E4D73D34C84B2@PH0PR18MB5167.namprd18.prod.outlook.com \
    --to=amitprakashs@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=jerinj@marvell.com \
    --cc=kevin.laatz@intel.com \
    --cc=mb@smartsharesystems.com \
    --cc=ndabilpuram@marvell.com \
    --cc=thomas@monjalon.net \
    --cc=vattunuru@marvell.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).