[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACcJQnQXL-LhA-fBK4NhPJbONPfRJ9G2QAvH5Nm42n6++0DHEg@mail.gmail.com>
Date: Tue, 14 Jul 2015 13:30:23 -0700
From: Anuradha Karuppiah <anuradhak@...ulusnetworks.com>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Scott Feldman <sfeldma@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Roopa Prabhu <roopa@...ulusnetworks.com>,
Andy Gospodarek <gospo@...ulusnetworks.com>,
Wilson Kok <wkok@...ulusnetworks.com>
Subject: Re: [PATCH net-next v6 3/4] rocker: Handle protodown notifications.
On Tue, Jul 14, 2015 at 9:42 AM, Sergei Shtylyov
<sergei.shtylyov@...entembedded.com> wrote:
> Hello.
>
> On 07/14/2015 06:32 PM, anuradhak@...ulusnetworks.com wrote:
>
>> From: Anuradha Karuppiah <anuradhak@...ulusnetworks.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@...ulusnetworks.com>
>> Signed-off-by: Andy Gospodarek <gospo@...ulusnetworks.com>
>> Signed-off-by: Roopa Prabhu <roopa@...ulusnetworks.com>
>> Signed-off-by: Wilson Kok <wkok@...ulusnetworks.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.
Ack.
>
>> + 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);
yes, that would be better. thanks for the review.
>
> [...]
>
> MBR, Sergei
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists