public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 2/2] udp_flow: move all udp_flow functions to udp_flow.c
Date: Sat, 3 Aug 2024 17:51:12 +1000	[thread overview]
Message-ID: <Zq3hcG5sFlXGzYzz@zatzit> (raw)
In-Reply-To: <20240802161036.1404559-3-lvivier@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]

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.

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-08-03  7:52 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 [this message]
2024-08-05  7:11     ` Laurent Vivier
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=Zq3hcG5sFlXGzYzz@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=lvivier@redhat.com \
    --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).