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

Function txgbe_write_mbx_pf

dpdk/drivers/net/txgbe/base/txgbe_mbx.c:566–592  ·  view source on GitHub ↗

* txgbe_write_mbx_pf - Places a message in the mailbox * @hw: pointer to the HW structure * @msg: The message buffer * @size: Length of buffer * @vf_number: the VF index * * returns 0 if it successfully copied message into the buffer **/

Source from the content-addressed store, hash-verified

564 * returns 0 if it successfully copied message into the buffer
565 **/
566s32 txgbe_write_mbx_pf(struct txgbe_hw *hw, u32 *msg, u16 size, u16 vf_number)
567{
568 s32 ret_val;
569 u16 i;
570
571 /* lock the mailbox to prevent pf/vf race condition */
572 ret_val = txgbe_obtain_mbx_lock_pf(hw, vf_number);
573 if (ret_val)
574 goto out_no_write;
575
576 /* flush msg and acks as we are overwriting the message buffer */
577 txgbe_check_for_msg_pf(hw, vf_number);
578 txgbe_check_for_ack_pf(hw, vf_number);
579
580 /* copy the caller specified message to the mailbox memory buffer */
581 for (i = 0; i < size; i++)
582 wr32a(hw, TXGBE_MBMEM(vf_number), i, msg[i]);
583
584 /* Interrupt VF to tell it a message has been sent and release buffer*/
585 wr32(hw, TXGBE_MBCTL(vf_number), TXGBE_MBCTL_STS);
586
587 /* update stats */
588 hw->mbx.stats.msgs_tx++;
589
590out_no_write:
591 return ret_val;
592}
593
594/**
595 * txgbe_read_mbx_pf - Read a message from the mailbox

Callers

nothing calls this directly

Calls 4

txgbe_obtain_mbx_lock_pfFunction · 0.85
txgbe_check_for_msg_pfFunction · 0.85
txgbe_check_for_ack_pfFunction · 0.85
wr32Function · 0.70

Tested by

no test coverage detected