mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 04:37:32 -04:00
Merge tag 'batadv-next-pullrequest-20260605' of https://git.open-mesh.org/batadv
Simon Wunderlich says: ==================== This cleanup patchset includes the following patches, all by Sven Eckelmann: - tp_meter: initialize last_recv_time during init - convert cancellation of work items to disable helper - clean up wifi detection cache (3 patches) - clean up kernel-doc: corrections, reword, typos (6 patches) * tag 'batadv-next-pullrequest-20260605' of https://git.open-mesh.org/batadv: batman-adv: fix kernel-doc typos and grammar errors batman-adv: fix batadv_v_ogm_packet_recv error handling kernel-doc batman-adv: uapi: keep kernel-doc in struct member order batman-adv: bla: update stale kernel-doc batman-adv: tp_meter: update stale kernel-doc after refactoring batman-adv: correct batadv_wifi_* kernel-doc batman-adv: document cleanup of batadv_wifi_net_devices entries batman-adv: use GFP_KERNEL allocations for the wifi detection cache batman-adv: drop duplicated wifi_flags assignments batman-adv: convert cancellation of work items to disable helper batman-adv: tp_meter: initialize last_recv_time during init ==================== Link: https://patch.msgid.link/20260605072005.490368-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -518,16 +518,16 @@ struct batadv_mcast_packet {
|
||||
* @packet_type: batman-adv packet type, part of the general header
|
||||
* @version: batman-adv protocol version, part of the general header
|
||||
* @ttl: time to live for this packet, part of the general header
|
||||
* @first_ttvn: tt-version number of first included packet
|
||||
* @first_source: original source of first included packet
|
||||
* @first_orig_dest: original destination of first included packet
|
||||
* @first_crc: checksum of first included packet
|
||||
* @first_ttvn: tt-version number of first included packet
|
||||
* @second_ttl: ttl of second packet
|
||||
* @second_ttvn: tt version number of second included packet
|
||||
* @second_dest: second receiver of this coded packet
|
||||
* @second_source: original source of second included packet
|
||||
* @second_orig_dest: original destination of second included packet
|
||||
* @second_crc: checksum of second included packet
|
||||
* @second_ttvn: tt version number of second included packet
|
||||
* @coded_len: length of network coded part of the payload
|
||||
*/
|
||||
struct batadv_coded_packet {
|
||||
@@ -554,8 +554,8 @@ struct batadv_coded_packet {
|
||||
* @version: batman-adv protocol version, part of the general header
|
||||
* @ttl: time to live for this packet, part of the general header
|
||||
* @reserved: reserved field (for packet alignment)
|
||||
* @src: address of the source
|
||||
* @dst: address of the destination
|
||||
* @src: address of the source
|
||||
* @tvlv_len: length of tvlv data following the unicast tvlv header
|
||||
* @align: 2 bytes to align the header to a 4 byte boundary
|
||||
*/
|
||||
|
||||
@@ -230,7 +230,7 @@ static void batadv_iv_ogm_iface_disable(struct batadv_hard_iface *hard_iface)
|
||||
|
||||
mutex_unlock(&hard_iface->bat_iv.ogm_buff_mutex);
|
||||
|
||||
cancel_delayed_work_sync(&hard_iface->bat_iv.reschedule_work);
|
||||
disable_delayed_work_sync(&hard_iface->bat_iv.reschedule_work);
|
||||
}
|
||||
|
||||
static void batadv_iv_ogm_iface_update_mac(struct batadv_hard_iface *hard_iface)
|
||||
|
||||
@@ -587,7 +587,7 @@ batadv_v_gw_get_best_gw_node(struct batadv_priv *bat_priv)
|
||||
}
|
||||
|
||||
/**
|
||||
* batadv_v_gw_is_eligible() - check if a originator would be selected as GW
|
||||
* batadv_v_gw_is_eligible() - check if an originator would be selected as GW
|
||||
* @bat_priv: the bat priv with all the mesh interface information
|
||||
* @curr_gw_orig: originator representing the currently selected GW
|
||||
* @orig_node: the originator representing the new candidate
|
||||
@@ -819,6 +819,8 @@ void batadv_v_hardif_init(struct batadv_hard_iface *hard_iface)
|
||||
skb_queue_head_init(&hard_iface->bat_v.aggr_list);
|
||||
INIT_DELAYED_WORK(&hard_iface->bat_v.aggr_wq,
|
||||
batadv_v_ogm_aggr_work);
|
||||
/* make sure it doesn't run until interface gets enabled */
|
||||
disable_delayed_work(&hard_iface->bat_v.aggr_wq);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -115,7 +115,7 @@ static bool batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh,
|
||||
goto default_throughput;
|
||||
|
||||
/* only use rtnl_trylock because the elp worker will be cancelled while
|
||||
* the rntl_lock is held. the cancel_delayed_work_sync() would otherwise
|
||||
* the rntl_lock is held. the disable_delayed_work_sync() would otherwise
|
||||
* wait forever when the elp work_item was started and it is then also
|
||||
* trying to rtnl_lock
|
||||
*/
|
||||
@@ -162,7 +162,7 @@ static bool batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh,
|
||||
}
|
||||
|
||||
/* only use rtnl_trylock because the elp worker will be cancelled while
|
||||
* the rntl_lock is held. the cancel_delayed_work_sync() would otherwise
|
||||
* the rntl_lock is held. the disable_delayed_work_sync() would otherwise
|
||||
* wait forever when the elp work_item was started and it is then also
|
||||
* trying to rtnl_lock
|
||||
*/
|
||||
@@ -447,7 +447,7 @@ int batadv_v_elp_iface_enable(struct batadv_hard_iface *hard_iface)
|
||||
*/
|
||||
void batadv_v_elp_iface_disable(struct batadv_hard_iface *hard_iface)
|
||||
{
|
||||
cancel_delayed_work_sync(&hard_iface->bat_v.elp_wq);
|
||||
disable_delayed_work_sync(&hard_iface->bat_v.elp_wq);
|
||||
|
||||
dev_kfree_skb(hard_iface->bat_v.elp_skb);
|
||||
hard_iface->bat_v.elp_skb = NULL;
|
||||
|
||||
@@ -415,6 +415,8 @@ int batadv_v_ogm_iface_enable(struct batadv_hard_iface *hard_iface)
|
||||
{
|
||||
struct batadv_priv *bat_priv = netdev_priv(hard_iface->mesh_iface);
|
||||
|
||||
enable_delayed_work(&hard_iface->bat_v.aggr_wq);
|
||||
|
||||
batadv_v_ogm_start_queue_timer(hard_iface);
|
||||
batadv_v_ogm_start_timer(bat_priv);
|
||||
|
||||
@@ -427,7 +429,7 @@ int batadv_v_ogm_iface_enable(struct batadv_hard_iface *hard_iface)
|
||||
*/
|
||||
void batadv_v_ogm_iface_disable(struct batadv_hard_iface *hard_iface)
|
||||
{
|
||||
cancel_delayed_work_sync(&hard_iface->bat_v.aggr_wq);
|
||||
disable_delayed_work_sync(&hard_iface->bat_v.aggr_wq);
|
||||
|
||||
spin_lock_bh(&hard_iface->bat_v.aggr_list.lock);
|
||||
batadv_v_ogm_aggr_list_free(hard_iface);
|
||||
@@ -513,7 +515,7 @@ static u32 batadv_v_forward_penalty(struct batadv_priv *bat_priv,
|
||||
* @bat_priv: the bat priv with all the mesh interface information
|
||||
* @ogm_received: previously received OGM to be forwarded
|
||||
* @orig_node: the originator which has been updated
|
||||
* @neigh_node: the neigh_node through with the OGM has been received
|
||||
* @neigh_node: the neigh_node through which the OGM has been received
|
||||
* @if_incoming: the interface on which this OGM was received on
|
||||
* @if_outgoing: the interface to which the OGM has to be forwarded to
|
||||
*
|
||||
@@ -600,7 +602,7 @@ static void batadv_v_ogm_forward(struct batadv_priv *bat_priv,
|
||||
* @bat_priv: the bat priv with all the mesh interface information
|
||||
* @ogm2: OGM2 structure
|
||||
* @orig_node: Originator structure for which the OGM has been received
|
||||
* @neigh_node: the neigh_node through with the OGM has been received
|
||||
* @neigh_node: the neigh_node through which the OGM has been received
|
||||
* @if_incoming: the interface where this packet was received
|
||||
* @if_outgoing: the interface for which the packet should be considered
|
||||
*
|
||||
@@ -684,7 +686,7 @@ static int batadv_v_ogm_metric_update(struct batadv_priv *bat_priv,
|
||||
* @ethhdr: the Ethernet header of the OGM2
|
||||
* @ogm2: OGM2 structure
|
||||
* @orig_node: Originator structure for which the OGM has been received
|
||||
* @neigh_node: the neigh_node through with the OGM has been received
|
||||
* @neigh_node: the neigh_node through which the OGM has been received
|
||||
* @if_incoming: the interface where this packet was received
|
||||
* @if_outgoing: the interface for which the packet should be considered
|
||||
*
|
||||
@@ -779,7 +781,7 @@ static bool batadv_v_ogm_route_update(struct batadv_priv *bat_priv,
|
||||
* @ethhdr: the Ethernet header of the OGM2
|
||||
* @ogm2: OGM2 structure
|
||||
* @orig_node: Originator structure for which the OGM has been received
|
||||
* @neigh_node: the neigh_node through with the OGM has been received
|
||||
* @neigh_node: the neigh_node through which the OGM has been received
|
||||
* @if_incoming: the interface where this packet was received
|
||||
* @if_outgoing: the interface for which the packet should be considered
|
||||
*/
|
||||
@@ -982,7 +984,7 @@ static void batadv_v_ogm_process(const struct sk_buff *skb, int ogm_offset,
|
||||
* @if_incoming: the interface where this OGM has been received
|
||||
*
|
||||
* Return: NET_RX_SUCCESS and consume the skb on success or returns NET_RX_DROP
|
||||
* (without freeing the skb) on failure
|
||||
* (freeing the skb) on failure
|
||||
*/
|
||||
int batadv_v_ogm_packet_recv(struct sk_buff *skb,
|
||||
struct batadv_hard_iface *if_incoming)
|
||||
@@ -1080,7 +1082,7 @@ int batadv_v_ogm_init(struct batadv_priv *bat_priv)
|
||||
*/
|
||||
void batadv_v_ogm_free(struct batadv_priv *bat_priv)
|
||||
{
|
||||
cancel_delayed_work_sync(&bat_priv->bat_v.ogm_wq);
|
||||
disable_delayed_work_sync(&bat_priv->bat_v.ogm_wq);
|
||||
|
||||
mutex_lock(&bat_priv->bat_v.ogm_buff_mutex);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ static void batadv_bitmap_shift_left(unsigned long *seq_bits, s32 n)
|
||||
* batadv_bit_get_packet() - receive and process one packet within the sequence
|
||||
* number window
|
||||
* @priv: the bat priv with all the mesh interface information
|
||||
* @seq_bits: pointer to the sequence number receive packet
|
||||
* @seq_bits: pointer to the sequence number bitmap of received packets
|
||||
* @seq_num_diff: difference between the current/received sequence number and
|
||||
* the last sequence number
|
||||
* @set_mark: whether this packet should be marked in seq_bits
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/**
|
||||
* batadv_test_bit() - check if bit is set in the current window
|
||||
*
|
||||
* @seq_bits: pointer to the sequence number receive packet
|
||||
* @seq_bits: pointer to the sequence number bitmap of received packets
|
||||
* @last_seqno: latest sequence number in seq_bits
|
||||
* @curr_seqno: sequence number to test for
|
||||
*
|
||||
|
||||
@@ -123,7 +123,7 @@ static bool batadv_compare_backbone_gw(const struct hlist_node *node,
|
||||
* @node: list node of the first entry to compare
|
||||
* @data2: pointer to the second claims
|
||||
*
|
||||
* Return: true if the claim have the same data, 0 otherwise
|
||||
* Return: true if the claims have the same data, false otherwise
|
||||
*/
|
||||
static bool batadv_compare_claim(const struct hlist_node *node,
|
||||
const void *data2)
|
||||
@@ -1282,7 +1282,7 @@ static void batadv_bla_purge_backbone_gw(struct batadv_priv *bat_priv, int now)
|
||||
|
||||
if (purged) {
|
||||
/* reference for pending report_work */
|
||||
if (cancel_work_sync(&backbone_gw->report_work))
|
||||
if (disable_work_sync(&backbone_gw->report_work))
|
||||
batadv_backbone_gw_put(backbone_gw);
|
||||
|
||||
/* reference for hash_entry */
|
||||
@@ -1850,7 +1850,7 @@ void batadv_bla_free(struct batadv_priv *bat_priv)
|
||||
{
|
||||
struct batadv_hard_iface *primary_if;
|
||||
|
||||
cancel_delayed_work_sync(&bat_priv->bla.work);
|
||||
disable_delayed_work_sync(&bat_priv->bla.work);
|
||||
primary_if = batadv_primary_if_get_selected(bat_priv);
|
||||
|
||||
if (bat_priv->bla.claim_hash) {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* detect frame sent by bridge loop avoidance
|
||||
* @mac: mac address to check
|
||||
*
|
||||
* Return: true if the it looks like a loop detect frame
|
||||
* Return: true if it looks like a loop detect frame
|
||||
* (mac starts with BA:BE), false otherwise
|
||||
*/
|
||||
static inline bool batadv_bla_is_loopdetect_mac(const uint8_t *mac)
|
||||
|
||||
@@ -838,7 +838,7 @@ void batadv_dat_free(struct batadv_priv *bat_priv)
|
||||
batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_DAT, 1);
|
||||
batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_DAT, 1);
|
||||
|
||||
cancel_delayed_work_sync(&bat_priv->dat.work);
|
||||
disable_delayed_work_sync(&bat_priv->dat.work);
|
||||
|
||||
batadv_dat_hash_free(bat_priv);
|
||||
}
|
||||
|
||||
@@ -309,7 +309,8 @@ batadv_frag_merge_packets(struct hlist_head *chain)
|
||||
* batadv_skb_is_frag() - check if newly merged skb contains unicast fragment
|
||||
* @skb: newly merged skb
|
||||
*
|
||||
* Return: if newly merged skb is of type BATADV_UNICAST_FRAG
|
||||
* Return: true if the newly merged skb is of type BATADV_UNICAST_FRAG, false
|
||||
* otherwise
|
||||
*/
|
||||
static bool batadv_skb_is_frag(struct sk_buff *skb)
|
||||
{
|
||||
|
||||
@@ -971,9 +971,9 @@ static int batadv_hard_if_event_meshif(unsigned long event,
|
||||
/**
|
||||
* batadv_wifi_net_device_insert() - save information about wifi net_device
|
||||
* @net_dev: net_device to add to batadv_wifi_net_devices
|
||||
* @wifi_flags: net_device which generated an event
|
||||
* @wifi_flags: extracted batadv_hard_iface_wifi_flags of a net_device
|
||||
*
|
||||
* Return: 0 on result, negative value on error
|
||||
* Return: 0 on success, negative value on error
|
||||
*/
|
||||
static int
|
||||
batadv_wifi_net_device_insert(struct net_device *net_dev, u32 wifi_flags)
|
||||
@@ -983,12 +983,11 @@ batadv_wifi_net_device_insert(struct net_device *net_dev, u32 wifi_flags)
|
||||
|
||||
ASSERT_RTNL();
|
||||
|
||||
device_state = kzalloc_obj(*device_state, GFP_ATOMIC);
|
||||
device_state = kzalloc_obj(*device_state, GFP_KERNEL);
|
||||
if (!device_state)
|
||||
return -ENOMEM;
|
||||
|
||||
device_state->wifi_flags = wifi_flags;
|
||||
netdev_hold(net_dev, &device_state->dev_tracker, GFP_ATOMIC);
|
||||
netdev_hold(net_dev, &device_state->dev_tracker, GFP_KERNEL);
|
||||
device_state->netdev = net_dev;
|
||||
WRITE_ONCE(device_state->wifi_flags, wifi_flags);
|
||||
|
||||
@@ -1007,7 +1006,7 @@ batadv_wifi_net_device_insert(struct net_device *net_dev, u32 wifi_flags)
|
||||
|
||||
/**
|
||||
* batadv_wifi_net_device_remove() - remove information about wifi net_device
|
||||
* @device_state: wifi net_device state to remove from batadv_wifi_net_device_state
|
||||
* @device_state: wifi net_device state to remove from batadv_wifi_net_devices
|
||||
*/
|
||||
static void
|
||||
batadv_wifi_net_device_remove(struct batadv_wifi_net_device_state *device_state)
|
||||
@@ -1186,5 +1185,9 @@ int __init batadv_wifi_net_devices_init(void)
|
||||
*/
|
||||
void batadv_wifi_net_devices_deinit(void)
|
||||
{
|
||||
/* just destroy table. entries should have been removed by
|
||||
* unregister_netdevice_notifier() and the corresponding
|
||||
* NETDEV_UNREGISTER events
|
||||
*/
|
||||
rhashtable_destroy(&batadv_wifi_net_devices);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ batadv_primary_if_get_selected(struct batadv_priv *bat_priv)
|
||||
/**
|
||||
* batadv_is_cfg80211() - check if the given hardif is a cfg80211
|
||||
* wifi interface
|
||||
* @wifi_flags: extracted batadv_hard_iface_wifi_flagss of an net_device
|
||||
* @wifi_flags: extracted batadv_hard_iface_wifi_flags of a net_device
|
||||
*
|
||||
* Return: true if the net device is a cfg80211 wireless device, false
|
||||
* otherwise.
|
||||
@@ -143,7 +143,7 @@ static inline bool batadv_is_cfg80211(u32 wifi_flags)
|
||||
|
||||
/**
|
||||
* batadv_is_wifi() - check if flags belong to wifi interface
|
||||
* @wifi_flags: extracted batadv_hard_iface_wifi_flagss of an net_device
|
||||
* @wifi_flags: extracted batadv_hard_iface_wifi_flags of a net_device
|
||||
*
|
||||
* Return: true if the net device is a 802.11 wireless device, false otherwise.
|
||||
*/
|
||||
|
||||
@@ -120,10 +120,10 @@ static inline int batadv_hash_add(struct batadv_hashtable *hash,
|
||||
* @choose: callback calculating the hash index
|
||||
* @data: data passed to the aforementioned callbacks as argument
|
||||
*
|
||||
* ata could be the structure you use with just the key filled, we just need
|
||||
* data could be the structure you use with just the key filled, we just need
|
||||
* the key for comparing.
|
||||
*
|
||||
* Return: returns pointer do data on success, so you can remove the used
|
||||
* Return: returns pointer to data on success, so you can remove the used
|
||||
* structure yourself, or NULL on error
|
||||
*/
|
||||
static inline void *batadv_hash_remove(struct batadv_hashtable *hash,
|
||||
|
||||
@@ -392,13 +392,13 @@ static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
|
||||
* @orig_node: originator from which the batman-adv packet was sent
|
||||
*
|
||||
* Sends an ethernet frame to the receive path of the local @mesh_iface.
|
||||
* skb->data has still point to the batman-adv header with the size @hdr_size.
|
||||
* skb->data must still point to the batman-adv header with the size @hdr_size.
|
||||
* The caller has to have parsed this header already and made sure that at least
|
||||
* @hdr_size bytes are still available for pull in @skb.
|
||||
*
|
||||
* The packet may still get dropped. This can happen when the encapsulated
|
||||
* ethernet frame is invalid or contains again an batman-adv packet. Also
|
||||
* unicast packets will be dropped directly when it was sent between two
|
||||
* ethernet frame is invalid or contains again a batman-adv packet. Also
|
||||
* unicast packets will be dropped directly when they were sent between two
|
||||
* isolated clients.
|
||||
*/
|
||||
void batadv_interface_rx(struct net_device *mesh_iface,
|
||||
|
||||
@@ -2161,7 +2161,7 @@ int batadv_mcast_flags_dump(struct sk_buff *msg, struct netlink_callback *cb)
|
||||
*/
|
||||
void batadv_mcast_free(struct batadv_priv *bat_priv)
|
||||
{
|
||||
cancel_delayed_work_sync(&bat_priv->mcast.work);
|
||||
disable_delayed_work_sync(&bat_priv->mcast.work);
|
||||
|
||||
batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_MCAST, 2);
|
||||
batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_MCAST_TRACKER, 1);
|
||||
|
||||
@@ -944,7 +944,7 @@ static int batadv_netlink_set_hardif(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
/**
|
||||
* batadv_netlink_dump_hardif() - Dump all hard interface into a messages
|
||||
* batadv_netlink_dump_hardif() - Dump all hard interfaces into a message
|
||||
* @msg: Netlink message to dump into
|
||||
* @cb: Parameters from query
|
||||
*
|
||||
@@ -1101,7 +1101,7 @@ static int batadv_netlink_get_vlan(struct sk_buff *skb, struct genl_info *info)
|
||||
}
|
||||
|
||||
/**
|
||||
* batadv_netlink_set_vlan() - Get vlan attributes
|
||||
* batadv_netlink_set_vlan() - Set vlan attributes
|
||||
* @skb: Netlink message with request data
|
||||
* @info: receiver information
|
||||
*
|
||||
|
||||
@@ -439,7 +439,7 @@ batadv_orig_ifinfo_new(struct batadv_orig_node *orig_node,
|
||||
}
|
||||
|
||||
/**
|
||||
* batadv_neigh_ifinfo_get() - find the ifinfo from an neigh_node
|
||||
* batadv_neigh_ifinfo_get() - find the ifinfo from a neigh_node
|
||||
* @neigh: the neigh node to be queried
|
||||
* @if_outgoing: the interface for which the ifinfo should be acquired
|
||||
*
|
||||
@@ -472,7 +472,7 @@ batadv_neigh_ifinfo_get(struct batadv_neigh_node *neigh,
|
||||
}
|
||||
|
||||
/**
|
||||
* batadv_neigh_ifinfo_new() - search and possibly create an neigh_ifinfo object
|
||||
* batadv_neigh_ifinfo_new() - search and possibly create a neigh_ifinfo object
|
||||
* @neigh: the neigh node to be queried
|
||||
* @if_outgoing: the interface for which the ifinfo should be acquired
|
||||
*
|
||||
@@ -908,7 +908,7 @@ void batadv_originator_free(struct batadv_priv *bat_priv)
|
||||
if (!hash)
|
||||
return;
|
||||
|
||||
cancel_delayed_work_sync(&bat_priv->orig_work);
|
||||
disable_delayed_work_sync(&bat_priv->orig_work);
|
||||
|
||||
bat_priv->orig_hash = NULL;
|
||||
|
||||
|
||||
@@ -629,7 +629,7 @@ static void batadv_forw_packet_list_free(struct hlist_head *head)
|
||||
|
||||
hlist_for_each_entry_safe(forw_packet, safe_tmp_node, head,
|
||||
cleanup_list) {
|
||||
cancel_delayed_work_sync(&forw_packet->delayed_work);
|
||||
disable_delayed_work_sync(&forw_packet->delayed_work);
|
||||
|
||||
hlist_del(&forw_packet->cleanup_list);
|
||||
batadv_forw_packet_free(forw_packet, true);
|
||||
|
||||
@@ -289,7 +289,7 @@ batadv_tp_list_find_sender(struct batadv_priv *bat_priv, const u8 *dst)
|
||||
* @bat_priv: the bat priv with all the mesh interface information
|
||||
* @dst: the other endpoint MAC address to look for
|
||||
*
|
||||
* Return: if matching session with @dst was found
|
||||
* Return: true if a matching session with @dst was found, false otherwise
|
||||
*/
|
||||
static bool batadv_tp_list_active(struct batadv_priv *bat_priv, const u8 *dst)
|
||||
__must_hold(&bat_priv->tp_list_lock)
|
||||
@@ -355,7 +355,7 @@ batadv_tp_list_find_sender_session(struct batadv_priv *bat_priv, const u8 *dst,
|
||||
/**
|
||||
* batadv_tp_vars_common_release() - release batadv_tp_vars_common from lists
|
||||
* and queue for free after rcu grace period
|
||||
* @ref: kref pointer of the batadv_tp_vars
|
||||
* @ref: kref pointer of the batadv_tp_vars_common
|
||||
*/
|
||||
static void batadv_tp_vars_common_release(struct kref *ref)
|
||||
{
|
||||
@@ -391,7 +391,7 @@ static void batadv_tp_sender_put(struct batadv_tp_sender *tp_vars)
|
||||
}
|
||||
|
||||
/**
|
||||
* batadv_tp_list_detach() - remove tp receiver session from mesh session list once
|
||||
* batadv_tp_list_detach() - remove tp session from mesh session list once
|
||||
* @tp_vars: the private data of the current TP meter session
|
||||
*
|
||||
* Return: whether tp_vars was detached from list and reference must be freed
|
||||
@@ -421,7 +421,7 @@ static bool batadv_tp_list_detach(struct batadv_tp_vars_common *tp_vars)
|
||||
*/
|
||||
static void batadv_tp_sender_cleanup(struct batadv_tp_sender *tp_vars)
|
||||
{
|
||||
cancel_delayed_work_sync(&tp_vars->finish_work);
|
||||
disable_delayed_work_sync(&tp_vars->finish_work);
|
||||
|
||||
if (batadv_tp_list_detach(&tp_vars->common))
|
||||
batadv_tp_sender_put(tp_vars);
|
||||
@@ -509,7 +509,7 @@ static void batadv_tp_sender_finish(struct work_struct *work)
|
||||
* batadv_tp_reset_sender_timer() - reschedule the sender timer
|
||||
* @tp_vars: the private TP meter data for this session
|
||||
*
|
||||
* Reschedule the timer using tp_vars->rto as delay
|
||||
* Reschedule the timer using tp_vars->cc.rto as delay
|
||||
*/
|
||||
static void batadv_tp_reset_sender_timer(struct batadv_tp_sender *tp_vars)
|
||||
{
|
||||
@@ -621,9 +621,9 @@ static void batadv_tp_fill_prerandom(struct batadv_tp_sender *tp_vars,
|
||||
*
|
||||
* Create and send a single TP Meter message.
|
||||
*
|
||||
* Return: 0 on success, BATADV_TP_REASON_DST_UNREACHABLE if the destination is
|
||||
* not reachable, BATADV_TP_REASON_MEMORY_ERROR if the packet couldn't be
|
||||
* allocated
|
||||
* Return: 0 on success, BATADV_TP_REASON_MEMORY_ERROR if the packet couldn't
|
||||
* be allocated, BATADV_TP_REASON_CANT_SEND if the packet could not be
|
||||
* transmitted
|
||||
*/
|
||||
static int batadv_tp_send_msg(struct batadv_tp_sender *tp_vars, const u8 *src,
|
||||
struct batadv_orig_node *orig_node,
|
||||
@@ -913,7 +913,7 @@ static int batadv_tp_wait_available(struct batadv_tp_sender *tp_vars, size_t ple
|
||||
* batadv_tp_send() - main sending thread of a tp meter session
|
||||
* @arg: address of the related tp_vars
|
||||
*
|
||||
* Return: nothing, this function never returns
|
||||
* Return: 0
|
||||
*/
|
||||
static int batadv_tp_send(void *arg)
|
||||
{
|
||||
@@ -1511,8 +1511,10 @@ batadv_tp_init_recv(struct batadv_priv *bat_priv,
|
||||
|
||||
tp_vars = batadv_tp_list_find_receiver_session(bat_priv, icmp->orig,
|
||||
icmp->session);
|
||||
if (tp_vars)
|
||||
if (tp_vars) {
|
||||
tp_vars->last_recv_time = jiffies;
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
if (!atomic_add_unless(&bat_priv->tp_num, 1, BATADV_TP_MAX_NUM)) {
|
||||
batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
|
||||
@@ -1539,6 +1541,8 @@ batadv_tp_init_recv(struct batadv_priv *bat_priv,
|
||||
kref_get(&tp_vars->common.refcount);
|
||||
timer_setup(&tp_vars->common.timer, batadv_tp_receiver_shutdown, 0);
|
||||
|
||||
tp_vars->last_recv_time = jiffies;
|
||||
|
||||
kref_get(&tp_vars->common.refcount);
|
||||
hlist_add_head_rcu(&tp_vars->common.list, &bat_priv->tp_receiver_list);
|
||||
|
||||
@@ -1587,9 +1591,9 @@ static void batadv_tp_recv_msg(struct batadv_priv *bat_priv,
|
||||
icmp->orig);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
tp_vars->last_recv_time = jiffies;
|
||||
tp_vars->last_recv_time = jiffies;
|
||||
}
|
||||
|
||||
/* if the packet is a duplicate, it may be the case that an ACK has been
|
||||
* lost. Resend the ACK
|
||||
|
||||
@@ -3574,7 +3574,7 @@ void batadv_tt_free(struct batadv_priv *bat_priv)
|
||||
batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_TT, 1);
|
||||
batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_TT, 1);
|
||||
|
||||
cancel_delayed_work_sync(&bat_priv->tt.work);
|
||||
disable_delayed_work_sync(&bat_priv->tt.work);
|
||||
|
||||
batadv_tt_local_table_free(bat_priv);
|
||||
batadv_tt_global_table_free(bat_priv);
|
||||
|
||||
@@ -48,7 +48,7 @@ static void batadv_tvlv_handler_release(struct kref *ref)
|
||||
}
|
||||
|
||||
/**
|
||||
* batadv_tvlv_handler_put() - decrement the tvlv container refcounter and
|
||||
* batadv_tvlv_handler_put() - decrement the tvlv handler refcounter and
|
||||
* possibly release it
|
||||
* @tvlv_handler: the tvlv handler to free
|
||||
*/
|
||||
@@ -272,7 +272,7 @@ void batadv_tvlv_container_register(struct batadv_priv *bat_priv,
|
||||
* @additional_packet_len: requested additional packet size on top of minimum
|
||||
* size
|
||||
*
|
||||
* Return: true of the packet buffer could be changed to the requested size,
|
||||
* Return: true if the packet buffer could be changed to the requested size,
|
||||
* false otherwise.
|
||||
*/
|
||||
static bool batadv_tvlv_realloc_packet_buff(struct batadv_ogm_buf *ogm_buff,
|
||||
|
||||
@@ -1331,7 +1331,7 @@ struct batadv_tp_unacked {
|
||||
/** @len: length of the packet */
|
||||
u16 len;
|
||||
|
||||
/** @list: list node for &batadv_tp_vars.unacked_list */
|
||||
/** @list: list node for &batadv_tp_vars_common.unacked_list */
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
@@ -1367,7 +1367,9 @@ struct batadv_tp_vars_common {
|
||||
struct rcu_head rcu;
|
||||
};
|
||||
|
||||
/** struct batadv_tp_sender_cc - congestion control variables */
|
||||
/**
|
||||
* struct batadv_tp_sender_cc - congestion control variables
|
||||
*/
|
||||
struct batadv_tp_sender_cc {
|
||||
/** @fast_recovery: true if in Fast Recovery mode */
|
||||
bool fast_recovery:1;
|
||||
@@ -1410,7 +1412,7 @@ struct batadv_tp_sender_cc {
|
||||
* struct batadv_tp_sender - sender tp meter private variables per session
|
||||
*/
|
||||
struct batadv_tp_sender {
|
||||
/** @common: common batadv_tp_vars (best be first member) */
|
||||
/** @common: common batadv_tp_vars_common (must be first member) */
|
||||
struct batadv_tp_vars_common common;
|
||||
|
||||
/** @start_time: start time in jiffies */
|
||||
@@ -1437,7 +1439,7 @@ struct batadv_tp_sender {
|
||||
/** @cc: congestion control variables */
|
||||
struct batadv_tp_sender_cc cc;
|
||||
|
||||
/** @cc_lock: lock do protect @cc */
|
||||
/** @cc_lock: lock to protect @cc */
|
||||
spinlock_t cc_lock;
|
||||
|
||||
/** @tot_sent: amount of data sent/ACKed so far */
|
||||
@@ -1460,7 +1462,7 @@ struct batadv_tp_sender {
|
||||
* struct batadv_tp_receiver - receiver tp meter private variables per session
|
||||
*/
|
||||
struct batadv_tp_receiver {
|
||||
/** @common: common batadv_tp_vars (best be first member) */
|
||||
/** @common: common batadv_tp_vars_common (must be first member) */
|
||||
struct batadv_tp_vars_common common;
|
||||
|
||||
/** @receiving: receiving binary semaphore: 1 if receiving, 0 is not */
|
||||
@@ -1662,7 +1664,7 @@ struct batadv_priv {
|
||||
/** @forw_bcast_list_lock: lock protecting forw_bcast_list */
|
||||
spinlock_t forw_bcast_list_lock;
|
||||
|
||||
/** @tp_list_lock: spinlock protecting @tp_list */
|
||||
/** @tp_list_lock: spinlock protecting @tp_sender_list + @tp_receiver_list */
|
||||
spinlock_t tp_list_lock;
|
||||
|
||||
/** @tp_num: number of currently active tp sessions */
|
||||
@@ -1721,22 +1723,26 @@ struct batadv_priv {
|
||||
|
||||
#ifdef CONFIG_BATMAN_ADV_BLA
|
||||
|
||||
/**
|
||||
* enum batadv_bla_backbone_gw_state - state of a bridge loop avoidance
|
||||
* backbone gateway
|
||||
*/
|
||||
enum batadv_bla_backbone_gw_state {
|
||||
/**
|
||||
* @BATADV_BLA_BACKBONE_GW_STOPPED: backbone gw is being removed
|
||||
* and it must not longer work on requests
|
||||
* and it must no longer work on requests
|
||||
*/
|
||||
BATADV_BLA_BACKBONE_GW_STOPPED,
|
||||
|
||||
/**
|
||||
* @BATADV_BLA_BACKBONE_GW_UNSYNCED: backbone was detected out
|
||||
* of sync and a request was send. No traffic is forwarded until the
|
||||
* of sync and a request was sent. No traffic is forwarded until the
|
||||
* situation is resolved
|
||||
*/
|
||||
BATADV_BLA_BACKBONE_GW_UNSYNCED,
|
||||
|
||||
/**
|
||||
* @BATADV_BLA_BACKBONE_GW_SYNCED: backbone is consider to be in
|
||||
* @BATADV_BLA_BACKBONE_GW_SYNCED: backbone is considered to be in
|
||||
* sync. traffic can be forwarded
|
||||
*/
|
||||
BATADV_BLA_BACKBONE_GW_SYNCED,
|
||||
|
||||
Reference in New Issue
Block a user