On Wed, Apr 23, 2025 at 11:13:07AM +0300, Leon Romanovsky wrote: > From: Leon Romanovsky <leonro@xxxxxxxxxx> > > Change the creation of mkey to be performed in multiple steps: > data allocation, DMA setup and actual call to HW to create that mkey. > > In this new flow, the whole input to MKEY command is saved to eliminate > the need to keep array of pointers for DMA addresses for receive list > and in the future patches for send list too. > > In addition to memory size reduce and elimination of unnecessary data > movements to set MKEY input, the code is prepared for future reuse. > > Tested-by: Jens Axboe <axboe@xxxxxxxxx> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx> > --- > drivers/vfio/pci/mlx5/cmd.c | 157 ++++++++++++++++++++---------------- > drivers/vfio/pci/mlx5/cmd.h | 4 +- > 2 files changed, 91 insertions(+), 70 deletions(-) Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx> Jason