of them do).
int prepare_xmit_allocate_grant2(struct netchannel2_ring_pair *ncrp,
struct sk_buff *skb,
int use_subpage_grants);
-void xmit_grant(struct netchannel2_ring_pair *ncrp,
- struct sk_buff *skb,
- int use_subpage_grants,
- volatile void *msg);
+int xmit_grant(struct netchannel2_ring_pair *ncrp,
+ struct sk_buff *skb,
+ int use_subpage_grants,
+ volatile void *msg);
int prepare_xmit_allocate_post(struct netchannel2 *nc,
struct sk_buff *skb);
-void xmit_post(struct netchannel2 *nc,
- struct sk_buff *skb,
- volatile void *msg);
+int xmit_post(struct netchannel2 *nc,
+ struct sk_buff *skb,
+ volatile void *msg);
void nc2_replenish_rx_buffers(struct netchannel2 *nc);
return 0;
}
-void xmit_post(struct netchannel2 *nc, struct sk_buff *skb,
- volatile void *msg_buf)
+int xmit_post(struct netchannel2 *nc, struct sk_buff *skb,
+ volatile void *msg_buf)
{
volatile struct netchannel2_msg_packet *msg = msg_buf;
struct skb_cb_overlay *scb;
this packet are now available for the other end to
fill with new buffers. */
list_splice(&scb->buffers, &nc->unused_tx_buffer_slots);
+
+ return 0;
}
/* The other endpoint has sent us a transmit buffer. Add it to the
return 0;
}
-void xmit_grant(struct netchannel2_ring_pair *ncrp,
- struct sk_buff *skb,
- int use_subpage_grants,
- volatile void *msg_buf)
+int xmit_grant(struct netchannel2_ring_pair *ncrp,
+ struct sk_buff *skb,
+ int use_subpage_grants,
+ volatile void *msg_buf)
{
volatile struct netchannel2_msg_packet *msg = msg_buf;
struct skb_cb_overlay *skb_co = get_skb_overlay(skb);
ncrp->interface->extant_bypasses < ncrp->interface->max_bypasses)
msg->flags |= NC2_PACKET_FLAG_bypass_candidate;
#endif
+
+ return 0;
}
switch (skb_co->policy) {
#ifdef CONFIG_XEN_NETDEV2_VMQ
case transmit_policy_vmq:
- xmit_vmq(nc, skb, msg);
+ r = xmit_vmq(nc, skb, msg);
break;
#endif
case transmit_policy_small:
/* Nothing to do */
+ r = 0;
break;
case transmit_policy_grant:
- xmit_grant(ncrp, skb, 1, msg);
+ r = xmit_grant(ncrp, skb, 1, msg);
break;
case transmit_policy_post:
- xmit_post(nc, skb, msg);
+ r = xmit_post(nc, skb, msg);
break;
case transmit_policy_map:
- xmit_grant(ncrp, skb, 0, msg);
+ r = xmit_grant(ncrp, skb, 0, msg);
break;
default:
BUG();
}
+ if (r < 0)
+ return r;
+
/* The transmission method may have decided not to use all the
fragments it reserved, which changes the message size. */
msg_size = get_transmitted_packet_msg_size(skb);
msg->hdr.size = msg_size;
-
ncrp->prod_ring.prod_pvt += msg_size;
BUG_ON(ncrp->prod_ring.bytes_available < msg_size);