batman-adv: remove network coding support

The Network Coding feature, introduced in 2013, is based on the master
thesis "Inter-Flow Network Coding for Wireless Mesh Networks". It relies on
the assumption that neighboring mesh nodes can reliably overhear each
other's transmissions in promiscuous mode, allowing packets to be combined
to reduce forwarding overhead.

This assumption no longer holds for modern wireless mesh networks, which
are heterogeneous and make overhearing increasingly unreliable. Factors
such as multiple spatial streams, varying data rates, beamforming, and
OFDMA all prevent nodes from consistently overhearing each other. The current
implementation in batman-adv is not able to detect these conditions and would
require a more complex layer beyond its neighbor discovery process to do so.

In addition, the feature has been unmaintained for years and is discouraged
for use. None of the current maintainers have the required test
setup to verify its functionality, and known issues remain in its data
structures (reference counting, RCU usage, and cleanup handling). Its
continued presence also blocks necessary refactoring of the core originator
infrastructure.

Remove this obsolete and unmaintained feature.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Acked-by: Martin Hundebøll <martin@hundeboll.net>
Acked-by: Marek Lindner <marek.lindner@mailbox.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
This commit is contained in:
Sven Eckelmann 2025-08-28 17:33:48 +02:00 committed by Simon Wunderlich
parent e89888a1e7
commit 87b95082db
15 changed files with 4 additions and 2302 deletions

View File

@ -53,19 +53,6 @@ config BATMAN_ADV_DAT
mesh networks. If you think that your network does not need mesh networks. If you think that your network does not need
this option you can safely remove it and save some space. this option you can safely remove it and save some space.
config BATMAN_ADV_NC
bool "Network Coding"
depends on BATMAN_ADV
help
This option enables network coding, a mechanism that aims to
increase the overall network throughput by fusing multiple
packets in one transmission.
Note that interfaces controlled by batman-adv must be manually
configured to have promiscuous mode enabled in order to make
network coding work.
If you think that your network does not need this feature you
can safely disable it and save some space.
config BATMAN_ADV_MCAST config BATMAN_ADV_MCAST
bool "Multicast optimisation" bool "Multicast optimisation"
depends on BATMAN_ADV && INET && !(BRIDGE=m && BATMAN_ADV=y) depends on BATMAN_ADV && INET && !(BRIDGE=m && BATMAN_ADV=y)

View File

@ -23,7 +23,6 @@ batman-adv-y += mesh-interface.o
batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += multicast.o batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += multicast.o
batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += multicast_forw.o batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += multicast_forw.o
batman-adv-y += netlink.o batman-adv-y += netlink.o
batman-adv-$(CONFIG_BATMAN_ADV_NC) += network-coding.o
batman-adv-y += originator.o batman-adv-y += originator.o
batman-adv-y += routing.o batman-adv-y += routing.o
batman-adv-y += send.o batman-adv-y += send.o

View File

