Lines Matching refs:vfidx
147 static int liquidio_set_vf_link_state(struct net_device *netdev, int vfidx,
2805 static int __liquidio_set_vf_mac(struct net_device *netdev, int vfidx, in __liquidio_set_vf_mac() argument
2816 if (vfidx < 0 || vfidx >= oct->sriov_info.max_vfs) in __liquidio_set_vf_mac()
2824 nctrl.ncmd.s.param1 = vfidx + 1; in __liquidio_set_vf_mac()
2837 oct->sriov_info.vf_macaddr[vfidx] = nctrl.udd[0]; in __liquidio_set_vf_mac()
2846 static int liquidio_set_vf_mac(struct net_device *netdev, int vfidx, u8 *mac) in liquidio_set_vf_mac() argument
2852 if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) in liquidio_set_vf_mac()
2855 retval = __liquidio_set_vf_mac(netdev, vfidx, mac, true); in liquidio_set_vf_mac()
2857 cn23xx_tell_vf_its_macaddr_changed(oct, vfidx, mac); in liquidio_set_vf_mac()
2862 static int liquidio_set_vf_spoofchk(struct net_device *netdev, int vfidx, in liquidio_set_vf_spoofchk() argument
2876 if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) { in liquidio_set_vf_spoofchk()
2877 netif_info(lio, drv, lio->netdev, "Invalid vfidx %d\n", vfidx); in liquidio_set_vf_spoofchk()
2882 if (oct->sriov_info.vf_spoofchk[vfidx]) in liquidio_set_vf_spoofchk()
2886 if (!oct->sriov_info.vf_spoofchk[vfidx]) in liquidio_set_vf_spoofchk()
2894 vfidx + 1; /* vfidx is 0 based, in liquidio_set_vf_spoofchk()
2906 "Failed to set VF %d spoofchk %s\n", vfidx, in liquidio_set_vf_spoofchk()
2911 oct->sriov_info.vf_spoofchk[vfidx] = enable; in liquidio_set_vf_spoofchk()
2912 netif_info(lio, drv, lio->netdev, "VF %u spoofchk is %s\n", vfidx, in liquidio_set_vf_spoofchk()
2918 static int liquidio_set_vf_vlan(struct net_device *netdev, int vfidx, in liquidio_set_vf_vlan() argument
2927 if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) in liquidio_set_vf_vlan()
2941 if (oct->sriov_info.vf_vlantci[vfidx] == vlantci) in liquidio_set_vf_vlan()
2953 vfidx + 1; /* vfidx is 0 based, but vf_num (param2) is 1 based */ in liquidio_set_vf_vlan()
2965 oct->sriov_info.vf_vlantci[vfidx] = vlantci; in liquidio_set_vf_vlan()
2970 static int liquidio_get_vf_config(struct net_device *netdev, int vfidx, in liquidio_get_vf_config() argument
2977 if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) in liquidio_get_vf_config()
2982 ivi->vf = vfidx; in liquidio_get_vf_config()
2983 macaddr = 2 + (u8 *)&oct->sriov_info.vf_macaddr[vfidx]; in liquidio_get_vf_config()
2985 ivi->vlan = oct->sriov_info.vf_vlantci[vfidx] & VLAN_VID_MASK; in liquidio_get_vf_config()
2986 ivi->qos = oct->sriov_info.vf_vlantci[vfidx] >> VLAN_PRIO_SHIFT; in liquidio_get_vf_config()
2988 oct->sriov_info.trusted_vf.id == vfidx) in liquidio_get_vf_config()
2992 ivi->linkstate = oct->sriov_info.vf_linkstate[vfidx]; in liquidio_get_vf_config()
2993 ivi->spoofchk = oct->sriov_info.vf_spoofchk[vfidx]; in liquidio_get_vf_config()
3000 static int liquidio_send_vf_trust_cmd(struct lio *lio, int vfidx, bool trusted) in liquidio_send_vf_trust_cmd() argument
3014 OPCODE_NIC_SET_TRUSTED_VF, 0, vfidx + 1, in liquidio_send_vf_trust_cmd()
3036 static int liquidio_set_vf_trust(struct net_device *netdev, int vfidx, in liquidio_set_vf_trust() argument
3047 if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) { in liquidio_set_vf_trust()
3048 netif_info(lio, drv, lio->netdev, "Invalid vfidx %d\n", vfidx); in liquidio_set_vf_trust()
3056 oct->sriov_info.trusted_vf.id == vfidx) in liquidio_set_vf_trust()
3070 if (!liquidio_send_vf_trust_cmd(lio, vfidx, setting)) { in liquidio_set_vf_trust()
3072 oct->sriov_info.trusted_vf.id = vfidx; in liquidio_set_vf_trust()
3078 netif_info(lio, drv, lio->netdev, "VF %u is %strusted\n", vfidx, in liquidio_set_vf_trust()
3088 static int liquidio_set_vf_link_state(struct net_device *netdev, int vfidx, in liquidio_set_vf_link_state() argument
3096 if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) in liquidio_set_vf_link_state()
3099 if (oct->sriov_info.vf_linkstate[vfidx] == linkstate) in liquidio_set_vf_link_state()
3105 vfidx + 1; /* vfidx is 0 based, but vf_num (param1) is 1 based */ in liquidio_set_vf_link_state()
3114 oct->sriov_info.vf_linkstate[vfidx] = linkstate; in liquidio_set_vf_link_state()
3191 static int liquidio_get_vf_stats(struct net_device *netdev, int vfidx, in liquidio_get_vf_stats() argument
3199 if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced) in liquidio_get_vf_stats()
3203 ret = cn23xx_get_vf_stats(oct, vfidx, &stats); in liquidio_get_vf_stats()