Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3624684ybi; Mon, 29 Jul 2019 09:41:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUNymNRWVx6ksXEdLgA5f8tB+NchgncA3m937It9+Ku1DEuahhHnxWfz8l+c3cf/ESrgMN X-Received: by 2002:aa7:84d4:: with SMTP id x20mr37112578pfn.60.1564418477566; Mon, 29 Jul 2019 09:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564418477; cv=none; d=google.com; s=arc-20160816; b=EfVy9tSxL1B7DHSeL4iOWyDpZ4XXoH+sPlhKCo/Qrgo6yvtGuqM1bOyIvsgnOx2aM9 nqR2PMzDmvm5W09zDcyVONkd3KpDMGHKEqweBrWQ8Axw81K7NPpLY68C6bna9KntmDy1 FmjE3wia8NtysAifo2qlOhj7Eh4DQeMbcnaPyDANnu7AQiCkKJK/bG/6IUpXqpOYBZoH 4gdkiVamd/rYBsjRoHhOZbfdIyfHkSGMw/S9Fy3FjRUmSbAIC5l6nXTFmiXznkeeuUN1 vGDnyq+4flREKR8BKvN/787FCSF0vYaY8kSIrYqPsGm3hsofxwdpkKo3/dxd4IQ0EBPw RHpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from; bh=7XyBf434vwCupL4pIBelaZ1QfD2Ox6PiKAfuLNqMaR8=; b=tqUyfMBfPBA3sZeP9wxrYoMDkCUgUUor2Ez/j4GC7eSqO4cQCcq6IYlvZXDkzYTYMl liLKwHyzs3O3RdcPoaD26KEY1lFmIi+JGCS9898WFzkRjGf6MP2hyw5IL1KbEh+T4Ngr 0mYag5HZklUXNggAwNYelpqzgeAYwrzU1J2+X2XCk5g2bBL7iZjHcLKMev5HQB/WO4V5 GVCsP4X2vr5odVQCeB41eTeiEk4l8IGmVkxOqwPKq/wNtISZItAFNknw2ENTmxo84BCt XkaMslQLnFodP3xsBzAuhlv0Fifc96w7mbEMKpGPwKyDjw98ADBxWhYATQpXQpAY10Xl luaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e129si27977204pgc.344.2019.07.29.09.41.03; Mon, 29 Jul 2019 09:41:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726805AbfG2QMW (ORCPT + 99 others); Mon, 29 Jul 2019 12:12:22 -0400 Received: from inva020.nxp.com ([92.121.34.13]:37792 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728871AbfG2QMU (ORCPT ); Mon, 29 Jul 2019 12:12:20 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 10EAB1A0375; Mon, 29 Jul 2019 18:12:18 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 01DE91A0374; Mon, 29 Jul 2019 18:12:18 +0200 (CEST) Received: from fsr-ub1464-137.ea.freescale.net (fsr-ub1464-137.ea.freescale.net [10.171.82.114]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 9A1F2205F3; Mon, 29 Jul 2019 18:12:17 +0200 (CEST) From: Ioana Ciornei To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org, davem@davemloft.net, andrew@lunn.ch, f.fainelli@gmail.com, jiri@mellanox.com, Ioana Ciornei Subject: [PATCH 2/5] staging: fsl-dpaa2/ethsw: notify switchdev of offloaded entry Date: Mon, 29 Jul 2019 19:11:49 +0300 Message-Id: <1564416712-16946-3-git-send-email-ioana.ciornei@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1564416712-16946-1-git-send-email-ioana.ciornei@nxp.com> References: <1564416712-16946-1-git-send-email-ioana.ciornei@nxp.com> Reply-to: ioana.ciornei@nxp.com X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Notify switchdev in case the FDB entry was successfully offloaded. This will help users to make the distinction between entries known to the HW switch and those that are held only on the software bridge. Signed-off-by: Ioana Ciornei --- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c index 341c36b3a76d..d6953ac427b1 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c @@ -1039,6 +1039,7 @@ static void ethsw_switchdev_event_work(struct work_struct *work) container_of(work, struct ethsw_switchdev_event_work, work); struct net_device *dev = switchdev_work->dev; struct switchdev_notifier_fdb_info *fdb_info; + int err; rtnl_lock(); fdb_info = &switchdev_work->fdb_info; @@ -1046,9 +1047,16 @@ static void ethsw_switchdev_event_work(struct work_struct *work) switch (switchdev_work->event) { case SWITCHDEV_FDB_ADD_TO_DEVICE: if (is_unicast_ether_addr(fdb_info->addr)) - ethsw_port_fdb_add_uc(netdev_priv(dev), fdb_info->addr); + err = ethsw_port_fdb_add_uc(netdev_priv(dev), + fdb_info->addr); else - ethsw_port_fdb_add_mc(netdev_priv(dev), fdb_info->addr); + err = ethsw_port_fdb_add_mc(netdev_priv(dev), + fdb_info->addr); + if (err) + break; + fdb_info->offloaded = true; + call_switchdev_notifiers(SWITCHDEV_FDB_OFFLOADED, dev, + &fdb_info->info, NULL); break; case SWITCHDEV_FDB_DEL_TO_DEVICE: if (is_unicast_ether_addr(fdb_info->addr)) -- 1.9.1