@ -52,7 +52,6 @@
#include "hash.h" #include "hash.h"
#include "log.h" #include "log.h"
#include "netlink.h" #include "netlink.h"
#include "network-coding.h"
#include "originator.h" #include "originator.h"
#include "routing.h" #include "routing.h"
#include "send.h" #include "send.h"
@ -1406,10 +1405,6 @@ batadv_iv_ogm_process_per_outif(const struct sk_buff *skb, int ogm_offset,
if (!orig_neigh_node) if (!orig_neigh_node)
goto out; goto out;
/* Update nc_nodes of the originator */
batadv_nc_update_nc_node(bat_priv, orig_node, orig_neigh_node,
ogm_packet, is_single_hop_neigh);
orig_neigh_router = batadv_orig_router_get(orig_neigh_node, orig_neigh_router = batadv_orig_router_get(orig_neigh_node,
if_outgoing); if_outgoing);

View File

@ -51,9 +51,6 @@ enum batadv_dbg_level {
/** @BATADV_DBG_DAT: ARP snooping and DAT related messages */ /** @BATADV_DBG_DAT: ARP snooping and DAT related messages */
BATADV_DBG_DAT = BIT(4), BATADV_DBG_DAT = BIT(4),
/** @BATADV_DBG_NC: network coding related messages */
BATADV_DBG_NC = BIT(5),
/** @BATADV_DBG_MCAST: multicast related messages */ /** @BATADV_DBG_MCAST: multicast related messages */
BATADV_DBG_MCAST = BIT(6), BATADV_DBG_MCAST = BIT(6),

View File

@ -53,7 +53,6 @@
#include "mesh-interface.h" #include "mesh-interface.h"
#include "multicast.h" #include "multicast.h"
#include "netlink.h" #include "netlink.h"
#include "network-coding.h"
#include "originator.h" #include "originator.h"
#include "routing.h" #include "routing.h"
#include "send.h" #include "send.h"
@ -103,7 +102,6 @@ static int __init batadv_init(void)
batadv_v_init(); batadv_v_init();
batadv_iv_init(); batadv_iv_init();
batadv_nc_init();
batadv_tp_meter_init(); batadv_tp_meter_init();
batadv_event_workqueue = create_singlethread_workqueue("bat_events"); batadv_event_workqueue = create_singlethread_workqueue("bat_events");
@ -218,12 +216,6 @@ int batadv_mesh_init(struct net_device *mesh_iface)
goto err_dat; goto err_dat;
} }
ret = batadv_nc_mesh_init(bat_priv);
if (ret < 0) {
atomic_set(&bat_priv->mesh_state, BATADV_MESH_DEACTIVATING);
goto err_nc;
}
batadv_gw_init(bat_priv); batadv_gw_init(bat_priv);
batadv_mcast_init(bat_priv); batadv_mcast_init(bat_priv);
@ -232,8 +224,6 @@ int batadv_mesh_init(struct net_device *mesh_iface)
return 0; return 0;
err_nc:
batadv_dat_free(bat_priv);
err_dat: err_dat:
batadv_bla_free(bat_priv); batadv_bla_free(bat_priv);
err_bla: err_bla:
@ -264,7 +254,6 @@ void batadv_mesh_free(struct net_device *mesh_iface)
batadv_gw_node_free(bat_priv); batadv_gw_node_free(bat_priv);
batadv_v_mesh_free(bat_priv); batadv_v_mesh_free(bat_priv);
batadv_nc_mesh_free(bat_priv);
batadv_dat_free(bat_priv); batadv_dat_free(bat_priv);
batadv_bla_free(bat_priv); batadv_bla_free(bat_priv);
@ -336,11 +325,6 @@ int batadv_max_header_len(void)
header_len = max_t(int, header_len, header_len = max_t(int, header_len,
sizeof(struct batadv_bcast_packet)); sizeof(struct batadv_bcast_packet));
#ifdef CONFIG_BATMAN_ADV_NC
header_len = max_t(int, header_len,
sizeof(struct batadv_coded_packet));
#endif
return header_len + ETH_HLEN; return header_len + ETH_HLEN;
} }

View File

@ -121,8 +121,6 @@
#define BATADV_RESET_PROTECTION_MS 30000 #define BATADV_RESET_PROTECTION_MS 30000
#define BATADV_EXPECTED_SEQNO_RANGE 65536 #define BATADV_EXPECTED_SEQNO_RANGE 65536
#define BATADV_NC_NODE_TIMEOUT 10000 /* Milliseconds */
/** /**
* BATADV_TP_MAX_NUM - maximum number of simultaneously active tp sessions * BATADV_TP_MAX_NUM - maximum number of simultaneously active tp sessions
*/ */

View File

