From patchwork Wed Nov 22 18:56:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander H Duyck X-Patchwork-Id: 840499 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=osuosl.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="vK2eCYuy"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yhssq2TGgz9ryQ for ; Thu, 23 Nov 2017 06:27:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id DC0A5882CB; Wed, 22 Nov 2017 19:27:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7CZ3OgQK1LuG; Wed, 22 Nov 2017 19:27:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 0AE44885F2; Wed, 22 Nov 2017 19:27:15 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 583151C2272 for ; Wed, 22 Nov 2017 19:02:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4F18A888C7 for ; Wed, 22 Nov 2017 19:02:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pVUJqQl+k7DX for ; Wed, 22 Nov 2017 19:02:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id 633758887B for ; Wed, 22 Nov 2017 19:02:24 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id v15so1257274plk.11 for ; Wed, 22 Nov 2017 11:02:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:date:message-id:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=Z/dpGiVg1ZG1Xv/cYX+pN1lzBCgCAzwX777PQVt6Di4=; b=vK2eCYuyLQafplf3OpRKE7hvMtzdZ/mus0+vC1QUeIsjq3sVsp96GwBnCCl9yIZdnX Qc/s49vh6lcJXfBfCzmSxXVRFqzEV1Bl1JMQ3EZlp5FX0zbFjsv/leBAbzjitu7he5NP raRbKHe8F6mCEiLTY/kWOrGPKNw4pd4ZaBB/Coz3SMH9ipi1X7d01mWhyW9cjSbM0mCR dtdOommPbRupAwP1+Bc5UWTWywizybeMpd49QGogz0ilH8K6TZggU8mkVtKg/Gg6WbZp XtPL3nXJqyMYD6gBLTWDq4Mdp2kw47CkJOrmlpa3Nadrx5tjUj9KAw6Xu5vx0+vVKcUu MU8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=Z/dpGiVg1ZG1Xv/cYX+pN1lzBCgCAzwX777PQVt6Di4=; b=sERByviNS1PNPqrOHpmDMTVU3uAGC+SPbnpKj2YISlwFeZwD0W9nNtg4vlKPifllAM 3+JRQUT2IiuDeRqFgTTU/5Q7IrkYS9obHj6tC+GgdM6SxJpsVM+UYBbXXN+o7OcG0Vjc 9+dwLBm/RuqzfRfita5ArrM9/jvv9acesCEJTzmRR/Kux97eOUjdFfrociZzoQj2d0hA rd0DQHKm5beQnsd8V5Y/EwS1rFyFxUcETDcxmsEve74OJT8jz4j/CC7RyjRQLRWKNzjD vk58pmaY+LiQPdu3QCna9LIqpSVqr1UzhmPyB4EdEUqnUQ1KsL3RnwQai20XdnE5eWYy etCg== X-Gm-Message-State: AJaThX42toOcmhCIWmN8TQZv9bpeFI6IeDyBmhOsuSDEsz0HJPPBbVI8 wcNSLL3OzfKuMrRl8ouW09Zf6Avr X-Google-Smtp-Source: AGs4zMZ2KWdtyMSCtOyepbaaqEZ8KVR8LVlW6rRy1J+j7/Qv76vz/Uq0RtedTvx3WKnby6ntgVP69Q== X-Received: by 10.84.195.3 with SMTP id i3mr1591106pld.282.1511377020041; Wed, 22 Nov 2017 10:57:00 -0800 (PST) Received: from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0]) by smtp.gmail.com with ESMTPSA id w9sm30624821pfk.16.2017.11.22.10.56.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 10:56:59 -0800 (PST) From: Alexander Duyck To: intel-wired-lan@lists.osuosl.org Date: Wed, 22 Nov 2017 10:56:59 -0800 Message-ID: <20171122185658.29785.82075.stgit@localhost.localdomain> In-Reply-To: <20171122185256.29785.93548.stgit@localhost.localdomain> References: <20171122185256.29785.93548.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [Intel-wired-lan] [jkirsher/next-queue PATCH 08/16] ixgbe: Assume provided MAC filter has been verified by macvlan X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Alexander Duyck The macvlan driver itself will validate the MAC address that is configured for a given interface. There is no need for us to verify it again. Instead we should be checking to verify that we actuall allocate the filter and have not run out of resources to configure a MAC rule in our filter table. Signed-off-by: Alexander Duyck Tested-by: Andrew Bowers --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 09754519a0d9..6b553f96ead9 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -5404,12 +5404,16 @@ static int ixgbe_fwd_ring_up(struct net_device *vdev, if (err) goto fwd_queue_err; - if (is_valid_ether_addr(vdev->dev_addr)) - ixgbe_add_mac_filter(adapter, vdev->dev_addr, - VMDQ_P(accel->pool)); + /* ixgbe_add_mac_filter will return an index if it succeeds, so we + * need to only treat it as an error value if it is negative. + */ + err = ixgbe_add_mac_filter(adapter, vdev->dev_addr, + VMDQ_P(accel->pool)); + if (err < 0) + goto fwd_queue_err; ixgbe_macvlan_set_rx_mode(vdev, VMDQ_P(accel->pool), adapter); - return err; + return 0; fwd_queue_err: ixgbe_fwd_ring_down(vdev, accel); return err;