netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, dan.carpenter@oracle.com
Subject: Re: [patch net] team: bcast: convert return value of team_dev_queue_xmit() to bool correctly
Date: Wed, 21 Nov 2012 13:53:28 +0100	[thread overview]
Message-ID: <20121121125328.GA6812@minipsycho.orion> (raw)
In-Reply-To: <1353501285-1340-1-git-send-email-jiri@resnulli.us>


I forgot to mention this bug was introduced by:
team: add broadcast mode (5fc889911a99043a97da1daa0d010ad72cbc3042)

Wed, Nov 21, 2012 at 01:34:45PM CET, jiri@resnulli.us 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 from team_dev_queue_xmit() result.
>This bug caused iface statistics to be badly computed.
>
>Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>---
> drivers/net/team/team_mode_broadcast.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/net/team/team_mode_broadcast.c b/drivers/net/team/team_mode_broadcast.c
>index 9db0171..c5db428 100644
>--- a/drivers/net/team/team_mode_broadcast.c
>+++ b/drivers/net/team/team_mode_broadcast.c
>@@ -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;
> 	}
>-- 
>1.8.0
>

  reply	other threads:[~2012-11-21 12:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 12:34 [patch net] team: bcast: convert return value of team_dev_queue_xmit() to bool correctly Jiri Pirko
2012-11-21 12:53 ` Jiri Pirko [this message]
2012-11-21 16:55   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121121125328.GA6812@minipsycho.orion \
    --to=jiri@resnulli.us \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).