Commit f8628d40 authored by John Fastabend's avatar John Fastabend Committed by Jeff Kirsher

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: default avatarJohn Fastabend <john.r.fastabend@intel.com>
Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 3032309b
...@@ -709,6 +709,35 @@ static int ixgbe_dcbnl_ieee_setpfc(struct net_device *dev, ...@@ -709,6 +709,35 @@ static int ixgbe_dcbnl_ieee_setpfc(struct net_device *dev,
return err; return err;
} }
static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev,
struct dcb_app *app)
{
struct ixgbe_adapter *adapter = netdev_priv(dev);
if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE))
return -EINVAL;
#ifdef IXGBE_FCOE
if (app->selector == 1 && app->protocol == ETH_P_FCOE) {
if (adapter->fcoe.tc == app->priority)
goto setapp;
/* In IEEE mode map up to tc 1:1 */
adapter->fcoe.tc = app->priority;
adapter->fcoe.up = app->priority;
/* Force hardware reset required to push FCoE
* setup on {tx|rx}_rings
*/
adapter->dcb_set_bitmap |= BIT_APP_UPCHG;
ixgbe_dcbnl_set_all(dev);
}
setapp:
#endif
dcb_setapp(dev, app);
return 0;
}
static u8 ixgbe_dcbnl_getdcbx(struct net_device *dev) static u8 ixgbe_dcbnl_getdcbx(struct net_device *dev)
{ {
struct ixgbe_adapter *adapter = netdev_priv(dev); struct ixgbe_adapter *adapter = netdev_priv(dev);
...@@ -759,6 +788,7 @@ const struct dcbnl_rtnl_ops dcbnl_ops = { ...@@ -759,6 +788,7 @@ const struct dcbnl_rtnl_ops dcbnl_ops = {
.ieee_setets = ixgbe_dcbnl_ieee_setets, .ieee_setets = ixgbe_dcbnl_ieee_setets,
.ieee_getpfc = ixgbe_dcbnl_ieee_getpfc, .ieee_getpfc = ixgbe_dcbnl_ieee_getpfc,
.ieee_setpfc = ixgbe_dcbnl_ieee_setpfc, .ieee_setpfc = ixgbe_dcbnl_ieee_setpfc,
.ieee_setapp = ixgbe_dcbnl_ieee_setapp,
.getstate = ixgbe_dcbnl_get_state, .getstate = ixgbe_dcbnl_get_state,
.setstate = ixgbe_dcbnl_set_state, .setstate = ixgbe_dcbnl_set_state,
.getpermhwaddr = ixgbe_dcbnl_get_perm_hw_addr, .getpermhwaddr = ixgbe_dcbnl_get_perm_hw_addr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment