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.com \
--cc=anuradhak@cumulusnetworks.com \
--cc=davem@davemloft.net \
--cc=gospo@cumulusnetworks.com \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
--cc=sfeldma@gmail.com \
--cc=wkok@cumulusnetworks.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.