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

Function ngbe_vf_reset

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

Source from the content-addressed store, hash-verified

330}
331
332static int
333ngbe_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
361static int
362ngbe_vf_set_mac_addr(struct rte_eth_dev *eth_dev,

Callers 1

ngbe_rcv_msg_from_vfFunction · 0.85

Calls 5

ngbe_dev_hwFunction · 0.85
ngbe_vf_reset_msgFunction · 0.85
ngbe_write_mbxFunction · 0.85
rte_memcpyFunction · 0.50

Tested by

no test coverage detected