Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1086503/?format=api
{ "id": 1086503, "url": "http://patchwork.ozlabs.org/api/patches/1086503/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190416173503.29847-7-anirudh.venkataramanan@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": "<20190416173503.29847-7-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2019-04-16T17:34:55", "name": "[S21,06/14] ice: Add switch rules to handle LLDP packets", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "cf16c9c0ee945e68774714e8ff7c0f015e280a59", "submitter": { "id": 73601, "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api", "name": "Anirudh Venkataramanan", "email": "anirudh.venkataramanan@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/20190416173503.29847-7-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 103110, "url": "http://patchwork.ozlabs.org/api/series/103110/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=103110", "date": "2019-04-16T17:34:49", "name": "Fixes and feature updates for ice", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/103110/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1086503/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1086503/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.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 44kCFk3gncz9s70\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 17 Apr 2019 03:35:54 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id D20C4870B2;\n\tTue, 16 Apr 2019 17:35:52 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id TI0akMBzFXu9; Tue, 16 Apr 2019 17:35:49 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 7941986E88;\n\tTue, 16 Apr 2019 17:35:49 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 6A0B61BF9A0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:44 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 678AA241AE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:44 +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 IFWnv8ZDV2GA for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:38 +0000 (UTC)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 64BC925716\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:35:37 +0000 (UTC)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Apr 2019 10:35:36 -0700", "from shasta.jf.intel.com ([10.166.244.191])\n\tby fmsmga001.fm.intel.com with ESMTP; 16 Apr 2019 10:35:36 -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.60,358,1549958400\"; d=\"scan'208\";a=\"165278545\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 16 Apr 2019 10:34:55 -0700", "Message-Id": "<20190416173503.29847-7-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190416173503.29847-1-anirudh.venkataramanan@intel.com>", "References": "<20190416173503.29847-1-anirudh.venkataramanan@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S21 06/14] ice: Add switch rules to handle\n\tLLDP packets", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "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>", "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": "From: Dave Ertman <david.m.ertman@intel.com>\n\nAdd call to configure dropping egress LLDP packets in ice_vsi_setup\nand remove the rule in ice_vsi_release.\n\nAdd calls to add/remove rule to route LLDP packets to default VSI when\nFW LLDP engine is disabled/enabled and remove rule if applied during\nice_vsi_release.\n\nIn the function ice_add_eth_mac(), there is a line that hardcodes the\nfilter info flag to TX. This is incorrect as this flag will be set by\nthe calling function that built the list of filters to add. So remove\nthe hardcoded value.\n\nThis patch also contains a fix to stop treating the DCBx state of\n\"Not Started\" as an error state that kicks DCB in SW mode. This will\naddress having non-cabled interfaces automatically go into SW mode\nwith the FW engine running.\n\nSigned-off-by: Dave Ertman <david.m.ertman@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n[Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> cleaned up commit message]\n---\n drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 4 +-\n drivers/net/ethernet/intel/ice/ice_ethtool.c | 11 +++\n drivers/net/ethernet/intel/ice/ice_lib.c | 70 +++++++++++++++++++-\n drivers/net/ethernet/intel/ice/ice_lib.h | 2 +\n drivers/net/ethernet/intel/ice/ice_switch.c | 5 +-\n 5 files changed, 86 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\nindex b04295ab35d5..e1db24cde38a 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n@@ -387,10 +387,8 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)\n \t\tset_bit(ICE_FLAG_ENABLE_FW_LLDP, pf->flags);\n \t}\n \n-\tif (port_info->dcbx_status == ICE_DCBX_STATUS_NOT_STARTED) {\n-\t\tsw_default = 1;\n+\tif (port_info->dcbx_status == ICE_DCBX_STATUS_NOT_STARTED)\n \t\tdev_info(&pf->pdev->dev, \"DCBX not started\\n\");\n-\t}\n \n \tif (sw_default) {\n \t\terr = ice_dcb_sw_dflt_cfg(pf, locked);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c\nindex 2da83847b9dc..6beb918f625f 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c\n@@ -1205,6 +1205,7 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\tif (!test_bit(ICE_FLAG_ENABLE_FW_LLDP, pf->flags)) {\n \t\t\tenum ice_status status;\n \n+\t\t\t/* Disable FW LLDP engine */\n \t\t\tstatus = ice_aq_cfg_lldp_mib_change(&pf->hw, false,\n \t\t\t\t\t\t\t NULL);\n \t\t\t/* If unregistering for LLDP events fails, this is\n@@ -1229,6 +1230,11 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\tstatus = ice_init_pf_dcb(pf, true);\n \t\t\tif (status)\n \t\t\t\tdev_warn(&pf->pdev->dev, \"Fail to init DCB\\n\");\n+\n+\t\t\t/* Forward LLDP packets to default VSI so that they\n+\t\t\t * are passed up the stack\n+\t\t\t */\n+\t\t\tice_cfg_sw_lldp(vsi, false, true);\n \t\t} else {\n \t\t\tenum ice_status status;\n \t\t\tbool dcbx_agent_status;\n@@ -1262,6 +1268,11 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\tstatus = ice_init_pf_dcb(pf, true);\n \t\t\tif (status)\n \t\t\t\tdev_dbg(&pf->pdev->dev, \"Fail to init DCB\\n\");\n+\n+\t\t\t/* Remove rule to direct LLDP packets to default VSI.\n+\t\t\t * The FW LLDP engine will now be consuming them.\n+\t\t\t */\n+\t\t\tice_cfg_sw_lldp(vsi, false, false);\n \t\t}\n \t}\n \tclear_bit(ICE_FLAG_ETHTOOL_CTXT, pf->flags);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex d0410c686ef4..e203c7114803 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -2345,6 +2345,53 @@ ice_vsi_add_rem_eth_mac(struct ice_vsi *vsi, bool add_rule)\n \tice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);\n }\n \n+/** ice_cfg_sw_lldp - Config switch rules for LLDP packet handling\n+ * @vsi: the VSI being configured\n+ * @tx: bool to determine Tx or Rx rule\n+ * @create: bool to determine create or remove Rule\n+ */\n+void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create)\n+{\n+\tstruct ice_fltr_list_entry *list;\n+\tstruct ice_pf *pf = vsi->back;\n+\tLIST_HEAD(tmp_add_list);\n+\tenum ice_status status;\n+\n+\tlist = devm_kzalloc(&pf->pdev->dev, sizeof(*list), GFP_KERNEL);\n+\tif (!list)\n+\t\treturn;\n+\n+\tlist->fltr_info.lkup_type = ICE_SW_LKUP_ETHERTYPE;\n+\tlist->fltr_info.vsi_handle = vsi->idx;\n+\tlist->fltr_info.l_data.ethertype_mac.ethertype = ETH_P_LLDP;\n+\n+\tif (tx) {\n+\t\tlist->fltr_info.fltr_act = ICE_DROP_PACKET;\n+\t\tlist->fltr_info.flag = ICE_FLTR_TX;\n+\t\tlist->fltr_info.src_id = ICE_SRC_ID_VSI;\n+\t} else {\n+\t\tlist->fltr_info.fltr_act = ICE_FWD_TO_VSI;\n+\t\tlist->fltr_info.flag = ICE_FLTR_RX;\n+\t\tlist->fltr_info.src_id = ICE_SRC_ID_LPORT;\n+\t}\n+\n+\tINIT_LIST_HEAD(&list->list_entry);\n+\tlist_add(&list->list_entry, &tmp_add_list);\n+\n+\tif (create)\n+\t\tstatus = ice_add_eth_mac(&pf->hw, &tmp_add_list);\n+\telse\n+\t\tstatus = ice_remove_eth_mac(&pf->hw, &tmp_add_list);\n+\n+\tif (status)\n+\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\"Fail %s %s LLDP rule on VSI %i error: %d\\n\",\n+\t\t\tcreate ? \"adding\" : \"removing\", tx ? \"TX\" : \"RX\",\n+\t\t\tvsi->vsi_num, status);\n+\n+\tice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);\n+}\n+\n /**\n * ice_vsi_setup - Set up a VSI by a given type\n * @pf: board private structure\n@@ -2487,10 +2534,22 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,\n \t * out PAUSE or PFC frames. If enabled, FW can still send FC frames.\n \t * The rule is added once for PF VSI in order to create appropriate\n \t * recipe, since VSI/VSI list is ignored with drop action...\n+\t * Also add rules to handle LLDP Tx and Rx packets. Tx LLDP packets\n+\t * need to be dropped so that VFs cannot send LLDP packets to reconfig\n+\t * DCB settings in the HW. Also, if the FW DCBx engine is not running\n+\t * then Rx LLDP packets need to be redirected up the stack.\n \t */\n-\tif (vsi->type == ICE_VSI_PF)\n+\tif (vsi->type == ICE_VSI_PF) {\n \t\tice_vsi_add_rem_eth_mac(vsi, true);\n \n+\t\t/* Tx LLDP packets */\n+\t\tice_cfg_sw_lldp(vsi, true, true);\n+\n+\t\t/* Rx LLDP packets */\n+\t\tif (!test_bit(ICE_FLAG_ENABLE_FW_LLDP, pf->flags))\n+\t\t\tice_cfg_sw_lldp(vsi, false, true);\n+\t}\n+\n \treturn vsi;\n \n unroll_vector_base:\n@@ -2829,8 +2888,15 @@ int ice_vsi_release(struct ice_vsi *vsi)\n \t\tpf->num_avail_sw_msix += vsi->num_q_vectors;\n \t}\n \n-\tif (vsi->type == ICE_VSI_PF)\n+\tif (vsi->type == ICE_VSI_PF) {\n \t\tice_vsi_add_rem_eth_mac(vsi, false);\n+\t\tice_cfg_sw_lldp(vsi, true, false);\n+\t\t/* The Rx rule will only exist to remove if the LLDP FW\n+\t\t * engine is currently stopped\n+\t\t */\n+\t\tif (!test_bit(ICE_FLAG_ENABLE_FW_LLDP, pf->flags))\n+\t\t\tice_cfg_sw_lldp(vsi, false, false);\n+\t}\n \n \tice_remove_vsi_fltr(&pf->hw, vsi->idx);\n \tice_rm_vsi_lan_cfg(vsi->port_info, vsi->idx);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h\nindex 2acae3215f5f..6e43ef03bfc3 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.h\n@@ -45,6 +45,8 @@ ice_vsi_stop_lan_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,\n \n int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc);\n \n+void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create);\n+\n void ice_vsi_delete(struct ice_vsi *vsi);\n \n int ice_vsi_clear(struct ice_vsi *vsi);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c\nindex 6a7aadbc508e..3dc29aa5fbcd 100644\n--- a/drivers/net/ethernet/intel/ice/ice_switch.c\n+++ b/drivers/net/ethernet/intel/ice/ice_switch.c\n@@ -1973,6 +1973,10 @@ ice_add_vlan(struct ice_hw *hw, struct list_head *v_list)\n * ice_add_eth_mac - Add ethertype and MAC based filter rule\n * @hw: pointer to the hardware structure\n * @em_list: list of ether type MAC filter, MAC is optional\n+ *\n+ * This function requires the caller to populate the entries in\n+ * the filter list with the necessary fields (including flags to\n+ * indicate Tx or Rx rules).\n */\n enum ice_status\n ice_add_eth_mac(struct ice_hw *hw, struct list_head *em_list)\n@@ -1990,7 +1994,6 @@ ice_add_eth_mac(struct ice_hw *hw, struct list_head *em_list)\n \t\t l_type != ICE_SW_LKUP_ETHERTYPE)\n \t\t\treturn ICE_ERR_PARAM;\n \n-\t\tem_list_itr->fltr_info.flag = ICE_FLTR_TX;\n \t\tem_list_itr->status = ice_add_rule_internal(hw, l_type,\n \t\t\t\t\t\t\t em_list_itr);\n \t\tif (em_list_itr->status)\n", "prefixes": [ "S21", "06/14" ] }