提交 f8628d40 编写于 作者: J John Fastabend 提交者: 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: NJohn Fastabend <john.r.fastabend@intel.com>
Tested-by: NRoss Brattain <ross.b.brattain@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册