Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189039
b: refs/heads/master
c: 669d3e0
h: refs/heads/master
i:
  189037: f96d447
  189035: 9be5d78
  189031: 8f5f15f
  189023: bd9a45d
v: v3
  • Loading branch information
Vasu Dev authored and David S. Miller committed Mar 24, 2010
1 parent 7ab97d8 commit 158bec9
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 31b24b955c3ebbb6f3008a6374e61cf7c05a193c
refs/heads/master: 669d3e0babb40018dd6e78f4093c13a2eac73866
71 changes: 68 additions & 3 deletions trunk/net/8021q/vlan_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,14 @@ static netdev_tx_t vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb,
return ret;
}

static u16 vlan_dev_select_queue(struct net_device *dev, struct sk_buff *skb)
{
struct net_device *rdev = vlan_dev_info(dev)->real_dev;
const struct net_device_ops *ops = rdev->netdev_ops;

return ops->ndo_select_queue(rdev, skb);
}

static int vlan_dev_change_mtu(struct net_device *dev, int new_mtu)
{
/* TODO: gotta make sure the underlying layer can handle it,
Expand Down Expand Up @@ -688,7 +696,8 @@ static const struct header_ops vlan_header_ops = {
.parse = eth_header_parse,
};

static const struct net_device_ops vlan_netdev_ops, vlan_netdev_accel_ops;
static const struct net_device_ops vlan_netdev_ops, vlan_netdev_accel_ops,
vlan_netdev_ops_sq, vlan_netdev_accel_ops_sq;

static int vlan_dev_init(struct net_device *dev)
{
Expand Down Expand Up @@ -722,11 +731,17 @@ static int vlan_dev_init(struct net_device *dev)
if (real_dev->features & NETIF_F_HW_VLAN_TX) {
dev->header_ops = real_dev->header_ops;
dev->hard_header_len = real_dev->hard_header_len;
dev->netdev_ops = &vlan_netdev_accel_ops;
if (real_dev->netdev_ops->ndo_select_queue)
dev->netdev_ops = &vlan_netdev_accel_ops_sq;
else
dev->netdev_ops = &vlan_netdev_accel_ops;
} else {
dev->header_ops = &vlan_header_ops;
dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN;
dev->netdev_ops = &vlan_netdev_ops;
if (real_dev->netdev_ops->ndo_select_queue)
dev->netdev_ops = &vlan_netdev_ops_sq;
else
dev->netdev_ops = &vlan_netdev_ops;
}

if (is_vlan_dev(real_dev))
Expand Down Expand Up @@ -865,6 +880,56 @@ static const struct net_device_ops vlan_netdev_accel_ops = {
#endif
};

static const struct net_device_ops vlan_netdev_ops_sq = {
.ndo_select_queue = vlan_dev_select_queue,
.ndo_change_mtu = vlan_dev_change_mtu,
.ndo_init = vlan_dev_init,
.ndo_uninit = vlan_dev_uninit,
.ndo_open = vlan_dev_open,
.ndo_stop = vlan_dev_stop,
.ndo_start_xmit = vlan_dev_hard_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = vlan_dev_set_mac_address,
.ndo_set_rx_mode = vlan_dev_set_rx_mode,
.ndo_set_multicast_list = vlan_dev_set_rx_mode,
.ndo_change_rx_flags = vlan_dev_change_rx_flags,
.ndo_do_ioctl = vlan_dev_ioctl,
.ndo_neigh_setup = vlan_dev_neigh_setup,
.ndo_get_stats = vlan_dev_get_stats,
#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
.ndo_fcoe_ddp_setup = vlan_dev_fcoe_ddp_setup,
.ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done,
.ndo_fcoe_enable = vlan_dev_fcoe_enable,
.ndo_fcoe_disable = vlan_dev_fcoe_disable,
.ndo_fcoe_get_wwn = vlan_dev_fcoe_get_wwn,
#endif
};

static const struct net_device_ops vlan_netdev_accel_ops_sq = {
.ndo_select_queue = vlan_dev_select_queue,
.ndo_change_mtu = vlan_dev_change_mtu,
.ndo_init = vlan_dev_init,
.ndo_uninit = vlan_dev_uninit,
.ndo_open = vlan_dev_open,
.ndo_stop = vlan_dev_stop,
.ndo_start_xmit = vlan_dev_hwaccel_hard_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = vlan_dev_set_mac_address,
.ndo_set_rx_mode = vlan_dev_set_rx_mode,
.ndo_set_multicast_list = vlan_dev_set_rx_mode,
.ndo_change_rx_flags = vlan_dev_change_rx_flags,
.ndo_do_ioctl = vlan_dev_ioctl,
.ndo_neigh_setup = vlan_dev_neigh_setup,
.ndo_get_stats = vlan_dev_get_stats,
#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
.ndo_fcoe_ddp_setup = vlan_dev_fcoe_ddp_setup,
.ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done,
.ndo_fcoe_enable = vlan_dev_fcoe_enable,
.ndo_fcoe_disable = vlan_dev_fcoe_disable,
.ndo_fcoe_get_wwn = vlan_dev_fcoe_get_wwn,
#endif
};

void vlan_setup(struct net_device *dev)
{
ether_setup(dev);
Expand Down

0 comments on commit 158bec9

Please sign in to comment.