• Home
  • Raw
  • Download

Lines Matching refs:forw_packet

469 void batadv_forw_packet_free(struct batadv_forw_packet *forw_packet,  in batadv_forw_packet_free()  argument
473 kfree_skb(forw_packet->skb); in batadv_forw_packet_free()
475 consume_skb(forw_packet->skb); in batadv_forw_packet_free()
477 if (forw_packet->if_incoming) in batadv_forw_packet_free()
478 batadv_hardif_put(forw_packet->if_incoming); in batadv_forw_packet_free()
479 if (forw_packet->if_outgoing) in batadv_forw_packet_free()
480 batadv_hardif_put(forw_packet->if_outgoing); in batadv_forw_packet_free()
481 if (forw_packet->queue_left) in batadv_forw_packet_free()
482 atomic_inc(forw_packet->queue_left); in batadv_forw_packet_free()
483 kfree(forw_packet); in batadv_forw_packet_free()
507 struct batadv_forw_packet *forw_packet; in batadv_forw_packet_alloc() local
525 forw_packet = kmalloc(sizeof(*forw_packet), GFP_ATOMIC); in batadv_forw_packet_alloc()
526 if (!forw_packet) in batadv_forw_packet_alloc()
535 INIT_HLIST_NODE(&forw_packet->list); in batadv_forw_packet_alloc()
536 INIT_HLIST_NODE(&forw_packet->cleanup_list); in batadv_forw_packet_alloc()
537 forw_packet->skb = skb; in batadv_forw_packet_alloc()
538 forw_packet->queue_left = queue_left; in batadv_forw_packet_alloc()
539 forw_packet->if_incoming = if_incoming; in batadv_forw_packet_alloc()
540 forw_packet->if_outgoing = if_outgoing; in batadv_forw_packet_alloc()
541 forw_packet->num_packets = 0; in batadv_forw_packet_alloc()
543 return forw_packet; in batadv_forw_packet_alloc()
562 batadv_forw_packet_was_stolen(struct batadv_forw_packet *forw_packet) in batadv_forw_packet_was_stolen() argument
564 return !hlist_unhashed(&forw_packet->cleanup_list); in batadv_forw_packet_was_stolen()
579 bool batadv_forw_packet_steal(struct batadv_forw_packet *forw_packet, in batadv_forw_packet_steal() argument
584 if (batadv_forw_packet_was_stolen(forw_packet)) { in batadv_forw_packet_steal()
589 hlist_del_init(&forw_packet->list); in batadv_forw_packet_steal()
592 hlist_add_fake(&forw_packet->cleanup_list); in batadv_forw_packet_steal()
616 struct batadv_forw_packet *forw_packet; in batadv_forw_packet_list_steal() local
619 hlist_for_each_entry_safe(forw_packet, safe_tmp_node, in batadv_forw_packet_list_steal()
625 forw_packet->if_incoming != hard_iface && in batadv_forw_packet_list_steal()
626 forw_packet->if_outgoing != hard_iface) in batadv_forw_packet_list_steal()
629 hlist_del(&forw_packet->list); in batadv_forw_packet_list_steal()
630 hlist_add_head(&forw_packet->cleanup_list, cleanup_list); in batadv_forw_packet_list_steal()
646 struct batadv_forw_packet *forw_packet; in batadv_forw_packet_list_free() local
649 hlist_for_each_entry_safe(forw_packet, safe_tmp_node, head, in batadv_forw_packet_list_free()
651 cancel_delayed_work_sync(&forw_packet->delayed_work); in batadv_forw_packet_list_free()
653 hlist_del(&forw_packet->cleanup_list); in batadv_forw_packet_list_free()
654 batadv_forw_packet_free(forw_packet, true); in batadv_forw_packet_list_free()
675 static void batadv_forw_packet_queue(struct batadv_forw_packet *forw_packet, in batadv_forw_packet_queue() argument
682 if (batadv_forw_packet_was_stolen(forw_packet)) { in batadv_forw_packet_queue()
686 WARN_ONCE(hlist_fake(&forw_packet->cleanup_list), in batadv_forw_packet_queue()
693 hlist_del_init(&forw_packet->list); in batadv_forw_packet_queue()
694 hlist_add_head(&forw_packet->list, head); in batadv_forw_packet_queue()
697 &forw_packet->delayed_work, in batadv_forw_packet_queue()
714 struct batadv_forw_packet *forw_packet, in batadv_forw_packet_bcast_queue() argument
717 batadv_forw_packet_queue(forw_packet, &bat_priv->forw_bcast_list_lock, in batadv_forw_packet_bcast_queue()
732 struct batadv_forw_packet *forw_packet, in batadv_forw_packet_ogmv1_queue() argument
735 batadv_forw_packet_queue(forw_packet, &bat_priv->forw_bat_list_lock, in batadv_forw_packet_ogmv1_queue()
760 struct batadv_forw_packet *forw_packet; in batadv_add_bcast_packet_to_list() local
774 forw_packet = batadv_forw_packet_alloc(primary_if, NULL, in batadv_add_bcast_packet_to_list()
778 if (!forw_packet) in batadv_add_bcast_packet_to_list()
785 forw_packet->own = own_packet; in batadv_add_bcast_packet_to_list()
787 INIT_DELAYED_WORK(&forw_packet->delayed_work, in batadv_add_bcast_packet_to_list()
790 batadv_forw_packet_bcast_queue(bat_priv, forw_packet, jiffies + delay); in batadv_add_bcast_packet_to_list()
814 batadv_forw_packet_bcasts_left(struct batadv_forw_packet *forw_packet, in batadv_forw_packet_bcasts_left() argument
824 return BATADV_SKB_CB(forw_packet->skb)->num_bcasts < max; in batadv_forw_packet_bcasts_left()
833 batadv_forw_packet_bcasts_inc(struct batadv_forw_packet *forw_packet) in batadv_forw_packet_bcasts_inc() argument
835 BATADV_SKB_CB(forw_packet->skb)->num_bcasts++; in batadv_forw_packet_bcasts_inc()
844 bool batadv_forw_packet_is_rebroadcast(struct batadv_forw_packet *forw_packet) in batadv_forw_packet_is_rebroadcast() argument
846 return BATADV_SKB_CB(forw_packet->skb)->num_bcasts > 0; in batadv_forw_packet_is_rebroadcast()
854 struct batadv_forw_packet *forw_packet; in batadv_send_outstanding_bcast_packet() local
866 forw_packet = container_of(delayed_work, struct batadv_forw_packet, in batadv_send_outstanding_bcast_packet()
868 soft_iface = forw_packet->if_incoming->soft_iface; in batadv_send_outstanding_bcast_packet()
876 if (batadv_dat_drop_broadcast_packet(bat_priv, forw_packet)) { in batadv_send_outstanding_bcast_packet()
881 bcast_packet = (struct batadv_bcast_packet *)forw_packet->skb->data; in batadv_send_outstanding_bcast_packet()
889 if (!batadv_forw_packet_bcasts_left(forw_packet, hard_iface)) in batadv_send_outstanding_bcast_packet()
892 if (forw_packet->own) { in batadv_send_outstanding_bcast_packet()
895 neigh_addr = eth_hdr(forw_packet->skb)->h_source; in batadv_send_outstanding_bcast_packet()
939 skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC); in batadv_send_outstanding_bcast_packet()
947 batadv_forw_packet_bcasts_inc(forw_packet); in batadv_send_outstanding_bcast_packet()
950 if (batadv_forw_packet_bcasts_left(forw_packet, NULL)) { in batadv_send_outstanding_bcast_packet()
951 batadv_forw_packet_bcast_queue(bat_priv, forw_packet, in batadv_send_outstanding_bcast_packet()
958 if (batadv_forw_packet_steal(forw_packet, in batadv_send_outstanding_bcast_packet()
960 batadv_forw_packet_free(forw_packet, dropped); in batadv_send_outstanding_bcast_packet()