Lines Matching refs:vf_rep
67 static int bnxt_hwrm_vfr_qcfg(struct bnxt *bp, struct bnxt_vf_rep *vf_rep, in bnxt_hwrm_vfr_qcfg() argument
76 req.fid = cpu_to_le16(bp->pf.vf[vf_rep->vf_idx].fw_fid); in bnxt_hwrm_vfr_qcfg()
94 struct bnxt_vf_rep *vf_rep = netdev_priv(dev); in bnxt_vf_rep_open() local
95 struct bnxt *bp = vf_rep->bp; in bnxt_vf_rep_open()
116 struct bnxt_vf_rep *vf_rep = netdev_priv(dev); in bnxt_vf_rep_xmit() local
120 dst_hold((struct dst_entry *)vf_rep->dst); in bnxt_vf_rep_xmit()
121 skb_dst_set(skb, (struct dst_entry *)vf_rep->dst); in bnxt_vf_rep_xmit()
122 skb->dev = vf_rep->dst->u.port_info.lower_dev; in bnxt_vf_rep_xmit()
126 vf_rep->tx_stats.packets++; in bnxt_vf_rep_xmit()
127 vf_rep->tx_stats.bytes += len; in bnxt_vf_rep_xmit()
136 struct bnxt_vf_rep *vf_rep = netdev_priv(dev); in bnxt_vf_rep_get_stats64() local
138 stats->rx_packets = vf_rep->rx_stats.packets; in bnxt_vf_rep_get_stats64()
139 stats->rx_bytes = vf_rep->rx_stats.bytes; in bnxt_vf_rep_get_stats64()
140 stats->tx_packets = vf_rep->tx_stats.packets; in bnxt_vf_rep_get_stats64()
141 stats->tx_bytes = vf_rep->tx_stats.bytes; in bnxt_vf_rep_get_stats64()
148 struct bnxt_vf_rep *vf_rep = cb_priv; in bnxt_vf_rep_setup_tc_block_cb() local
149 struct bnxt *bp = vf_rep->bp; in bnxt_vf_rep_setup_tc_block_cb()
150 int vf_fid = bp->pf.vf[vf_rep->vf_idx].fw_fid; in bnxt_vf_rep_setup_tc_block_cb()
152 if (!bnxt_tc_flower_enabled(vf_rep->bp) || in bnxt_vf_rep_setup_tc_block_cb()
167 struct bnxt_vf_rep *vf_rep = netdev_priv(dev); in bnxt_vf_rep_setup_tc_block() local
176 vf_rep, vf_rep, f->extack); in bnxt_vf_rep_setup_tc_block()
179 bnxt_vf_rep_setup_tc_block_cb, vf_rep); in bnxt_vf_rep_setup_tc_block()
211 struct bnxt_vf_rep *vf_rep = netdev_priv(skb->dev); in bnxt_vf_rep_rx() local
214 rx_stats = &vf_rep->rx_stats; in bnxt_vf_rep_rx()
215 vf_rep->rx_stats.bytes += skb->len; in bnxt_vf_rep_rx()
216 vf_rep->rx_stats.packets++; in bnxt_vf_rep_rx()
224 struct bnxt_vf_rep *vf_rep = netdev_priv(dev); in bnxt_vf_rep_get_phys_port_name() local
225 struct pci_dev *pf_pdev = vf_rep->bp->pdev; in bnxt_vf_rep_get_phys_port_name()
229 vf_rep->vf_idx); in bnxt_vf_rep_get_phys_port_name()
245 struct bnxt_vf_rep *vf_rep = netdev_priv(dev); in bnxt_vf_rep_port_attr_get() local
250 return bnxt_port_attr_get(vf_rep->bp, attr); in bnxt_vf_rep_port_attr_get()
282 struct bnxt_vf_rep *vf_rep; in bnxt_vf_reps_close() local
290 vf_rep = bp->vf_reps[i]; in bnxt_vf_reps_close()
291 if (netif_running(vf_rep->dev)) in bnxt_vf_reps_close()
292 bnxt_vf_rep_close(vf_rep->dev); in bnxt_vf_reps_close()
315 struct bnxt_vf_rep *vf_rep; in __bnxt_vf_reps_destroy() local
319 vf_rep = bp->vf_reps[i]; in __bnxt_vf_reps_destroy()
320 if (vf_rep) { in __bnxt_vf_reps_destroy()
321 dst_release((struct dst_entry *)vf_rep->dst); in __bnxt_vf_reps_destroy()
323 if (vf_rep->tx_cfa_action != CFA_HANDLE_INVALID) in __bnxt_vf_reps_destroy()
324 hwrm_cfa_vfr_free(bp, vf_rep->vf_idx); in __bnxt_vf_reps_destroy()
326 if (vf_rep->dev) { in __bnxt_vf_reps_destroy()
330 if (vf_rep->dev->netdev_ops) in __bnxt_vf_reps_destroy()
331 unregister_netdev(vf_rep->dev); in __bnxt_vf_reps_destroy()
332 free_netdev(vf_rep->dev); in __bnxt_vf_reps_destroy()
389 static void bnxt_vf_rep_netdev_init(struct bnxt *bp, struct bnxt_vf_rep *vf_rep, in bnxt_vf_rep_netdev_init() argument
406 bnxt_vf_rep_eth_addr_gen(bp->pf.mac_addr, vf_rep->vf_idx, in bnxt_vf_rep_netdev_init()
410 if (!bnxt_hwrm_vfr_qcfg(bp, vf_rep, &max_mtu)) in bnxt_vf_rep_netdev_init()
438 struct bnxt_vf_rep *vf_rep; in bnxt_vf_reps_create() local
442 bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL); in bnxt_vf_reps_create()
457 dev = alloc_etherdev(sizeof(*vf_rep)); in bnxt_vf_reps_create()
463 vf_rep = netdev_priv(dev); in bnxt_vf_reps_create()
464 bp->vf_reps[i] = vf_rep; in bnxt_vf_reps_create()
465 vf_rep->dev = dev; in bnxt_vf_reps_create()
466 vf_rep->bp = bp; in bnxt_vf_reps_create()
467 vf_rep->vf_idx = i; in bnxt_vf_reps_create()
468 vf_rep->tx_cfa_action = CFA_HANDLE_INVALID; in bnxt_vf_reps_create()
471 rc = hwrm_cfa_vfr_alloc(bp, vf_rep->vf_idx, in bnxt_vf_reps_create()
472 &vf_rep->tx_cfa_action, in bnxt_vf_reps_create()
473 &vf_rep->rx_cfa_code); in bnxt_vf_reps_create()
478 cfa_code_map[vf_rep->rx_cfa_code] = vf_rep->vf_idx; in bnxt_vf_reps_create()
480 vf_rep->dst = metadata_dst_alloc(0, METADATA_HW_PORT_MUX, in bnxt_vf_reps_create()
482 if (!vf_rep->dst) { in bnxt_vf_reps_create()
487 vf_rep->dst->u.port_info.port_id = vf_rep->tx_cfa_action; in bnxt_vf_reps_create()
488 vf_rep->dst->u.port_info.lower_dev = bp->dev; in bnxt_vf_reps_create()
490 bnxt_vf_rep_netdev_init(bp, vf_rep, dev); in bnxt_vf_reps_create()