On Tue, Jun 23, 2020 at 07:57:15PM -0700, Keith Busch wrote:
> On Tue, Jun 23, 2020 at 09:24:32PM +0800, Baolin Wang wrote:
> > +void nvme_set_arbitration_burst(struct nvme_ctrl *ctrl)
> > +{
> > +   u32 result;
> > +   int status;
> > +
> > +   if (!ctrl->rab)
> > +           return;
> > +
> > +   /*
> > +    * The Arbitration Burst setting indicates the maximum number of
> > +    * commands that the controller may launch at one time from a
> > +    * particular Submission Queue. It is recommended that host software
> > +    * configure the Arbitration Burst setting as close to the recommended
> > +    * value by the controller as possible.
> > +    */
> > +   status = nvme_set_features(ctrl, NVME_FEAT_ARBITRATION, ctrl->rab,
> 
> Since 'rab' is an 8-bit field, but the feature's AB value is only 3
> bits, we should add a validity check.

Sure.

> 
> > +}
> > +EXPORT_SYMBOL_GPL(nvme_set_arbitration_burst);
> 
> I don't see any particular reason to export this function just for the
> pci transport to use. Just make it a local static function an call it
> from nvme_init_identify().

OK. Thanks.

Reply via email to