get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1310824/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1310824,
    "url": "http://patchwork.ozlabs.org/api/patches/1310824/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200617000555.15985-1-arkadiusz.kubalewski@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": "<20200617000555.15985-1-arkadiusz.kubalewski@intel.com>",
    "list_archive_url": null,
    "date": "2020-06-17T00:05:55",
    "name": "[v3] i40e: Add support for a new feature: Total Port Shutdown",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "f634070364e6f30ca4a3e7367a2c38d8b65e0c05",
    "submitter": {
        "id": 78857,
        "url": "http://patchwork.ozlabs.org/api/people/78857/?format=api",
        "name": "Arkadiusz Kubalewski",
        "email": "arkadiusz.kubalewski@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/20200617000555.15985-1-arkadiusz.kubalewski@intel.com/mbox/",
    "series": [
        {
            "id": 183868,
            "url": "http://patchwork.ozlabs.org/api/series/183868/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=183868",
            "date": "2020-06-17T00:05:55",
            "name": "[v3] i40e: Add support for a new feature: Total Port Shutdown",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/183868/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1310824/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1310824/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 spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)",
            "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49mlqH6zbXz9sSd\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 17 Jun 2020 10:11:39 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 5D5E287A5C;\n\tWed, 17 Jun 2020 00:11:38 +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 6OifiH_FDlQK; Wed, 17 Jun 2020 00:11:37 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 2055887A4E;\n\tWed, 17 Jun 2020 00:11:37 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by ash.osuosl.org (Postfix) with ESMTP id 14CE51BF982\n for <intel-wired-lan@lists.osuosl.org>; Wed, 17 Jun 2020 00:11:36 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by fraxinus.osuosl.org (Postfix) with ESMTP id 1043587A4E\n for <intel-wired-lan@lists.osuosl.org>; Wed, 17 Jun 2020 00:11:36 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id K79AwPQExO_G for <intel-wired-lan@lists.osuosl.org>;\n Wed, 17 Jun 2020 00:11:34 +0000 (UTC)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by fraxinus.osuosl.org (Postfix) with ESMTPS id B0D0A878E6\n for <intel-wired-lan@lists.osuosl.org>; Wed, 17 Jun 2020 00:11:34 +0000 (UTC)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 16 Jun 2020 17:11:26 -0700",
            "from amlin-018-053.igk.intel.com ([10.102.18.53])\n by fmsmga001.fm.intel.com with ESMTP; 16 Jun 2020 17:11:24 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "IronPort-SDR": [
            "\n +6W4LDvhPkB5feISsdepJV5QYQXCYhpHalZizu5q60/0WR2Fr9AbAe5sQ3rLkDe+q1nvtXA1lH\n 4e+KCgeWZXtg==",
            "\n c6GoOZM3od6KmzwAjyXKWOnAyDfkvVM/A7CjJjJQcZHQFuakV73x/cu9kmqms3OuchCjfGZyE2\n U/cKqECVsrgA=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,520,1583222400\"; d=\"scan'208\";a=\"383030663\"",
        "From": "Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 17 Jun 2020 00:05:55 +0000",
        "Message-Id": "<20200617000555.15985-1-arkadiusz.kubalewski@intel.com>",
        "X-Mailer": "git-send-email 2.26.0",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH v3] i40e: Add support for a new feature:\n Total Port Shutdown",
        "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 <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <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 <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Cc": "Aleksandr Loktionov <aleksandr.loktionov@intel.com>",
        "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": "After OS requests to down a link on a physical network port, the\ntraffic is no longer being processed but the physical link with\na link partner is still established.\n\nCurrently there is a feature (Link down on close) which allows\nto physically bring the link down (after OS request).\n\nWith this patch new feature with similar capability is introduced:\nTOTAL_PORT_SHUTDOWN\nAllows to physically disable the link on the NIC's port.\nIf enabled, (after link down request from the OS)\nno link, traffic or led activity is possible on that port.\n\nIf I40E_FLAG_TOTAL_PORT_SHUTDOWN is enabled, the\nI40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED must be explicitly forced to\ntrue and cannot be disabled at that time.\nThe functionalities are exclusive in terms of configuration, but\nthey also have similar behavior (allowing to disable physical link\nof the port), with following differences:\n- LINK_DOWN_ON_CLOSE_ENABLED is configurable at host OS run-time\n  and is supported by whole family of 7xx Intel Ethernet Controllers\n- TOTAL_PORT_SHUTDOWN may be enabled only before OS loads (in BIOS)\n  only if motherboard's BIOS and NIC's FW has support of it\n- when LINK_DOWN_ON_CLOSE_ENABLED is used, the link is being brought\n  down by sending phy_type=0 to NIC's FW\n- when TOTAL_PORT_SHUTDOWN is used, phy_type is not altered, instead\n  the link is being brought down by clearing bit\n  (I40E_AQ_PHY_ENABLE_LINK) in abilities field of\n  i40e_aq_set_phy_config structure\n\nIntroduced changes:\n- new private flag I40E_FLAG_TOTAL_PORT_SHUTDOWN for handling the\n  feature\n- probe of NVM if the feature was enabled at driver's port\n  initialization\n- special handling on link-down procedure to let FW physically\n  shutdown the port if the feature was enabled\n\nSigned-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>\nSigned-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\n---\nv3:\n- error messages changed\n- '_ENABLED' suffix in a new private flag name\n- new comment for documentation of a new private flag\n- rewrite commit message\n\n--- Cut off before submitting to external review ---\nTesting Hints (required if no HSD):\nLink up/down, link-down-on-close\n\nChange-Id: I5427227c31b5e2d30f1149ad8d27d475caa27241\nTitle: i40e: Add support for a new feature: Total Port Shutdown\nChange-type: FeatureImplementation\nHSDES-Number: 2209979406\nHSDES-Tenant: server_platf_lan.bug\n---\n drivers/net/ethernet/intel/i40e/i40e.h        |  22 ++++\n .../net/ethernet/intel/i40e/i40e_ethtool.c    |   9 ++\n drivers/net/ethernet/intel/i40e/i40e_main.c   | 124 +++++++++++++++---\n 3 files changed, 134 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 4833187..f9b966f 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -567,6 +567,28 @@ struct i40e_pf {\n #define I40E_FLAG_DISABLE_FW_LLDP\t\tBIT(24)\n #define I40E_FLAG_RS_FEC\t\t\tBIT(25)\n #define I40E_FLAG_BASE_R_FEC\t\t\tBIT(26)\n+/* TOTAL_PORT_SHUTDOWN\n+ * Allows to physically disable the link on the NIC's port.\n+ * If enabled, (after link down request from the OS)\n+ * no link, traffic or led activity is possible on that port.\n+ *\n+ * If I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED is set, the\n+ * I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED must be explicitly forced to true\n+ * and cannot be disabled by system admin at that time.\n+ * The functionalities are exclusive in terms of configuration, but they also\n+ * have similar behavior (allowing to disable physical link of the port),\n+ * with following differences:\n+ * - LINK_DOWN_ON_CLOSE_ENABLED is configurable at host OS run-time and is\n+ *   supported by whole family of 7xx Intel Ethernet Controllers\n+ * - TOTAL_PORT_SHUTDOWN may be enabled only before OS loads (in BIOS)\n+ *   only if motherboard's BIOS and NIC's FW has support of it\n+ * - when LINK_DOWN_ON_CLOSE_ENABLED is used, the link is being brought down\n+ *   by sending phy_type=0 to NIC's FW\n+ * - when TOTAL_PORT_SHUTDOWN is used, phy_type is not altered, instead\n+ *   the link is being brought down by clearing bit (I40E_AQ_PHY_ENABLE_LINK)\n+ *   in abilities field of i40e_aq_set_phy_config structure\n+ */\n+#define I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED\tBIT(27)\n \n \tstruct i40e_client_instance *cinst;\n \tbool stat_offsets_loaded;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 317f3f1..1cb65da 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -428,6 +428,8 @@ struct i40e_priv_flags {\n static const struct i40e_priv_flags i40e_gstrings_priv_flags[] = {\n \t/* NOTE: MFP setting cannot be changed */\n \tI40E_PRIV_FLAG(\"MFP\", I40E_FLAG_MFP_ENABLED, 1),\n+\tI40E_PRIV_FLAG(\"total-port-shutdown\",\n+\t\t       I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED, 1),\n \tI40E_PRIV_FLAG(\"LinkPolling\", I40E_FLAG_LINK_POLLING_ENABLED, 0),\n \tI40E_PRIV_FLAG(\"flow-director-atr\", I40E_FLAG_FD_ATR_ENABLED, 0),\n \tI40E_PRIV_FLAG(\"veb-stats\", I40E_FLAG_VEB_STATS_ENABLED, 0),\n@@ -5006,6 +5008,13 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)\n \t\t\tdev_warn(&pf->pdev->dev, \"Cannot change FEC config\\n\");\n \t}\n \n+\tif ((changed_flags & I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED) &&\n+\t    (orig_flags & I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED)) {\n+\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\"Setting link-down-on-close not supported on this port (because total-port-shutdown is enabled)\\n\");\n+\t\treturn -EOPNOTSUPP;\n+\t}\n+\n \tif ((changed_flags & new_flags &\n \t     I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED) &&\n \t    (new_flags & I40E_FLAG_MFP_ENABLED))\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 8c3e753..c872298 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -54,7 +54,7 @@ static void i40e_fdir_sb_setup(struct i40e_pf *pf);\n static int i40e_veb_get_bw_info(struct i40e_veb *veb);\n static int i40e_get_capabilities(struct i40e_pf *pf,\n \t\t\t\t enum i40e_admin_queue_opc list_type);\n-\n+static bool i40e_is_total_port_shutdown_enabled(struct i40e_pf *pf);\n \n /* i40e_pci_tbl - PCI Device ID Table\n  *\n@@ -6672,21 +6672,6 @@ static void i40e_vsi_reinit_locked(struct i40e_vsi *vsi)\n \tclear_bit(__I40E_CONFIG_BUSY, pf->state);\n }\n \n-/**\n- * i40e_up - Bring the connection back up after being down\n- * @vsi: the VSI being configured\n- **/\n-int i40e_up(struct i40e_vsi *vsi)\n-{\n-\tint err;\n-\n-\terr = i40e_vsi_configure(vsi);\n-\tif (!err)\n-\t\terr = i40e_up_complete(vsi);\n-\n-\treturn err;\n-}\n-\n /**\n  * i40e_force_link_state - Force the link status\n  * @pf: board private structure\n@@ -6696,6 +6681,7 @@ static i40e_status i40e_force_link_state(struct i40e_pf *pf, bool is_up)\n {\n \tstruct i40e_aq_get_phy_abilities_resp abilities;\n \tstruct i40e_aq_set_phy_config config = {0};\n+\tbool non_zero_phy_type = is_up;\n \tstruct i40e_hw *hw = &pf->hw;\n \ti40e_status err;\n \tu64 mask;\n@@ -6731,8 +6717,11 @@ static i40e_status i40e_force_link_state(struct i40e_pf *pf, bool is_up)\n \n \t/* If link needs to go up, but was not forced to go down,\n \t * and its speed values are OK, no need for a flap\n+\t * if non_zero_phy_type was set, still need to force up\n \t */\n-\tif (is_up && abilities.phy_type != 0 && abilities.link_speed != 0)\n+\tif (pf->flags & I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED)\n+\t\tnon_zero_phy_type = true;\n+\telse if (is_up && abilities.phy_type != 0 && abilities.link_speed != 0)\n \t\treturn I40E_SUCCESS;\n \n \t/* To force link we need to set bits for all supported PHY types,\n@@ -6740,10 +6729,18 @@ static i40e_status i40e_force_link_state(struct i40e_pf *pf, bool is_up)\n \t * across two fields.\n \t */\n \tmask = I40E_PHY_TYPES_BITMASK;\n-\tconfig.phy_type = is_up ? cpu_to_le32((u32)(mask & 0xffffffff)) : 0;\n-\tconfig.phy_type_ext = is_up ? (u8)((mask >> 32) & 0xff) : 0;\n+\tconfig.phy_type =\n+\t\tnon_zero_phy_type ? cpu_to_le32((u32)(mask & 0xffffffff)) : 0;\n+\tconfig.phy_type_ext =\n+\t\tnon_zero_phy_type ? (u8)((mask >> 32) & 0xff) : 0;\n \t/* Copy the old settings, except of phy_type */\n \tconfig.abilities = abilities.abilities;\n+\tif (pf->flags & I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED) {\n+\t\tif (is_up)\n+\t\t\tconfig.abilities |= I40E_AQ_PHY_ENABLE_LINK;\n+\t\telse\n+\t\t\tconfig.abilities &= ~(I40E_AQ_PHY_ENABLE_LINK);\n+\t}\n \tif (abilities.link_speed != 0)\n \t\tconfig.link_speed = abilities.link_speed;\n \telse\n@@ -6774,11 +6771,31 @@ static i40e_status i40e_force_link_state(struct i40e_pf *pf, bool is_up)\n \t\ti40e_update_link_info(hw);\n \t}\n \n-\ti40e_aq_set_link_restart_an(hw, true, NULL);\n+\ti40e_aq_set_link_restart_an(hw, is_up, NULL);\n \n \treturn I40E_SUCCESS;\n }\n \n+/**\n+ * i40e_up - Bring the connection back up after being down\n+ * @vsi: the VSI being configured\n+ **/\n+int i40e_up(struct i40e_vsi *vsi)\n+{\n+\tint err;\n+\n+\tif (vsi->type == I40E_VSI_MAIN &&\n+\t    (vsi->back->flags & I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED ||\n+\t     vsi->back->flags & I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED))\n+\t\ti40e_force_link_state(vsi->back, true);\n+\n+\terr = i40e_vsi_configure(vsi);\n+\tif (!err)\n+\t\terr = i40e_up_complete(vsi);\n+\n+\treturn err;\n+}\n+\n /**\n  * i40e_down - Shutdown the connection processing\n  * @vsi: the VSI being stopped\n@@ -6797,7 +6814,8 @@ void i40e_down(struct i40e_vsi *vsi)\n \ti40e_vsi_disable_irq(vsi);\n \ti40e_vsi_stop_rings(vsi);\n \tif (vsi->type == I40E_VSI_MAIN &&\n-\t    vsi->back->flags & I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED)\n+\t   (vsi->back->flags & I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED ||\n+\t    vsi->back->flags & I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED))\n \t\ti40e_force_link_state(vsi->back, false);\n \ti40e_napi_disable_all(vsi);\n \n@@ -11837,6 +11855,60 @@ i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf)\n \treturn ret;\n }\n \n+/**\n+ * i40e_is_total_port_shutdown_enabled - read nvm and return value\n+ * if total port shutdown feature is enabled for this pf\n+ * @pf: board private structure\n+ **/\n+static bool i40e_is_total_port_shutdown_enabled(struct i40e_pf *pf)\n+{\n+#define I40E_TOTAL_PORT_SHUTDOWN_ENABLED\tBIT(4)\n+#define I40E_FEATURES_ENABLE_PTR\t\t0x2A\n+#define I40E_CURRENT_SETTING_PTR\t\t0x2B\n+#define I40E_LINK_BEHAVIOR_WORD_OFFSET\t\t0x2D\n+#define I40E_LINK_BEHAVIOR_WORD_LENGTH\t\t0x1\n+#define I40E_LINK_BEHAVIOR_OS_FORCED_ENABLED\tBIT(0)\n+#define I40E_LINK_BEHAVIOR_PORT_BIT_LENGTH\t4\n+\ti40e_status read_status = I40E_SUCCESS;\n+\tu16 sr_emp_sr_settings_ptr = 0;\n+\tu16 features_enable = 0;\n+\tu16 link_behavior = 0;\n+\tbool ret = false;\n+\n+\tread_status = i40e_read_nvm_word(&pf->hw,\n+\t\t\t\t\t I40E_SR_EMP_SR_SETTINGS_PTR,\n+\t\t\t\t\t &sr_emp_sr_settings_ptr);\n+\tif (read_status)\n+\t\tgoto err_nvm;\n+\tread_status = i40e_read_nvm_word(&pf->hw,\n+\t\t\t\t\t sr_emp_sr_settings_ptr +\n+\t\t\t\t\t I40E_FEATURES_ENABLE_PTR,\n+\t\t\t\t\t &features_enable);\n+\tif (read_status)\n+\t\tgoto err_nvm;\n+\tif (I40E_TOTAL_PORT_SHUTDOWN_ENABLED & features_enable) {\n+\t\tread_status =\n+\t\ti40e_read_nvm_module_data(&pf->hw,\n+\t\t\t\t\t  I40E_SR_EMP_SR_SETTINGS_PTR,\n+\t\t\t\t\t  I40E_CURRENT_SETTING_PTR,\n+\t\t\t\t\t  I40E_LINK_BEHAVIOR_WORD_OFFSET,\n+\t\t\t\t\t  I40E_LINK_BEHAVIOR_WORD_LENGTH,\n+\t\t\t\t\t  &link_behavior);\n+\t\tif (read_status)\n+\t\t\tgoto err_nvm;\n+\t\tlink_behavior >>=\n+\t\t(pf->hw.port * I40E_LINK_BEHAVIOR_PORT_BIT_LENGTH);\n+\t\tret = I40E_LINK_BEHAVIOR_OS_FORCED_ENABLED & link_behavior;\n+\t}\n+\treturn ret;\n+\n+err_nvm:\n+\tdev_warn(&pf->pdev->dev,\n+\t\t \"total-port-shutdown feature is off due to read nvm error:%s\\n\",\n+\t\t i40e_stat_str(&pf->hw, read_status));\n+\treturn ret;\n+}\n+\n /**\n  * i40e_sw_init - Initialize general software structures (struct i40e_pf)\n  * @pf: board private structure to initialize\n@@ -12012,6 +12084,16 @@ static int i40e_sw_init(struct i40e_pf *pf)\n \n \tpf->tx_timeout_recovery_level = 1;\n \n+\tif (pf->hw.mac.type != I40E_MAC_X722 &&\n+\t    i40e_is_total_port_shutdown_enabled(pf)) {\n+\t\t/* Link down on close must be on when total port shutdown\n+\t\t * is enabled for a given port\n+\t\t */\n+\t\tpf->flags |= (I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED\n+\t\t\t  | I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED);\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"total-port-shutdown was enabled, link-down-on-close is forced on\\n\");\n+\t}\n \tmutex_init(&pf->switch_mutex);\n \n sw_init_done:\n",
    "prefixes": [
        "v3"
    ]
}