From patchwork Wed Nov 22 18:57:47 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: 840497 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.137; helo=fraxinus.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="e/t+wwdq"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yhssg5GcMz9s76 for ; Thu, 23 Nov 2017 06:27:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id BF53F86886; Wed, 22 Nov 2017 19:27:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ixDVS7xXIPAc; Wed, 22 Nov 2017 19:27:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6C35086B85; 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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 6BEB51C2272 for ; Wed, 22 Nov 2017 19:03:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 655202D03E for ; Wed, 22 Nov 2017 19:03:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lixEDZsB2aiI for ; Wed, 22 Nov 2017 19:03:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f65.google.com (mail-pl0-f65.google.com [209.85.160.65]) by silver.osuosl.org (Postfix) with ESMTPS id 895BC2D00E for ; Wed, 22 Nov 2017 19:03:46 +0000 (UTC) Received: by mail-pl0-f65.google.com with SMTP id 62so1259202plc.2 for ; Wed, 22 Nov 2017 11:03:46 -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=yIy0rSCz5c/pq8Hwt4akrLBxldMzDxACItXKmsyMa2c=; b=e/t+wwdqK4aqhOZGCxNP/QPrOIvH/3GigJKc9O9GqOP8L+tCzUF9zCs7bH0Dz+rRCX Bel7rENyQZmvEm922I88sF529d3CQk/HS0eLdO/gBCEpiTFo25+efPTJ9m6zPtAQoiLG 3+94z00MsBs3H6uubbOYE2PZd9I65dh7+lggI9wdTkuO159AJ4YuvHkzR1/j8u7NkeaB 4pqiFRVu1ri3z3rZWbLdVscGWSpVqJwgB7SktJf7qUu/ZeqRGdLA96XKFmV4PfTkZzeQ WPcgz+L5CkMBa1dsLrigNEKupFoagybzv5sDkh7c4VZ0DDVC+MViMyQ1vaSVhPBR1EVP D/Fw== 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=yIy0rSCz5c/pq8Hwt4akrLBxldMzDxACItXKmsyMa2c=; b=b024ikkXx5XIF123ZcfabovASuEIc4cIBltyA+PMRQVGEHznauYQj1iENa/xpJalt0 oAf2C2XtZONBF9yN7tmbmikpqIqol95Q9RE2XsZDUPitlrL8aNH0RXhZ3oofMwJJn1bK 6pD8/NbQKYDw6dKNxgs014yP0V2r6m5UQQyrlVpWCemlEbXqY3NgQ4rh0Bzblb3h88of PGf5poqEgTQIG8KPX+ciRqVFk//iaPhBo568embw7Rthj0kZfEEdTtDGsdy2r3gCmYc4 2Hqa+Sz25djYcNgwX8GZc4usLMULf3k/a2s9djTf2INdrF6QjjCfkpyqzEWbcGXAHuOy fH8Q== X-Gm-Message-State: AJaThX7/WNjy7CUh5j0smKjqJsGUBHT5LbMZOYhGjA8l/rsM8wgyFsz0 UxrGMrAobY5iVPVID8x4b4mpXxgT X-Google-Smtp-Source: AGs4zMbBf/fMHGRAbGZETLGXY43NPXI96MwhW8CrYZ+KfNINQuU6MsCc6kFnSivtfDtw4J6/fRkiuQ== X-Received: by 10.159.194.18 with SMTP id x18mr14788212pln.412.1511377068329; Wed, 22 Nov 2017 10:57:48 -0800 (PST) Received: from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0]) by smtp.gmail.com with ESMTPSA id s73sm30507878pfi.167.2017.11.22.10.57.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 10:57:47 -0800 (PST) From: Alexander Duyck To: intel-wired-lan@lists.osuosl.org Date: Wed, 22 Nov 2017 10:57:47 -0800 Message-ID: <20171122185747.29785.20248.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 16/16] fm10k: Fix configuration for macvlan offload 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 fm10k driver didn't work correctly when macvlan offload was enabled. Specifically what would occur is that we would see no unicast packets being received. This was traced down to us not correctly configuring the default VLAN ID for the port and defaulting to 0. To correct this we either use the default ID provided by the switch or simply use 1. With that we are able to pass and receive traffic without any issues. In addition we were not repopulating the filter table following a reset. To correct that I have added a bit of code to fm10k_restore_rx_state that will repopulate the Rx filter configuration for the macvlan interfaces. Signed-off-by: Alexander Duyck Tested-by: Krishneil Singh --- drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 25 ++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c index adc62fb38c49..6d9088956407 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c @@ -1182,9 +1182,10 @@ static void fm10k_set_rx_mode(struct net_device *dev) void fm10k_restore_rx_state(struct fm10k_intfc *interface) { + struct fm10k_l2_accel *l2_accel = interface->l2_accel; struct net_device *netdev = interface->netdev; struct fm10k_hw *hw = &interface->hw; - int xcast_mode; + int xcast_mode, i; u16 vid, glort; /* record glort for this interface */ @@ -1234,6 +1235,24 @@ void fm10k_restore_rx_state(struct fm10k_intfc *interface) __dev_uc_sync(netdev, fm10k_uc_sync, fm10k_uc_unsync); __dev_mc_sync(netdev, fm10k_mc_sync, fm10k_mc_unsync); + /* synchronize macvlan addresses */ + if (l2_accel) { + for (i = 0; i < l2_accel->size; i++) { + struct net_device *sdev = l2_accel->macvlan[i]; + + if (!sdev) + continue; + + glort = l2_accel->dglort + 1 + i; + + hw->mac.ops.update_xcast_mode(hw, glort, + FM10K_XCAST_MODE_MULTI); + fm10k_queue_mac_request(interface, glort, + sdev->dev_addr, + hw->mac.default_vid, true); + } + } + fm10k_mbx_unlock(interface); /* record updated xcast mode state */ @@ -1490,7 +1509,7 @@ static void *fm10k_dfwd_add_station(struct net_device *dev, hw->mac.ops.update_xcast_mode(hw, glort, FM10K_XCAST_MODE_MULTI); fm10k_queue_mac_request(interface, glort, sdev->dev_addr, - 0, true); + hw->mac.default_vid, true); } fm10k_mbx_unlock(interface); @@ -1530,7 +1549,7 @@ static void fm10k_dfwd_del_station(struct net_device *dev, void *priv) hw->mac.ops.update_xcast_mode(hw, glort, FM10K_XCAST_MODE_NONE); fm10k_queue_mac_request(interface, glort, sdev->dev_addr, - 0, false); + hw->mac.default_vid, false); } fm10k_mbx_unlock(interface);