b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Simon Wunderlich <sw@simonwunderlich.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: "Linus Lüssing" <linus.luessing@c0d3.blue>,
	"Linus Lüssing" <linus.luessing@c0d3.blue>
Subject: Re: [PATCH v4 3/5] batman-adv: mcast: implement multicast packet reception and forwarding
Date: Thu, 19 Jan 2023 13:47:25 +0100	[thread overview]
Message-ID: <2927983.YVBx59ikfs@prime> (raw)
In-Reply-To: <20221227193409.13461-4-linus.luessing@c0d3.blue>

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

On Tuesday, December 27, 2022 8:34:07 PM CET Linus Lüssing wrote:
> +/**
> + * struct batadv_tvlv_mcast_tracker - payload of a multicast tracker tvlv
> + * @num_dests: number of subsequent destination originator MAC addresses
> + * @align: (optional) alignment bytes to make the tracker TVLV 4 bytes
> aligned, + * present if num_dests are even, not present if odd
> + */
> +struct batadv_tvlv_mcast_tracker {
> +       __be16  num_dests;
> +       __u8    align[2];
> +};
> +
The one thing which I really don't like is to have the alignment in the 
beginning, and depending on the number of entries. Normally, such alignments 
should be at the end of the structure so it is straight forward for a parser 
to omit it.

My understanding is that the alignment is due to technical reasons (mac 
address list is assembled by pushing the data to the front), perhaps to save 
another memove/memcpy. However, the data is collected by traversing various 
lists, and if performance would be a concern, then this data should be cached 
and this "technicality" wouldn't be needed either.

So please, skip the alignment in the front and have it in the back.

The rest of the packet format looks good from what I've seen.

Cheers,
      Simon


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2023-01-19 12:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 19:34 [PATCH v4 0/5] Implementation of a Stateless Multicast Packet Type Linus Lüssing
2022-12-27 19:34 ` [PATCH v4 1/5] batman-adv: mcast: remove now redundant single ucast forwarding Linus Lüssing
2023-01-06 17:21   ` Sven Eckelmann
2022-12-27 19:34 ` [PATCH v4 2/5] batman-adv: tvlv: prepare for tvlv enabled multicast packet type Linus Lüssing
2023-01-06 17:54   ` Sven Eckelmann
2022-12-27 19:34 ` [PATCH v4 3/5] batman-adv: mcast: implement multicast packet reception and forwarding Linus Lüssing
2023-01-15 17:56   ` Sven Eckelmann
2023-01-16 18:31     ` Linus Lüssing
2023-01-19 12:47   ` Simon Wunderlich [this message]
2023-01-21 13:15     ` Linus Lüssing
2022-12-27 19:34 ` [PATCH v4 4/5] batman-adv: mcast: implement multicast packet generation Linus Lüssing
2023-01-18 21:15   ` Sven Eckelmann
2022-12-27 19:34 ` [PATCH v4 5/5] batman-adv: mcast: shrink tracker packet after scrubbing Linus Lüssing
2023-01-18 21:29   ` Sven Eckelmann
2023-01-27  9:26 ` [PATCH v4 0/5] Implementation of a Stateless Multicast Packet Type Sven Eckelmann

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=2927983.YVBx59ikfs@prime \
    --to=sw@simonwunderlich.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=linus.luessing@c0d3.blue \
    /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).