qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>,
	Jason Wang <jasowang@redhat.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	qemu-ppc@nongnu.org, Alexey Kardashevskiy <aik@ozlabs.ru>,
	Harsh Prateek Bora <harshpb@linux.ibm.com>
Subject: Re: [PATCH v2 4/4] net/l2tpv3: Simplify LD/ST API uses
Date: Thu, 3 Oct 2024 15:34:04 -0700	[thread overview]
Message-ID: <f7ce2afa-9f64-4965-bbd4-fa7d04cdd060@linaro.org> (raw)
In-Reply-To: <20240927215040.20552-5-philmd@linaro.org>

On 9/27/24 14:50, Philippe Mathieu-Daudé wrote:
> Directly call ldn_be_p once instead of ldl_be_p / ldq_be_p.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   net/l2tpv3.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/net/l2tpv3.c b/net/l2tpv3.c
> index b5547cb917..7a0d5dcfe9 100644
> --- a/net/l2tpv3.c
> +++ b/net/l2tpv3.c
> @@ -318,11 +318,7 @@ static int l2tpv3_verify_header(NetL2TPV3State *s, uint8_t *buf)
>       */
>   
>       if (s->cookie) {
> -        if (s->cookie_is_64) {
> -            cookie = ldq_be_p(buf + s->cookie_offset);
> -        } else {
> -            cookie = ldl_be_p(buf + s->cookie_offset) & 0xffffffffULL;
> -        }
> +        cookie = ldn_be_p(buf + s->cookie_offset, s->cookie_is_64 ? 8 : 4);
>           if (cookie != s->rx_cookie) {
>               if (!s->header_mismatch) {
>                   error_report("unknown cookie id");

Is this really an improvement?  I don't see it.


r~


      reply	other threads:[~2024-10-03 22:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-27 21:50 [PATCH v2 0/4] hw/ppc & net: Simplify LD/ST API uses Philippe Mathieu-Daudé
2024-09-27 21:50 ` [PATCH v2 1/4] hw/ppc/spapr_nvdimm: " Philippe Mathieu-Daudé
2024-10-03 22:18   ` Richard Henderson
2024-09-27 21:50 ` [PATCH v2 2/4] hw/ppc/spapr_vof: " Philippe Mathieu-Daudé
2024-10-03 22:21   ` Richard Henderson
2024-09-27 21:50 ` [PATCH v2 3/4] hw/ppc/vof: " Philippe Mathieu-Daudé
2024-09-27 21:50 ` [PATCH v2 4/4] net/l2tpv3: " Philippe Mathieu-Daudé
2024-10-03 22:34   ` Richard Henderson [this message]

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=f7ce2afa-9f64-4965-bbd4-fa7d04cdd060@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=aik@ozlabs.ru \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=harshpb@linux.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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;
as well as URLs for NNTP newsgroup(s).