From patchwork Wed Feb 27 17:46:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Yasevich X-Patchwork-Id: 223663 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 41F0B2C008C for ; Thu, 28 Feb 2013 04:46:37 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932404Ab3B0RqS (ORCPT ); Wed, 27 Feb 2013 12:46:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46794 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932182Ab3B0RqR (ORCPT ); Wed, 27 Feb 2013 12:46:17 -0500 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 r1RHkA7H022920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Feb 2013 12:46:11 -0500 Received: from vyasevic.redhat.com (ovpn-113-85.phx2.redhat.com [10.3.113.85]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1RHk4Qn004998; Wed, 27 Feb 2013 12:46:09 -0500 From: Vlad Yasevich To: netdev@vger.kernel.org Cc: john.r.fastabend@intel.com, davem@davemloft.net, Vlad Yasevich , Amir Vadai Subject: [RFC PATCH 3/3] mlx4: Use default fdb handlers when not multifunction. Date: Wed, 27 Feb 2013 12:46:04 -0500 Message-Id: <1361987164-15280-4-git-send-email-vyasevic@redhat.com> In-Reply-To: <1361987164-15280-1-git-send-email-vyasevic@redhat.com> References: <1361987164-15280-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 Allow the use of ndo_dflt_fdb_ when the adapter is not configured with virtual functins (!mlx4_is_mfunc()) This allows proper IFF_UNICAST_FLT support and allows for additional handling by the driver if needed. CC: Amir Vadai Signed-off-by: Vlad Yasevich --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 5385474..5732025 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -1934,7 +1934,7 @@ static int mlx4_en_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], int err; if (!mlx4_is_mfunc(mdev)) - return -EOPNOTSUPP; + return ndo_dflt_fdb_add(ndm, tb, dev, addr, flags); /* Hardware does not support aging addresses, allow only * permanent addresses if ndm_state is given @@ -1968,7 +1968,7 @@ static int mlx4_en_fdb_del(struct ndmsg *ndm, int err; if (!mlx4_is_mfunc(mdev)) - return -EOPNOTSUPP; + return ndo_dflt_fdb_del(ndm, tb, dev, addr); if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) { en_info(priv, "Del FDB only supports static addresses\n"); @@ -1989,13 +1989,7 @@ static int mlx4_en_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb, struct net_device *dev, int idx) { - struct mlx4_en_priv *priv = netdev_priv(dev); - struct mlx4_dev *mdev = priv->mdev->dev; - - if (mlx4_is_mfunc(mdev)) - idx = ndo_dflt_fdb_dump(skb, cb, dev, idx); - - return idx; + return ndo_dflt_fdb_dump(skb, cb, dev, idx); } static const struct net_device_ops mlx4_netdev_ops = {