Re: [PATCH v9 2/3] batman-adv: split DAT cache into DAT cache and DAT DHT
Sven Eckelmann <[email protected]>
| Newsgroups | org.open-mesh.lists.batman |
|---|---|
| Message-ID | <177875359527.23013.13660542318783039992.b4-review@b4> |
On Fri, 17 Jan 2025 03:06:36 +0100, Linus Lüssing <[email protected]> wrote: > Similar to the translation table split the (mostly) locally maintained > DAT cache and the DAT DHT concepts into two separate tables. > > This eases the monitoring and debugging regarding the origin of DAT > entries. And allows to apply differing properties to entries in the DAT > cache and DAT DHT in the future, like distinct timeouts. > > Signed-off-by: Linus Lüssing <[email protected]> It applies find on 2cff5b1c6bba ("batman-adv: Use mailmap to fix old e-mail addresses") but not anymore on the current main. This patch has various minor conflicts with the rename of softif to meshif. It looks like the conflict has to be solved like this --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -144,13 +144,8 @@ } /** -<<<<<<< * __batadv_dat_purge() - delete entries from a DAT hash table * @hash: the hash table to delete from -======= - * __batadv_dat_purge() - delete entries from the DAT local storage - * @bat_priv: the bat priv with all the mesh interface information ->>>>>>> * @to_purge: function in charge to decide whether an entry has to be purged or * not. This function takes the dat_entry as argument and has to * returns a boolean value: true is the entry has to be deleted, @@ -319,14 +314,8 @@ } /** -<<<<<<< * batadv_dat_entry_hash_find() - look for a given dat_entry in a hash table * @hash: the hash table to search in -======= - * batadv_dat_entry_hash_find() - look for a given dat_entry in the local hash - * table - * @bat_priv: the bat priv with all the mesh interface information ->>>>>>> * @ip: search key * @vid: VLAN identifier * @@ -397,12 +386,8 @@ /** * batadv_dat_entry_add() - add a new dat entry or update it if already exists -<<<<<<< * @bat_priv: the bat priv with all the mesh interface information -======= - * @bat_priv: the bat priv with all the soft interface information * @hash: the hash table to add to ->>>>>>> * @ip: ipv4 to add/edit * @mac_addr: mac address to assign to the given ipv4 * @vid: VLAN identifier @@ -865,13 +850,8 @@ } /** -<<<<<<< * batadv_dat_hash_free() - free a DAT hash table - * @bat_priv: the bat priv with all the soft interface information -======= - * batadv_dat_hash_free() - free the local DAT hash table * @bat_priv: the bat priv with all the mesh interface information ->>>>>>> */ static void batadv_dat_hash_free(struct batadv_hashtable **hash) { @@ -1068,27 +1048,11 @@ u8 cmd) { int portid = NETLINK_CB(cb->skb).portid; -<<<<<<< struct batadv_hard_iface *primary_if; -======= - struct net_device *mesh_iface; - struct batadv_hashtable *hash; - struct batadv_priv *bat_priv; ->>>>>>> int bucket = cb->args[0]; int idx = cb->args[1]; int ret = 0; -<<<<<<< -======= - mesh_iface = batadv_netlink_get_meshif(cb); - if (IS_ERR(mesh_iface)) - return PTR_ERR(mesh_iface); - - bat_priv = netdev_priv(mesh_iface); - hash = bat_priv->dat.hash; - ->>>>>>> primary_if = batadv_primary_if_get_selected(bat_priv); if (!primary_if || primary_if->if_status != BATADV_IF_ACTIVE) { ret = -ENOENT; @@ -1112,12 +1076,8 @@ out: batadv_hardif_put(primary_if); -<<<<<<< - dev_put(mesh_iface); -======= return ret; } ->>>>>>> /** * batadv_dat_cache_dump() - dump the DAT cache table to a netlink socket @@ -1128,20 +1088,20 @@ */ int batadv_dat_cache_dump(struct sk_buff *msg, struct netlink_callback *cb) { - struct net_device *soft_iface; + struct net_device *mesh_iface; struct batadv_priv *bat_priv; int ret; - soft_iface = batadv_netlink_get_softif(cb); - if (IS_ERR(soft_iface)) - return PTR_ERR(soft_iface); + mesh_iface = batadv_netlink_get_meshif(cb); + if (IS_ERR(mesh_iface)) + return PTR_ERR(mesh_iface); - bat_priv = netdev_priv(soft_iface); + bat_priv = netdev_priv(mesh_iface); ret = batadv_dat_dump(bat_priv, msg, cb, bat_priv->dat.cache_hash, BATADV_CMD_GET_DAT_CACHE); - dev_put(soft_iface); + dev_put(mesh_iface); return ret; } @@ -1154,20 +1114,20 @@ */ int batadv_dat_dht_dump(struct sk_buff *msg, struct netlink_callback *cb) { - struct net_device *soft_iface; + struct net_device *mesh_iface; struct batadv_priv *bat_priv; int ret; - soft_iface = batadv_netlink_get_softif(cb); - if (IS_ERR(soft_iface)) - return PTR_ERR(soft_iface); + mesh_iface = batadv_netlink_get_meshif(cb); + if (IS_ERR(mesh_iface)) + return PTR_ERR(mesh_iface); - bat_priv = netdev_priv(soft_iface); + bat_priv = netdev_priv(mesh_iface); ret = batadv_dat_dump(bat_priv, msg, cb, bat_priv->dat.dht_hash, BATADV_CMD_GET_DAT_DHT); - dev_put(soft_iface); + dev_put(mesh_iface); return ret; } > > > diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c > index e5a07152..8d6d5e33 100644 > --- a/net/batman-adv/distributed-arp-table.c > +++ b/net/batman-adv/distributed-arp-table.c > @@ -785,19 +851,57 @@ static void batadv_dat_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv, > } > > /** > - * batadv_dat_hash_free() - free the local DAT hash table > + * batadv_dat_hash_free() - free a DAT hash table > * @bat_priv: the bat priv with all the soft interface information > */ > -static void batadv_dat_hash_free(struct batadv_priv *bat_priv) > +static void batadv_dat_hash_free(struct batadv_hashtable **hash) function parameter 'hash' not described in 'batadv_dat_hash_free' > @@ -1332,7 +1486,8 @@ void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv, > * packet has to be delivered to the interface > */ > bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv, > - struct sk_buff *skb, int hdr_size) > + struct sk_buff *skb, int hdr_size, > + bool is_dht_put) function parameter 'is_dht_put' not described in 'batadv_dat_snoop_incoming_arp_reply' -- Sven Eckelmann <[email protected]>