macvtap: Return error when macvlan drops the packet
Subsystems (2)
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
@@ -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();
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
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