Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/897752/?format=api
{ "id": 897752, "url": "http://patchwork.ozlabs.org/api/patches/897752/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180412181559.4343-1-jacob.e.keller@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20180412181559.4343-1-jacob.e.keller@intel.com>", "list_archive_url": null, "date": "2018-04-12T18:15:54", "name": "[1/6] fm10k: setup VLANs for l2 accelerated macvlan interfaces", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "363e8a42ea59651d0f7726abf3e265aadafca841", "submitter": { "id": 9784, "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api", "name": "Jacob Keller", "email": "jacob.e.keller@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180412181559.4343-1-jacob.e.keller@intel.com/mbox/", "series": [ { "id": 38679, "url": "http://patchwork.ozlabs.org/api/series/38679/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=38679", "date": "2018-04-12T18:15:54", "name": "[1/6] fm10k: setup VLANs for l2 accelerated macvlan interfaces", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/38679/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/897752/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/897752/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.136; helo=silver.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=intel.com" ], "Received": [ "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 40MTcb4Sk7z9s27\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 13 Apr 2018 04:16:15 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 02DEB22182;\n\tThu, 12 Apr 2018 18:16:14 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 3WuNk51vyyyn; Thu, 12 Apr 2018 18:16:13 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 08D5022070;\n\tThu, 12 Apr 2018 18:16:13 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id AD41B1CF139\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Apr 2018 18:16:11 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id A9E82221DF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Apr 2018 18:16:11 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id sthPjEWLOh4D for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Apr 2018 18:16:11 +0000 (UTC)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby silver.osuosl.org (Postfix) with ESMTPS id F1B9D22070\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Apr 2018 18:16:10 +0000 (UTC)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Apr 2018 11:16:09 -0700", "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-desk.jekeller.internal) ([134.134.177.161])\n\tby fmsmga004.fm.intel.com with ESMTP; 12 Apr 2018 11:16:09 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.48,442,1517904000\"; d=\"scan'208\";a=\"45707719\"", "From": "Jacob Keller <jacob.e.keller@intel.com>", "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>", "Date": "Thu, 12 Apr 2018 11:15:54 -0700", "Message-Id": "<20180412181559.4343-1-jacob.e.keller@intel.com>", "X-Mailer": "git-send-email 2.15.1.478.ga1e07cd25f8b", "Subject": "[Intel-wired-lan] [PATCH 1/6] fm10k: setup VLANs for l2 accelerated\n\tmacvlan interfaces", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "We have support for accelerating macvlan devices via the\n.ndo_dfwd_add_station() netdev op. These accelerated macvlan MAC\naddresses are stored in the l2_accel structure, separate from the\nunicast or multicast address lists.\n\nIf a VLAN is added on top of the macvlan device by the stack, traffic\nwill not properly flow to the macvlan. This occurs because we fail to\nsetup the VLANs for l2_accel MAC addresses.\n\nIn the non-offloaded case the MAC address is added to the unicast\naddress list, and thus the normal setup for enabling VLANs works as\nexpected.\n\nWe also need to add VLANs marked from .ndo_vlan_rx_add_vid() into the\nl2_accel MAC addresses. Otherwise, VLAN traffic will not properly be\nreceived by the VLAN devices attached to the offloaded macvlan devices.\n\nFix this by adding necessary logic to setup VLANs not only for the\nunicast and multicast addresses, but also the l2_accel list. We need\nsimilar logic in dfwd_add_station, dfwd_del_station, fm10k_update_vid,\nand fm10k_restore_rx_state.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nReviewed-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 50 ++++++++++++++++++++++++-\n 1 file changed, 48 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c\nindex 26e749766337..36200dec941d 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c\n@@ -925,7 +925,9 @@ static int fm10k_mc_vlan_unsync(struct net_device *netdev,\n static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)\n {\n \tstruct fm10k_intfc *interface = netdev_priv(netdev);\n+\tstruct fm10k_l2_accel *l2_accel = interface->l2_accel;\n \tstruct fm10k_hw *hw = &interface->hw;\n+\tu16 glort;\n \ts32 err;\n \tint i;\n \n@@ -993,6 +995,22 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set)\n \tif (err)\n \t\tgoto err_out;\n \n+\t/* Update L2 accelerated macvlan addresses */\n+\tif (l2_accel) {\n+\t\tfor (i = 0; i < l2_accel->size; i++) {\n+\t\t\tstruct net_device *sdev = l2_accel->macvlan[i];\n+\n+\t\t\tif (!sdev)\n+\t\t\t\tcontinue;\n+\n+\t\t\tglort = l2_accel->dglort + 1 + i;\n+\n+\t\t\tfm10k_queue_mac_request(interface, glort,\n+\t\t\t\t\t\tsdev->dev_addr,\n+\t\t\t\t\t\tvid, set);\n+\t\t}\n+\t}\n+\n \t/* set VLAN ID prior to syncing/unsyncing the VLAN */\n \tinterface->vid = vid + (set ? VLAN_N_VID : 0);\n \n@@ -1232,6 +1250,22 @@ void fm10k_restore_rx_state(struct fm10k_intfc *interface)\n \n \t\tfm10k_queue_mac_request(interface, glort,\n \t\t\t\t\thw->mac.addr, vid, true);\n+\n+\t\t/* synchronize macvlan addresses */\n+\t\tif (l2_accel) {\n+\t\t\tfor (i = 0; i < l2_accel->size; i++) {\n+\t\t\t\tstruct net_device *sdev = l2_accel->macvlan[i];\n+\n+\t\t\t\tif (!sdev)\n+\t\t\t\t\tcontinue;\n+\n+\t\t\t\tglort = l2_accel->dglort + 1 + i;\n+\n+\t\t\t\tfm10k_queue_mac_request(interface, glort,\n+\t\t\t\t\t\t\tsdev->dev_addr,\n+\t\t\t\t\t\t\tvid, true);\n+\t\t\t}\n+\t\t}\n \t}\n \n \t/* update xcast mode before synchronizing addresses if host's mailbox\n@@ -1448,7 +1482,7 @@ static void *fm10k_dfwd_add_station(struct net_device *dev,\n \tstruct fm10k_dglort_cfg dglort = { 0 };\n \tstruct fm10k_hw *hw = &interface->hw;\n \tint size = 0, i;\n-\tu16 glort;\n+\tu16 vid, glort;\n \n \t/* The hardware supported by fm10k only filters on the destination MAC\n \t * address. In order to avoid issues we only support offloading modes\n@@ -1528,6 +1562,12 @@ static void *fm10k_dfwd_add_station(struct net_device *dev,\n \t\t\t\t\thw->mac.default_vid, true);\n \t}\n \n+\tfor (vid = fm10k_find_next_vlan(interface, 0);\n+\t vid < VLAN_N_VID;\n+\t vid = fm10k_find_next_vlan(interface, vid))\n+\t\tfm10k_queue_mac_request(interface, glort, sdev->dev_addr,\n+\t\t\t\t\tvid, true);\n+\n \tfm10k_mbx_unlock(interface);\n \n \treturn sdev;\n@@ -1540,8 +1580,8 @@ static void fm10k_dfwd_del_station(struct net_device *dev, void *priv)\n \tstruct fm10k_dglort_cfg dglort = { 0 };\n \tstruct fm10k_hw *hw = &interface->hw;\n \tstruct net_device *sdev = priv;\n+\tu16 vid, glort;\n \tint i;\n-\tu16 glort;\n \n \tif (!l2_accel)\n \t\treturn;\n@@ -1568,6 +1608,12 @@ static void fm10k_dfwd_del_station(struct net_device *dev, void *priv)\n \t\t\t\t\thw->mac.default_vid, false);\n \t}\n \n+\tfor (vid = fm10k_find_next_vlan(interface, 0);\n+\t vid < VLAN_N_VID;\n+\t vid = fm10k_find_next_vlan(interface, vid))\n+\t\tfm10k_queue_mac_request(interface, glort, sdev->dev_addr,\n+\t\t\t\t\tvid, false);\n+\n \tfm10k_mbx_unlock(interface);\n \n \t/* record removal */\n", "prefixes": [ "1/6" ] }