diff options
author | Dan Aloni <da-x@monatomic.org> | 2007-03-02 23:44:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-03-02 23:44:51 -0500 |
commit | 5c15bdec5c38f4ccf73ef2585fc80a6164de9554 (patch) | |
tree | c99084e96238eb9ce40e8d9d90e0097c4e92111d /drivers/net/cxgb3 | |
parent | b5284e5aa94be2f88dc92b29e97aff3da0c45f9f (diff) |
[VLAN]: Avoid a 4-order allocation.
This patch splits the vlan_group struct into a multi-allocated struct. On
x86_64, the size of the original struct is a little more than 32KB, causing
a 4-order allocation, which is prune to problems caused by buddy-system
external fragmentation conditions.
I couldn't just use vmalloc() because vfree() cannot be called in the
softirq context of the RCU callback.
Signed-off-by: Dan Aloni <da-x@monatomic.org>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_offload.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c index b2cf5f6feb4a..f6ed033efb56 100644 --- a/drivers/net/cxgb3/cxgb3_offload.c +++ b/drivers/net/cxgb3/cxgb3_offload.c | |||
@@ -160,14 +160,16 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter, | |||
160 | int i; | 160 | int i; |
161 | 161 | ||
162 | for_each_port(adapter, i) { | 162 | for_each_port(adapter, i) { |
163 | const struct vlan_group *grp; | 163 | struct vlan_group *grp; |
164 | struct net_device *dev = adapter->port[i]; | 164 | struct net_device *dev = adapter->port[i]; |
165 | const struct port_info *p = netdev_priv(dev); | 165 | const struct port_info *p = netdev_priv(dev); |
166 | 166 | ||
167 | if (!memcmp(dev->dev_addr, mac, ETH_ALEN)) { | 167 | if (!memcmp(dev->dev_addr, mac, ETH_ALEN)) { |
168 | if (vlan && vlan != VLAN_VID_MASK) { | 168 | if (vlan && vlan != VLAN_VID_MASK) { |
169 | grp = p->vlan_grp; | 169 | grp = p->vlan_grp; |
170 | dev = grp ? grp->vlan_devices[vlan] : NULL; | 170 | dev = NULL; |
171 | if (grp) | ||
172 | dev = vlan_group_get_device(grp, vlan); | ||
171 | } else | 173 | } else |
172 | while (dev->master) | 174 | while (dev->master) |
173 | dev = dev->master; | 175 | dev = dev->master; |