Lines Matching refs:nn
50 static struct nfp_dcb *get_dcb_priv(struct nfp_net *nn) in get_dcb_priv() argument
52 struct nfp_dcb *dcb = &((struct nfp_app_nic_private *)nn->app_priv)->dcb; in get_dcb_priv()
72 struct nfp_net *nn = netdev_priv(dev); in nfp_nic_dcbnl_ieee_getets() local
75 dcb = get_dcb_priv(nn); in nfp_nic_dcbnl_ieee_getets()
86 static bool nfp_refresh_tc2idx(struct nfp_net *nn) in nfp_refresh_tc2idx() argument
93 dcb = get_dcb_priv(nn); in nfp_refresh_tc2idx()
116 static int nfp_fill_maxrate(struct nfp_net *nn, u64 *max_rate_array) in nfp_fill_maxrate() argument
118 struct nfp_app *app = nn->app; in nfp_fill_maxrate()
122 dcb = get_dcb_priv(nn); in nfp_fill_maxrate()
150 struct nfp_net *nn = netdev_priv(dev); in update_dscp_maxrate() local
154 dcb = get_dcb_priv(nn); in update_dscp_maxrate()
156 err = nfp_fill_maxrate(nn, dcb->tc_maxrate); in update_dscp_maxrate()
175 static void nfp_nic_set_trust(struct nfp_net *nn, u32 *update) in nfp_nic_set_trust() argument
180 dcb = get_dcb_priv(nn); in nfp_nic_set_trust()
193 static void nfp_nic_set_enable(struct nfp_net *nn, u32 enable, u32 *update) in nfp_nic_set_enable() argument
198 dcb = get_dcb_priv(nn); in nfp_nic_set_enable()
211 struct nfp_net *nn = netdev_priv(dev); in dcb_ets_check() local
212 struct nfp_app *app = nn->app; in dcb_ets_check()
235 static void nfp_nic_fill_ets(struct nfp_net *nn) in nfp_nic_fill_ets() argument
239 dcb = get_dcb_priv(nn); in nfp_nic_fill_ets()
251 static void nfp_nic_ets_init(struct nfp_net *nn, u32 *update) in nfp_nic_ets_init() argument
253 struct nfp_dcb *dcb = get_dcb_priv(nn); in nfp_nic_ets_init()
258 nfp_nic_fill_ets(nn); in nfp_nic_ets_init()
267 struct nfp_net *nn = netdev_priv(dev); in nfp_nic_dcbnl_ieee_setets() local
268 struct nfp_app *app = nn->app; in nfp_nic_dcbnl_ieee_setets()
278 dcb = get_dcb_priv(nn); in nfp_nic_dcbnl_ieee_setets()
286 change = nfp_refresh_tc2idx(nn); in nfp_nic_dcbnl_ieee_setets()
287 nfp_nic_fill_ets(nn); in nfp_nic_dcbnl_ieee_setets()
300 nfp_nic_set_enable(nn, NFP_DCB_ALL_QOS_ENABLE, &update); in nfp_nic_dcbnl_ieee_setets()
301 nfp_nic_set_trust(nn, &update); in nfp_nic_dcbnl_ieee_setets()
302 err = nfp_net_mbox_lock(nn, NFP_DCB_UPDATE_MSK_SZ); in nfp_nic_dcbnl_ieee_setets()
306 nn_writel(nn, nn->tlv_caps.mbox_off + NFP_NET_CFG_MBOX_SIMPLE_VAL, in nfp_nic_dcbnl_ieee_setets()
310 return nfp_net_mbox_reconfig_and_unlock(nn, cmd); in nfp_nic_dcbnl_ieee_setets()
316 struct nfp_net *nn = netdev_priv(dev); in nfp_nic_dcbnl_ieee_getmaxrate() local
319 dcb = get_dcb_priv(nn); in nfp_nic_dcbnl_ieee_getmaxrate()
331 struct nfp_net *nn = netdev_priv(dev); in nfp_nic_dcbnl_ieee_setmaxrate() local
332 struct nfp_app *app = nn->app; in nfp_nic_dcbnl_ieee_setmaxrate()
337 err = nfp_fill_maxrate(nn, maxrate->tc_maxrate); in nfp_nic_dcbnl_ieee_setmaxrate()
345 dcb = get_dcb_priv(nn); in nfp_nic_dcbnl_ieee_setmaxrate()
348 nfp_nic_set_enable(nn, NFP_DCB_ALL_QOS_ENABLE, &update); in nfp_nic_dcbnl_ieee_setmaxrate()
349 nfp_nic_set_trust(nn, &update); in nfp_nic_dcbnl_ieee_setmaxrate()
350 nfp_nic_ets_init(nn, &update); in nfp_nic_dcbnl_ieee_setmaxrate()
352 err = nfp_net_mbox_lock(nn, NFP_DCB_UPDATE_MSK_SZ); in nfp_nic_dcbnl_ieee_setmaxrate()
356 nn_writel(nn, nn->tlv_caps.mbox_off + NFP_NET_CFG_MBOX_SIMPLE_VAL, in nfp_nic_dcbnl_ieee_setmaxrate()
359 return nfp_net_mbox_reconfig_and_unlock(nn, cmd); in nfp_nic_dcbnl_ieee_setmaxrate()
362 static int nfp_nic_set_trust_status(struct nfp_net *nn, u8 status) in nfp_nic_set_trust_status() argument
369 dcb = get_dcb_priv(nn); in nfp_nic_set_trust_status()
371 err = nfp_fill_maxrate(nn, dcb->tc_maxrate); in nfp_nic_set_trust_status()
379 err = nfp_net_mbox_lock(nn, NFP_DCB_UPDATE_MSK_SZ); in nfp_nic_set_trust_status()
383 nfp_nic_ets_init(nn, &update); in nfp_nic_set_trust_status()
386 nfp_nic_set_enable(nn, NFP_DCB_ALL_QOS_ENABLE, &update); in nfp_nic_set_trust_status()
387 nn_writel(nn, nn->tlv_caps.mbox_off + NFP_NET_CFG_MBOX_SIMPLE_VAL, in nfp_nic_set_trust_status()
390 err = nfp_net_mbox_reconfig_and_unlock(nn, cmd); in nfp_nic_set_trust_status()
399 static int nfp_nic_set_dscp2prio(struct nfp_net *nn, u8 dscp, u8 prio) in nfp_nic_set_dscp2prio() argument
406 err = nfp_net_mbox_lock(nn, NFP_DCB_UPDATE_MSK_SZ); in nfp_nic_set_dscp2prio()
410 dcb = get_dcb_priv(nn); in nfp_nic_set_dscp2prio()
418 nn_writel(nn, nn->tlv_caps.mbox_off + in nfp_nic_set_dscp2prio()
421 err = nfp_net_mbox_reconfig_and_unlock(nn, cmd); in nfp_nic_set_dscp2prio()
433 struct nfp_net *nn = netdev_priv(dev); in nfp_nic_dcbnl_ieee_setapp() local
442 dcb = get_dcb_priv(nn); in nfp_nic_dcbnl_ieee_setapp()
451 err = nfp_nic_set_trust_status(nn, NFP_DCB_TRUST_DSCP); in nfp_nic_dcbnl_ieee_setapp()
458 err = nfp_nic_set_dscp2prio(nn, app->protocol, app->priority); in nfp_nic_dcbnl_ieee_setapp()
480 struct nfp_net *nn = netdev_priv(dev); in nfp_nic_dcbnl_ieee_delapp() local
487 dcb = get_dcb_priv(nn); in nfp_nic_dcbnl_ieee_delapp()
494 err = nfp_nic_set_dscp2prio(nn, app->protocol, 0); in nfp_nic_dcbnl_ieee_delapp()
508 return nfp_nic_set_trust_status(nn, NFP_DCB_TRUST_PCP); in nfp_nic_dcbnl_ieee_delapp()
523 int nfp_nic_dcb_init(struct nfp_net *nn) in nfp_nic_dcb_init() argument
525 struct nfp_app *app = nn->app; in nfp_nic_dcb_init()
529 dcb = get_dcb_priv(nn); in nfp_nic_dcb_init()
530 dcb->cfg_offset = NFP_DCB_CFG_STRIDE * nn->id; in nfp_nic_dcb_init()
558 nn->dp.netdev->dcbnl_ops = &nfp_nic_dcbnl_ops; in nfp_nic_dcb_init()
564 void nfp_nic_dcb_clean(struct nfp_net *nn) in nfp_nic_dcb_clean() argument
568 dcb = get_dcb_priv(nn); in nfp_nic_dcb_clean()