[dpdk-dev] [PATCH v2 02/15] common/octeontx2: add routine to check if sec capable otx2

Anoob Joseph anoobj at marvell.com
Mon Jan 27 09:12:07 CET 2020


Hi Akhil,

Minor correction. Please see inline.

Thanks,
Anoob

> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Anoob Joseph
> Sent: Monday, January 27, 2020 1:33 PM
> To: Akhil Goyal <akhil.goyal at nxp.com>; Declan Doherty
> <declan.doherty at intel.com>; Thomas Monjalon <thomas at monjalon.net>
> Cc: Vamsi Krishna Attunuru <vattunuru at marvell.com>; Jerin Jacob
> Kollanukkaran <jerinj at marvell.com>; Narayana Prasad Raju Athreya
> <pathreya at marvell.com>; Kiran Kumar Kokkilagadda
> <kirankumark at marvell.com>; Nithin Kumar Dabilpuram
> <ndabilpuram at marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula at marvell.com>; Ankur Dwivedi <adwivedi at marvell.com>;
> Archana Muniganti <marchana at marvell.com>; Tejasree Kondoj
> <ktejasree at marvell.com>; Lukas Bartosik <lbartosik at marvell.com>;
> dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 02/15] common/octeontx2: add routine to
> check if sec capable otx2
> 
> Hi Akhil,
> 
> Please see inline.
> 
> Thanks,
> Anoob
> 
> > -----Original Message-----
> > From: Akhil Goyal <akhil.goyal at nxp.com>
> > Sent: Monday, January 27, 2020 12:31 PM
> > To: Anoob Joseph <anoobj at marvell.com>; Declan Doherty
> > <declan.doherty at intel.com>; Thomas Monjalon <thomas at monjalon.net>
> > Cc: Vamsi Krishna Attunuru <vattunuru at marvell.com>; Jerin Jacob
> > Kollanukkaran <jerinj at marvell.com>; Narayana Prasad Raju Athreya
> > <pathreya at marvell.com>; Kiran Kumar Kokkilagadda
> > <kirankumark at marvell.com>; Nithin Kumar Dabilpuram
> > <ndabilpuram at marvell.com>; Pavan Nikhilesh Bhagavatula
> > <pbhagavatula at marvell.com>; Ankur Dwivedi <adwivedi at marvell.com>;
> > Archana Muniganti <marchana at marvell.com>; Tejasree Kondoj
> > <ktejasree at marvell.com>; Lukas Bartosik <lbartosik at marvell.com>;
> > dev at dpdk.org
> > Subject: [EXT] RE: [PATCH v2 02/15] common/octeontx2: add routine to
> > check if sec capable otx2
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> > Hi Anoob,
> >
> > >
> > > From: Vamsi Attunuru <vattunuru at marvell.com>
> > >
> > > This routine returns true if given rte_eth_dev is security offload
> > > capable and belongs to octeontx2.
> > >
> > > Signed-off-by: Anoob Joseph <anoobj at marvell.com>
> > > Signed-off-by: Tejasree Kondoj <ktejasree at marvell.com>
> > > Signed-off-by: Vamsi Attunuru <vattunuru at marvell.com>
> > > ---
> > >  drivers/common/octeontx2/otx2_common.c               | 20
> > > ++++++++++++++++++++
> > >  drivers/common/octeontx2/otx2_common.h               |  2 ++
> > >  .../octeontx2/rte_common_octeontx2_version.map       |  1 +
> > >  3 files changed, 23 insertions(+)
> > >
> > > diff --git a/drivers/common/octeontx2/otx2_common.c
> > > b/drivers/common/octeontx2/otx2_common.c
> > > index 7e45366..2f9b167 100644
> > > --- a/drivers/common/octeontx2/otx2_common.c
> > > +++ b/drivers/common/octeontx2/otx2_common.c
> > > @@ -3,6 +3,7 @@
> > >   */
> > >
> > >  #include <rte_atomic.h>
> > > +#include <rte_ethdev.h>
> > >  #include <rte_malloc.h>
> > >  #include <rte_log.h>
> > >
> > > @@ -23,6 +24,25 @@ otx2_npa_set_defaults(struct otx2_idev_cfg *idev)
> > >
> > >  /**
> > >   * @internal
> > > + * Check if rte_eth_dev is security offload capable otx2_eth_dev
> > > +*/ uint8_t otx2_ethdev_is_sec_capable(struct rte_eth_dev *eth_dev) {
> > > +	struct rte_pci_device *pci_dev;
> > > +
> > > +	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
> > > +
> > > +	if (pci_dev->id.device_id == PCI_DEVID_OCTEONTX2_RVU_PF ||
> > > +	    pci_dev->id.device_id == PCI_DEVID_OCTEONTX2_RVU_VF ||
> > > +	    pci_dev->id.device_id == PCI_DEVID_OCTEONTX2_RVU_AF_VF)
> > > +		return 1;
> > > +
> > > +	return 0;
> > > +}
> >
> > Why is this API defined in common?
> > This is a capability of ethernet device and is only specific to OCTEONTX2 driver.
> 
> [Anoob] Crypto PMD is querying eth dev device for 'security' capability. If we put
> the "definition" in ethdev PMD, then there will be a build dependency.

[Anoob] Minor correction in the above line. 

> 
> This is required because we need to map crypto queues to eth devices. This is
> required for outbound processing.
> 
> >
> > - Akhil


More information about the dev mailing list