]> git.proxmox.com Git - pve-kernel-2.6.32.git/blame - rhel63-vlan-bonding-fix.patch
bump version to 2.6.32-74
[pve-kernel-2.6.32.git] / rhel63-vlan-bonding-fix.patch
CommitLineData
fcfdc537
AD
1From bf46c88fabc0787975c7ea202c9d82be4175a1fa Mon Sep 17 00:00:00 2001
2From: Neil Horman <nhorman@redhat.com>
3Date: Mon, 25 Jun 2012 09:41:26 -0400
4Subject: [RHEL 6 PATCH] bonding: Always add vid to new slave group
5
6If a bonded device has a vid added to it, we need to unilaterally add that vid
7to the slaves now, otherwise we can't receive frames on that vid. This happened
8to work before because the slave shared a vlan group with the bond master, but
9that is no longer the case.
10
11Signed-off-by: Neil Horman <nhorman@redhat.com>
12---
13 drivers/net/bonding/bond_main.c | 55 +++++++++++++++++++--------------------
14 1 files changed, 27 insertions(+), 28 deletions(-)
15
16diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
17index 23c21b5..53fb138 100644
18--- a/drivers/net/bonding/bond_main.c
19+++ b/drivers/net/bonding/bond_main.c
20@@ -566,39 +566,38 @@ static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid)
21 struct net_device *slave_dev = slave->dev;
22 const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
23
24- if ((slave_dev->features & NETIF_F_HW_VLAN_FILTER) &&
25- slave_ops->ndo_vlan_rx_add_vid) {
26
27- /* We only inform the hardware of vlan 0, don't store it in the group */
28- if (vid) {
29- sgrp = vlan_find_group(slave->dev);
30- if (!sgrp) {
31- pr_err(DRV_NAME ": %s: Could not find vlan group\n",
32- slave->dev->name);
33- continue;
34- }
35-
36- /* Cant add the vid if we can't alloc storage for it */
37- if (vlan_group_prealloc_vid(sgrp, vid)) {
38- pr_err(DRV_NAME ": %s: Could not prealloc vid array\n",
39- slave->dev->name);
40- continue;
41- }
42+ /* We only inform the hardware of vlan 0, don't store it in the group */
43+ if (vid) {
44+ sgrp = vlan_find_group(slave->dev);
45+ if (!sgrp) {
46+ pr_err(DRV_NAME ": %s: Could not find vlan group\n",
47+ slave->dev->name);
48+ continue;
49+ }
50
51- /*
52- * If the slave already has a vlan on that vid, don't overwrite it
53- */
54- if (vlan_group_get_device(sgrp, vid)) {
55- pr_err(DRV_NAME ": %s: vid %d already exists on %s\n",
56- bond_dev->name, vid, slave_dev->name);
57- continue;
58- }
59+ /* Cant add the vid if we can't alloc storage for it */
60+ if (vlan_group_prealloc_vid(sgrp, vid)) {
61+ pr_err(DRV_NAME ": %s: Could not prealloc vid array\n",
62+ slave->dev->name);
63+ continue;
64+ }
65
66- vlan_group_set_device(sgrp, vid, vdev);
67- sgrp->nr_vlans++;
68+ /*
69+ * If the slave already has a vlan on that vid, don't overwrite it
70+ */
71+ if (vlan_group_get_device(sgrp, vid)) {
72+ pr_err(DRV_NAME ": %s: vid %d already exists on %s\n",
73+ bond_dev->name, vid, slave_dev->name);
74+ continue;
75 }
76- slave_ops->ndo_vlan_rx_add_vid(slave_dev, vid);
77+
78+ vlan_group_set_device(sgrp, vid, vdev);
79+ sgrp->nr_vlans++;
80 }
81+ if ((slave_dev->features & NETIF_F_HW_VLAN_FILTER) &&
82+ slave_ops->ndo_vlan_rx_add_vid)
83+ slave_ops->ndo_vlan_rx_add_vid(slave_dev, vid);
84 }
85
86 res = bond_add_vlan(bond, vid);
87--
881.7.7.6
89