team.c (1c213bd24ad04f4430031d20d740d7783162b099) | team.c (99932d4fc03a13bb3e94938fe25458fabc8f2fc3) |
---|---|
1/* 2 * drivers/net/team/team.c - Network team device driver 3 * Copyright (c) 2011 Jiri Pirko <jpirko@redhat.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 1526 unchanged lines hidden (view full) --- 1535 struct team *team = netdev_priv(dev); 1536 int i; 1537 int err; 1538 1539 team->dev = dev; 1540 mutex_init(&team->lock); 1541 team_set_no_mode(team); 1542 | 1/* 2 * drivers/net/team/team.c - Network team device driver 3 * Copyright (c) 2011 Jiri Pirko <jpirko@redhat.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 1526 unchanged lines hidden (view full) --- 1535 struct team *team = netdev_priv(dev); 1536 int i; 1537 int err; 1538 1539 team->dev = dev; 1540 mutex_init(&team->lock); 1541 team_set_no_mode(team); 1542 |
1543 team->pcpu_stats = netdev_alloc_pcpu_stats(struct team_pcpu_stats); | 1543 team->pcpu_stats = alloc_percpu(struct team_pcpu_stats); |
1544 if (!team->pcpu_stats) 1545 return -ENOMEM; 1546 | 1544 if (!team->pcpu_stats) 1545 return -ENOMEM; 1546 |
1547 for_each_possible_cpu(i) { 1548 struct team_pcpu_stats *team_stats; 1549 team_stats = per_cpu_ptr(team->pcpu_stats, i); 1550 u64_stats_init(&team_stats->syncp); 1551 } 1552 |
|
1547 for (i = 0; i < TEAM_PORT_HASHENTRIES; i++) 1548 INIT_HLIST_HEAD(&team->en_port_hlist[i]); 1549 INIT_LIST_HEAD(&team->port_list); 1550 err = team_queue_override_init(team); 1551 if (err) 1552 goto err_team_queue_override_init; 1553 1554 team_adjust_ops(team); --- 82 unchanged lines hidden (view full) --- 1637 } else { 1638 this_cpu_inc(team->pcpu_stats->tx_dropped); 1639 } 1640 1641 return NETDEV_TX_OK; 1642} 1643 1644static u16 team_select_queue(struct net_device *dev, struct sk_buff *skb, | 1553 for (i = 0; i < TEAM_PORT_HASHENTRIES; i++) 1554 INIT_HLIST_HEAD(&team->en_port_hlist[i]); 1555 INIT_LIST_HEAD(&team->port_list); 1556 err = team_queue_override_init(team); 1557 if (err) 1558 goto err_team_queue_override_init; 1559 1560 team_adjust_ops(team); --- 82 unchanged lines hidden (view full) --- 1643 } else { 1644 this_cpu_inc(team->pcpu_stats->tx_dropped); 1645 } 1646 1647 return NETDEV_TX_OK; 1648} 1649 1650static u16 team_select_queue(struct net_device *dev, struct sk_buff *skb, |
1645 void *accel_priv) | 1651 void *accel_priv, select_queue_fallback_t fallback) |
1646{ 1647 /* 1648 * This helper function exists to help dev_pick_tx get the correct 1649 * destination queue. Using a helper function skips a call to 1650 * skb_tx_hash and will put the skbs in the queue we expect on their 1651 * way down to the team driver. 1652 */ 1653 u16 txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0; --- 1260 unchanged lines hidden --- | 1652{ 1653 /* 1654 * This helper function exists to help dev_pick_tx get the correct 1655 * destination queue. Using a helper function skips a call to 1656 * skb_tx_hash and will put the skbs in the queue we expect on their 1657 * way down to the team driver. 1658 */ 1659 u16 txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0; --- 1260 unchanged lines hidden --- |