| 590 | } |
| 591 | |
| 592 | static int |
| 593 | ngbe_set_vf_macvlan_msg(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) |
| 594 | { |
| 595 | struct ngbe_hw *hw = ngbe_dev_hw(dev); |
| 596 | struct ngbe_vf_info *vf_info = *(NGBE_DEV_VFDATA(dev)); |
| 597 | uint8_t *new_mac = (uint8_t *)(&msgbuf[1]); |
| 598 | struct rte_ether_addr *ea = (struct rte_ether_addr *)new_mac; |
| 599 | int index = (msgbuf[0] & NGBE_VT_MSGINFO_MASK) >> |
| 600 | NGBE_VT_MSGINFO_SHIFT; |
| 601 | |
| 602 | if (index) { |
| 603 | if (!rte_is_valid_assigned_ether_addr(ea)) { |
| 604 | PMD_DRV_LOG(ERR, "set invalid mac vf:%d", vf); |
| 605 | return -1; |
| 606 | } |
| 607 | |
| 608 | vf_info[vf].mac_count++; |
| 609 | |
| 610 | hw->mac.set_rar(hw, vf_info[vf].mac_count, |
| 611 | new_mac, vf, true); |
| 612 | } else { |
| 613 | if (vf_info[vf].mac_count) { |
| 614 | hw->mac.clear_rar(hw, vf_info[vf].mac_count); |
| 615 | vf_info[vf].mac_count = 0; |
| 616 | } |
| 617 | } |
| 618 | return 0; |
| 619 | } |
| 620 | |
| 621 | static int |
| 622 | ngbe_rcv_msg_from_vf(struct rte_eth_dev *eth_dev, uint16_t vf) |
no test coverage detected