From: Sergei Shtylyov <sergei.shtylyov@cogentembedded•com>
To: anuradhak@cumulusnetworks•com, davem@davemloft•net, sfeldma@gmail•com
Cc: netdev@vger•kernel.org, roopa@cumulusnetworks•com,
gospo@cumulusnetworks•com, wkok@cumulusnetworks•com
Subject: Re: [PATCH net-next v6 3/4] rocker: Handle protodown notifications.
Date: Tue, 14 Jul 2015 19:42:51 +0300 [thread overview]
Message-ID: <55A53C0B.6010807@cogentembedded.com> (raw)
In-Reply-To: <1436887930-3067-4-git-send-email-anuradhak@cumulusnetworks.com>
Hello.
On 07/14/2015 06:32 PM, anuradhak@cumulusnetworks•com wrote:
> From: Anuradha Karuppiah <anuradhak@cumulusnetworks•com>
> protodown can be set by user space applications like MLAG on detecting
> errors on a switch port. This patch provides sample switch driver changes
> for handling protodown. Rocker PHYS disables the port in response to
> protodown.
> Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks•com>
> Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks•com>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks•com>
> Signed-off-by: Wilson Kok <wkok@cumulusnetworks•com>
> ---
> drivers/net/ethernet/rocker/rocker.c | 19 ++++++++++++++++++-
> 1 file changed, 18 insertions(+), 1 deletion(-)
> diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
> index 2d8578cade..ec950d9 100644
> --- a/drivers/net/ethernet/rocker/rocker.c
> +++ b/drivers/net/ethernet/rocker/rocker.c
> @@ -3983,7 +3983,8 @@ static int rocker_port_open(struct net_device *dev)
>
> napi_enable(&rocker_port->napi_tx);
> napi_enable(&rocker_port->napi_rx);
> - rocker_port_set_enable(rocker_port, true);
> + if (!(dev->proto_down))
Inner parens not needed.
> + rocker_port_set_enable(rocker_port, true);
> netif_start_queue(dev);
> return 0;
>
> @@ -4167,6 +4168,21 @@ static int rocker_port_get_phys_port_name(struct net_device *dev,
> return err ? -EOPNOTSUPP : 0;
> }
>
> +static int rocker_port_change_proto_down(struct net_device *dev,
> + bool proto_down)
> +{
> + struct rocker_port *rocker_port = netdev_priv(dev);
> +
> + if (rocker_port->dev->flags & IFF_UP) {
> + if (proto_down)
> + rocker_port_set_enable(rocker_port, false);
> + else
> + rocker_port_set_enable(rocker_port, true);
Why not:
rocker_port_set_enable(rocker_port, !proto_down);
[...]
MBR, Sergei
next prev parent reply other threads:[~2015-07-14 16:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-14 15:32 [PATCH net-next v6 3/4] rocker: Handle protodown notifications anuradhak
2015-07-14 16:42 ` Sergei Shtylyov [this message]
2015-07-14 20:30 ` Anuradha Karuppiah
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=55A53C0B.6010807@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded$(echo .)com \
--cc=anuradhak@cumulusnetworks$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=gospo@cumulusnetworks$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=roopa@cumulusnetworks$(echo .)com \
--cc=sfeldma@gmail$(echo .)com \
--cc=wkok@cumulusnetworks$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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