Skip to contentSkip to conversation

macvtap: Return error when macvlan drops the packet

PATCH In review Shirley Ma 2 participants 3 messages Jul 12, 2010 – Jul 13, 2010

Subsystems (2)
lore
Share & tools
lore

Shirley Ma

author
#0 lore raw

PATCH 1/1 macvtap: Return error when macvlan drops the packet

Return err when macvlan dropps the packet.

---
 drivers/net/macvtap.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/macvtap.c +0 -0
index 2b4d59b..36d52b5 100644
@@ -492,9 +492,11 @@ static ssize_t macvtap_get_user(struct

macvtap_queue *q,

rcu_read_lock_bh();
vlan = rcu_dereference(q->vlan);
- if (vlan)
- macvlan_start_xmit(skb, vlan->dev);
- else
+ if (vlan) {
+ err = macvlan_start_xmit(skb, vlan->dev);
+ if (err)
+ count = err;
+ } else
kfree_skb(skb);
rcu_read_unlock_bh();

#1 lore raw
Quoted 2 lines · Shirley Ma

Return err when macvlan dropps the packet.

Can you be more specific why you think this is the right idea?

As far as I can tell, this will return '1' to user space for a dropped packet (NET_XMIT_DROP) or another positive return value. While this might be nice for a user application to know, neither does qemu check for this nor does it match the read(2) documentation.

I fear if we want congestion control to improve, we need to do it differently.

Arnd

author
#2 lore raw

Hello Arnd,

I am working on macvtap zero-copy patch. I found that the packet was silently dropped and packet out of order when using zero-copy. That was a reason I submitted this patch to switch to copy mode when that happens. I think I might need more time to debug why first.

Thanks
Shirley