MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ngbe_set_vf_macvlan_msg

Function ngbe_set_vf_macvlan_msg

dpdk/drivers/net/ngbe/ngbe_pf.c:592–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

590}
591
592static int
593ngbe_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
621static int
622ngbe_rcv_msg_from_vf(struct rte_eth_dev *eth_dev, uint16_t vf)

Callers 1

ngbe_rcv_msg_from_vfFunction · 0.85

Calls 2

ngbe_dev_hwFunction · 0.85

Tested by

no test coverage detected