b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: "Linus Lüssing" <linus.luessing@c0d3.blue>,
	"Antonio Quartulli" <a@unstable.cc>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [PATCH v5 1/2] batman-adv: split DAT cache into DAT cache and DAT DHT
Date: Sat, 23 Nov 2024 19:36:32 +0100	[thread overview]
Message-ID: <2320571.iZASKD2KPV@sven-l14> (raw)
In-Reply-To: <878c7f2c-ea78-4f40-b20e-9698c77f887d@unstable.cc>

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

On Monday, 28 October 2024 14:25:36 CET Antonio Quartulli wrote:
[...]
> > +/**
> > + * batadv_dat_get_softif() - get the soft interface from a netlink callback
> > + * @cb: callback structure containing arguments
> > + *
> > + * Return: The soft interface on success or an error pointer otherwise.
> > + */
> > +static struct net_device *batadv_dat_get_softif(struct netlink_callback *cb)
> > +{
> > +	struct net *net = sock_net(cb->skb->sk);
> > +	struct net_device *soft_iface;
> > +	int ifindex;
> > +
> > +	ifindex = batadv_netlink_get_ifindex(cb->nlh,
> > +					     BATADV_ATTR_MESH_IFINDEX);
> > +	if (!ifindex)
> > +		return ERR_PTR(-EINVAL);
> > +
> > +	soft_iface = dev_get_by_index(net, ifindex);
> > +	if (!soft_iface)
> > +		return ERR_PTR(-ENODEV);
> > +
> > +	if (!batadv_softif_is_valid(soft_iface)) {
> > +		dev_put(soft_iface);
> > +		return ERR_PTR(-ENODEV);
> > +	}
> > +
> > +	return soft_iface;
> > +}
> 
> I don't think this function is DAT specific at all.
> Moreover, the very same code (which I think you are re-using here) 
> appears in batadv_netlink_dump_hardif().
> 
> I think it'd make more sense to factor it out and create a helper out of 
> it (place it in netlink.c?). This way we avoid code duplication.
> 
> [I might be wrong but 90% of the work already is in 
> batadv_get_softif_from_info()]


Looks like this was never answered and also not handled in the v6 version of the patch.

[...]
> > --- a/net/batman-adv/types.h
> > +++ b/net/batman-adv/types.h
> > @@ -1231,8 +1231,11 @@ struct batadv_priv_dat {
> >   	/** @addr: node DAT address */
> >   	batadv_dat_addr_t addr;
> >   
> > -	/** @hash: hashtable representing the local ARP cache */
> > -	struct batadv_hashtable *hash;
> > +	/** @cache_hash: hashtable representing the local ARP cache */
> > +	struct batadv_hashtable *cache_hash;
> > +
> > +	/** @dht_hash: hashtable representing the local DAT DHT */
> > +	struct batadv_hashtable *dht_hash;
> >   
> >   	/** @work: work queue callback item for cache purging */
> >   	struct delayed_work work;
> 
> I can see that most of the code in this patch is about handling two 
> tables (in a generic fashion) instead of one.
> 
> One functional change I am seeing is also that before this patch 
> batman-adv would store/cache any ARP information coming from the mesh.
> While now this happens only for the DHT PUT. Am I right?
> 
> If that's the case, it means we may issue more DHT_GETs (and possibly 
> ARP requests) because we lost a chance to cache a bit more that what the 
> DHT stores. Does it make sense?


Looks like this was never answered.


Kind regards,
	Sven

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

  reply	other threads:[~2024-11-23 18:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11  4:57 [PATCH v5 0/2] batman-adv: increase DAT DHT timeout Linus Lüssing
2024-09-11  4:57 ` [PATCH v5 1/2] batman-adv: split DAT cache into DAT cache and DAT DHT Linus Lüssing
2024-09-11  7:35   ` Antonio Quartulli
2024-09-12 11:08     ` Linus Lüssing
2024-09-12 11:28       ` Antonio Quartulli
2024-09-17 10:29         ` Linus Lüssing
2024-10-28 13:25   ` Antonio Quartulli
2024-11-23 18:36     ` Sven Eckelmann [this message]
2024-11-29 17:57     ` Linus Lüssing
2024-09-11  4:57 ` [PATCH v5 2/2] batman-adv: increase DAT DHT timeout Linus Lüssing

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=2320571.iZASKD2KPV@sven-l14 \
    --to=sven@narfation.org \
    --cc=a@unstable.cc \
    --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).