mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
xen/netback: use struct ubuf_info_msgzc
struct ubuf_info will be changed, use ubuf_info_msgzc instead. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
6eaab4dfdd
commit
b63ca3e822
@ -62,7 +62,7 @@ struct pending_tx_info {
|
|||||||
* ubuf_to_vif is a helper which finds the struct xenvif from a pointer
|
* ubuf_to_vif is a helper which finds the struct xenvif from a pointer
|
||||||
* to this field.
|
* to this field.
|
||||||
*/
|
*/
|
||||||
struct ubuf_info callback_struct;
|
struct ubuf_info_msgzc callback_struct;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, XEN_PAGE_SIZE)
|
#define XEN_NETIF_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, XEN_PAGE_SIZE)
|
||||||
|
@ -591,8 +591,8 @@ int xenvif_init_queue(struct xenvif_queue *queue)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAX_PENDING_REQS; i++) {
|
for (i = 0; i < MAX_PENDING_REQS; i++) {
|
||||||
queue->pending_tx_info[i].callback_struct = (struct ubuf_info)
|
queue->pending_tx_info[i].callback_struct = (struct ubuf_info_msgzc)
|
||||||
{ .callback = xenvif_zerocopy_callback,
|
{ { .callback = xenvif_zerocopy_callback },
|
||||||
{ { .ctx = NULL,
|
{ { .ctx = NULL,
|
||||||
.desc = i } } };
|
.desc = i } } };
|
||||||
queue->grant_tx_handle[i] = NETBACK_INVALID_HANDLE;
|
queue->grant_tx_handle[i] = NETBACK_INVALID_HANDLE;
|
||||||
|
@ -133,7 +133,7 @@ static inline unsigned long idx_to_kaddr(struct xenvif_queue *queue,
|
|||||||
|
|
||||||
/* Find the containing VIF's structure from a pointer in pending_tx_info array
|
/* Find the containing VIF's structure from a pointer in pending_tx_info array
|
||||||
*/
|
*/
|
||||||
static inline struct xenvif_queue *ubuf_to_queue(const struct ubuf_info *ubuf)
|
static inline struct xenvif_queue *ubuf_to_queue(const struct ubuf_info_msgzc *ubuf)
|
||||||
{
|
{
|
||||||
u16 pending_idx = ubuf->desc;
|
u16 pending_idx = ubuf->desc;
|
||||||
struct pending_tx_info *temp =
|
struct pending_tx_info *temp =
|
||||||
@ -1228,11 +1228,12 @@ static int xenvif_tx_submit(struct xenvif_queue *queue)
|
|||||||
return work_done;
|
return work_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
void xenvif_zerocopy_callback(struct sk_buff *skb, struct ubuf_info *ubuf,
|
void xenvif_zerocopy_callback(struct sk_buff *skb, struct ubuf_info *ubuf_base,
|
||||||
bool zerocopy_success)
|
bool zerocopy_success)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
pending_ring_idx_t index;
|
pending_ring_idx_t index;
|
||||||
|
struct ubuf_info_msgzc *ubuf = uarg_to_msgzc(ubuf_base);
|
||||||
struct xenvif_queue *queue = ubuf_to_queue(ubuf);
|
struct xenvif_queue *queue = ubuf_to_queue(ubuf);
|
||||||
|
|
||||||
/* This is the only place where we grab this lock, to protect callbacks
|
/* This is the only place where we grab this lock, to protect callbacks
|
||||||
@ -1241,7 +1242,7 @@ void xenvif_zerocopy_callback(struct sk_buff *skb, struct ubuf_info *ubuf,
|
|||||||
spin_lock_irqsave(&queue->callback_lock, flags);
|
spin_lock_irqsave(&queue->callback_lock, flags);
|
||||||
do {
|
do {
|
||||||
u16 pending_idx = ubuf->desc;
|
u16 pending_idx = ubuf->desc;
|
||||||
ubuf = (struct ubuf_info *) ubuf->ctx;
|
ubuf = (struct ubuf_info_msgzc *) ubuf->ctx;
|
||||||
BUG_ON(queue->dealloc_prod - queue->dealloc_cons >=
|
BUG_ON(queue->dealloc_prod - queue->dealloc_cons >=
|
||||||
MAX_PENDING_REQS);
|
MAX_PENDING_REQS);
|
||||||
index = pending_index(queue->dealloc_prod);
|
index = pending_index(queue->dealloc_prod);
|
||||||
|
Loading…
Reference in New Issue
Block a user