linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can <linux-can@vger.kernel.org>,
	Arunachalam Santhanam <arunachalam.santhanam@in.bosch.com>
Subject: Re: [PATCH v12 1/1] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces
Date: Wed, 10 Mar 2021 03:26:12 +0900	[thread overview]
Message-ID: <CAMZ6RqKR3HYrJvc+=rXK40Yq=L3pgvTWwgC=reYWSN9XdQ4ksg@mail.gmail.com> (raw)
In-Reply-To: <CAMZ6Rq+bKzRqAg9egg6NL_mJHTwY02em2dR+O33OGe6xqt-nqg@mail.gmail.com>

Le mer. 10 mars 2021 à 02:54, Vincent MAILHOL
<mailhol.vincent@wanadoo.fr> a écrit :
>
> On Wed. 10 Mar 2021 at 00:35, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> >
> > On 09.03.2021 22:10:08, Vincent MAILHOL wrote:
> > > Sounds good to me. I will prepare a patch to explain the issue
> > > and try to introduce the dql_set_min_limit() function.
> > >
> > > Meanwhile, I would be thankful if you could continue the review :)
> >
> > Thanks for the mail, looks good.
> >
> > One note for the patch, though:
> >
> > > diff --git a/include/linux/dynamic_queue_limits.h b/include/linux/dynamic_queue_limits.h
> > > index 407c2f281b64..32437f168a35 100644
> > > --- a/include/linux/dynamic_queue_limits.h
> > > +++ b/include/linux/dynamic_queue_limits.h
> > > @@ -103,6 +103,9 @@ void dql_reset(struct dql *dql);
> > >  /* Initialize dql state */
> > >  void dql_init(struct dql *dql, unsigned int hold_time);
> > >
> > > +/* Set the dql minimum limit */
> > #ifdef CONFIG_DQL
> > > +void dql_set_min_limit(struct dql *dql, unsigned int min_limit);
> > #else
> > static inline void dql_set_min_limit(struct dql *dql, unsigned int min_limit)
> > {
> > }
> > #endif
> > > +
> > >  #endif /* _KERNEL_ */
> > >
> > >  #endif /* _LINUX_DQL_H */
> > > diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c
> > > index fde0aa244148..8b6ad1e0a2e3 100644
> > > --- a/lib/dynamic_queue_limits.c
> > > +++ b/lib/dynamic_queue_limits.c
> >
> > This file is only compiled if CONFIG_DQL is set, see lib/Makefile:
> >
> > | obj-$(CONFIG_DQL) += dynamic_queue_limits.o
>
> Got it.
>
> > > @@ -136,3 +136,11 @@ void dql_init(struct dql *dql, unsigned int hold_time)
> > >       dql_reset(dql);
> > >  }
> > >  EXPORT_SYMBOL(dql_init);
> > > +
> > > +void dql_set_min_limit(struct dql *dql, unsigned int min_limit)
> > > +{
> > > +#ifdef CONFIG_BQL
> >
> > remove this ifdef
> >
> > > +     dql->min_limit = min_limit;
> > > +#endif
> > > +}
> > > +EXPORT_SYMBOL(dql_set_min_limit);
>
> Actually, after doing a few more tests, this is a bit more complicated
> than anticipated.
> The dql member of struct netdev_queue is also guarded by a #ifdef CONFIG_BQL:
> https://elixir.bootlin.com/linux/latest/source/include/linux/netdevice.h#L629
>
> This means that under the current idea, we would also need to guard
> the call to dql_set_min_limit():
> #ifdef CONFIG_BQL
>     dql_set_min_limit(&netdev_get_tx_queue(netdev, 0)->dql,
>               es58x_dev->param->dql_limit_min);
> #ifdef CONFIG_BQL
>
> This kills the initial intent of not using the #ifdef CONFIG_BQL to
> set the value.
>
> This leads to the need to do:
> void netdev_queue_set_dql_min_limit(struct netdev_queue *q, unsigned int min_limit)

Of course, I meant:
static inline void netdev_queue_set_dql_min_limit(struct netdev_queue
*q, unsigned int min_limit)

> {
> #ifdef CONFIG_BQL
>     q->dql.min_limit = min_limit;
> #endif
> }
> which would probably be inside /include/linux/netdevice.h.
>
> Does it make sense?

  reply	other threads:[~2021-03-09 18:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 16:34 [PATCH v12 0/1] Introducing ETAS ES58X CAN USB interfaces Vincent Mailhol
2021-03-09  8:30 ` Jimmy Assarsson
2021-03-09 12:18   ` Vincent MAILHOL
2021-03-09 12:21     ` Jimmy Assarsson
     [not found] ` <20210308163445.103636-2-mailhol.vincent@wanadoo.fr>
2021-03-09 10:27   ` [PATCH v12 1/1] can: usb: etas_es58X: add support for " Marc Kleine-Budde
2021-03-09 12:45     ` Vincent MAILHOL
2021-03-09 12:57       ` Marc Kleine-Budde
2021-03-09 13:10         ` Vincent MAILHOL
2021-03-09 15:35           ` Marc Kleine-Budde
2021-03-09 17:54             ` Vincent MAILHOL
2021-03-09 18:26               ` Vincent MAILHOL [this message]
2021-03-09 20:26                 ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMZ6RqKR3HYrJvc+=rXK40Yq=L3pgvTWwgC=reYWSN9XdQ4ksg@mail.gmail.com' \
    --to=mailhol.vincent@wanadoo.fr \
    --cc=arunachalam.santhanam@in.bosch.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).