@ -46,7 +46,6 @@
#include "gateway_client.h" #include "gateway_client.h"
#include "hard-interface.h" #include "hard-interface.h"
#include "multicast.h" #include "multicast.h"
#include "network-coding.h"
#include "send.h" #include "send.h"
#include "translation-table.h" #include "translation-table.h"
@ -802,8 +801,6 @@ static int batadv_meshif_init_late(struct net_device *dev)
bat_priv->primary_if = NULL; bat_priv->primary_if = NULL;
batadv_nc_init_bat_priv(bat_priv);
if (!bat_priv->algo_ops) { if (!bat_priv->algo_ops) {
ret = batadv_algo_select(bat_priv, batadv_routing_algo); ret = batadv_algo_select(bat_priv, batadv_routing_algo);
if (ret < 0) if (ret < 0)
@ -947,17 +944,6 @@ static const struct {
{ "dat_put_rx" }, { "dat_put_rx" },
{ "dat_cached_reply_tx" }, { "dat_cached_reply_tx" },
#endif #endif
#ifdef CONFIG_BATMAN_ADV_NC
{ "nc_code" },
{ "nc_code_bytes" },
{ "nc_recode" },
{ "nc_recode_bytes" },
{ "nc_buffer" },
{ "nc_decode" },
{ "nc_decode_bytes" },
{ "nc_decode_failed" },
{ "nc_sniffed" },
#endif
}; };
static void batadv_get_strings(struct net_device *dev, u32 stringset, u8 *data) static void batadv_get_strings(struct net_device *dev, u32 stringset, u8 *data)

View File

@ -44,7 +44,6 @@
#include "log.h" #include "log.h"
#include "mesh-interface.h" #include "mesh-interface.h"
#include "multicast.h" #include "multicast.h"
#include "network-coding.h"
#include "originator.h" #include "originator.h"
#include "tp_meter.h" #include "tp_meter.h"
#include "translation-table.h" #include "translation-table.h"
@ -144,7 +143,6 @@ static const struct nla_policy batadv_netlink_policy[NUM_BATADV_ATTR] = {
[BATADV_ATTR_LOG_LEVEL] = { .type = NLA_U32 }, [BATADV_ATTR_LOG_LEVEL] = { .type = NLA_U32 },
[BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED] = { .type = NLA_U8 }, [BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED] = { .type = NLA_U8 },
[BATADV_ATTR_MULTICAST_FANOUT] = { .type = NLA_U32 }, [BATADV_ATTR_MULTICAST_FANOUT] = { .type = NLA_U32 },
[BATADV_ATTR_NETWORK_CODING_ENABLED] = { .type = NLA_U8 },
[BATADV_ATTR_ORIG_INTERVAL] = { .type = NLA_U32 }, [BATADV_ATTR_ORIG_INTERVAL] = { .type = NLA_U32 },
[BATADV_ATTR_ELP_INTERVAL] = { .type = NLA_U32 }, [BATADV_ATTR_ELP_INTERVAL] = { .type = NLA_U32 },
[BATADV_ATTR_THROUGHPUT_OVERRIDE] = { .type = NLA_U32 }, [BATADV_ATTR_THROUGHPUT_OVERRIDE] = { .type = NLA_U32 },
@ -345,12 +343,6 @@ static int batadv_netlink_mesh_fill(struct sk_buff *msg,
goto nla_put_failure; goto nla_put_failure;
#endif /* CONFIG_BATMAN_ADV_MCAST */ #endif /* CONFIG_BATMAN_ADV_MCAST */
#ifdef CONFIG_BATMAN_ADV_NC
if (nla_put_u8(msg, BATADV_ATTR_NETWORK_CODING_ENABLED,
!!atomic_read(&bat_priv->network_coding)))
goto nla_put_failure;
#endif /* CONFIG_BATMAN_ADV_NC */
if (nla_put_u32(msg, BATADV_ATTR_ORIG_INTERVAL, if (nla_put_u32(msg, BATADV_ATTR_ORIG_INTERVAL,
atomic_read(&bat_priv->orig_interval))) atomic_read(&bat_priv->orig_interval)))
goto nla_put_failure; goto nla_put_failure;
@ -588,15 +580,6 @@ static int batadv_netlink_set_mesh(struct sk_buff *skb, struct genl_info *info)
} }
#endif /* CONFIG_BATMAN_ADV_MCAST */ #endif /* CONFIG_BATMAN_ADV_MCAST */
#ifdef CONFIG_BATMAN_ADV_NC
if (info->attrs[BATADV_ATTR_NETWORK_CODING_ENABLED]) {
attr = info->attrs[BATADV_ATTR_NETWORK_CODING_ENABLED];
atomic_set(&bat_priv->network_coding, !!nla_get_u8(attr));
batadv_nc_status_update(bat_priv->mesh_iface);
}
#endif /* CONFIG_BATMAN_ADV_NC */
if (info->attrs[BATADV_ATTR_ORIG_INTERVAL]) { if (info->attrs[BATADV_ATTR_ORIG_INTERVAL]) {
u32 orig_interval; u32 orig_interval;

File diff suppressed because it is too large Load Diff

View File

@ -1,106 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) B.A.T.M.A.N. contributors:
*
* Martin Hundebøll, Jeppe Ledet-Pedersen
*/
#ifndef _NET_BATMAN_ADV_NETWORK_CODING_H_
#define _NET_BATMAN_ADV_NETWORK_CODING_H_
#include "main.h"
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/types.h>
#include <uapi/linux/batadv_packet.h>
#ifdef CONFIG_BATMAN_ADV_NC
void batadv_nc_status_update(struct net_device *net_dev);
int batadv_nc_init(void);
int batadv_nc_mesh_init(struct batadv_priv *bat_priv);
void batadv_nc_mesh_free(struct batadv_priv *bat_priv);
void batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
struct batadv_orig_node *orig_node,
struct batadv_orig_node *orig_neigh_node,
struct batadv_ogm_packet *ogm_packet,
int is_single_hop_neigh);
void batadv_nc_purge_orig(struct batadv_priv *bat_priv,
struct batadv_orig_node *orig_node,
bool (*to_purge)(struct batadv_priv *,
struct batadv_nc_node *));
void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv);
void batadv_nc_init_orig(struct batadv_orig_node *orig_node);
bool batadv_nc_skb_forward(struct sk_buff *skb,
struct batadv_neigh_node *neigh_node);
void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv,
struct sk_buff *skb);
void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv,
struct sk_buff *skb);
#else /* ifdef CONFIG_BATMAN_ADV_NC */
static inline void batadv_nc_status_update(struct net_device *net_dev)
{
}
static inline int batadv_nc_init(void)
{
return 0;
}
static inline int batadv_nc_mesh_init(struct batadv_priv *bat_priv)
{
return 0;
}
static inline void batadv_nc_mesh_free(struct batadv_priv *bat_priv)
{
}
static inline void
batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
struct batadv_orig_node *orig_node,
struct batadv_orig_node *orig_neigh_node,
struct batadv_ogm_packet *ogm_packet,
int is_single_hop_neigh)
{
}
static inline void
batadv_nc_purge_orig(struct batadv_priv *bat_priv,
struct batadv_orig_node *orig_node,
bool (*to_purge)(struct batadv_priv *,
struct batadv_nc_node *))
{
}
static inline void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv)
{
}
static inline void batadv_nc_init_orig(struct batadv_orig_node *orig_node)
{
}
static inline bool batadv_nc_skb_forward(struct sk_buff *skb,
struct batadv_neigh_node *neigh_node)
{
return false;
}
static inline void
batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv,
struct sk_buff *skb)
{
}
static inline void
batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv,
struct sk_buff *skb)
{
}
#endif /* ifdef CONFIG_BATMAN_ADV_NC */
#endif /* _NET_BATMAN_ADV_NETWORK_CODING_H_ */

