public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Machon <daniel.machon@microchip.com>
To: Petr Machata <petrm@nvidia.com>
Cc: <netdev@vger.kernel.org>, <dsahern@kernel.org>,
	<stephen@networkplumber.org>, <UNGLinuxDriver@microchip.com>
Subject: Re: [PATCH iproute2-next v2 3/8] dcb: app: modify dcb_app_table_remove_replaced() for dcb-rewr reuse
Date: Tue, 30 May 2023 08:03:30 +0000	[thread overview]
Message-ID: <ZHWt0geuzEfIU3Ck@DEN-LT-70577> (raw)
In-Reply-To: <87pm6j5ako.fsf@nvidia.com>

> > When doing a replace command, entries are checked against selector and
> > protocol. Rewrite requires the check to be against selector and
> > priority.
> >
> > Adapt the existing dcb_app_table_remove_replace function for this, by
> > using callback functions for selector, pid and prio checks.
> >
> > Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
> > ---
> >  dcb/dcb.h     | 14 ++++++++++++++
> >  dcb/dcb_app.c | 32 ++++++++++++++++++++------------
> >  2 files changed, 34 insertions(+), 12 deletions(-)
> >
> > diff --git a/dcb/dcb.h b/dcb/dcb.h
> > index d40664f29dad..84ce95d5c1b2 100644
> > --- a/dcb/dcb.h
> > +++ b/dcb/dcb.h
> > @@ -56,11 +56,25 @@ void dcb_print_array_kw(const __u8 *array, size_t array_size,
> >
> >  /* dcb_app.c */
> >
> > +struct dcb_app_table {
> > +     struct dcb_app *apps;
> > +     size_t n_apps;
> > +     int attr;
> > +};
> > +
> >  int dcb_cmd_app(struct dcb *dcb, int argc, char **argv);
> >  enum ieee_attrs_app dcb_app_attr_type_get(__u8 selector);
> >  bool dcb_app_attr_type_validate(enum ieee_attrs_app type);
> >  bool dcb_app_selector_validate(enum ieee_attrs_app type, __u8 selector);
> >
> > +bool dcb_app_pid_eq(const struct dcb_app *aa, const struct dcb_app *ab);
> > +bool dcb_app_prio_eq(const struct dcb_app *aa, const struct dcb_app *ab);
> 
> This function isn't necessary until 5/8, that's when it should be added.
> 
> > +
> > +void dcb_app_table_remove_replaced(struct dcb_app_table *a,
> > +                                const struct dcb_app_table *b,
> > +                                bool (*key_eq)(const struct dcb_app *aa,
> > +                                               const struct dcb_app *ab));
> > +
> 
> This is conflating publication with prototype change. It would be best
> to separate. I think the publication could be done at the point when you
> actually need the function, i.e. 5/8 as well. I would keep here just the
> prototype change.
> 

Sounds OK to me. Will change in next v.
 

  reply	other threads:[~2023-05-30  8:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 18:10 [PATCH iproute2-next v2 0/8] Introduce new dcb-rewr subcommand Daniel Machon
2023-05-25 18:10 ` [PATCH iproute2-next v2 1/8] dcb: app: add new dcbnl attribute field Daniel Machon
2023-05-25 18:10 ` [PATCH iproute2-next v2 2/8] dcb: app: modify dcb-app print functions for dcb-rewr reuse Daniel Machon
2023-05-29 17:09   ` Petr Machata
2023-05-30  8:01     ` Daniel Machon
2023-05-31  8:31     ` Daniel Machon
2023-05-31 11:26       ` Petr Machata
2023-05-31 14:28         ` David Ahern
2023-05-25 18:10 ` [PATCH iproute2-next v2 3/8] dcb: app: modify dcb_app_table_remove_replaced() " Daniel Machon
2023-05-29 17:00   ` Petr Machata
2023-05-30  8:03     ` Daniel Machon [this message]
2023-05-30 20:29     ` Petr Machata
2023-05-25 18:10 ` [PATCH iproute2-next v2 4/8] dcb: app: modify dcb_app_parse_mapping_cb " Daniel Machon
2023-05-30 19:50   ` Petr Machata
2023-05-31  8:12     ` Daniel Machon
2023-05-31 11:05       ` Petr Machata
2023-05-25 18:10 ` [PATCH iproute2-next v2 5/8] dcb: rewr: add new dcb-rewr subcommand Daniel Machon
2023-05-30 19:58   ` Petr Machata
2023-05-31  8:14     ` Daniel Machon
2023-05-25 18:10 ` [PATCH iproute2-next v2 6/8] man: dcb-rewr: add new manpage for dcb-rewr Daniel Machon
2023-05-30 19:47   ` Petr Machata
2023-05-25 18:10 ` [PATCH iproute2-next v2 7/8] man: dcb: add additional references under 'SEE ALSO' Daniel Machon
2023-05-30 19:39   ` Petr Machata
2023-05-25 18:10 ` [PATCH iproute2-next v2 8/8] man: dcb-app: clean up a few mistakes Daniel Machon
2023-05-30 19:37   ` Petr Machata

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=ZHWt0geuzEfIU3Ck@DEN-LT-70577 \
    --to=daniel.machon@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=stephen@networkplumber.org \
    /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