team: bcast: convert return value of team_dev_queue_xmit() to bool correctly
Subsystems (3)
Jiri Pirko
maintainerPATCH 1/1 team: bcast: convert return value of team_dev_queue_xmit() to bool correctly
The thing is that team_dev_queue_xmit() returns NET_XMIT_* or -E*. bc_trasmit() should return true in case all went well. So use ! to get correct retval from team_dev_queue_xmit() result.
This bug caused iface statistics to be badly computed.
--- drivers/net/team/team_mode_broadcast.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/team/team_mode_broadcast.c +3 -3
@@ -29,8 +29,8 @@ static bool bc_transmit(struct team *team, struct sk_buff *skb)if (last) { skb2 =skb_clone (skb,GFP_ATOMIC );if (skb2) { - ret =team_dev_queue_xmit (team, last, - skb2); + ret = !team_dev_queue_xmit (team, last, + skb2);if (!sum_ret) sum_ret = ret; }
@@ -39,7 +39,7 @@ static bool bc_transmit(struct team *team, struct sk_buff *skb) } }if (last) { - ret =team_dev_queue_xmit (team, last, skb); + ret = !team_dev_queue_xmit (team, last, skb);if (!sum_ret) sum_ret = ret; }
Signature · 1 line
1.8.0
Jiri Pirko
maintainerI forgot to mention this bug was introduced by:
team: add broadcast mode (5fc889911a99043a97da1daa0d010ad72cbc3042)
Quoted 38 lines · Wed, Nov 21, 2012 at 01:34:45PM CET, [email protected] wrote:
The thing is that
team_dev_queue_xmit()returns NET_XMIT_* or -E*.bc_trasmit()should return true in case all went well. So use ! to get correct retval fromteam_dev_queue_xmit()result.
This bug caused iface statistics to be badly computed.Reported-by Dan Carpenter <[email protected]>Signed-off-by Jiri Pirko <[email protected]>---
drivers/net/team/team_mode_broadcast.c| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)drivers/net/team/team_mode_broadcast.c +3
-3@@ -29,8 +29,8 @@ static bool bc_transmit(struct team *team, struct sk_buff *skb)if (last) { skb2 =skb_clone (skb,GFP_ATOMIC );if (skb2) { - ret =team_dev_queue_xmit (team, last, - skb2); + ret = !team_dev_queue_xmit (team, last, + skb2);if (!sum_ret) sum_ret = ret; }@@ -39,7 +39,7 @@ static bool bc_transmit(struct team *team, struct sk_buff *skb) } }if (last) { - ret =team_dev_queue_xmit (team, last, skb); + ret = !team_dev_queue_xmit (team, last, skb);if (!sum_ret) sum_ret = ret; }Signature · 1 line
1.8.0
David Miller
maintainerFrom: Jiri Pirko <[email protected]>
Date: Wed, 21 Nov 2012 13:53:28 +0100
Quoted 12 lines
I forgot to mention this bug was introduced by:
team: add broadcast mode (5fc889911a99043a97da1daa0d010ad72cbc3042)Quoted 7 lines · Wed, Nov 21, 2012 at 01:34:45PM CET, [email protected] wrote:
The thing is that
team_dev_queue_xmit()returns NET_XMIT_* or -E*.bc_trasmit()should return true in case all went well. So use ! to get correct retval fromteam_dev_queue_xmit()result.
This bug caused iface statistics to be badly computed.Reported-by Dan Carpenter <[email protected]>Signed-off-by Jiri Pirko <[email protected]>
I incorporated the reference to the bug introducing commit and applied this patch, thanks.