summaryrefslogtreecommitdiffstats
path: root/drivers/net/macvlan.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2018-04-03 17:16:03 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-04-25 11:26:19 -0400
commit7d775f63470c3b6ddf34c770c973293ab925a7bb (patch)
tree1e679c12ceda9a6418ba081068537d16ed899477 /drivers/net/macvlan.c
parentb056b83c06e1b01b7091ba81c5883038a0fc2f46 (diff)
macvlan: Rename fwd_priv to accel_priv and add accessor function
This change renames the fwd_priv member to accel_priv as this more accurately reflects the actual purpose of this value. In addition I am adding an accessor which will allow us to further abstract this in the future if needed. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r--drivers/net/macvlan.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 725f4b4afc6d..7ddc94ff4109 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -559,9 +559,9 @@ static netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
559 if (unlikely(netpoll_tx_running(dev))) 559 if (unlikely(netpoll_tx_running(dev)))
560 return macvlan_netpoll_send_skb(vlan, skb); 560 return macvlan_netpoll_send_skb(vlan, skb);
561 561
562 if (vlan->fwd_priv) { 562 if (vlan->accel_priv) {
563 skb->dev = vlan->lowerdev; 563 skb->dev = vlan->lowerdev;
564 ret = dev_queue_xmit_accel(skb, vlan->fwd_priv); 564 ret = dev_queue_xmit_accel(skb, vlan->accel_priv);
565 } else { 565 } else {
566 ret = macvlan_queue_xmit(skb, dev); 566 ret = macvlan_queue_xmit(skb, dev);
567 } 567 }
@@ -613,16 +613,23 @@ static int macvlan_open(struct net_device *dev)
613 goto hash_add; 613 goto hash_add;
614 } 614 }
615 615
616 err = -EBUSY;
617 if (macvlan_addr_busy(vlan->port, dev->dev_addr))
618 goto out;
619
620 /* Attempt to populate accel_priv which is used to offload the L2
621 * forwarding requests for unicast packets.
622 */
616 if (lowerdev->features & NETIF_F_HW_L2FW_DOFFLOAD) { 623 if (lowerdev->features & NETIF_F_HW_L2FW_DOFFLOAD) {
617 vlan->fwd_priv = 624 vlan->accel_priv =
618 lowerdev->netdev_ops->ndo_dfwd_add_station(lowerdev, dev); 625 lowerdev->netdev_ops->ndo_dfwd_add_station(lowerdev, dev);
619 626
620 /* If we get a NULL pointer back, or if we get an error 627 /* If we get a NULL pointer back, or if we get an error
621 * then we should just fall through to the non accelerated path 628 * then we should just fall through to the non accelerated path
622 */ 629 */
623 if (IS_ERR_OR_NULL(vlan->fwd_priv)) { 630 if (IS_ERR_OR_NULL(vlan->accel_priv))
624 vlan->fwd_priv = NULL; 631 vlan->accel_priv = NULL;
625 } else 632 else
626 return 0; 633 return 0;
627 } 634 }
628 635
@@ -655,10 +662,10 @@ clear_multi:
655del_unicast: 662del_unicast:
656 dev_uc_del(lowerdev, dev->dev_addr); 663 dev_uc_del(lowerdev, dev->dev_addr);
657out: 664out:
658 if (vlan->fwd_priv) { 665 if (vlan->accel_priv) {
659 lowerdev->netdev_ops->ndo_dfwd_del_station(lowerdev, 666 lowerdev->netdev_ops->ndo_dfwd_del_station(lowerdev,
660 vlan->fwd_priv); 667 vlan->accel_priv);
661 vlan->fwd_priv = NULL; 668 vlan->accel_priv = NULL;
662 } 669 }
663 return err; 670 return err;
664} 671}
@@ -668,10 +675,10 @@ static int macvlan_stop(struct net_device *dev)
668 struct macvlan_dev *vlan = netdev_priv(dev); 675 struct macvlan_dev *vlan = netdev_priv(dev);
669 struct net_device *lowerdev = vlan->lowerdev; 676 struct net_device *lowerdev = vlan->lowerdev;
670 677
671 if (vlan->fwd_priv) { 678 if (vlan->accel_priv) {
672 lowerdev->netdev_ops->ndo_dfwd_del_station(lowerdev, 679 lowerdev->netdev_ops->ndo_dfwd_del_station(lowerdev,
673 vlan->fwd_priv); 680 vlan->accel_priv);
674 vlan->fwd_priv = NULL; 681 vlan->accel_priv = NULL;
675 return 0; 682 return 0;
676 } 683 }
677 684