mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
net: introduce qemu_get_nic()
To support multiqueue, this patch introduces a helper qemu_get_nic() to get NICState from a NetClientState. The following patches would refactor this helper to support multiqueue. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
b356f76de3
commit
cc1f0f4542
28 changed files with 92 additions and 78 deletions
|
@ -236,7 +236,7 @@ static void net_rx_response(struct XenNetDev *netdev,
|
|||
|
||||
static int net_rx_ok(NetClientState *nc)
|
||||
{
|
||||
struct XenNetDev *netdev = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
struct XenNetDev *netdev = qemu_get_nic_opaque(nc);
|
||||
RING_IDX rc, rp;
|
||||
|
||||
if (netdev->xendev.be_state != XenbusStateConnected) {
|
||||
|
@ -257,7 +257,7 @@ static int net_rx_ok(NetClientState *nc)
|
|||
|
||||
static ssize_t net_rx_packet(NetClientState *nc, const uint8_t *buf, size_t size)
|
||||
{
|
||||
struct XenNetDev *netdev = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
struct XenNetDev *netdev = qemu_get_nic_opaque(nc);
|
||||
netif_rx_request_t rxreq;
|
||||
RING_IDX rc, rp;
|
||||
void *page;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue