Lines Matching refs:nn
133 static int nfp_net_ipsec_cfg(struct nfp_net *nn, struct nfp_mbox_amsg_entry *entry) in nfp_net_ipsec_cfg() argument
135 unsigned int offset = nn->tlv_caps.mbox_off + NFP_NET_CFG_MBOX_SIMPLE_VAL; in nfp_net_ipsec_cfg()
139 ret = nfp_net_mbox_lock(nn, sizeof(*msg)); in nfp_net_ipsec_cfg()
145 nn_writel(nn, offset + 4 * i, msg->raw[i]); in nfp_net_ipsec_cfg()
147 ret = nfp_net_mbox_reconfig(nn, entry->cmd); in nfp_net_ipsec_cfg()
149 nn_ctrl_bar_unlock(nn); in nfp_net_ipsec_cfg()
155 msg->raw[i] = nn_readl(nn, offset + 4 * i); in nfp_net_ipsec_cfg()
157 nn_ctrl_bar_unlock(nn); in nfp_net_ipsec_cfg()
276 struct nfp_net *nn; in nfp_net_xfrm_add_state() local
279 nn = netdev_priv(netdev); in nfp_net_xfrm_add_state()
339 if (nn->pdev->device == PCI_DEVICE_ID_NFP3800) { in nfp_net_xfrm_add_state()
386 if (nn->pdev->device != PCI_DEVICE_ID_NFP3800) { in nfp_net_xfrm_add_state()
414 if (nn->pdev->device == PCI_DEVICE_ID_NFP3800) { in nfp_net_xfrm_add_state()
526 err = xa_alloc(&nn->xa_ipsec, &saidx, x, in nfp_net_xfrm_add_state()
536 err = nfp_net_sched_mbox_amsg_work(nn, NFP_NET_CFG_MBOX_CMD_IPSEC, &msg, in nfp_net_xfrm_add_state()
539 xa_erase(&nn->xa_ipsec, saidx); in nfp_net_xfrm_add_state()
556 struct nfp_net *nn; in nfp_net_xfrm_del_state() local
559 nn = netdev_priv(netdev); in nfp_net_xfrm_del_state()
560 err = nfp_net_sched_mbox_amsg_work(nn, NFP_NET_CFG_MBOX_CMD_IPSEC, &msg, in nfp_net_xfrm_del_state()
563 nn_warn(nn, "Failed to invalidate SA in hardware\n"); in nfp_net_xfrm_del_state()
565 xa_erase(&nn->xa_ipsec, x->xso.offload_handle - 1); in nfp_net_xfrm_del_state()
584 void nfp_net_ipsec_init(struct nfp_net *nn) in nfp_net_ipsec_init() argument
586 if (!(nn->cap_w1 & NFP_NET_CFG_CTRL_IPSEC)) in nfp_net_ipsec_init()
589 xa_init_flags(&nn->xa_ipsec, XA_FLAGS_ALLOC); in nfp_net_ipsec_init()
590 nn->dp.netdev->xfrmdev_ops = &nfp_net_ipsec_xfrmdev_ops; in nfp_net_ipsec_init()
593 void nfp_net_ipsec_clean(struct nfp_net *nn) in nfp_net_ipsec_clean() argument
595 if (!(nn->cap_w1 & NFP_NET_CFG_CTRL_IPSEC)) in nfp_net_ipsec_clean()
598 WARN_ON(!xa_empty(&nn->xa_ipsec)); in nfp_net_ipsec_clean()
599 xa_destroy(&nn->xa_ipsec); in nfp_net_ipsec_clean()
625 struct nfp_net *nn; in nfp_net_ipsec_rx() local
628 nn = netdev_priv(netdev); in nfp_net_ipsec_rx()
638 xa_lock(&nn->xa_ipsec); in nfp_net_ipsec_rx()
639 x = xa_load(&nn->xa_ipsec, saidx); in nfp_net_ipsec_rx()
640 xa_unlock(&nn->xa_ipsec); in nfp_net_ipsec_rx()