| 330 | } |
| 331 | |
| 332 | static int |
| 333 | ngbe_vf_reset(struct rte_eth_dev *eth_dev, uint16_t vf, uint32_t *msgbuf) |
| 334 | { |
| 335 | struct ngbe_hw *hw = ngbe_dev_hw(eth_dev); |
| 336 | struct ngbe_vf_info *vfinfo = *(NGBE_DEV_VFDATA(eth_dev)); |
| 337 | unsigned char *vf_mac = vfinfo[vf].vf_mac_addresses; |
| 338 | int rar_entry = hw->mac.num_rar_entries - (vf + 1); |
| 339 | uint8_t *new_mac = (uint8_t *)(&msgbuf[1]); |
| 340 | |
| 341 | ngbe_vf_reset_msg(eth_dev, vf); |
| 342 | |
| 343 | hw->mac.set_rar(hw, rar_entry, vf_mac, vf, true); |
| 344 | |
| 345 | /* Disable multicast promiscuous at reset */ |
| 346 | ngbe_disable_vf_mc_promisc(eth_dev, vf); |
| 347 | |
| 348 | /* reply to reset with ack and vf mac address */ |
| 349 | msgbuf[0] = NGBE_VF_RESET | NGBE_VT_MSGTYPE_ACK; |
| 350 | rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN); |
| 351 | /* |
| 352 | * Piggyback the multicast filter type so VF can compute the |
| 353 | * correct vectors |
| 354 | */ |
| 355 | msgbuf[3] = hw->mac.mc_filter_type; |
| 356 | ngbe_write_mbx(hw, msgbuf, NGBE_VF_PERMADDR_MSG_LEN, vf); |
| 357 | |
| 358 | return 0; |
| 359 | } |
| 360 | |
| 361 | static int |
| 362 | ngbe_vf_set_mac_addr(struct rte_eth_dev *eth_dev, |
no test coverage detected