uint16_t relid;
uint16_t subchannel_id;
uint8_t monitor_id;
+
+ struct vmbus_mon_page *monitor_page;
};
#define VMBUS_MAX_CHANNELS 64
}
static inline void
-vmbus_set_monitor(const struct rte_vmbus_device *dev, uint32_t monitor_id)
+vmbus_set_monitor(const struct vmbus_channel *channel, uint32_t monitor_id)
{
uint32_t *monitor_addr, monitor_mask;
unsigned int trigger_index;
trigger_index = monitor_id / HV_MON_TRIG_LEN;
monitor_mask = 1u << (monitor_id % HV_MON_TRIG_LEN);
- monitor_addr = &dev->monitor_page->trigs[trigger_index].pending;
+ monitor_addr = &channel->monitor_page->trigs[trigger_index].pending;
vmbus_sync_set_bit(monitor_addr, monitor_mask);
}
static void
-vmbus_set_event(const struct rte_vmbus_device *dev,
- const struct vmbus_channel *chan)
+vmbus_set_event(const struct vmbus_channel *chan)
{
- vmbus_set_monitor(dev, chan->monitor_id);
+ vmbus_set_monitor(chan, chan->monitor_id);
}
/*
void
rte_vmbus_chan_signal_tx(const struct vmbus_channel *chan)
{
- const struct rte_vmbus_device *dev = chan->device;
const struct vmbus_br *tbr = &chan->txbr;
/* Make sure all updates are done before signaling host */
if (tbr->vbr->imask)
return;
- vmbus_set_event(dev, chan);
+ vmbus_set_event(chan);
}
if (write_sz <= pending_sz)
return;
- vmbus_set_event(chan->device, chan);
+ vmbus_set_event(chan);
}
int rte_vmbus_chan_recv(struct vmbus_channel *chan, void *data, uint32_t *len,
chan->subchannel_id = subid;
chan->relid = relid;
chan->monitor_id = monitor_id;
+ chan->monitor_page = device->monitor_page;
*new_chan = chan;
err = vmbus_uio_map_rings(chan);
}
hv->vmbus = vmbus;
- hv->rxbuf_res = &vmbus->resource[HV_RECV_BUF_MAP];
- hv->chim_res = &vmbus->resource[HV_SEND_BUF_MAP];
+ hv->rxbuf_res = vmbus->resource[HV_RECV_BUF_MAP];
+ hv->chim_res = vmbus->resource[HV_SEND_BUF_MAP];
hv->port_id = eth_dev->data->port_id;
hv->latency = HN_CHAN_LATENCY_NS;
hv->rx_copybreak = HN_RXCOPY_THRESHOLD;
* Connect RXBUF to NVS.
*/
conn.type = NVS_TYPE_RXBUF_CONN;
- conn.gpadl = hv->rxbuf_res->phys_addr;
+ conn.gpadl = hv->rxbuf_res.phys_addr;
conn.sig = NVS_RXBUF_SIG;
PMD_DRV_LOG(DEBUG, "connect rxbuff va=%p gpad=%#" PRIx64,
- hv->rxbuf_res->addr,
- hv->rxbuf_res->phys_addr);
+ hv->rxbuf_res.addr,
+ hv->rxbuf_res.phys_addr);
error = hn_nvs_execute(hv, &conn, sizeof(conn),
&resp, sizeof(resp),
struct hn_nvs_chim_conn chim;
struct hn_nvs_chim_connresp resp;
uint32_t sectsz;
- unsigned long len = hv->chim_res->len;
+ unsigned long len = hv->chim_res.len;
int error;
/* Connect chimney sending buffer to NVS */
memset(&chim, 0, sizeof(chim));
chim.type = NVS_TYPE_CHIM_CONN;
- chim.gpadl = hv->chim_res->phys_addr;
+ chim.gpadl = hv->chim_res.phys_addr;
chim.sig = NVS_CHIM_SIG;
PMD_DRV_LOG(DEBUG, "connect send buf va=%p gpad=%#" PRIx64,
- hv->chim_res->addr,
- hv->chim_res->phys_addr);
+ hv->chim_res.addr,
+ hv->chim_res.phys_addr);
error = hn_nvs_execute(hv, &chim, sizeof(chim),
&resp, sizeof(resp),
* Use refcount to handle multiple packets in same
* receive buffer section.
*/
- rxbuf = hv->rxbuf_res->addr;
+ rxbuf = hv->rxbuf_res.addr;
iova = rte_mem_virt2iova(rxbuf) + RTE_PTR_DIFF(data, rxbuf);
shinfo = &rxb->shinfo;
{
const struct vmbus_chanpkt_rxbuf *pkt;
const struct hn_nvs_hdr *nvs_hdr = buf;
- uint32_t rxbuf_sz = hv->rxbuf_res->len;
- char *rxbuf = hv->rxbuf_res->addr;
+ uint32_t rxbuf_sz = hv->rxbuf_res.len;
+ char *rxbuf = hv->rxbuf_res.addr;
unsigned int i, hlen, count;
struct hn_rx_bufinfo *rxb;
if (txd->chim_index == NVS_CHIM_IDX_INVALID)
return NULL;
- chim = (uint8_t *)hv->chim_res->addr
+ chim = (uint8_t *)hv->chim_res.addr
+ txd->chim_index * hv->chim_szmax;
txq->agg_txd = txd;
uint32_t link_status;
uint32_t link_speed;
- struct rte_mem_resource *rxbuf_res; /* UIO resource for Rx */
+ struct rte_mem_resource rxbuf_res; /* UIO resource for Rx */
uint32_t rxbuf_section_cnt; /* # of Rx sections */
uint32_t rx_copybreak;
uint32_t rx_extmbuf_enable;
uint64_t rss_offloads;
rte_spinlock_t chim_lock;
- struct rte_mem_resource *chim_res; /* UIO resource for Tx */
+ struct rte_mem_resource chim_res; /* UIO resource for Tx */
struct rte_bitmap *chim_bmap; /* Send buffer map */
void *chim_bmem;
uint32_t tx_copybreak;