The following commit has been merged in the master branch: commit b77af26a790a2ecfdd4109a3b1328499ea988181 Merge: 5ee389751922a497d38c4750c5cbe6223873c24c 29824a55c07cd79a530d4bc1020a529c402515b6 Author: David S. Miller davem@davemloft.net Date: Mon Jul 4 23:33:59 2016 -0700
Merge tag 'batadv-next-for-davem-20160704' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says:
==================== This feature patchset includes the following changes:
- Cleanup work by Markus Pargmann and Sven Eckelmann (six patches)
- Initial Netlink support by Matthias Schiffer (two patches)
- Throughput Meter implementation by Antonio Quartulli, a kernel-space traffic generator to estimate link speeds. This feature is useful on low-end WiFi APs where running iperf or netperf from userspace gives wrong results due to heavy userspace/kernelspace overhead. (two patches)
- API clean-up work by Antonio Quartulli (one patch) ====================
Signed-off-by: David S. Miller davem@davemloft.net
diff --combined MAINTAINERS index 772c9ff,e25091f..67e4a65 --- a/MAINTAINERS +++ b/MAINTAINERS @@@ -595,10 -595,6 +595,10 @@@ S: Odd Fixe L: linux-alpha@vger.kernel.org F: arch/alpha/
+ALPS PS/2 TOUCHPAD DRIVER +R: Pali Rohár pali.rohar@gmail.com +F: drivers/input/mouse/alps.* + ALTERA MAILBOX DRIVER M: Ley Foon Tan lftan@altera.com L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers) @@@ -1163,7 -1159,6 +1163,7 @@@ F: arch/arm/mach-footbridge ARM/FREESCALE IMX / MXC ARM ARCHITECTURE M: Shawn Guo shawnguo@kernel.org M: Sascha Hauer kernel@pengutronix.de +R: Fabio Estevam fabio.estevam@nxp.com L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Maintained T: git git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git @@@ -2247,8 -2242,7 +2247,8 @@@ F: include/net/ax25. F: net/ax25/
AZ6007 DVB DRIVER -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-media@vger.kernel.org W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git @@@ -2297,6 -2291,7 +2297,7 @@@ S: Maintaine F: Documentation/ABI/testing/sysfs-class-net-batman-adv F: Documentation/ABI/testing/sysfs-class-net-mesh F: Documentation/networking/batman-adv.txt + F: include/uapi/linux/batman_adv.h F: net/batman-adv/
BAYCOM/HDLCDRV DRIVERS FOR AX.25 @@@ -2584,11 -2579,12 +2585,11 @@@ S: Supporte F: drivers/net/ethernet/broadcom/tg3.*
BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER -M: Brett Rudley brudley@broadcom.com -M: Arend van Spriel arend@broadcom.com -M: Franky (Zhenhui) Lin frankyl@broadcom.com -M: Hante Meuleman meuleman@broadcom.com +M: Arend van Spriel arend.vanspriel@broadcom.com +M: Franky Lin franky.lin@broadcom.com +M: Hante Meuleman hante.meuleman@broadcom.com L: linux-wireless@vger.kernel.org -L: brcm80211-dev-list@broadcom.com +L: brcm80211-dev-list.pdl@broadcom.com S: Supported F: drivers/net/wireless/broadcom/brcm80211/
@@@ -2722,8 -2718,7 +2723,8 @@@ F: Documentation/filesystems/btrfs.tx F: fs/btrfs/
BTTV VIDEO4LINUX DRIVER -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-media@vger.kernel.org W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git @@@ -2787,9 -2782,9 +2788,9 @@@ F: include/net/caif F: net/caif/
CALGARY x86-64 IOMMU -M: Muli Ben-Yehuda muli@il.ibm.com -M: "Jon D. Mason" jdmason@kudzu.us -L: discuss@x86-64.org +M: Muli Ben-Yehuda mulix@mulix.org +M: Jon Mason jdmason@kudzu.us +L: iommu@lists.linux-foundation.org S: Maintained F: arch/x86/kernel/pci-calgary_64.c F: arch/x86/kernel/tce_64.c @@@ -2820,7 -2815,6 +2821,7 @@@ W: https://github.com/linux-ca T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git S: Maintained +F: Documentation/devicetree/bindings/net/can/ F: drivers/net/can/ F: include/linux/can/dev.h F: include/linux/can/platform/ @@@ -3359,8 -3353,7 +3360,8 @@@ S: Maintaine F: drivers/media/dvb-frontends/cx24120*
CX88 VIDEO4LINUX DRIVER -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-media@vger.kernel.org W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git @@@ -3790,7 -3783,6 +3791,7 @@@ Q: https://patchwork.kernel.org/project S: Maintained F: drivers/dma/ F: include/linux/dmaengine.h +F: Documentation/devicetree/bindings/dma/ F: Documentation/dmaengine/ T: git git://git.infradead.org/users/vkoul/slave-dma.git
@@@ -4308,8 -4300,7 +4309,8 @@@ F: fs/ecryptfs EDAC-CORE M: Doug Thompson dougthompson@xmission.com M: Borislav Petkov bp@alien8.de -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-edac@vger.kernel.org T: git git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git for-next T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac.git linux_next @@@ -4354,8 -4345,7 +4355,8 @@@ S: Maintaine F: drivers/edac/e7xxx_edac.c
EDAC-GHES -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-edac@vger.kernel.org S: Maintained F: drivers/edac/ghes_edac.c @@@ -4379,22 -4369,19 +4380,22 @@@ S: Maintaine F: drivers/edac/i5000_edac.c
EDAC-I5400 -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-edac@vger.kernel.org S: Maintained F: drivers/edac/i5400_edac.c
EDAC-I7300 -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-edac@vger.kernel.org S: Maintained F: drivers/edac/i7300_edac.c
EDAC-I7CORE -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-edac@vger.kernel.org S: Maintained F: drivers/edac/i7core_edac.c @@@ -4431,8 -4418,7 +4432,8 @@@ S: Maintaine F: drivers/edac/r82600_edac.c
EDAC-SBRIDGE -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-edac@vger.kernel.org S: Maintained F: drivers/edac/sb_edac.c @@@ -4491,8 -4477,7 +4492,8 @@@ S: Maintaine F: drivers/net/ethernet/ibm/ehea/
EM28XX VIDEO4LINUX DRIVER -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-media@vger.kernel.org W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git @@@ -5437,15 -5422,6 +5438,15 @@@ F: include/uapi/linux/if_hippi. F: net/802/hippi.c F: drivers/net/hippi/
+HISILICON NETWORK SUBSYSTEM DRIVER +M: Yisen Zhuang yisen.zhuang@huawei.com +M: Salil Mehta salil.mehta@huawei.com +L: netdev@vger.kernel.org +W: http://www.hisilicon.com +S: Maintained +F: drivers/net/ethernet/hisilicon/ +F: Documentation/devicetree/bindings/net/hisilicon*.txt + HISILICON SAS Controller M: John Garry john.garry@huawei.com W: http://www.hisilicon.com @@@ -6527,7 -6503,6 +6528,7 @@@ F: include/uapi/linux/sunrpc
KERNEL SELFTEST FRAMEWORK M: Shuah Khan shuahkh@osg.samsung.com +M: Shuah Khan shuah@kernel.org L: linux-kselftest@vger.kernel.org T: git git://git.kernel.org/pub/scm/shuah/linux-kselftest S: Maintained @@@ -7197,12 -7172,6 +7198,12 @@@ W: http://www.kernel.org/doc/man-page L: linux-man@vger.kernel.org S: Maintained
+MARVELL 88E6XXX ETHERNET SWITCH FABRIC DRIVER +M: Andrew Lunn andrew@lunn.ch +M: Vivien Didelot vivien.didelot@savoirfairelinux.com +S: Maintained +F: drivers/net/dsa/mv88e6xxx/ + MARVELL ARMADA DRM SUPPORT M: Russell King rmk+kernel@armlinux.org.uk S: Maintained @@@ -7210,6 -7179,11 +7211,6 @@@ F: drivers/gpu/drm/armada F: include/uapi/drm/armada_drm.h F: Documentation/devicetree/bindings/display/armada/
-MARVELL 88E6352 DSA support -M: Guenter Roeck linux@roeck-us.net -S: Maintained -F: drivers/net/dsa/mv88e6352.c - MARVELL CRYPTO DRIVER M: Boris Brezillon boris.brezillon@free-electrons.com M: Arnaud Ebalard arno@natisbad.org @@@ -7400,8 -7374,7 +7401,8 @@@ S: Supporte F: drivers/media/pci/netup_unidvb/*
MEDIA INPUT INFRASTRUCTURE (V4L/DVB) -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org P: LinuxTV.org Project L: linux-media@vger.kernel.org W: https://linuxtv.org @@@ -7449,7 -7422,7 +7450,7 @@@ F: drivers/scsi/megaraid. F: drivers/scsi/megaraid/
MELLANOX ETHERNET DRIVER (mlx4_en) -M: Eugenia Emantayev eugenia@mellanox.com +M: Tariq Toukan tariqt@mellanox.com L: netdev@vger.kernel.org S: Supported W: http://www.mellanox.com @@@ -8450,9 -8423,10 +8451,9 @@@ F: drivers/i2c/busses/i2c-ocores. OPEN FIRMWARE AND FLATTENED DEVICE TREE M: Rob Herring robh+dt@kernel.org M: Frank Rowand frowand.list@gmail.com -M: Grant Likely grant.likely@linaro.org L: devicetree@vger.kernel.org W: http://www.devicetree.org/ -T: git git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux.git +T: git git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git S: Maintained F: drivers/of/ F: include/linux/of*.h @@@ -8460,10 -8434,12 +8461,10 @@@ F: scripts/dtc
OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS M: Rob Herring robh+dt@kernel.org -M: Pawel Moll pawel.moll@arm.com M: Mark Rutland mark.rutland@arm.com -M: Ian Campbell ijc+devicetree@hellion.org.uk -M: Kumar Gala galak@codeaurora.org L: devicetree@vger.kernel.org T: git git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git +Q: http://patchwork.ozlabs.org/project/devicetree-bindings/list/ S: Maintained F: Documentation/devicetree/ F: arch/*/boot/dts/ @@@ -8988,7 -8964,6 +8989,7 @@@ L: linux-gpio@vger.kernel.or T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git S: Maintained F: Documentation/devicetree/bindings/pinctrl/ +F: Documentation/pinctrl.txt F: drivers/pinctrl/ F: include/linux/pinctrl/
@@@ -9896,8 -9871,7 +9897,8 @@@ S: Odd Fixe F: drivers/media/i2c/saa6588*
SAA7134 VIDEO4LINUX DRIVER -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-media@vger.kernel.org W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git @@@ -10306,9 -10280,10 +10307,9 @@@ W: http://www.avagotech.co S: Supported F: drivers/scsi/be2iscsi/
-Emulex 10Gbps NIC BE2, BE3-R, Lancer, Skyhawk-R DRIVER +Emulex 10Gbps NIC BE2, BE3-R, Lancer, Skyhawk-R DRIVER (be2net) M: Sathya Perla sathya.perla@broadcom.com M: Ajit Khaparde ajit.khaparde@broadcom.com -M: Padmanabh Ratnakar padmanabh.ratnakar@broadcom.com M: Sriharsha Basavapatna sriharsha.basavapatna@broadcom.com M: Somnath Kotur somnath.kotur@broadcom.com L: netdev@vger.kernel.org @@@ -10415,8 -10390,7 +10416,8 @@@ S: Maintaine F: drivers/media/radio/si4713/radio-usb-si4713.c
SIANO DVB DRIVER -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-media@vger.kernel.org W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git @@@ -11182,8 -11156,7 +11183,8 @@@ S: Maintaine F: drivers/media/i2c/tda9840*
TEA5761 TUNER DRIVER -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-media@vger.kernel.org W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git @@@ -11191,8 -11164,7 +11192,8 @@@ S: Odd fixe F: drivers/media/tuners/tea5761.*
TEA5767 TUNER DRIVER -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-media@vger.kernel.org W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git @@@ -11579,8 -11551,7 +11580,8 @@@ F: include/linux/shmem_fs. F: mm/shmem.c
TM6000 VIDEO4LINUX DRIVER -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-media@vger.kernel.org W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git @@@ -11934,8 -11905,7 +11935,8 @@@ F: drivers/usb/common/usb-otg-fsm.
USB OVER IP DRIVER M: Valentina Manea valentina.manea.m@gmail.com -M: Shuah Khan shuah.kh@samsung.com +M: Shuah Khan shuahkh@osg.samsung.com +M: Shuah Khan shuah@kernel.org L: linux-usb@vger.kernel.org S: Maintained F: Documentation/usb/usbip_protocol.txt @@@ -12006,7 -11976,6 +12007,7 @@@ L: linux-usb@vger.kernel.or W: http://www.linux-usb.org T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git S: Supported +F: Documentation/devicetree/bindings/usb/ F: Documentation/usb/ F: drivers/usb/ F: include/linux/usb.h @@@ -12180,7 -12149,6 +12181,7 @@@ VIRTIO CORE, NET AND BLOCK DRIVER M: "Michael S. Tsirkin" mst@redhat.com L: virtualization@lists.linux-foundation.org S: Maintained +F: Documentation/devicetree/bindings/virtio/ F: drivers/virtio/ F: tools/virtio/ F: drivers/net/virtio_net.c @@@ -12569,8 -12537,7 +12570,8 @@@ S: Maintaine F: arch/x86/entry/vdso/
XC2028/3028 TUNER DRIVER -M: Mauro Carvalho Chehab mchehab@osg.samsung.com +M: Mauro Carvalho Chehab mchehab@s-opensource.com +M: Mauro Carvalho Chehab mchehab@kernel.org L: linux-media@vger.kernel.org W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git diff --combined net/batman-adv/routing.c index 319a588,0f8c0dd..af8e119 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@@ -40,12 -40,15 +40,15 @@@ #include "fragmentation.h" #include "hard-interface.h" #include "icmp_socket.h" + #include "log.h" #include "network-coding.h" #include "originator.h" #include "packet.h" #include "send.h" #include "soft-interface.h" + #include "tp_meter.h" #include "translation-table.h" + #include "tvlv.h"
static int batadv_route_unicast_packet(struct sk_buff *skb, struct batadv_hard_iface *recv_if); @@@ -268,10 -271,19 +271,19 @@@ static int batadv_recv_my_icmp_packet(s icmph->ttl = BATADV_TTL;
res = batadv_send_skb_to_orig(skb, orig_node, NULL); - if (res != NET_XMIT_DROP) - ret = NET_RX_SUCCESS; + if (res == -1) + goto out; + + ret = NET_RX_SUCCESS;
break; + case BATADV_TP: + if (!pskb_may_pull(skb, sizeof(struct batadv_icmp_tp_packet))) + goto out; + + batadv_tp_meter_recv(bat_priv, skb); + ret = NET_RX_SUCCESS; + goto out; default: /* drop unknown type */ goto out; @@@ -290,7 -302,7 +302,7 @@@ static int batadv_recv_icmp_ttl_exceede struct batadv_hard_iface *primary_if = NULL; struct batadv_orig_node *orig_node = NULL; struct batadv_icmp_packet *icmp_packet; - int ret = NET_RX_DROP; + int res, ret = NET_RX_DROP;
icmp_packet = (struct batadv_icmp_packet *)skb->data;
@@@ -321,7 -333,8 +333,8 @@@ icmp_packet->msg_type = BATADV_TTL_EXCEEDED; icmp_packet->ttl = BATADV_TTL;
- if (batadv_send_skb_to_orig(skb, orig_node, NULL) != NET_XMIT_DROP) + res = batadv_send_skb_to_orig(skb, orig_node, NULL); + if (res != -1) ret = NET_RX_SUCCESS;
out: @@@ -341,7 -354,7 +354,7 @@@ int batadv_recv_icmp_packet(struct sk_b struct ethhdr *ethhdr; struct batadv_orig_node *orig_node = NULL; int hdr_size = sizeof(struct batadv_icmp_header); - int ret = NET_RX_DROP; + int res, ret = NET_RX_DROP;
/* drop packet if it has not necessary minimum size */ if (unlikely(!pskb_may_pull(skb, hdr_size))) @@@ -374,7 -387,6 +387,7 @@@ if (skb_cow(skb, ETH_HLEN) < 0) goto out;
+ ethhdr = eth_hdr(skb); icmph = (struct batadv_icmp_header *)skb->data; icmp_packet_rr = (struct batadv_icmp_packet_rr *)icmph; if (icmp_packet_rr->rr_cur >= BATADV_RR_LEN) @@@ -408,7 -420,8 +421,8 @@@ icmph->ttl--;
/* route it */ - if (batadv_send_skb_to_orig(skb, orig_node, recv_if) != NET_XMIT_DROP) + res = batadv_send_skb_to_orig(skb, orig_node, recv_if); + if (res != -1) ret = NET_RX_SUCCESS;
out: @@@ -469,7 -482,7 +483,7 @@@ batadv_find_router(struct batadv_priv * struct batadv_orig_node *orig_node, struct batadv_hard_iface *recv_if) { - struct batadv_algo_ops *bao = bat_priv->bat_algo_ops; + struct batadv_algo_ops *bao = bat_priv->algo_ops; struct batadv_neigh_node *first_candidate_router = NULL; struct batadv_neigh_node *next_candidate_router = NULL; struct batadv_neigh_node *router, *cand_router = NULL; @@@ -523,9 -536,9 +537,9 @@@ /* alternative candidate should be good enough to be * considered */ - if (!bao->bat_neigh_is_similar_or_better(cand_router, - cand->if_outgoing, - router, recv_if)) + if (!bao->neigh.is_similar_or_better(cand_router, + cand->if_outgoing, router, + recv_if)) goto next;
/* don't use the same router twice */ @@@ -645,6 -658,8 +659,8 @@@ static int batadv_route_unicast_packet(
len = skb->len; res = batadv_send_skb_to_orig(skb, orig_node, recv_if); + if (res == -1) + goto out;
/* translate transmit result into receive result */ if (res == NET_XMIT_SUCCESS) { @@@ -652,13 -667,10 +668,10 @@@ batadv_inc_counter(bat_priv, BATADV_CNT_FORWARD); batadv_add_counter(bat_priv, BATADV_CNT_FORWARD_BYTES, len + ETH_HLEN); - - ret = NET_RX_SUCCESS; - } else if (res == -EINPROGRESS) { - /* skb was buffered and consumed */ - ret = NET_RX_SUCCESS; }
+ ret = NET_RX_SUCCESS; + out: if (orig_node) batadv_orig_node_put(orig_node); diff --combined net/batman-adv/soft-interface.c index 4ba894c,18b6d07..7527c06 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@@ -48,6 -48,7 +48,7 @@@ #include <linux/types.h> #include <linux/workqueue.h>
+ #include "bat_algo.h" #include "bridge_loop_avoidance.h" #include "debugfs.h" #include "distributed-arp-table.h" @@@ -841,6 -842,8 +842,8 @@@ static int batadv_softif_init_late(stru #ifdef CONFIG_BATMAN_ADV_BLA atomic_set(&bat_priv->bla.num_requests, 0); #endif + atomic_set(&bat_priv->tp_num, 0); + bat_priv->tt.last_changeset = NULL; bat_priv->tt.last_changeset_len = 0; bat_priv->isolation_mark = 0; @@@ -1037,9 -1040,7 +1040,9 @@@ void batadv_softif_destroy_sysfs(struc static void batadv_softif_destroy_netlink(struct net_device *soft_iface, struct list_head *head) { + struct batadv_priv *bat_priv = netdev_priv(soft_iface); struct batadv_hard_iface *hard_iface; + struct batadv_softif_vlan *vlan;
list_for_each_entry(hard_iface, &batadv_hardif_list, list) { if (hard_iface->soft_iface == soft_iface) @@@ -1047,13 -1048,6 +1050,13 @@@ BATADV_IF_CLEANUP_KEEP); }
+ /* destroy the "untagged" VLAN */ + vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); + if (vlan) { + batadv_softif_destroy_vlan(bat_priv, vlan); + batadv_softif_vlan_put(vlan); + } + batadv_sysfs_del_meshif(soft_iface); unregister_netdevice_queue(soft_iface, head); } diff --combined net/batman-adv/translation-table.c index 0d441aa,8bb82a3..7e6df7a --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@@ -47,10 -47,12 +47,12 @@@ #include "bridge_loop_avoidance.h" #include "hard-interface.h" #include "hash.h" + #include "log.h" #include "multicast.h" #include "originator.h" #include "packet.h" #include "soft-interface.h" + #include "tvlv.h"
/* hash class keys */ static struct lock_class_key batadv_tt_local_hash_lock_class_key; @@@ -650,10 -652,8 +652,10 @@@ bool batadv_tt_local_add(struct net_dev
/* increase the refcounter of the related vlan */ vlan = batadv_softif_vlan_get(bat_priv, vid); - if (WARN(!vlan, "adding TT local entry %pM to non-existent VLAN %d", - addr, BATADV_PRINT_VID(vid))) { + if (!vlan) { + net_ratelimited_function(batadv_info, soft_iface, + "adding TT local entry %pM to non-existent VLAN %d\n", + addr, BATADV_PRINT_VID(vid)); kfree(tt_local); tt_local = NULL; goto out; @@@ -693,6 -693,7 +695,6 @@@ if (unlikely(hash_added != 0)) { /* remove the reference for the hash */ batadv_tt_local_entry_put(tt_local); - batadv_softif_vlan_put(vlan); goto out; }
@@@ -1545,7 -1546,7 +1547,7 @@@ batadv_transtable_best_orig(struct bata struct batadv_tt_global_entry *tt_global_entry) { struct batadv_neigh_node *router, *best_router = NULL; - struct batadv_algo_ops *bao = bat_priv->bat_algo_ops; + struct batadv_algo_ops *bao = bat_priv->algo_ops; struct hlist_head *head; struct batadv_tt_orig_list_entry *orig_entry, *best_entry = NULL;
@@@ -1557,8 -1558,8 +1559,8 @@@ continue;
if (best_router && - bao->bat_neigh_cmp(router, BATADV_IF_DEFAULT, - best_router, BATADV_IF_DEFAULT) <= 0) { + bao->neigh.cmp(router, BATADV_IF_DEFAULT, best_router, + BATADV_IF_DEFAULT) <= 0) { batadv_neigh_node_put(router); continue; } @@@ -2268,29 -2269,6 +2270,29 @@@ static u32 batadv_tt_local_crc(struct b return crc; }
+/** + * batadv_tt_req_node_release - free tt_req node entry + * @ref: kref pointer of the tt req_node entry + */ +static void batadv_tt_req_node_release(struct kref *ref) +{ + struct batadv_tt_req_node *tt_req_node; + + tt_req_node = container_of(ref, struct batadv_tt_req_node, refcount); + + kfree(tt_req_node); +} + +/** + * batadv_tt_req_node_put - decrement the tt_req_node refcounter and + * possibly release it + * @tt_req_node: tt_req_node to be free'd + */ +static void batadv_tt_req_node_put(struct batadv_tt_req_node *tt_req_node) +{ + kref_put(&tt_req_node->refcount, batadv_tt_req_node_release); +} + static void batadv_tt_req_list_free(struct batadv_priv *bat_priv) { struct batadv_tt_req_node *node; @@@ -2300,7 -2278,7 +2302,7 @@@
hlist_for_each_entry_safe(node, safe, &bat_priv->tt.req_list, list) { hlist_del_init(&node->list); - kfree(node); + batadv_tt_req_node_put(node); }
spin_unlock_bh(&bat_priv->tt.req_list_lock); @@@ -2337,7 -2315,7 +2339,7 @@@ static void batadv_tt_req_purge(struct if (batadv_has_timed_out(node->issued_at, BATADV_TT_REQUEST_TIMEOUT)) { hlist_del_init(&node->list); - kfree(node); + batadv_tt_req_node_put(node); } } spin_unlock_bh(&bat_priv->tt.req_list_lock); @@@ -2369,11 -2347,9 +2371,11 @@@ batadv_tt_req_node_new(struct batadv_pr if (!tt_req_node) goto unlock;
+ kref_init(&tt_req_node->refcount); ether_addr_copy(tt_req_node->addr, orig_node->orig); tt_req_node->issued_at = jiffies;
+ kref_get(&tt_req_node->refcount); hlist_add_head(&tt_req_node->list, &bat_priv->tt.req_list); unlock: spin_unlock_bh(&bat_priv->tt.req_list_lock); @@@ -2637,19 -2613,13 +2639,19 @@@ static bool batadv_send_tt_request(stru out: if (primary_if) batadv_hardif_put(primary_if); + if (ret && tt_req_node) { spin_lock_bh(&bat_priv->tt.req_list_lock); - /* hlist_del_init() verifies tt_req_node still is in the list */ - hlist_del_init(&tt_req_node->list); + if (!hlist_unhashed(&tt_req_node->list)) { + hlist_del_init(&tt_req_node->list); + batadv_tt_req_node_put(tt_req_node); + } spin_unlock_bh(&bat_priv->tt.req_list_lock); - kfree(tt_req_node); } + + if (tt_req_node) + batadv_tt_req_node_put(tt_req_node); + kfree(tvlv_tt_data); return ret; } @@@ -3085,7 -3055,7 +3087,7 @@@ static void batadv_handle_tt_response(s if (!batadv_compare_eth(node->addr, resp_src)) continue; hlist_del_init(&node->list); - kfree(node); + batadv_tt_req_node_put(node); }
spin_unlock_bh(&bat_priv->tt.req_list_lock); diff --combined net/batman-adv/types.h index 02e2276,4d6a7ce..43db7b6 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h @@@ -33,6 -33,7 +33,7 @@@ #include <linux/types.h> #include <linux/wait.h> #include <linux/workqueue.h> + #include <uapi/linux/batman_adv.h>
#include "packet.h"
@@@ -833,6 -834,111 +834,111 @@@ struct batadv_priv_nc };
/** + * struct batadv_tp_unacked - unacked packet meta-information + * @seqno: seqno of the unacked packet + * @len: length of the packet + * @list: list node for batadv_tp_vars::unacked_list + * + * This struct is supposed to represent a buffer unacked packet. However, since + * the purpose of the TP meter is to count the traffic only, there is no need to + * store the entire sk_buff, the starting offset and the length are enough + */ + struct batadv_tp_unacked { + u32 seqno; + u16 len; + struct list_head list; + }; + + /** + * enum batadv_tp_meter_role - Modus in tp meter session + * @BATADV_TP_RECEIVER: Initialized as receiver + * @BATADV_TP_SENDER: Initialized as sender + */ + enum batadv_tp_meter_role { + BATADV_TP_RECEIVER, + BATADV_TP_SENDER + }; + + /** + * struct batadv_tp_vars - tp meter private variables per session + * @list: list node for bat_priv::tp_list + * @timer: timer for ack (receiver) and retry (sender) + * @bat_priv: pointer to the mesh object + * @start_time: start time in jiffies + * @other_end: mac address of remote + * @role: receiver/sender modi + * @sending: sending binary semaphore: 1 if sending, 0 is not + * @reason: reason for a stopped session + * @finish_work: work item for the finishing procedure + * @test_length: test length in milliseconds + * @session: TP session identifier + * @icmp_uid: local ICMP "socket" index + * @dec_cwnd: decimal part of the cwnd used during linear growth + * @cwnd: current size of the congestion window + * @cwnd_lock: lock do protect @cwnd & @dec_cwnd + * @ss_threshold: Slow Start threshold. Once cwnd exceeds this value the + * connection switches to the Congestion Avoidance state + * @last_acked: last acked byte + * @last_sent: last sent byte, not yet acked + * @tot_sent: amount of data sent/ACKed so far + * @dup_acks: duplicate ACKs counter + * @fast_recovery: true if in Fast Recovery mode + * @recover: last sent seqno when entering Fast Recovery + * @rto: sender timeout + * @srtt: smoothed RTT scaled by 2^3 + * @rttvar: RTT variation scaled by 2^2 + * @more_bytes: waiting queue anchor when waiting for more ack/retry timeout + * @prerandom_offset: offset inside the prerandom buffer + * @prerandom_lock: spinlock protecting access to prerandom_offset + * @last_recv: last in-order received packet + * @unacked_list: list of unacked packets (meta-info only) + * @unacked_lock: protect unacked_list + * @last_recv_time: time time (jiffies) a msg was received + * @refcount: number of context where the object is used + * @rcu: struct used for freeing in an RCU-safe manner + */ + struct batadv_tp_vars { + struct hlist_node list; + struct timer_list timer; + struct batadv_priv *bat_priv; + unsigned long start_time; + u8 other_end[ETH_ALEN]; + enum batadv_tp_meter_role role; + atomic_t sending; + enum batadv_tp_meter_reason reason; + struct delayed_work finish_work; + u32 test_length; + u8 session[2]; + u8 icmp_uid; + + /* sender variables */ + u16 dec_cwnd; + u32 cwnd; + spinlock_t cwnd_lock; /* Protects cwnd & dec_cwnd */ + u32 ss_threshold; + atomic_t last_acked; + u32 last_sent; + atomic64_t tot_sent; + atomic_t dup_acks; + bool fast_recovery; + u32 recover; + u32 rto; + u32 srtt; + u32 rttvar; + wait_queue_head_t more_bytes; + u32 prerandom_offset; + spinlock_t prerandom_lock; /* Protects prerandom_offset */ + + /* receiver variables */ + u32 last_recv; + struct list_head unacked_list; + spinlock_t unacked_lock; /* Protects unacked_list */ + unsigned long last_recv_time; + struct kref refcount; + struct rcu_head rcu; + }; + + /** * struct batadv_softif_vlan - per VLAN attributes set * @bat_priv: pointer to the mesh object * @vid: VLAN identifier @@@ -900,14 -1006,17 +1006,17 @@@ struct batadv_priv_bat_v * @debug_dir: dentry for debugfs batman-adv subdirectory * @forw_bat_list: list of aggregated OGMs that will be forwarded * @forw_bcast_list: list of broadcast packets that will be rebroadcasted + * @tp_list: list of tp sessions + * @tp_num: number of currently active tp sessions * @orig_hash: hash table containing mesh participants (orig nodes) * @forw_bat_list_lock: lock protecting forw_bat_list * @forw_bcast_list_lock: lock protecting forw_bcast_list + * @tp_list_lock: spinlock protecting @tp_list * @orig_work: work queue callback item for orig node purging * @cleanup_work: work queue callback item for soft-interface deinit * @primary_if: one of the hard-interfaces assigned to this mesh interface * becomes the primary interface - * @bat_algo_ops: routing algorithm used by this mesh interface + * @algo_ops: routing algorithm used by this mesh interface * @softif_vlan_list: a list of softif_vlan structs, one per VLAN created on top * of the mesh interface represented by this object * @softif_vlan_list_lock: lock protecting softif_vlan_list @@@ -956,13 -1065,16 +1065,16 @@@ struct batadv_priv struct dentry *debug_dir; struct hlist_head forw_bat_list; struct hlist_head forw_bcast_list; + struct hlist_head tp_list; struct batadv_hashtable *orig_hash; spinlock_t forw_bat_list_lock; /* protects forw_bat_list */ spinlock_t forw_bcast_list_lock; /* protects forw_bcast_list */ + spinlock_t tp_list_lock; /* protects tp_list */ + atomic_t tp_num; struct delayed_work orig_work; struct work_struct cleanup_work; struct batadv_hard_iface __rcu *primary_if; /* rcu protected pointer */ - struct batadv_algo_ops *bat_algo_ops; + struct batadv_algo_ops *algo_ops; struct hlist_head softif_vlan_list; spinlock_t softif_vlan_list_lock; /* protects softif_vlan_list */ #ifdef CONFIG_BATMAN_ADV_BLA @@@ -1154,13 -1266,11 +1266,13 @@@ struct batadv_tt_change_node * struct batadv_tt_req_node - data to keep track of the tt requests in flight * @addr: mac address address of the originator this request was sent to * @issued_at: timestamp used for purging stale tt requests + * @refcount: number of contexts the object is used by * @list: list node for batadv_priv_tt::req_list */ struct batadv_tt_req_node { u8 addr[ETH_ALEN]; unsigned long issued_at; + struct kref refcount; struct hlist_node list; };
@@@ -1278,59 -1388,77 +1390,77 @@@ struct batadv_forw_packet };
/** + * struct batadv_algo_iface_ops - mesh algorithm callbacks (interface specific) + * @activate: start routing mechanisms when hard-interface is brought up + * @enable: init routing info when hard-interface is enabled + * @disable: de-init routing info when hard-interface is disabled + * @update_mac: (re-)init mac addresses of the protocol information + * belonging to this hard-interface + * @primary_set: called when primary interface is selected / changed + */ + struct batadv_algo_iface_ops { + void (*activate)(struct batadv_hard_iface *hard_iface); + int (*enable)(struct batadv_hard_iface *hard_iface); + void (*disable)(struct batadv_hard_iface *hard_iface); + void (*update_mac)(struct batadv_hard_iface *hard_iface); + void (*primary_set)(struct batadv_hard_iface *hard_iface); + }; + + /** + * struct batadv_algo_neigh_ops - mesh algorithm callbacks (neighbour specific) + * @hardif_init: called on creation of single hop entry + * @cmp: compare the metrics of two neighbors for their respective outgoing + * interfaces + * @is_similar_or_better: check if neigh1 is equally similar or better than + * neigh2 for their respective outgoing interface from the metric prospective + * @print: print the single hop neighbor list (optional) + */ + struct batadv_algo_neigh_ops { + void (*hardif_init)(struct batadv_hardif_neigh_node *neigh); + int (*cmp)(struct batadv_neigh_node *neigh1, + struct batadv_hard_iface *if_outgoing1, + struct batadv_neigh_node *neigh2, + struct batadv_hard_iface *if_outgoing2); + bool (*is_similar_or_better)(struct batadv_neigh_node *neigh1, + struct batadv_hard_iface *if_outgoing1, + struct batadv_neigh_node *neigh2, + struct batadv_hard_iface *if_outgoing2); + void (*print)(struct batadv_priv *priv, struct seq_file *seq); + }; + + /** + * struct batadv_algo_orig_ops - mesh algorithm callbacks (originator specific) + * @free: free the resources allocated by the routing algorithm for an orig_node + * object + * @add_if: ask the routing algorithm to apply the needed changes to the + * orig_node due to a new hard-interface being added into the mesh + * @del_if: ask the routing algorithm to apply the needed changes to the + * orig_node due to an hard-interface being removed from the mesh + * @print: print the originator table (optional) + */ + struct batadv_algo_orig_ops { + void (*free)(struct batadv_orig_node *orig_node); + int (*add_if)(struct batadv_orig_node *orig_node, int max_if_num); + int (*del_if)(struct batadv_orig_node *orig_node, int max_if_num, + int del_if_num); + void (*print)(struct batadv_priv *priv, struct seq_file *seq, + struct batadv_hard_iface *hard_iface); + }; + + /** * struct batadv_algo_ops - mesh algorithm callbacks * @list: list node for the batadv_algo_list * @name: name of the algorithm - * @bat_iface_activate: start routing mechanisms when hard-interface is brought - * up - * @bat_iface_enable: init routing info when hard-interface is enabled - * @bat_iface_disable: de-init routing info when hard-interface is disabled - * @bat_iface_update_mac: (re-)init mac addresses of the protocol information - * belonging to this hard-interface - * @bat_primary_iface_set: called when primary interface is selected / changed - * @bat_hardif_neigh_init: called on creation of single hop entry - * @bat_neigh_cmp: compare the metrics of two neighbors for their respective - * outgoing interfaces - * @bat_neigh_is_similar_or_better: check if neigh1 is equally similar or - * better than neigh2 for their respective outgoing interface from the metric - * prospective - * @bat_neigh_print: print the single hop neighbor list (optional) - * @bat_orig_print: print the originator table (optional) - * @bat_orig_free: free the resources allocated by the routing algorithm for an - * orig_node object - * @bat_orig_add_if: ask the routing algorithm to apply the needed changes to - * the orig_node due to a new hard-interface being added into the mesh - * @bat_orig_del_if: ask the routing algorithm to apply the needed changes to - * the orig_node due to an hard-interface being removed from the mesh + * @iface: callbacks related to interface handling + * @neigh: callbacks related to neighbors handling + * @orig: callbacks related to originators handling */ struct batadv_algo_ops { struct hlist_node list; char *name; - void (*bat_iface_activate)(struct batadv_hard_iface *hard_iface); - int (*bat_iface_enable)(struct batadv_hard_iface *hard_iface); - void (*bat_iface_disable)(struct batadv_hard_iface *hard_iface); - void (*bat_iface_update_mac)(struct batadv_hard_iface *hard_iface); - void (*bat_primary_iface_set)(struct batadv_hard_iface *hard_iface); - /* neigh_node handling API */ - void (*bat_hardif_neigh_init)(struct batadv_hardif_neigh_node *neigh); - int (*bat_neigh_cmp)(struct batadv_neigh_node *neigh1, - struct batadv_hard_iface *if_outgoing1, - struct batadv_neigh_node *neigh2, - struct batadv_hard_iface *if_outgoing2); - bool (*bat_neigh_is_similar_or_better) - (struct batadv_neigh_node *neigh1, - struct batadv_hard_iface *if_outgoing1, - struct batadv_neigh_node *neigh2, - struct batadv_hard_iface *if_outgoing2); - void (*bat_neigh_print)(struct batadv_priv *priv, struct seq_file *seq); - /* orig_node handling API */ - void (*bat_orig_print)(struct batadv_priv *priv, struct seq_file *seq, - struct batadv_hard_iface *hard_iface); - void (*bat_orig_free)(struct batadv_orig_node *orig_node); - int (*bat_orig_add_if)(struct batadv_orig_node *orig_node, - int max_if_num); - int (*bat_orig_del_if)(struct batadv_orig_node *orig_node, - int max_if_num, int del_if_num); + struct batadv_algo_iface_ops iface; + struct batadv_algo_neigh_ops neigh; + struct batadv_algo_orig_ops orig; };
/**