Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3777305ybi; Mon, 29 Jul 2019 12:25:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsID3TV1vPeUEMr+pGGwFZ7RCVyMWI/P5rT5O/jZ0p40gJYzjdy/dRP7DylLE2w1ukeOEn X-Received: by 2002:a17:902:e512:: with SMTP id ck18mr105859536plb.53.1564428356996; Mon, 29 Jul 2019 12:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564428356; cv=none; d=google.com; s=arc-20160816; b=NWWu6LELkC8kufcAc0BGcby+akt+/i8bgF3PR5Ir7UyqaWAgtiEx37S5RggvwRY/pZ zFnddrdL0uqtdmXs6b8ohes9B0SiKGGKWtpE0bgUaiBvzxaRscQe463oDl87a3+Im6Zt jOsH9USDyO43R7FHRPJlhAlaTehTaZj2a0UCtVZwDKlwPMEZGIXukXFBF36S0oaF7mWY 5rl7Fba0WblYBwyW+aVZifprkfO1m3WAuT3yVAyrJOJp/+dSrB4HWwGXw/qdSpvDY1CM 3RMpaRsDkyMD9WOOOcalJbw6RqJJ1tO+YQ6v1RBQf3cUerDTGzuH7FBkUPUEWdoBa3MK wg/Q== 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=C+pObUryZFkbanTQRRWe6qqKgtMzrzMO/DjnT5/w0FM=; b=CYJjP62YCiQLJKUR3AaW+LU5yxnvMjyrhtI9/eE976MZFGTdg1SQ3RUQ/U3DYQJ2hH Oi5cSYF5uE7pdZlLz1b/YEr/0XET7xLD1ezjLoERbkZXGC9UKEvQuKAKqmX7mHYwYXgb hkZbEV7F1w8WMNO0LAYs96wUcpZeMCpw5ZMw/nPMvGNRCJsWFAxoVngHfcxxninqe/T6 Kmfnv+SjYzF3MpW+NA3sXObS1n0J/8vrLj8UZrU0c7wDA0DGC2fF27Kd9SWrzTZX+fpg HxgERQVT/7Bl1sdwvClF/NKWBK37xzmqD8LfHJQ2tyCRhGnXTR/Xo7tX9QJzNN2KI3Di 1c8A== 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 z62si28563401pgz.143.2019.07.29.12.25.41; Mon, 29 Jul 2019 12:25:56 -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 S1728940AbfG2QM1 (ORCPT + 99 others); Mon, 29 Jul 2019 12:12:27 -0400 Received: from inva021.nxp.com ([92.121.34.21]:40818 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728912AbfG2QMY (ORCPT ); Mon, 29 Jul 2019 12:12:24 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 4106720035B; Mon, 29 Jul 2019 18:12:22 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 33A41200344; Mon, 29 Jul 2019 18:12:22 +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 C0DB0205F3; Mon, 29 Jul 2019 18:12:21 +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 5/5] staging: fsl-dpaa2/ethsw: add .ndo_fdb[add|del] callbacks Date: Mon, 29 Jul 2019 19:11:52 +0300 Message-Id: <1564416712-16946-6-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 Add the .ndo_fdb_[add|del] callbacks so that FDB entries not associated with a master device still end up offloaded. Signed-off-by: Ioana Ciornei --- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c index 2d3179c6bad8..4b94a01513a7 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c @@ -316,6 +316,31 @@ static int ethsw_port_fdb_del_mc(struct ethsw_port_priv *port_priv, return err; } +static int port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], + struct net_device *dev, const unsigned char *addr, + u16 vid, u16 flags, + struct netlink_ext_ack *extack) +{ + if (is_unicast_ether_addr(addr)) + return ethsw_port_fdb_add_uc(netdev_priv(dev), + addr); + else + return ethsw_port_fdb_add_mc(netdev_priv(dev), + addr); +} + +static int port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], + struct net_device *dev, + const unsigned char *addr, u16 vid) +{ + if (is_unicast_ether_addr(addr)) + return ethsw_port_fdb_del_uc(netdev_priv(dev), + addr); + else + return ethsw_port_fdb_del_mc(netdev_priv(dev), + addr); +} + static void port_get_stats(struct net_device *netdev, struct rtnl_link_stats64 *stats) { @@ -670,6 +695,8 @@ static int port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, .ndo_change_mtu = port_change_mtu, .ndo_has_offload_stats = port_has_offload_stats, .ndo_get_offload_stats = port_get_offload_stats, + .ndo_fdb_add = port_fdb_add, + .ndo_fdb_del = port_fdb_del, .ndo_fdb_dump = port_fdb_dump, .ndo_start_xmit = port_dropframe, -- 1.9.1