Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/470209/?format=api
{ "id": 470209, "url": "http://patchwork.ozlabs.org/api/patches/470209/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20150508223557.26673.76301.stgit@jbrandeb-cp2.jf.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": "<20150508223557.26673.76301.stgit@jbrandeb-cp2.jf.intel.com>", "list_archive_url": null, "date": "2015-05-08T22:35:57", "name": "[net,2/2] i40e: start up in VEPA mode by default", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "420d5d8bca165451d96279e5351117606f378739", "submitter": { "id": 189, "url": "http://patchwork.ozlabs.org/api/people/189/?format=api", "name": "Jesse Brandeburg", "email": "jesse.brandeburg@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/20150508223557.26673.76301.stgit@jbrandeb-cp2.jf.intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/470209/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/470209/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.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" ], "Received": [ "from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137])\n\tby ozlabs.org (Postfix) with ESMTP id AFA8A14076A\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 9 May 2015 08:36:02 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id DFD54A1F24;\n\tFri, 8 May 2015 22:36:01 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id Db8UTHkYlYSV; Fri, 8 May 2015 22:36:01 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 1D108A1F12;\n\tFri, 8 May 2015 22:36:01 +0000 (UTC)", "from silver.osuosl.org (silver.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 005681C1FD1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 May 2015 22:35:58 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id F131F313DA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 May 2015 22:35:58 +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 gin9crGEdNgD for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 May 2015 22:35:58 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby silver.osuosl.org (Postfix) with ESMTP id 1B184313BD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 May 2015 22:35:58 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga102.fm.intel.com with ESMTP; 08 May 2015 15:35:57 -0700", "from jbrandeb-cp2.jf.intel.com ([134.134.3.82])\n\tby FMSMGA003.fm.intel.com with ESMTP; 08 May 2015 15:35:57 -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-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.13,393,1427785200\"; d=\"scan'208\";a=\"491267318\"", "To": "intel-wired-lan@lists.osuosl.org", "From": "Jesse Brandeburg <jesse.brandeburg@intel.com>", "Date": "Fri, 08 May 2015 15:35:57 -0700", "Message-ID": "<20150508223557.26673.76301.stgit@jbrandeb-cp2.jf.intel.com>", "In-Reply-To": "<20150508223552.26673.5631.stgit@jbrandeb-cp2.jf.intel.com>", "References": "<20150508223552.26673.5631.stgit@jbrandeb-cp2.jf.intel.com>", "User-Agent": "StGit/0.16-44-gd947d-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [net PATCH 2/2] i40e: start up in VEPA mode by\n\tdefault", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "From: Anjali Singhai Jain <anjali.singhai@intel.com>\n\nThe patch fixes a bug in the default configuration which\nprevented a software bridge loaded on the PF interface from\nworking correctly because broadcast packets are incorrectly\nlooped back.\n\nFix the general case, by loading the driver in VEPA mode Until a\nVF or VMDq VSI is added. This way loopback on the Main VSI is\nturned off until needed and can resolve the issue of unnecessary\nreflection for users that do not have VF or VMDq VSIs setup.\n\nThe driver must now coordinate the loopback setting for the Flow\nDirector (FDIR) VSI to make sure it is in sync with the current\nVEB or VEPA mode setting.\n\nThe user can still switch bridge modes from the bridge commands and\nchoose to be in VEPA mode with VF VSIs. Because of hardware\nrequirements, the call to switch to VEB mode when no VF/VMDqs are\npresent will be rejected.\n\nNOTE: This patch uses BIT_ULL as that is preferred going forward,\na followup patch in the lower priority queue to net-next will fix\nup the remaining 1 << usages.\n\nChange-ID: Ib121ddb18fe4b3c4f52e9deda6fcbeb9105683d1\nSigned-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>\nSigned-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h | 1 +\n drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 9 +++++++++\n drivers/net/ethernet/intel/i40e/i40e_main.c | 21 ++++++++++++++++----\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 10 +++++++++-\n 4 files changed, 36 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 33c35d3..e946d75 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -317,6 +317,7 @@ struct i40e_pf {\n #endif\n #define I40E_FLAG_PORT_ID_VALID (u64)(1 << 28)\n #define I40E_FLAG_DCB_CAPABLE (u64)(1 << 29)\n+#define I40E_FLAG_VEB_MODE_ENABLED BIT_ULL(40)\n \n \t/* tracks features that get auto disabled by errors */\n \tu64 auto_disable_flags;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\nindex 34170ea..da0faf4 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n@@ -1021,6 +1021,15 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t\tgoto command_write_done;\n \t\t}\n \n+\t\t/* By default we are in VEPA mode, if this is the first VF/VMDq\n+\t\t * VSI to be added switch to VEB mode.\n+\t\t */\n+\t\tif (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) {\n+\t\t\tpf->flags |= I40E_FLAG_VEB_MODE_ENABLED;\n+\t\t\ti40e_do_reset_safe(pf,\n+\t\t\t\t\t BIT_ULL(__I40E_PF_RESET_REQUESTED));\n+\t\t}\n+\n \t\tvsi = i40e_vsi_setup(pf, I40E_VSI_VMDQ2, vsi_seid, 0);\n \t\tif (vsi)\n \t\t\tdev_info(&pf->pdev->dev, \"added VSI %d to relay %d\\n\",\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex a54c144..853eb2f 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -6097,6 +6097,10 @@ static int i40e_reconstitute_veb(struct i40e_veb *veb)\n \tif (ret)\n \t\tgoto end_reconstitute;\n \n+\tif (pf->flags & I40E_FLAG_VEB_MODE_ENABLED)\n+\t\tveb->bridge_mode = BRIDGE_MODE_VEB;\n+\telse\n+\t\tveb->bridge_mode = BRIDGE_MODE_VEPA;\n \ti40e_config_bridge_mode(veb);\n \n \t/* create the remaining VSIs attached to this VEB */\n@@ -8031,7 +8035,12 @@ static int i40e_ndo_bridge_setlink(struct net_device *dev,\n \t\t} else if (mode != veb->bridge_mode) {\n \t\t\t/* Existing HW bridge but different mode needs reset */\n \t\t\tveb->bridge_mode = mode;\n-\t\t\ti40e_do_reset(pf, (1 << __I40E_PF_RESET_REQUESTED));\n+\t\t\t/* TODO: If no VFs or VMDq VSIs, disallow VEB mode */\n+\t\t\tif (mode == BRIDGE_MODE_VEB)\n+\t\t\t\tpf->flags |= I40E_FLAG_VEB_MODE_ENABLED;\n+\t\t\telse\n+\t\t\t\tpf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;\n+\t\t\ti40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED));\n \t\t\tbreak;\n \t\t}\n \t}\n@@ -8343,11 +8352,12 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)\n \t\tctxt.uplink_seid = vsi->uplink_seid;\n \t\tctxt.connection_type = I40E_AQ_VSI_CONN_TYPE_NORMAL;\n \t\tctxt.flags = I40E_AQ_VSI_TYPE_PF;\n-\t\tif (i40e_is_vsi_uplink_mode_veb(vsi)) {\n+\t\tif ((pf->flags & I40E_FLAG_VEB_MODE_ENABLED) &&\n+\t\t (i40e_is_vsi_uplink_mode_veb(vsi))) {\n \t\t\tctxt.info.valid_sections |=\n-\t\t\t\tcpu_to_le16(I40E_AQ_VSI_PROP_SWITCH_VALID);\n+\t\t\t cpu_to_le16(I40E_AQ_VSI_PROP_SWITCH_VALID);\n \t\t\tctxt.info.switch_id =\n-\t\t\t\tcpu_to_le16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB);\n+\t\t\t cpu_to_le16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB);\n \t\t}\n \t\ti40e_vsi_setup_queue_map(vsi, &ctxt, enabled_tc, true);\n \t\tbreak;\n@@ -8746,6 +8756,9 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,\n \t\t\t\t\t __func__);\n \t\t\t\treturn NULL;\n \t\t\t}\n+\t\t\t/* We come up by default in VEPA mode */\n+\t\t\tveb->bridge_mode = BRIDGE_MODE_VEPA;\n+\t\t\tpf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;\n \t\t\ti40e_config_bridge_mode(veb);\n \t\t}\n \t\tfor (i = 0; i < I40E_MAX_VEB && !veb; i++) {\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex 78d1c4f..4e9376d 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -1018,11 +1018,19 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)\n {\n \tstruct i40e_pf *pf = pci_get_drvdata(pdev);\n \n-\tif (num_vfs)\n+\tif (num_vfs) {\n+\t\tif (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) {\n+\t\t\tpf->flags |= I40E_FLAG_VEB_MODE_ENABLED;\n+\t\t\ti40e_do_reset_safe(pf,\n+\t\t\t\t\t BIT_ULL(__I40E_PF_RESET_REQUESTED));\n+\t\t}\n \t\treturn i40e_pci_sriov_enable(pdev, num_vfs);\n+\t}\n \n \tif (!pci_vfs_assigned(pf->pdev)) {\n \t\ti40e_free_vfs(pf);\n+\t\tpf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;\n+\t\ti40e_do_reset_safe(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED));\n \t} else {\n \t\tdev_warn(&pdev->dev, \"Unable to free VFs because some are assigned to VMs.\\n\");\n \t\treturn -EINVAL;\n", "prefixes": [ "net", "2/2" ] }