From: Laurent Vivier <lvivier@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 2/2] udp_flow: move all udp_flow functions to udp_flow.c
Date: Mon, 5 Aug 2024 09:11:36 +0200 [thread overview]
Message-ID: <73ecabe9-5ea6-46bf-8b1c-29429336ad51@redhat.com> (raw)
In-Reply-To: <Zq3hcG5sFlXGzYzz@zatzit>
On 03/08/2024 09:51, David Gibson wrote:
> On Fri, Aug 02, 2024 at 06:10:36PM +0200, Laurent Vivier wrote:
>> No code change.
>>
>> They need to be exported to be available by the vhost-user version of
>> passt.
>>
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>
> LGTM, with one nit:
>
>> +/**
>> + * udp_at_sidx() - Get UDP specific flow at given sidx
>> + * @sidx: Flow and side to retrieve
>> + *
>> + * Return: UDP specific flow at @sidx, or NULL of @sidx is invalid. Asserts if
>> + * the flow at @sidx is not FLOW_UDP.
>> + */
>> +struct udp_flow *udp_at_sidx(flow_sidx_t sidx)
>> +{
>> + union flow *flow = flow_at_sidx(sidx);
>> +
>> + if (!flow)
>> + return NULL;
>> +
>> + ASSERT(flow->f.type == FLOW_UDP);
>> + return &flow->udp;
>> +}
>
> udp_at_sidx() is so simple it probably makes more sense to have it as
> an inline in the header file, rather than a regular function. When it
> was a local function, I was pretty much assuming the compiler would
> inline it anyways.
>
I can't move it to udp_flow.h because udp_at_sidx() uses flow_at_sidx() that is defined in
flow_table.h after udp_flow.h has already been included. flow_table.h includes udp_flow.h
at its top because it needs "struct udp_flow" in union flow.
Thanks,
Laurent
next prev parent reply other threads:[~2024-08-05 7:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 16:10 [PATCH 0/2] udp_flow: move all udp_flow functions to udp_flow.c Laurent Vivier
2024-08-02 16:10 ` [PATCH 1/2] udp_flow: Remove udp_meta_t from the parameters of udp_flow_from_sock() Laurent Vivier
2024-08-03 7:47 ` David Gibson
2024-08-02 16:10 ` [PATCH 2/2] udp_flow: move all udp_flow functions to udp_flow.c Laurent Vivier
2024-08-03 7:51 ` David Gibson
2024-08-05 7:11 ` Laurent Vivier [this message]
2024-08-05 12:17 ` David Gibson
2024-08-05 19:02 ` [PATCH 0/2] " Stefano Brivio
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=73ecabe9-5ea6-46bf-8b1c-29429336ad51@redhat.com \
--to=lvivier@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
/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.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
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 IMAP folder(s).