From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20BADC433E2 for ; Tue, 15 Sep 2020 08:20:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9530206B5 for ; Tue, 15 Sep 2020 08:20:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bSlHOhVt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726369AbgIOIUa (ORCPT ); Tue, 15 Sep 2020 04:20:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42874 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726361AbgIOIUA (ORCPT ); Tue, 15 Sep 2020 04:20:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600157999; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Tvwl3r1gtQ/vI6amnctmoViryXc61AUea/91GxxvZOQ=; b=bSlHOhVtlYxn0+sLmI9/apRK9Wu/9YlvmgjDjn7OfUrrmUbYaUu902+yy9IZhFqdU+I0tT pSUNIED4BnKcXbdbX77A16sulrV2gpbpTUcBHty8A9brt0ncCJmRDUmJgo6aT5naYyHYdE KsI14vCAO+8ee0CIJ7tRqFd2EHkNpUY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-23-cDtDwTJQNG2DyR0IvAZcgQ-1; Tue, 15 Sep 2020 04:19:55 -0400 X-MC-Unique: cDtDwTJQNG2DyR0IvAZcgQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 98280801AF1; Tue, 15 Sep 2020 08:19:48 +0000 (UTC) Received: from ceranb (unknown [10.40.194.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id D635A7512A; Tue, 15 Sep 2020 08:19:42 +0000 (UTC) Date: Tue, 15 Sep 2020 10:19:41 +0200 From: Ivan Vecera To: Julian Wiedmann Cc: David Miller , Jakub Kicinski , netdev , linux-s390 , Heiko Carstens , Ursula Braun , Karsten Graul , Alexandra Winter , Roopa Prabhu , Nikolay Aleksandrov , Jiri Pirko Subject: Re: [PATCH net-next 5/8] bridge: Add SWITCHDEV_FDB_FLUSH_TO_BRIDGE notifier Message-ID: <20200915101941.7c18be01@ceranb> In-Reply-To: <20200910172351.5622-6-jwi@linux.ibm.com> References: <20200910172351.5622-1-jwi@linux.ibm.com> <20200910172351.5622-6-jwi@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 10 Sep 2020 19:23:48 +0200 Julian Wiedmann wrote: > From: Alexandra Winter > > so the switchdev can notifiy the bridge to flush non-permanent fdb entries > for this port. This is useful whenever the hardware fdb of the switchdev > is reset, but the netdev and the bridgeport are not deleted. > > Note that this has the same effect as the IFLA_BRPORT_FLUSH attribute. > > CC: Jiri Pirko > CC: Ivan Vecera > CC: Roopa Prabhu > CC: Nikolay Aleksandrov > Signed-off-by: Alexandra Winter > Signed-off-by: Julian Wiedmann > --- > include/net/switchdev.h | 1 + > net/bridge/br.c | 5 +++++ > 2 files changed, 6 insertions(+) > > diff --git a/include/net/switchdev.h b/include/net/switchdev.h > index ff2246914301..53e8b4994296 100644 > --- a/include/net/switchdev.h > +++ b/include/net/switchdev.h > @@ -203,6 +203,7 @@ enum switchdev_notifier_type { > SWITCHDEV_FDB_ADD_TO_DEVICE, > SWITCHDEV_FDB_DEL_TO_DEVICE, > SWITCHDEV_FDB_OFFLOADED, > + SWITCHDEV_FDB_FLUSH_TO_BRIDGE, > > SWITCHDEV_PORT_OBJ_ADD, /* Blocking. */ > SWITCHDEV_PORT_OBJ_DEL, /* Blocking. */ > diff --git a/net/bridge/br.c b/net/bridge/br.c > index b6fe30e3768f..401eeb9142eb 100644 > --- a/net/bridge/br.c > +++ b/net/bridge/br.c > @@ -183,6 +183,11 @@ static int br_switchdev_event(struct notifier_block *unused, > br_fdb_offloaded_set(br, p, fdb_info->addr, > fdb_info->vid, fdb_info->offloaded); > break; > + case SWITCHDEV_FDB_FLUSH_TO_BRIDGE: > + fdb_info = ptr; > + /* Don't delete static entries */ > + br_fdb_delete_by_port(br, p, fdb_info->vid, 0); > + break; > } > > out: Acked-by: Ivan Vecera