From patchwork Wed Jun 4 20:23:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Yasevich X-Patchwork-Id: 356088 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 446FD14009C for ; Thu, 5 Jun 2014 06:24:03 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751329AbaFDUXv (ORCPT ); Wed, 4 Jun 2014 16:23:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61624 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbaFDUXs (ORCPT ); Wed, 4 Jun 2014 16:23:48 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s54KNjga031171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Jun 2014 16:23:45 -0400 Received: from vyasevic.redhat.com (vpn-62-229.rdu2.redhat.com [10.10.62.229]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s54KNeSj005458; Wed, 4 Jun 2014 16:23:44 -0400 From: Vlad Yasevich To: netdev@vger.kernel.org Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, kaber@trash.net, Vlad Yasevich Subject: [PATCH net-next 2/3] macvlan: Support bonding events Date: Wed, 4 Jun 2014 16:23:37 -0400 Message-Id: <1401913418-31307-3-git-send-email-vyasevic@redhat.com> In-Reply-To: <1401913418-31307-1-git-send-email-vyasevic@redhat.com> References: <1401913418-31307-1-git-send-email-vyasevic@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Bonding and team drivers generate specific events during failover that trigger switch updates. When a macvlan device is configured on top of bonding, we want switches to learn about the macvlan devices as well. This patch adds a handler to macvlan driver to propagate these events to all macvlan devices. We let the generic inetdev event handler do the work. This allows macvlan to operated correctly over active-backup mode bond. Signed-off-by: Vlad Yasevich --- drivers/net/macvlan.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index eee9106..453d55a 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -1209,6 +1209,13 @@ static int macvlan_device_event(struct notifier_block *unused, case NETDEV_PRE_TYPE_CHANGE: /* Forbid underlaying device to change its type. */ return NOTIFY_BAD; + + case NETDEV_NOTIFY_PEERS: + case NETDEV_BONDING_FAILOVER: + case NETDEV_RESEND_IGMP: + /* Propagate to all vlans */ + list_for_each_entry(vlan, &port->vlans, list) + call_netdevice_notifiers(event, vlan->dev); } return NOTIFY_DONE; }