aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-02-23 00:57:47 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-03-12 07:10:54 -0500
commitf8628d404505e61bfc63638744656ede69227766 (patch)
tree934e57125f759ebb32cc196afeaa8518606bf5d5 /drivers/net/ixgbe
parent3032309b49622497430ecd2b40ff51fb204c35e8 (diff)
ixgbe: DCB, implement ieee_setapp dcbnl ops
Implement ieee_setapp dcbnl ops in ixgbe. This is required to setup FCoE which requires dedicated resources. If the app data is not for FCoE then no action is taken in ixgbe except to add it to the dcb_app_list. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index d7c456f685ff..8d139f7b393a 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -709,6 +709,35 @@ static int ixgbe_dcbnl_ieee_setpfc(struct net_device *dev,
709 return err; 709 return err;
710} 710}
711 711
712static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev,
713 struct dcb_app *app)
714{
715 struct ixgbe_adapter *adapter = netdev_priv(dev);
716
717 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE))
718 return -EINVAL;
719#ifdef IXGBE_FCOE
720 if (app->selector == 1 && app->protocol == ETH_P_FCOE) {
721 if (adapter->fcoe.tc == app->priority)
722 goto setapp;
723
724 /* In IEEE mode map up to tc 1:1 */
725 adapter->fcoe.tc = app->priority;
726 adapter->fcoe.up = app->priority;
727
728 /* Force hardware reset required to push FCoE
729 * setup on {tx|rx}_rings
730 */
731 adapter->dcb_set_bitmap |= BIT_APP_UPCHG;
732 ixgbe_dcbnl_set_all(dev);
733 }
734
735setapp:
736#endif
737 dcb_setapp(dev, app);
738 return 0;
739}
740
712static u8 ixgbe_dcbnl_getdcbx(struct net_device *dev) 741static u8 ixgbe_dcbnl_getdcbx(struct net_device *dev)
713{ 742{
714 struct ixgbe_adapter *adapter = netdev_priv(dev); 743 struct ixgbe_adapter *adapter = netdev_priv(dev);
@@ -759,6 +788,7 @@ const struct dcbnl_rtnl_ops dcbnl_ops = {
759 .ieee_setets = ixgbe_dcbnl_ieee_setets, 788 .ieee_setets = ixgbe_dcbnl_ieee_setets,
760 .ieee_getpfc = ixgbe_dcbnl_ieee_getpfc, 789 .ieee_getpfc = ixgbe_dcbnl_ieee_getpfc,
761 .ieee_setpfc = ixgbe_dcbnl_ieee_setpfc, 790 .ieee_setpfc = ixgbe_dcbnl_ieee_setpfc,
791 .ieee_setapp = ixgbe_dcbnl_ieee_setapp,
762 .getstate = ixgbe_dcbnl_get_state, 792 .getstate = ixgbe_dcbnl_get_state,
763 .setstate = ixgbe_dcbnl_set_state, 793 .setstate = ixgbe_dcbnl_set_state,
764 .getpermhwaddr = ixgbe_dcbnl_get_perm_hw_addr, 794 .getpermhwaddr = ixgbe_dcbnl_get_perm_hw_addr,