Lines Matching refs:forw_packet
465 void batadv_forw_packet_free(struct batadv_forw_packet *forw_packet, in batadv_forw_packet_free() argument
469 kfree_skb(forw_packet->skb); in batadv_forw_packet_free()
471 consume_skb(forw_packet->skb); in batadv_forw_packet_free()
473 batadv_hardif_put(forw_packet->if_incoming); in batadv_forw_packet_free()
474 batadv_hardif_put(forw_packet->if_outgoing); in batadv_forw_packet_free()
475 if (forw_packet->queue_left) in batadv_forw_packet_free()
476 atomic_inc(forw_packet->queue_left); in batadv_forw_packet_free()
477 kfree(forw_packet); in batadv_forw_packet_free()
501 struct batadv_forw_packet *forw_packet; in batadv_forw_packet_alloc() local
519 forw_packet = kmalloc(sizeof(*forw_packet), GFP_ATOMIC); in batadv_forw_packet_alloc()
520 if (!forw_packet) in batadv_forw_packet_alloc()
529 INIT_HLIST_NODE(&forw_packet->list); in batadv_forw_packet_alloc()
530 INIT_HLIST_NODE(&forw_packet->cleanup_list); in batadv_forw_packet_alloc()
531 forw_packet->skb = skb; in batadv_forw_packet_alloc()
532 forw_packet->queue_left = queue_left; in batadv_forw_packet_alloc()
533 forw_packet->if_incoming = if_incoming; in batadv_forw_packet_alloc()
534 forw_packet->if_outgoing = if_outgoing; in batadv_forw_packet_alloc()
535 forw_packet->num_packets = 0; in batadv_forw_packet_alloc()
537 return forw_packet; in batadv_forw_packet_alloc()
556 batadv_forw_packet_was_stolen(struct batadv_forw_packet *forw_packet) in batadv_forw_packet_was_stolen() argument
558 return !hlist_unhashed(&forw_packet->cleanup_list); in batadv_forw_packet_was_stolen()
573 bool batadv_forw_packet_steal(struct batadv_forw_packet *forw_packet, in batadv_forw_packet_steal() argument
578 if (batadv_forw_packet_was_stolen(forw_packet)) { in batadv_forw_packet_steal()
583 hlist_del_init(&forw_packet->list); in batadv_forw_packet_steal()
586 hlist_add_fake(&forw_packet->cleanup_list); in batadv_forw_packet_steal()
610 struct batadv_forw_packet *forw_packet; in batadv_forw_packet_list_steal() local
613 hlist_for_each_entry_safe(forw_packet, safe_tmp_node, in batadv_forw_packet_list_steal()
619 forw_packet->if_incoming != hard_iface && in batadv_forw_packet_list_steal()
620 forw_packet->if_outgoing != hard_iface) in batadv_forw_packet_list_steal()
623 hlist_del(&forw_packet->list); in batadv_forw_packet_list_steal()
624 hlist_add_head(&forw_packet->cleanup_list, cleanup_list); in batadv_forw_packet_list_steal()
640 struct batadv_forw_packet *forw_packet; in batadv_forw_packet_list_free() local
643 hlist_for_each_entry_safe(forw_packet, safe_tmp_node, head, in batadv_forw_packet_list_free()
645 cancel_delayed_work_sync(&forw_packet->delayed_work); in batadv_forw_packet_list_free()
647 hlist_del(&forw_packet->cleanup_list); in batadv_forw_packet_list_free()
648 batadv_forw_packet_free(forw_packet, true); in batadv_forw_packet_list_free()
669 static void batadv_forw_packet_queue(struct batadv_forw_packet *forw_packet, in batadv_forw_packet_queue() argument
676 if (batadv_forw_packet_was_stolen(forw_packet)) { in batadv_forw_packet_queue()
680 WARN_ONCE(hlist_fake(&forw_packet->cleanup_list), in batadv_forw_packet_queue()
687 hlist_del_init(&forw_packet->list); in batadv_forw_packet_queue()
688 hlist_add_head(&forw_packet->list, head); in batadv_forw_packet_queue()
691 &forw_packet->delayed_work, in batadv_forw_packet_queue()
708 struct batadv_forw_packet *forw_packet, in batadv_forw_packet_bcast_queue() argument
711 batadv_forw_packet_queue(forw_packet, &bat_priv->forw_bcast_list_lock, in batadv_forw_packet_bcast_queue()
726 struct batadv_forw_packet *forw_packet, in batadv_forw_packet_ogmv1_queue() argument
729 batadv_forw_packet_queue(forw_packet, &bat_priv->forw_bat_list_lock, in batadv_forw_packet_ogmv1_queue()
758 struct batadv_forw_packet *forw_packet; in batadv_forw_bcast_packet_to_list() local
766 forw_packet = batadv_forw_packet_alloc(if_in, if_out, in batadv_forw_bcast_packet_to_list()
769 if (!forw_packet) in batadv_forw_bcast_packet_to_list()
772 forw_packet->own = own_packet; in batadv_forw_bcast_packet_to_list()
774 INIT_DELAYED_WORK(&forw_packet->delayed_work, in batadv_forw_bcast_packet_to_list()
779 batadv_forw_packet_bcast_queue(bat_priv, forw_packet, send_time); in batadv_forw_bcast_packet_to_list()
1016 batadv_forw_packet_bcasts_left(struct batadv_forw_packet *forw_packet) in batadv_forw_packet_bcasts_left() argument
1018 return BATADV_SKB_CB(forw_packet->skb)->num_bcasts; in batadv_forw_packet_bcasts_left()
1027 batadv_forw_packet_bcasts_dec(struct batadv_forw_packet *forw_packet) in batadv_forw_packet_bcasts_dec() argument
1029 BATADV_SKB_CB(forw_packet->skb)->num_bcasts--; in batadv_forw_packet_bcasts_dec()
1038 bool batadv_forw_packet_is_rebroadcast(struct batadv_forw_packet *forw_packet) in batadv_forw_packet_is_rebroadcast() argument
1040 unsigned char num_bcasts = BATADV_SKB_CB(forw_packet->skb)->num_bcasts; in batadv_forw_packet_is_rebroadcast()
1042 return num_bcasts != forw_packet->if_outgoing->num_bcasts; in batadv_forw_packet_is_rebroadcast()
1054 struct batadv_forw_packet *forw_packet; in batadv_send_outstanding_bcast_packet() local
1061 forw_packet = container_of(delayed_work, struct batadv_forw_packet, in batadv_send_outstanding_bcast_packet()
1063 bat_priv = netdev_priv(forw_packet->if_incoming->soft_iface); in batadv_send_outstanding_bcast_packet()
1070 if (batadv_dat_drop_broadcast_packet(bat_priv, forw_packet)) { in batadv_send_outstanding_bcast_packet()
1076 skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC); in batadv_send_outstanding_bcast_packet()
1080 batadv_send_broadcast_skb(skb1, forw_packet->if_outgoing); in batadv_send_outstanding_bcast_packet()
1081 batadv_forw_packet_bcasts_dec(forw_packet); in batadv_send_outstanding_bcast_packet()
1083 if (batadv_forw_packet_bcasts_left(forw_packet)) { in batadv_send_outstanding_bcast_packet()
1084 batadv_forw_packet_bcast_queue(bat_priv, forw_packet, in batadv_send_outstanding_bcast_packet()
1091 if (batadv_forw_packet_steal(forw_packet, in batadv_send_outstanding_bcast_packet()
1093 batadv_forw_packet_free(forw_packet, dropped); in batadv_send_outstanding_bcast_packet()