On 12/20/19 11:37 PM, James Smart wrote: > This patch continues the efct driver population. > > This patch adds driver definitions for: > RQ data buffer allocation and deallocate. > Memory pool allocation and deallocation APIs. > Mailbox command submission and completion routines. > > Signed-off-by: Ram Vegesna <ram.vegesna@xxxxxxxxxxxx> > Signed-off-by: James Smart <jsmart2021@xxxxxxxxx> > --- > drivers/scsi/elx/efct/efct_hw.c | 355 +++++++++++++++++++++++++++++ > drivers/scsi/elx/efct/efct_hw.h | 7 + > drivers/scsi/elx/efct/efct_utils.c | 446 +++++++++++++++++++++++++++++++++++++ > drivers/scsi/elx/efct/efct_utils.h | 83 +++++++ > 4 files changed, 891 insertions(+) > create mode 100644 drivers/scsi/elx/efct/efct_utils.c > create mode 100644 drivers/scsi/elx/efct/efct_utils.h > [ .. ] > diff --git a/drivers/scsi/elx/efct/efct_utils.c b/drivers/scsi/elx/efct/efct_utils.c > new file mode 100644 > index 000000000000..1d28be633a41 > --- /dev/null > +++ b/drivers/scsi/elx/efct/efct_utils.c > @@ -0,0 +1,446 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (C) 2019 Broadcom. All Rights Reserved. The term > + * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. > + */ > + > +#include "efct_driver.h" > +#include "efct_utils.h" > + > +#define DEFAULT_SLAB_LEN (64 * 1024) > + > +struct pool_hdr { > + struct list_head list_entry; > +}; > + > +struct efct_array { > + void *os; > + > + u32 size; > + u32 count; > + > + u32 n_rows; > + u32 elems_per_row; > + u32 bytes_per_row; > + > + void **array_rows; > + u32 array_rows_len; > +}; > + I really wonder if xarray wouldn't be better suited here. Have you checked? Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@xxxxxxx +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer