| 432 | } |
| 433 | |
| 434 | static int |
| 435 | ixgbe_vf_reset(struct rte_eth_dev *dev, uint16_t vf, uint32_t *msgbuf) |
| 436 | { |
| 437 | struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 438 | struct ixgbe_vf_info *vfinfo = |
| 439 | *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private)); |
| 440 | unsigned char *vf_mac = vfinfo[vf].vf_mac_addresses; |
| 441 | int rar_entry = hw->mac.num_rar_entries - (vf + 1); |
| 442 | uint8_t *new_mac = (uint8_t *)(&msgbuf[1]); |
| 443 | |
| 444 | ixgbe_vf_reset_msg(dev, vf); |
| 445 | |
| 446 | hw->mac.ops.set_rar(hw, rar_entry, vf_mac, vf, IXGBE_RAH_AV); |
| 447 | |
| 448 | /* Disable multicast promiscuous at reset */ |
| 449 | ixgbe_disable_vf_mc_promisc(dev, vf); |
| 450 | |
| 451 | /* reply to reset with ack and vf mac address */ |
| 452 | msgbuf[0] = IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK; |
| 453 | rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN); |
| 454 | /* |
| 455 | * Piggyback the multicast filter type so VF can compute the |
| 456 | * correct vectors |
| 457 | */ |
| 458 | msgbuf[3] = hw->mac.mc_filter_type; |
| 459 | ixgbe_write_mbx(hw, msgbuf, IXGBE_VF_PERMADDR_MSG_LEN, vf); |
| 460 | |
| 461 | return 0; |
| 462 | } |
| 463 | |
| 464 | static int |
| 465 | ixgbe_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) |
no test coverage detected