netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <amwang@redhat.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: linux-kernel@vger.kernel.org, Jiri Pirko <jpirko@redhat.com>,
	Neil Horman <nhorman@redhat.com>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Herbert Xu <herbert@gondor.hengli.com.au>,
	bonding-devel@lists.sourceforge.net,
	Jay Vosburgh <fubar@us.ibm.com>
Subject: Re: [v2 PATCH 1/2] bonding: sync netpoll code with bridge
Date: Fri, 03 Dec 2010 10:13:12 +0800	[thread overview]
Message-ID: <4CF85238.7010508@redhat.com> (raw)
In-Reply-To: <20101202103650.06647704@nehalam>

On 12/03/10 02:36, Stephen Hemminger wrote:
> On Thu, 2 Dec 2010 08:35:42 -0500
> Amerigo Wang<amwang@redhat.com>  wrote:
>
>>   #ifdef CONFIG_NET_POLL_CONTROLLER
>> -	if (unlikely(bond->dev->priv_flags&  IFF_IN_NETPOLL)) {
>> -		struct netpoll *np = bond->dev->npinfo->netpoll;
>> -		slave_dev->npinfo = bond->dev->npinfo;
>> +	if (unlikely(netpoll_tx_running(slave_dev))) {
>>   		slave_dev->priv_flags |= IFF_IN_NETPOLL;
>> -		netpoll_send_skb_on_dev(np, skb, slave_dev);
>> +		bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb);
>>   		slave_dev->priv_flags&= ~IFF_IN_NETPOLL;
>>   	} else
>>   #endif
>
> Couldn't you eliminate #ifdef by putting the following into header file.
>
> #ifdef CONFIG_NET_POLL_CONTROLLER
> static inline netpoll_tx_running
> ...
> #else
> #define netpoll_tx_running(dev)  (0)
> #endif
>

Oh, nice idea! Will change this in the next update.

Thanks.

      reply	other threads:[~2010-12-03  2:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-02 13:35 [v2 PATCH 1/2] bonding: sync netpoll code with bridge Amerigo Wang
2010-12-02 13:35 ` [v2 PATCH 2/2] netpoll: remove IFF_IN_NETPOLL flag Amerigo Wang
2010-12-02 18:36 ` [v2 PATCH 1/2] bonding: sync netpoll code with bridge Stephen Hemminger
2010-12-03  2:13   ` Cong Wang [this message]

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=4CF85238.7010508@redhat.com \
    --to=amwang@redhat.com \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=fubar@us.ibm.com \
    --cc=herbert@gondor.hengli.com.au \
    --cc=jpirko@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=shemminger@vyatta.com \
    /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).