View File

@ -37,7 +37,6 @@
#include "log.h" #include "log.h"
#include "multicast.h" #include "multicast.h"
#include "netlink.h" #include "netlink.h"
#include "network-coding.h"
#include "routing.h" #include "routing.h"
#include "translation-table.h" #include "translation-table.h"
@ -883,9 +882,6 @@ void batadv_orig_node_release(struct kref *ref)
} }
spin_unlock_bh(&orig_node->vlan_list_lock); spin_unlock_bh(&orig_node->vlan_list_lock);
/* Free nc_nodes */
batadv_nc_purge_orig(orig_node->bat_priv, orig_node, NULL);
call_rcu(&orig_node->rcu, batadv_orig_node_free_rcu); call_rcu(&orig_node->rcu, batadv_orig_node_free_rcu);
} }
@ -959,8 +955,6 @@ struct batadv_orig_node *batadv_orig_node_new(struct batadv_priv *bat_priv,
spin_lock_init(&orig_node->tt_lock); spin_lock_init(&orig_node->tt_lock);
spin_lock_init(&orig_node->vlan_list_lock); spin_lock_init(&orig_node->vlan_list_lock);
batadv_nc_init_orig(orig_node);
/* extra reference for return */ /* extra reference for return */
kref_init(&orig_node->refcount); kref_init(&orig_node->refcount);

View File

@ -31,7 +31,6 @@
#include "hard-interface.h" #include "hard-interface.h"
#include "log.h" #include "log.h"
#include "mesh-interface.h" #include "mesh-interface.h"
#include "network-coding.h"
#include "originator.h" #include "originator.h"
#include "send.h" #include "send.h"
#include "tp_meter.h" #include "tp_meter.h"
@ -956,15 +955,9 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
/* function returns -EREMOTE for promiscuous packets */ /* function returns -EREMOTE for promiscuous packets */
check = batadv_check_unicast_packet(bat_priv, skb, hdr_size); check = batadv_check_unicast_packet(bat_priv, skb, hdr_size);
/* Even though the packet is not for us, we might save it to use for
* decoding a later received coded packet
*/
if (check == -EREMOTE)
batadv_nc_skb_store_sniffed_unicast(bat_priv, skb);
if (check < 0) if (check < 0)
goto free_skb; goto free_skb;
if (!batadv_check_unicast_ttvn(bat_priv, skb, hdr_size)) if (!batadv_check_unicast_ttvn(bat_priv, skb, hdr_size))
goto free_skb; goto free_skb;

View File

@ -34,7 +34,6 @@
#include "hard-interface.h" #include "hard-interface.h"
#include "log.h" #include "log.h"
#include "mesh-interface.h" #include "mesh-interface.h"
#include "network-coding.h"
#include "originator.h" #include "originator.h"
#include "routing.h" #include "routing.h"
#include "translation-table.h" #include "translation-table.h"
@ -63,12 +62,9 @@ int batadv_send_skb_packet(struct sk_buff *skb,
struct batadv_hard_iface *hard_iface, struct batadv_hard_iface *hard_iface,
const u8 *dst_addr) const u8 *dst_addr)
{ {
struct batadv_priv *bat_priv;
struct ethhdr *ethhdr; struct ethhdr *ethhdr;
int ret; int ret;
bat_priv = netdev_priv(hard_iface->mesh_iface);
if (hard_iface->if_status != BATADV_IF_ACTIVE) if (hard_iface->if_status != BATADV_IF_ACTIVE)
goto send_skb_err; goto send_skb_err;
@ -97,9 +93,6 @@ int batadv_send_skb_packet(struct sk_buff *skb,
skb->dev = hard_iface->net_dev; skb->dev = hard_iface->net_dev;
/* Save a clone of the skb to use when decoding coded packets */
batadv_nc_skb_store_for_decoding(bat_priv, skb);
/* dev_queue_xmit() returns a negative result on error. However on /* dev_queue_xmit() returns a negative result on error. However on
* congestion and traffic shaping, it drops and returns NET_XMIT_DROP * congestion and traffic shaping, it drops and returns NET_XMIT_DROP
* (which is > 0). This will not be treated as an error. * (which is > 0). This will not be treated as an error.
@ -202,14 +195,7 @@ int batadv_send_skb_to_orig(struct sk_buff *skb,
goto put_neigh_node; goto put_neigh_node;
} }
/* try to network code the packet, if it is received on an interface ret = batadv_send_unicast_skb(skb, neigh_node);
* (i.e. being forwarded). If the packet originates from this node or if
* network coding fails, then send the packet as usual.
*/
if (recv_if && batadv_nc_skb_forward(skb, neigh_node))
ret = -EINPROGRESS;
else
ret = batadv_send_unicast_skb(skb, neigh_node);
/* skb was consumed */ /* skb was consumed */
skb = NULL; skb = NULL;

View File

@ -212,7 +212,7 @@ batadv_tt_global_hash_find(struct batadv_priv *bat_priv, const u8 *addr,
/** /**
* batadv_tt_local_entry_release() - release tt_local_entry from lists and queue * batadv_tt_local_entry_release() - release tt_local_entry from lists and queue
* for free after rcu grace period * for free after rcu grace period
* @ref: kref pointer of the nc_node * @ref: kref pointer of the batadv_tt_local_entry
*/ */
static void batadv_tt_local_entry_release(struct kref *ref) static void batadv_tt_local_entry_release(struct kref *ref)
{ {
@ -244,7 +244,7 @@ batadv_tt_local_entry_put(struct batadv_tt_local_entry *tt_local_entry)
/** /**
* batadv_tt_global_entry_release() - release tt_global_entry from lists and * batadv_tt_global_entry_release() - release tt_global_entry from lists and
* queue for free after rcu grace period * queue for free after rcu grace period
* @ref: kref pointer of the nc_node * @ref: kref pointer of the batadv_tt_global_entry
*/ */
void batadv_tt_global_entry_release(struct kref *ref) void batadv_tt_global_entry_release(struct kref *ref)
{ {

View File

@ -505,20 +505,6 @@ struct batadv_orig_node {
/** @rcu: struct used for freeing in an RCU-safe manner */ /** @rcu: struct used for freeing in an RCU-safe manner */
struct rcu_head rcu; struct rcu_head rcu;
#ifdef CONFIG_BATMAN_ADV_NC
/** @in_coding_list: list of nodes this orig can hear */
struct list_head in_coding_list;
/** @out_coding_list: list of nodes that can hear this orig */
struct list_head out_coding_list;
/** @in_coding_list_lock: protects in_coding_list */
spinlock_t in_coding_list_lock;
/** @out_coding_list_lock: protects out_coding_list */
spinlock_t out_coding_list_lock;
#endif
/** @fragments: array with heads for fragment chains */ /** @fragments: array with heads for fragment chains */
struct batadv_frag_table_entry fragments[BATADV_FRAG_BUFFER_COUNT]; struct batadv_frag_table_entry fragments[BATADV_FRAG_BUFFER_COUNT];
@ -545,9 +531,6 @@ enum batadv_orig_capabilities {
*/ */
BATADV_ORIG_CAPA_HAS_DAT, BATADV_ORIG_CAPA_HAS_DAT,
/** @BATADV_ORIG_CAPA_HAS_NC: orig node has network coding enabled */
BATADV_ORIG_CAPA_HAS_NC,
/** @BATADV_ORIG_CAPA_HAS_TT: orig node has tt capability */ /** @BATADV_ORIG_CAPA_HAS_TT: orig node has tt capability */
BATADV_ORIG_CAPA_HAS_TT, BATADV_ORIG_CAPA_HAS_TT,
@ -953,60 +936,6 @@ enum batadv_counters {
BATADV_CNT_DAT_CACHED_REPLY_TX, BATADV_CNT_DAT_CACHED_REPLY_TX,
#endif #endif
#ifdef CONFIG_BATMAN_ADV_NC
/**
* @BATADV_CNT_NC_CODE: transmitted nc-combined traffic packet counter
*/
BATADV_CNT_NC_CODE,
/**
* @BATADV_CNT_NC_CODE_BYTES: transmitted nc-combined traffic bytes
* counter
*/
BATADV_CNT_NC_CODE_BYTES,
/**
* @BATADV_CNT_NC_RECODE: transmitted nc-recombined traffic packet
* counter
*/
BATADV_CNT_NC_RECODE,
/**
* @BATADV_CNT_NC_RECODE_BYTES: transmitted nc-recombined traffic bytes
* counter
*/
BATADV_CNT_NC_RECODE_BYTES,
/**
* @BATADV_CNT_NC_BUFFER: counter for packets buffered for later nc
* decoding
*/
BATADV_CNT_NC_BUFFER,
/**
* @BATADV_CNT_NC_DECODE: received and nc-decoded traffic packet counter
*/
BATADV_CNT_NC_DECODE,
/**
* @BATADV_CNT_NC_DECODE_BYTES: received and nc-decoded traffic bytes
* counter
*/
BATADV_CNT_NC_DECODE_BYTES,
/**
* @BATADV_CNT_NC_DECODE_FAILED: received and decode-failed traffic
* packet counter
*/
BATADV_CNT_NC_DECODE_FAILED,
/**
* @BATADV_CNT_NC_SNIFFED: counter for nc-decoded packets received in
* promisc mode.
*/
BATADV_CNT_NC_SNIFFED,
#endif
/** @BATADV_CNT_NUM: number of traffic counters */ /** @BATADV_CNT_NUM: number of traffic counters */
BATADV_CNT_NUM, BATADV_CNT_NUM,
}; };
@ -1339,56 +1268,6 @@ struct batadv_priv_mcast {
}; };
#endif #endif
/**
* struct batadv_priv_nc - per mesh interface network coding private data
*/
struct batadv_priv_nc {
/** @work: work queue callback item for cleanup */
struct delayed_work work;
/**
* @min_tq: only consider neighbors for encoding if neigh_tq > min_tq
*/
u8 min_tq;
/**
* @max_fwd_delay: maximum packet forward delay to allow coding of
* packets
*/
u32 max_fwd_delay;
/**
* @max_buffer_time: buffer time for sniffed packets used to decoding
*/
u32 max_buffer_time;
/**
* @timestamp_fwd_flush: timestamp of last forward packet queue flush
*/
unsigned long timestamp_fwd_flush;
/**
* @timestamp_sniffed_purge: timestamp of last sniffed packet queue
* purge
*/
unsigned long timestamp_sniffed_purge;
/**
* @coding_hash: Hash table used to buffer skbs while waiting for
* another incoming skb to code it with. Skbs are added to the buffer
* just before being forwarded in routing.c
*/
struct batadv_hashtable *coding_hash;
/**
* @decoding_hash: Hash table used to buffer skbs that might be needed
* to decode a received coded skb. The buffer is used for 1) skbs
* arriving on the mesh-interface; 2) skbs overheard on the
* hard-interface; and 3) skbs forwarded by batman-adv.
*/
struct batadv_hashtable *decoding_hash;
};
/** /**
* struct batadv_tp_unacked - unacked packet meta-information * struct batadv_tp_unacked - unacked packet meta-information
* *
@ -1775,16 +1654,6 @@ struct batadv_priv {
struct batadv_priv_mcast mcast; struct batadv_priv_mcast mcast;
#endif #endif
#ifdef CONFIG_BATMAN_ADV_NC
/**
* @network_coding: bool indicating whether network coding is enabled
*/
atomic_t network_coding;
/** @nc: network coding data */
struct batadv_priv_nc nc;
#endif /* CONFIG_BATMAN_ADV_NC */
#ifdef CONFIG_BATMAN_ADV_BATMAN_V #ifdef CONFIG_BATMAN_ADV_BATMAN_V
/** @bat_v: B.A.T.M.A.N. V per mesh-interface private data */ /** @bat_v: B.A.T.M.A.N. V per mesh-interface private data */
struct batadv_priv_bat_v bat_v; struct batadv_priv_bat_v bat_v;
@ -2016,96 +1885,11 @@ struct batadv_tt_roam_node {
struct list_head list; struct list_head list;
}; };
/**
* struct batadv_nc_node - network coding node
*/
struct batadv_nc_node {
/** @list: next and prev pointer for the list handling */
struct list_head list;
/** @addr: the node's mac address */
u8 addr[ETH_ALEN];
/** @refcount: number of contexts the object is used by */
struct kref refcount;
/** @rcu: struct used for freeing in an RCU-safe manner */
struct rcu_head rcu;
/** @orig_node: pointer to corresponding orig node struct */
struct batadv_orig_node *orig_node;
/** @last_seen: timestamp of last ogm received from this node */
unsigned long last_seen;
};
/**
* struct batadv_nc_path - network coding path
*/
struct batadv_nc_path {
/** @hash_entry: next and prev pointer for the list handling */
struct hlist_node hash_entry;
/** @rcu: struct used for freeing in an RCU-safe manner */
struct rcu_head rcu;
/** @refcount: number of contexts the object is used by */
struct kref refcount;
/** @packet_list: list of buffered packets for this path */
struct list_head packet_list;
/** @packet_list_lock: access lock for packet list */
spinlock_t packet_list_lock;
/** @next_hop: next hop (destination) of path */
u8 next_hop[ETH_ALEN];
/** @prev_hop: previous hop (source) of path */
u8 prev_hop[ETH_ALEN];
/** @last_valid: timestamp for last validation of path */
unsigned long last_valid;
};
/**
* struct batadv_nc_packet - network coding packet used when coding and
* decoding packets
*/
struct batadv_nc_packet {
/** @list: next and prev pointer for the list handling */
struct list_head list;
/** @packet_id: crc32 checksum of skb data */
__be32 packet_id;
/**
* @timestamp: field containing the info when the packet was added to
* path
*/
unsigned long timestamp;
/** @neigh_node: pointer to original next hop neighbor of skb */
struct batadv_neigh_node *neigh_node;
/** @skb: skb which can be encoded or used for decoding */
struct sk_buff *skb;
/** @nc_path: pointer to path this nc packet is attached to */
struct batadv_nc_path *nc_path;
};
/** /**
* struct batadv_skb_cb - control buffer structure used to store private data * struct batadv_skb_cb - control buffer structure used to store private data
* relevant to batman-adv in the skb->cb buffer in skbs. * relevant to batman-adv in the skb->cb buffer in skbs.
*/ */
struct batadv_skb_cb { struct batadv_skb_cb {
/**
* @decoded: Marks a skb as decoded, which is checked when searching for
* coding opportunities in network-coding.c
*/
unsigned char decoded:1;
/** @num_bcasts: Counter for broadcast packet retransmissions */ /** @num_bcasts: Counter for broadcast packet retransmissions */
unsigned char num_bcasts; unsigned char num_bcasts;
}; };