All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: netdev@vger.kernel.org, Simon Wunderlich <sw@simonwunderlich.de>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	b.a.t.m.a.n@lists.open-mesh.org,
	Simon Wunderlich <sw@simonwunderlich.de>
Subject: Re: [PATCH net-next 03/10] batman-adv: add missing kernel-doc comments
Date: Thu, 06 Aug 2026 20:25:50 +0200	[thread overview]
Message-ID: <2591882.ElGaqSPkdT@sven-desktop> (raw)
In-Reply-To: <20260805143200.722098-4-sw@simonwunderlich.de>

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

https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260805143200.722098-1-sw%40simonwunderlich.de?part=3

--- Patch [3]: [PATCH net-next 03/10] batman-adv: add missing kernel-doc comments ---

> > @@ -469,6 +510,17 @@ static int batadv_v_neigh_cmp(struct batadv_neigh_node *neigh1,
> >  	return ret;
> >  }
> >  
> > +/**
> > + * batadv_v_neigh_is_sob() - check whether two B.A.T.M.A.N. V neighbours have
> > + *  a similar or better throughput
> > + * @neigh1: first neighbour to compare
> > + * @if_outgoing1: outgoing interface to use for @neigh1
> > + * @neigh2: second neighbour to compare
> > + * @if_outgoing2: outgoing interface to use for @neigh2
> > + *
> > + * Return: true if the throughput of @neigh2 is at least 3/4 of the
> > + *  @neigh1 throughput
> > + */
> >  static bool batadv_v_neigh_is_sob(struct batadv_neigh_node *neigh1,
> >  				  struct batadv_hard_iface *if_outgoing1,
> >  				  struct batadv_neigh_node *neigh2,
> 
> Discovered by: opus-5 · Missed by: sashiko-gemini
> Does "at least 3/4" match the comparison in the body?  The test is strict:
> 
> 	threshold = ifinfo1->bat_v.throughput / 4;
> 	threshold = ifinfo1->bat_v.throughput - threshold;
> 
> 	ret = ifinfo2->bat_v.throughput > threshold;
> 
> For a neigh1 throughput of 100 the threshold is 75, so an exact 75 on
> neigh2 returns false rather than true.

Correct, will change it to "more than" in a patchset which deals with the 
bonding in B.A.T.M.A.N. V. Shouldn't be too bad enough to force a resubmission 
of this PR.

> 
> The second half is about the direction of the comparison.  The ops contract
> in net/batman-adv/types.h documents the hook the other way around:
> 
> 	 * @is_similar_or_better: check if neigh1 is equally similar or better
> 	 *  than neigh2 for their respective outgoing interface from the metric
> 	 *  prospective

Already stumbled upon that. I am not really interested in B.A.T.M.A.N. V or 
even bonding in B.A.T.M.A.N. V. But I don't think anyone of the developers 
will react. I have therefore documented the background in 
https://www.open-mesh.org/issues/464 and will send a patchset which uses more 
descriptive names and reorders this calculation.

Regards,
	Sven

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

  parent reply	other threads:[~2026-08-06 18:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05 14:27 [PATCH net-next 00/10] pull request for net-next: batman-adv 2026-08-05 Simon Wunderlich
2026-08-05 14:27 ` [PATCH net-next 01/10] batman-adv: dat: drop non-4addr backwards compatibility Simon Wunderlich
2026-08-06 15:03   ` Sven Eckelmann
2026-08-05 14:27 ` [PATCH net-next 02/10] batman-adv: tvlv: handle negative tvlv processing return codes Simon Wunderlich
2026-08-06 15:36   ` Sven Eckelmann
2026-08-05 14:27 ` [PATCH net-next 03/10] batman-adv: add missing kernel-doc comments Simon Wunderlich
2026-08-06 16:02   ` Sven Eckelmann
2026-08-06 18:25   ` Sven Eckelmann [this message]
2026-08-05 14:27 ` [PATCH net-next 04/10] batman-adv: fix kernel-doc for functions holding skb ownership Simon Wunderlich
2026-08-05 14:27 ` [PATCH net-next 05/10] batman-adv: annotate functions which may reallocate the skbuff Simon Wunderlich
2026-08-06 16:13   ` Sven Eckelmann
2026-08-05 14:27 ` [PATCH net-next 06/10] batman-adv: split multiple declarations per line Simon Wunderlich
2026-08-05 14:27 ` [PATCH net-next 07/10] batman-adv: switch var declarations to reverse x-mas tree order Simon Wunderlich
2026-08-05 14:27 ` [PATCH net-next 08/10] batman-adv: handle errors in batadv_init() Simon Wunderlich
2026-08-05 14:27 ` [PATCH net-next 09/10] batman-adv: correct NET_RX_* NET_XMIT_* confusion Simon Wunderlich
2026-08-05 14:27 ` [PATCH net-next 10/10] batman-adv: remove negative returns for batadv_send_skb_unicast Simon Wunderlich
2026-08-06 16:26   ` 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=2591882.ElGaqSPkdT@sven-desktop \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sw@simonwunderlich.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.