HI Akhil,

> -----Original Message-----
> From: Akhil Goyal <gak...@marvell.com>
> Sent: Monday, August 8, 2022 8:43 AM
> To: Zhang, Roy Fan <roy.fan.zh...@intel.com>; Ji, Kai <kai...@intel.com>;
> dev@dpdk.org
> Cc: Anoob Joseph <ano...@marvell.com>; hemant.agra...@nxp.com;
> Chandubabu Namburu <cha...@amd.com>; Ruifeng Wang
> <ruifeng.w...@arm.com>; ajit.khapa...@broadcom.com; Michael Shamis
> <michae...@marvell.com>; Nagadheeraj Rottela
> <rnagadhee...@marvell.com>; ma...@nvidia.com; Jay Zhou
> <jianjay.z...@huawei.com>
> Subject: RE: [EXT] [dpdk-dev v1] lib/cryptodev: multi-process IPC request
> handler
> 
> Hi Fan,
> > Hi Akhil,
> >
> > > This is a library change you should cc all PMD owners while sending patch.
> > Kai is in holiday at the moment and will be back in a week. I will sync with
> him
> > then.
> > >
> > > > This patch add in multi-process IPC request handler function in rte
> > > > cryptodev. This function intend to support a queue-pair configuration
> > > > request to allow the secondary process to reconfigure the queue-pair
> > > > setup'ed by the primary process.
> > >
> > > Who will release the queue pair already setup by primary in the first 
> > > place?
> >
> > Fan: If the queue pair already setup by primary the secondary shall not
> recreate
> > it
> > but use it instead.
> 
> OK but the description says secondary would reconfigure the qp setup by
> primary.
> 
> >
> > > Currently, all queues are setup by primary and secondary uses them.
> > > So if a queue is re-initialized by secondary, and if it is being used in
> primary
> > > process,
> > > Wont that drop packets abruptly if the queue is re-initialized?
> >
> > You are right. What about creating a variable in the queue pair with either
> PID
> > or thread id who own the queue pair?
> 
> I believe we should not expose the PID/thread id via queue to the user
> application.
> This may be security issue.

You have a point.

> 
> Instead an "in_use" parameter can be added which can tell if sone other
> process is using it or not.
> And this in_use param also need not be exposed to user. It can be
> completely hidden in the PMD.
> User will get an error number(probably -EUSERS) indicating the queue pair is
> already in use.

Great idea. That's what I am after too. So can I sum up the following change?

- each queue pair has a "in_use" param. I believe we can refine this a bit by
a "not_in_use", "in_use_by_primary" and "in_use_by_secondary" enum.
- the secondary process may request to configure a queue pair by sending
  message to primary
- as of requesting freeing a queue pair
        - primary can free any queue pair.
        - but for secondary to free a queue pair, we have a problem:
                - we may allow secondary to request freeing the queue pair if it
                  is "in_use_by_secondary". But then there may be a security
                  issue as a secondary can free a queue pair used by different
                  secondary process.
                - or we may not allow secondary process to request freeing
                  any queue pair, it is securer, but less flexible.


> 
> Regards,
> Akhil

Regards,
Fan

Reply via email to