From patchwork Fri Feb 1 14:28:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 217473 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 426A62C0094 for ; Sat, 2 Feb 2013 01:28:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756972Ab3BAO2M (ORCPT ); Fri, 1 Feb 2013 09:28:12 -0500 Received: from mail-ee0-f45.google.com ([74.125.83.45]:35963 "EHLO mail-ee0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755473Ab3BAO2L (ORCPT ); Fri, 1 Feb 2013 09:28:11 -0500 Received: by mail-ee0-f45.google.com with SMTP id b57so2202572eek.32 for ; Fri, 01 Feb 2013 06:28:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=zppBLC4Edt73/1P6V1/eG7UnRXgkDTE8Wbjw8nOxDmI=; b=LbL0KcVkAJTnACQbpQkFLbYMK+gNE7S/c5X8HknKydhG2L+6XX0FXwdiTaU5/Sdm5C hsVV28cZVGTw6kLSeC8R8n+gvgcBURyORvYvnOz2hT9GiMKLPf/3tvGOWfdK/bOt0Dt1 CuytnXvqIZqUQMhiXZ2djDRSUnb1IksfdM10cRbGzDB2uA3qtvT7nBVHvHzeAlcciWVB aifMHalMmDHpfbMU3v3LdnJWuFxmC+iA4skP+HU5d5nQz6UJe64gqXA+MmD/jP26MdW+ 1VeUzmX4MRUd2mNsMgNPPXb7HtAae5R7HMEMFfYntdYlo+tU7dZNUrpUGHAeFlmqHKFe iwKA== X-Received: by 10.14.200.137 with SMTP id z9mr23619485een.20.1359728889828; Fri, 01 Feb 2013 06:28:09 -0800 (PST) Received: from localhost (sun-0.pirko.cz. [84.16.102.25]) by mx.google.com with ESMTPS id h5sm12803423eem.1.2013.02.01.06.28.08 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 01 Feb 2013 06:28:09 -0800 (PST) From: Jiri Pirko To: netdev@vger.kernel.org Cc: davem@davemloft.net, fbl@redhat.com Subject: [patch net-next 2/2] team: ab: set active port option as changed when port is leaving Date: Fri, 1 Feb 2013 15:28:02 +0100 Message-Id: <1359728882-15333-2-git-send-email-jiri@resnulli.us> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1359728882-15333-1-git-send-email-jiri@resnulli.us> References: <1359728882-15333-1-git-send-email-jiri@resnulli.us> X-Gm-Message-State: ALoCoQnByph82mAB33UA6pQmMsmrBEyzjAWgl78vi8PQJ75Er5WFqCwlzTB3obLslqPAysIofSk/ Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In case port is leaving the team, set the option "activeport" as changed so the change can be properly propagated to userspace Signed-off-by: Jiri Pirko --- drivers/net/team/team_mode_activebackup.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c index 6262b4d..40fd338 100644 --- a/drivers/net/team/team_mode_activebackup.c +++ b/drivers/net/team/team_mode_activebackup.c @@ -19,6 +19,7 @@ struct ab_priv { struct team_port __rcu *active_port; + struct team_option_inst_info *ap_opt_inst_info; }; static struct ab_priv *ab_priv(struct team *team) @@ -54,8 +55,17 @@ drop: static void ab_port_leave(struct team *team, struct team_port *port) { - if (ab_priv(team)->active_port == port) + if (ab_priv(team)->active_port == port) { RCU_INIT_POINTER(ab_priv(team)->active_port, NULL); + team_option_inst_set_change(ab_priv(team)->ap_opt_inst_info); + } +} + +static int ab_active_port_init(struct team *team, + struct team_option_inst_info *info) +{ + ab_priv(team)->ap_opt_inst_info = info; + return 0; } static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx) @@ -88,6 +98,7 @@ static const struct team_option ab_options[] = { { .name = "activeport", .type = TEAM_OPTION_TYPE_U32, + .init = ab_active_port_init, .getter = ab_active_port_get, .setter = ab_active_port_set, },