> -----Original Message----- > From: Jason Gunthorpe <jgg@xxxxxxxx> > Sent: Saturday, January 12, 2019 11:35 AM > To: Parav Pandit <parav@xxxxxxxxxxxx> > Cc: Leon Romanovsky <leon@xxxxxxxxxx>; Doug Ledford > <dledford@xxxxxxxxxx>; Leon Romanovsky <leonro@xxxxxxxxxxxx>; RDMA > mailing list <linux-rdma@xxxxxxxxxxxxxxx> > Subject: Re: [PATCH rdma-next 3/7] RDMA/core: Introduce helper functions > for cache cleanup, update > > On Sat, Jan 12, 2019 at 05:20:19PM +0000, Parav Pandit wrote: > > > > > > > From: Jason Gunthorpe <jgg@xxxxxxxx> > > > Sent: Saturday, January 12, 2019 11:14 AM > > > To: Parav Pandit <parav@xxxxxxxxxxxx> > > > Cc: Leon Romanovsky <leon@xxxxxxxxxx>; Doug Ledford > > > <dledford@xxxxxxxxxx>; Leon Romanovsky <leonro@xxxxxxxxxxxx>; > RDMA > > > mailing list <linux-rdma@xxxxxxxxxxxxxxx> > > > Subject: Re: [PATCH rdma-next 3/7] RDMA/core: Introduce helper > > > functions for cache cleanup, update > > > > > > On Sat, Jan 12, 2019 at 04:39:25AM +0000, Parav Pandit wrote: > > > > > > + > > > > > > +void ib_device_cache_update(struct ib_device *device); void > > > > > > +ib_gid_table_cleanup_one(struct ib_device *device); > > > > > > > > > > This is super goofy, why do we have a 'cleanup' followed by 'update' > > > > > API design? > > > > Cleanup removes all entries from the gid table. > > > > > > The work 'cleanup' should be a final act, there shouldn't be another > > > touch to the datastructure until it is re-inited. So either > > > 'cleanup' or 'update' are the wrong words for what these functions are > doing. > > > > > Update is wrong word. A wrapper such as reinit() for a update() would > help? > > Sure, but if we have reinit do we need the two steps to be exposed? > reinit() looks like below. Is that what you are looking for? gid_cache_reinit() { ib_gid_table_cleanup_one(device); rdma_roce_rescan_device(device); from_start_port to end_port { config_non_roce_gid_cache(device); } > Jason