Author: erj
Date: Tue May  1 18:50:12 2018
New Revision: 333149
URL: https://svnweb.freebsd.org/changeset/base/333149

Log:
  ixl(4): Update to 1.9.9-k
  
  Refresh upstream driver before impending conversion to iflib.
  
  Major changes:
  
  - Support for descriptor writeback mode (required by ixlv(4) for AVF support)
  - Ability to disable firmware LLDP agent by user (PR 221530)
  - Fix for TX queue hang when using TSO (PR 221919)
  - Separate descriptor ring sizes for TX and RX rings
  
  PR:           221530, 221919
  Submitted by: Krzysztof Galazka <krzysztof.gala...@intel.com>
  Reviewed by:  #IntelNetworking
  MFC after:    1 day
  Relnotes:     Yes
  Sponsored by: Intel Corporation
  Differential Revision:        https://reviews.freebsd.org/D14985

Added:
  head/sys/dev/ixl/i40e_dcb.c   (contents, props changed)
  head/sys/dev/ixl/i40e_dcb.h   (contents, props changed)
  head/sys/dev/ixl/virtchnl.h   (contents, props changed)
Deleted:
  head/sys/dev/ixl/i40e_virtchnl.h
Modified:
  head/sys/conf/files.amd64
  head/sys/dev/ixl/i40e_adminq.c
  head/sys/dev/ixl/i40e_adminq.h
  head/sys/dev/ixl/i40e_adminq_cmd.h
  head/sys/dev/ixl/i40e_alloc.h
  head/sys/dev/ixl/i40e_common.c
  head/sys/dev/ixl/i40e_devids.h
  head/sys/dev/ixl/i40e_hmc.c
  head/sys/dev/ixl/i40e_hmc.h
  head/sys/dev/ixl/i40e_lan_hmc.c
  head/sys/dev/ixl/i40e_lan_hmc.h
  head/sys/dev/ixl/i40e_nvm.c
  head/sys/dev/ixl/i40e_osdep.c
  head/sys/dev/ixl/i40e_osdep.h
  head/sys/dev/ixl/i40e_prototype.h
  head/sys/dev/ixl/i40e_register.h
  head/sys/dev/ixl/i40e_status.h
  head/sys/dev/ixl/i40e_type.h
  head/sys/dev/ixl/if_ixl.c
  head/sys/dev/ixl/if_ixlv.c
  head/sys/dev/ixl/ixl.h
  head/sys/dev/ixl/ixl_iw.c
  head/sys/dev/ixl/ixl_iw.h
  head/sys/dev/ixl/ixl_iw_int.h
  head/sys/dev/ixl/ixl_pf.h
  head/sys/dev/ixl/ixl_pf_i2c.c
  head/sys/dev/ixl/ixl_pf_iov.c
  head/sys/dev/ixl/ixl_pf_iov.h
  head/sys/dev/ixl/ixl_pf_main.c
  head/sys/dev/ixl/ixl_pf_qmgr.c
  head/sys/dev/ixl/ixl_pf_qmgr.h
  head/sys/dev/ixl/ixl_txrx.c
  head/sys/dev/ixl/ixlv.h
  head/sys/dev/ixl/ixlv_vc_mgr.h
  head/sys/dev/ixl/ixlvc.c
  head/sys/modules/ixl/Makefile

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64   Tue May  1 18:28:42 2018        (r333148)
+++ head/sys/conf/files.amd64   Tue May  1 18:50:12 2018        (r333149)
@@ -290,6 +290,8 @@ dev/ixl/i40e_nvm.c          optional        ixl pci | ixlv 
pci \
        compile-with "${NORMAL_C} -I$S/dev/ixl"
 dev/ixl/i40e_adminq.c          optional        ixl pci | ixlv pci \
        compile-with "${NORMAL_C} -I$S/dev/ixl"
+dev/ixl/i40e_dcb.c             optional        ixl pci \
+       compile-with "${NORMAL_C} -I$S/dev/ixl"
 dev/fdc/fdc.c                  optional        fdc
 dev/fdc/fdc_acpi.c             optional        fdc
 dev/fdc/fdc_isa.c              optional        fdc isa

Modified: head/sys/dev/ixl/i40e_adminq.c
==============================================================================
--- head/sys/dev/ixl/i40e_adminq.c      Tue May  1 18:28:42 2018        
(r333148)
+++ head/sys/dev/ixl/i40e_adminq.c      Tue May  1 18:50:12 2018        
(r333149)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2013-2015, Intel Corporation 
+  Copyright (c) 2013-2017, Intel Corporation
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -644,6 +644,24 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw 
                           &oem_lo);
        hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo;
 
+       /* The ability to RX (not drop) 802.1ad frames was added in API 1.7 */
+       if ((hw->aq.api_maj_ver > 1) ||
+           ((hw->aq.api_maj_ver == 1) &&
+            (hw->aq.api_min_ver >= 7)))
+               hw->flags |= I40E_HW_FLAG_802_1AD_CAPABLE;
+
+       if (hw->mac.type == I40E_MAC_XL710 &&
+           hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
+           hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) {
+               hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE;
+       }
+
+       /* Newer versions of firmware require lock when reading the NVM */
+       if ((hw->aq.api_maj_ver > 1) ||
+           ((hw->aq.api_maj_ver == 1) &&
+            (hw->aq.api_min_ver >= 5)))
+               hw->flags |= I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK;
+
        if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) {
                ret_code = I40E_ERR_FIRMWARE_API_VERSION;
                goto init_adminq_free_arq;
@@ -899,8 +917,8 @@ enum i40e_status_code i40e_asq_send_command(struct i40
                         */
                        if (i40e_asq_done(hw))
                                break;
-                       i40e_msec_delay(1);
-                       total_delay++;
+                       i40e_usec_delay(50);
+                       total_delay += 50;
                } while (total_delay < hw->aq.asq_cmd_timeout);
        }
 
@@ -941,10 +959,15 @@ enum i40e_status_code i40e_asq_send_command(struct i40
        /* update the error if time out occurred */
        if ((!cmd_completed) &&
            (!details->async && !details->postpone)) {
-               i40e_debug(hw,
-                          I40E_DEBUG_AQ_MESSAGE,
-                          "AQTX: Writeback timeout.\n");
-               status = I40E_ERR_ADMIN_QUEUE_TIMEOUT;
+               if (rd32(hw, hw->aq.asq.len) & I40E_GL_ATQLEN_ATQCRIT_MASK) {
+                       i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
+                                  "AQTX: AQ Critical error.\n");
+                       status = I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR;
+               } else {
+                       i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
+                                  "AQTX: Writeback timeout.\n");
+                       status = I40E_ERR_ADMIN_QUEUE_TIMEOUT;
+               }
        }
 
 asq_send_command_error:
@@ -1007,9 +1030,9 @@ enum i40e_status_code i40e_clean_arq_element(struct i4
 
        /* set next_to_use to head */
        if (!i40e_is_vf(hw))
-               ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK);
-       if (i40e_is_vf(hw))
-               ntu = (rd32(hw, hw->aq.arq.head) & I40E_VF_ARQH1_ARQH_MASK);
+               ntu = rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK;
+       else
+               ntu = rd32(hw, hw->aq.arq.head) & I40E_VF_ARQH1_ARQH_MASK;
        if (ntu == ntc) {
                /* nothing to do - shouldn't need to update ring's values */
                ret_code = I40E_ERR_ADMIN_QUEUE_NO_WORK;
@@ -1067,7 +1090,7 @@ enum i40e_status_code i40e_clean_arq_element(struct i4
        hw->aq.arq.next_to_clean = ntc;
        hw->aq.arq.next_to_use = ntu;
 
-       i40e_nvmupd_check_wait_event(hw, LE16_TO_CPU(e->desc.opcode));
+       i40e_nvmupd_check_wait_event(hw, LE16_TO_CPU(e->desc.opcode), &e->desc);
 clean_arq_element_out:
        /* Set pending if needed, unlock and return */
        if (pending != NULL)

Modified: head/sys/dev/ixl/i40e_adminq.h
==============================================================================
--- head/sys/dev/ixl/i40e_adminq.h      Tue May  1 18:28:42 2018        
(r333148)
+++ head/sys/dev/ixl/i40e_adminq.h      Tue May  1 18:50:12 2018        
(r333149)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2013-2015, Intel Corporation 
+  Copyright (c) 2013-2017, Intel Corporation
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -159,7 +159,7 @@ static INLINE int i40e_aq_rc_to_posix(int aq_ret, int 
 
 /* general information */
 #define I40E_AQ_LARGE_BUF      512
-#define I40E_ASQ_CMD_TIMEOUT   250  /* msecs */
+#define I40E_ASQ_CMD_TIMEOUT   250000  /* usecs */
 
 void i40e_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
                                       u16 opcode);

Modified: head/sys/dev/ixl/i40e_adminq_cmd.h
==============================================================================
--- head/sys/dev/ixl/i40e_adminq_cmd.h  Tue May  1 18:28:42 2018        
(r333148)
+++ head/sys/dev/ixl/i40e_adminq_cmd.h  Tue May  1 18:50:12 2018        
(r333149)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2013-2015, Intel Corporation 
+  Copyright (c) 2013-2017, Intel Corporation
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -41,9 +41,18 @@
  * This file needs to comply with the Linux Kernel coding style.
  */
 
+
 #define I40E_FW_API_VERSION_MAJOR      0x0001
-#define I40E_FW_API_VERSION_MINOR      0x0005
+#define I40E_FW_API_VERSION_MINOR_X722 0x0005
+#define I40E_FW_API_VERSION_MINOR_X710 0x0007
 
+#define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
+                                       I40E_FW_API_VERSION_MINOR_X710 : \
+                                       I40E_FW_API_VERSION_MINOR_X722)
+
+/* API version 1.7 implements additional link and PHY-specific APIs  */
+#define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007
+
 struct i40e_aq_desc {
        __le16 flags;
        __le16 opcode;
@@ -202,6 +211,7 @@ enum i40e_admin_queue_opc {
        /* DCB commands */
        i40e_aqc_opc_dcb_ignore_pfc     = 0x0301,
        i40e_aqc_opc_dcb_updated        = 0x0302,
+       i40e_aqc_opc_set_dcb_parameters = 0x0303,
 
        /* TX scheduler */
        i40e_aqc_opc_configure_vsi_bw_limit             = 0x0400,
@@ -241,6 +251,8 @@ enum i40e_admin_queue_opc {
        i40e_aqc_opc_set_phy_debug              = 0x0622,
        i40e_aqc_opc_upload_ext_phy_fm          = 0x0625,
        i40e_aqc_opc_run_phy_activity           = 0x0626,
+       i40e_aqc_opc_set_phy_register           = 0x0628,
+       i40e_aqc_opc_get_phy_register           = 0x0629,
 
        /* NVM commands */
        i40e_aqc_opc_nvm_read                   = 0x0701,
@@ -248,6 +260,7 @@ enum i40e_admin_queue_opc {
        i40e_aqc_opc_nvm_update                 = 0x0703,
        i40e_aqc_opc_nvm_config_read            = 0x0704,
        i40e_aqc_opc_nvm_config_write           = 0x0705,
+       i40e_aqc_opc_nvm_progress               = 0x0706,
        i40e_aqc_opc_oem_post_update            = 0x0720,
        i40e_aqc_opc_thermal_sensor             = 0x0721,
 
@@ -771,8 +784,52 @@ struct i40e_aqc_set_switch_config {
 /* flags used for both fields below */
 #define I40E_AQ_SET_SWITCH_CFG_PROMISC         0x0001
 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER       0x0002
+#define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT    0x0004
        __le16  valid_flags;
-       u8      reserved[12];
+       /* The ethertype in switch_tag is dropped on ingress and used
+        * internally by the switch. Set this to zero for the default
+        * of 0x88a8 (802.1ad). Should be zero for firmware API
+        * versions lower than 1.7.
+        */
+       __le16  switch_tag;
+       /* The ethertypes in first_tag and second_tag are used to
+        * match the outer and inner VLAN tags (respectively) when HW
+        * double VLAN tagging is enabled via the set port parameters
+        * AQ command. Otherwise these are both ignored. Set them to
+        * zero for their defaults of 0x8100 (802.1Q). Should be zero
+        * for firmware API versions lower than 1.7.
+        */
+       __le16  first_tag;
+       __le16  second_tag;
+       /* Next byte is split into following:
+        * Bit 7    : 0 : No action, 1: Switch to mode defined by bits 6:0
+        * Bit 6    : 0 : Destination Port, 1: source port
+        * Bit 5..4 : L4 type
+        * 0: rsvd
+        * 1: TCP
+        * 2: UDP
+        * 3: Both TCP and UDP
+        * Bits 3:0 Mode
+        * 0: default mode
+        * 1: L4 port only mode
+        * 2: non-tunneled mode
+        * 3: tunneled mode
+        */
+#define I40E_AQ_SET_SWITCH_BIT7_VALID          0x80
+
+#define I40E_AQ_SET_SWITCH_L4_SRC_PORT         0x40
+
+#define I40E_AQ_SET_SWITCH_L4_TYPE_RSVD                0x00
+#define I40E_AQ_SET_SWITCH_L4_TYPE_TCP         0x10
+#define I40E_AQ_SET_SWITCH_L4_TYPE_UDP         0x20
+#define I40E_AQ_SET_SWITCH_L4_TYPE_BOTH                0x30
+
+#define I40E_AQ_SET_SWITCH_MODE_DEFAULT                0x00
+#define I40E_AQ_SET_SWITCH_MODE_L4_PORT                0x01
+#define I40E_AQ_SET_SWITCH_MODE_NON_TUNNEL     0x02
+#define I40E_AQ_SET_SWITCH_MODE_TUNNEL         0x03
+       u8      mode;
+       u8      rsvd5[5];
 };
 
 I40E_CHECK_CMD_LENGTH(i40e_aqc_set_switch_config);
@@ -1703,6 +1760,8 @@ enum i40e_aq_phy_type {
        I40E_PHY_TYPE_10GBASE_CR1_CU            = 0xB,
        I40E_PHY_TYPE_10GBASE_AOC               = 0xC,
        I40E_PHY_TYPE_40GBASE_AOC               = 0xD,
+       I40E_PHY_TYPE_UNRECOGNIZED              = 0xE,
+       I40E_PHY_TYPE_UNSUPPORTED               = 0xF,
        I40E_PHY_TYPE_100BASE_TX                = 0x11,
        I40E_PHY_TYPE_1000BASE_T                = 0x12,
        I40E_PHY_TYPE_10GBASE_T                 = 0x13,
@@ -1721,9 +1780,51 @@ enum i40e_aq_phy_type {
        I40E_PHY_TYPE_25GBASE_CR                = 0x20,
        I40E_PHY_TYPE_25GBASE_SR                = 0x21,
        I40E_PHY_TYPE_25GBASE_LR                = 0x22,
-       I40E_PHY_TYPE_MAX
+       I40E_PHY_TYPE_25GBASE_AOC               = 0x23,
+       I40E_PHY_TYPE_25GBASE_ACC               = 0x24,
+       I40E_PHY_TYPE_MAX,
+       I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP   = 0xFD,
+       I40E_PHY_TYPE_EMPTY                     = 0xFE,
+       I40E_PHY_TYPE_DEFAULT                   = 0xFF,
 };
 
+#define I40E_PHY_TYPES_BITMASK (BIT_ULL(I40E_PHY_TYPE_SGMII) | \
+                               BIT_ULL(I40E_PHY_TYPE_1000BASE_KX) | \
+                               BIT_ULL(I40E_PHY_TYPE_10GBASE_KX4) | \
+                               BIT_ULL(I40E_PHY_TYPE_10GBASE_KR) | \
+                               BIT_ULL(I40E_PHY_TYPE_40GBASE_KR4) | \
+                               BIT_ULL(I40E_PHY_TYPE_XAUI) | \
+                               BIT_ULL(I40E_PHY_TYPE_XFI) | \
+                               BIT_ULL(I40E_PHY_TYPE_SFI) | \
+                               BIT_ULL(I40E_PHY_TYPE_XLAUI) | \
+                               BIT_ULL(I40E_PHY_TYPE_XLPPI) | \
+                               BIT_ULL(I40E_PHY_TYPE_40GBASE_CR4_CU) | \
+                               BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1_CU) | \
+                               BIT_ULL(I40E_PHY_TYPE_10GBASE_AOC) | \
+                               BIT_ULL(I40E_PHY_TYPE_40GBASE_AOC) | \
+                               BIT_ULL(I40E_PHY_TYPE_UNRECOGNIZED) | \
+                               BIT_ULL(I40E_PHY_TYPE_UNSUPPORTED) | \
+                               BIT_ULL(I40E_PHY_TYPE_100BASE_TX) | \
+                               BIT_ULL(I40E_PHY_TYPE_1000BASE_T) | \
+                               BIT_ULL(I40E_PHY_TYPE_10GBASE_T) | \
+                               BIT_ULL(I40E_PHY_TYPE_10GBASE_SR) | \
+                               BIT_ULL(I40E_PHY_TYPE_10GBASE_LR) | \
+                               BIT_ULL(I40E_PHY_TYPE_10GBASE_SFPP_CU) | \
+                               BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1) | \
+                               BIT_ULL(I40E_PHY_TYPE_40GBASE_CR4) | \
+                               BIT_ULL(I40E_PHY_TYPE_40GBASE_SR4) | \
+                               BIT_ULL(I40E_PHY_TYPE_40GBASE_LR4) | \
+                               BIT_ULL(I40E_PHY_TYPE_1000BASE_SX) | \
+                               BIT_ULL(I40E_PHY_TYPE_1000BASE_LX) | \
+                               BIT_ULL(I40E_PHY_TYPE_1000BASE_T_OPTICAL) | \
+                               BIT_ULL(I40E_PHY_TYPE_20GBASE_KR2) | \
+                               BIT_ULL(I40E_PHY_TYPE_25GBASE_KR) | \
+                               BIT_ULL(I40E_PHY_TYPE_25GBASE_CR) | \
+                               BIT_ULL(I40E_PHY_TYPE_25GBASE_SR) | \
+                               BIT_ULL(I40E_PHY_TYPE_25GBASE_LR) | \
+                               BIT_ULL(I40E_PHY_TYPE_25GBASE_AOC) | \
+                               BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC))
+
 #define I40E_LINK_SPEED_100MB_SHIFT    0x1
 #define I40E_LINK_SPEED_1000MB_SHIFT   0x2
 #define I40E_LINK_SPEED_10GB_SHIFT     0x3
@@ -1778,6 +1879,8 @@ struct i40e_aq_get_phy_abilities_resp {
 #define I40E_AQ_PHY_TYPE_EXT_25G_CR    0x02
 #define I40E_AQ_PHY_TYPE_EXT_25G_SR    0x04
 #define I40E_AQ_PHY_TYPE_EXT_25G_LR    0x08
+#define I40E_AQ_PHY_TYPE_EXT_25G_AOC   0x10
+#define I40E_AQ_PHY_TYPE_EXT_25G_ACC   0x20
        u8      fec_cfg_curr_mod_ext_info;
 #define I40E_AQ_ENABLE_FEC_KR          0x01
 #define I40E_AQ_ENABLE_FEC_RS          0x02
@@ -1907,19 +2010,31 @@ struct i40e_aqc_get_link_status {
 #define I40E_AQ_25G_SERDES_UCODE_ERR   0X04
 #define I40E_AQ_25G_NIMB_UCODE_ERR     0X05
        u8      loopback; /* use defines from i40e_aqc_set_lb_mode */
+/* Since firmware API 1.7 loopback field keeps power class info as well */
+#define I40E_AQ_LOOPBACK_MASK          0x07
+#define I40E_AQ_PWR_CLASS_SHIFT_LB     6
+#define I40E_AQ_PWR_CLASS_MASK_LB      (0x03 << I40E_AQ_PWR_CLASS_SHIFT_LB)
        __le16  max_frame_size;
        u8      config;
 #define I40E_AQ_CONFIG_FEC_KR_ENA      0x01
 #define I40E_AQ_CONFIG_FEC_RS_ENA      0x02
 #define I40E_AQ_CONFIG_CRC_ENA         0x04
 #define I40E_AQ_CONFIG_PACING_MASK     0x78
-       u8      power_desc;
+       union {
+               struct {
+                       u8      power_desc;
 #define I40E_AQ_LINK_POWER_CLASS_1     0x00
 #define I40E_AQ_LINK_POWER_CLASS_2     0x01
 #define I40E_AQ_LINK_POWER_CLASS_3     0x02
 #define I40E_AQ_LINK_POWER_CLASS_4     0x03
 #define I40E_AQ_PWR_CLASS_MASK         0x03
-       u8      reserved[4];
+                       u8      reserved[4];
+               };
+               struct {
+                       u8      link_type[4];
+                       u8      link_type_ext;
+               };
+       };
 };
 
 I40E_CHECK_CMD_LENGTH(i40e_aqc_get_link_status);
@@ -1956,11 +2071,28 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_an_advt_reg);
 
 /* Set Loopback mode (0x0618) */
 struct i40e_aqc_set_lb_mode {
-       __le16  lb_mode;
+       u8      lb_level;
+#define I40E_AQ_LB_NONE        0
+#define I40E_AQ_LB_MAC 1
+#define I40E_AQ_LB_SERDES      2
+#define I40E_AQ_LB_PHY_INT     3
+#define I40E_AQ_LB_PHY_EXT     4
+#define I40E_AQ_LB_CPVL_PCS    5
+#define I40E_AQ_LB_CPVL_EXT    6
 #define I40E_AQ_LB_PHY_LOCAL   0x01
 #define I40E_AQ_LB_PHY_REMOTE  0x02
 #define I40E_AQ_LB_MAC_LOCAL   0x04
-       u8      reserved[14];
+       u8      lb_type;
+#define I40E_AQ_LB_LOCAL       0
+#define I40E_AQ_LB_FAR 0x01
+       u8      speed;
+#define I40E_AQ_LB_SPEED_NONE  0
+#define I40E_AQ_LB_SPEED_1G    1
+#define I40E_AQ_LB_SPEED_10G   2
+#define I40E_AQ_LB_SPEED_40G   3
+#define I40E_AQ_LB_SPEED_20G   4
+       u8      force_speed;
+       u8      reserved[12];
 };
 
 I40E_CHECK_CMD_LENGTH(i40e_aqc_set_lb_mode);
@@ -2002,14 +2134,34 @@ struct i40e_aqc_run_phy_activity {
 
 I40E_CHECK_CMD_LENGTH(i40e_aqc_run_phy_activity);
 
+/* Set PHY Register command (0x0628) */
+/* Get PHY Register command (0x0629) */
+struct i40e_aqc_phy_register_access {
+       u8      phy_interface;
+#define I40E_AQ_PHY_REG_ACCESS_INTERNAL        0
+#define I40E_AQ_PHY_REG_ACCESS_EXTERNAL        1
+#define I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE 2
+       u8      dev_addres;
+       u8      reserved1[2];
+       __le32  reg_address;
+       __le32  reg_value;
+       u8      reserved2[4];
+};
+
+I40E_CHECK_CMD_LENGTH(i40e_aqc_phy_register_access);
+
 /* NVM Read command (indirect 0x0701)
  * NVM Erase commands (direct 0x0702)
  * NVM Update commands (indirect 0x0703)
  */
 struct i40e_aqc_nvm_update {
        u8      command_flags;
-#define I40E_AQ_NVM_LAST_CMD   0x01
-#define I40E_AQ_NVM_FLASH_ONLY 0x80
+#define I40E_AQ_NVM_LAST_CMD                   0x01
+#define I40E_AQ_NVM_FLASH_ONLY                 0x80
+#define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT   1
+#define I40E_AQ_NVM_PRESERVATION_FLAGS_MASK    0x03
+#define I40E_AQ_NVM_PRESERVATION_FLAGS_SELECTED        0x03
+#define I40E_AQ_NVM_PRESERVATION_FLAGS_ALL     0x01
        u8      module_pointer;
        __le16  length;
        __le32  offset;
@@ -2268,6 +2420,17 @@ struct i40e_aqc_lldp_start {
 };
 
 I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
+
+/* Set DCB (direct 0x0303) */
+struct i40e_aqc_set_dcb_parameters {
+       u8 command;
+#define I40E_AQ_DCB_SET_AGENT  0x1
+#define I40E_DCB_VALID         0x1
+       u8 valid_flags;
+       u8 reserved[14];
+};
+
+I40E_CHECK_CMD_LENGTH(i40e_aqc_set_dcb_parameters);
 
 /* Get CEE DCBX Oper Config (0x0A07)
  * uses the generic descriptor struct

Modified: head/sys/dev/ixl/i40e_alloc.h
==============================================================================
--- head/sys/dev/ixl/i40e_alloc.h       Tue May  1 18:28:42 2018        
(r333148)
+++ head/sys/dev/ixl/i40e_alloc.h       Tue May  1 18:50:12 2018        
(r333149)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2013-2015, Intel Corporation 
+  Copyright (c) 2013-2017, Intel Corporation
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 

Modified: head/sys/dev/ixl/i40e_common.c
==============================================================================
--- head/sys/dev/ixl/i40e_common.c      Tue May  1 18:28:42 2018        
(r333148)
+++ head/sys/dev/ixl/i40e_common.c      Tue May  1 18:50:12 2018        
(r333149)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2013-2015, Intel Corporation 
+  Copyright (c) 2013-2017, Intel Corporation
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -35,7 +35,7 @@
 #include "i40e_type.h"
 #include "i40e_adminq.h"
 #include "i40e_prototype.h"
-#include "i40e_virtchnl.h"
+#include "virtchnl.h"
 
 
 /**
@@ -68,7 +68,6 @@ enum i40e_status_code i40e_set_mac_type(struct i40e_hw
                case I40E_DEV_ID_25G_SFP28:
                        hw->mac.type = I40E_MAC_XL710;
                        break;
-               case I40E_DEV_ID_X722_A0:
                case I40E_DEV_ID_KX_X722:
                case I40E_DEV_ID_QSFP_X722:
                case I40E_DEV_ID_SFP_X722:
@@ -78,11 +77,11 @@ enum i40e_status_code i40e_set_mac_type(struct i40e_hw
                        hw->mac.type = I40E_MAC_X722;
                        break;
                case I40E_DEV_ID_X722_VF:
-               case I40E_DEV_ID_X722_A0_VF:
                        hw->mac.type = I40E_MAC_X722_VF;
                        break;
                case I40E_DEV_ID_VF:
                case I40E_DEV_ID_VF_HV:
+               case I40E_DEV_ID_ADAPTIVE_VF:
                        hw->mac.type = I40E_MAC_VF;
                        break;
                default:
@@ -298,6 +297,8 @@ const char *i40e_stat_str(struct i40e_hw *hw, enum i40
                return "I40E_NOT_SUPPORTED";
        case I40E_ERR_FIRMWARE_API_VERSION:
                return "I40E_ERR_FIRMWARE_API_VERSION";
+       case I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR:
+               return "I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR";
        }
 
        snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err);
@@ -318,13 +319,15 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug
                   void *buffer, u16 buf_len)
 {
        struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc;
-       u16 len = LE16_TO_CPU(aq_desc->datalen);
        u8 *buf = (u8 *)buffer;
+       u16 len;
        u16 i = 0;
 
        if ((!(mask & hw->debug_mask)) || (desc == NULL))
                return;
 
+       len = LE16_TO_CPU(aq_desc->datalen);
+
        i40e_debug(hw, mask,
                   "AQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 
0x%04X\n",
                   LE16_TO_CPU(aq_desc->opcode),
@@ -1008,7 +1011,8 @@ enum i40e_status_code i40e_init_shared_code(struct i40
                hw->pf_id = (u8)(func_rid & 0x7);
 
        if (hw->mac.type == I40E_MAC_X722)
-               hw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE;
+               hw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE |
+                            I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK;
 
        status = i40e_init_nvm(hw);
        return status;
@@ -1242,6 +1246,8 @@ static enum i40e_media_type i40e_get_media_type(struct
        case I40E_PHY_TYPE_40GBASE_AOC:
        case I40E_PHY_TYPE_10GBASE_AOC:
        case I40E_PHY_TYPE_25GBASE_CR:
+       case I40E_PHY_TYPE_25GBASE_AOC:
+       case I40E_PHY_TYPE_25GBASE_ACC:
                media = I40E_MEDIA_TYPE_DA;
                break;
        case I40E_PHY_TYPE_1000BASE_KX:
@@ -1324,6 +1330,8 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw
         * we don't need to do the PF Reset
         */
        if (!cnt) {
+               u32 reg2 = 0;
+
                reg = rd32(hw, I40E_PFGEN_CTRL);
                wr32(hw, I40E_PFGEN_CTRL,
                     (reg | I40E_PFGEN_CTRL_PFSWR_MASK));
@@ -1331,6 +1339,12 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw
                        reg = rd32(hw, I40E_PFGEN_CTRL);
                        if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK))
                                break;
+                       reg2 = rd32(hw, I40E_GLGEN_RSTAT);
+                       if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) {
+                               DEBUGOUT("Core reset upcoming. Skipping PF 
reset request.\n");
+                               DEBUGOUT1("I40E_GLGEN_RSTAT = 0x%x\n", reg2);
+                               return I40E_ERR_NOT_READY;
+                       }
                        i40e_msec_delay(1);
                }
                if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) {
@@ -1519,6 +1533,7 @@ u32 i40e_led_get(struct i40e_hw *hw)
                case I40E_COMBINED_ACTIVITY:
                case I40E_FILTER_ACTIVITY:
                case I40E_MAC_ACTIVITY:
+               case I40E_LINK_ACTIVITY:
                        continue;
                default:
                        break;
@@ -1567,6 +1582,7 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool b
                case I40E_COMBINED_ACTIVITY:
                case I40E_FILTER_ACTIVITY:
                case I40E_MAC_ACTIVITY:
+               case I40E_LINK_ACTIVITY:
                        continue;
                default:
                        break;
@@ -1577,9 +1593,6 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool b
                gpio_val |= ((mode << I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT) &
                             I40E_GLGEN_GPIO_CTL_LED_MODE_MASK);
 
-               if (mode == I40E_LINK_ACTIVITY)
-                       blink = FALSE;
-
                if (blink)
                        gpio_val |= BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT);
                else
@@ -1609,35 +1622,58 @@ enum i40e_status_code i40e_aq_get_phy_capabilities(str
 {
        struct i40e_aq_desc desc;
        enum i40e_status_code status;
+       u16 max_delay = I40E_MAX_PHY_TIMEOUT, total_delay = 0;
        u16 abilities_size = sizeof(struct i40e_aq_get_phy_abilities_resp);
 
        if (!abilities)
                return I40E_ERR_PARAM;
 
-       i40e_fill_default_direct_cmd_desc(&desc,
-                                         i40e_aqc_opc_get_phy_abilities);
+       do {
+               i40e_fill_default_direct_cmd_desc(&desc,
+                                              i40e_aqc_opc_get_phy_abilities);
 
-       desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF);
-       if (abilities_size > I40E_AQ_LARGE_BUF)
-               desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB);
+               desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF);
+               if (abilities_size > I40E_AQ_LARGE_BUF)
+                       desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB);
 
-       if (qualified_modules)
-               desc.params.external.param0 |=
+               if (qualified_modules)
+                       desc.params.external.param0 |=
                        CPU_TO_LE32(I40E_AQ_PHY_REPORT_QUALIFIED_MODULES);
 
-       if (report_init)
-               desc.params.external.param0 |=
+               if (report_init)
+                       desc.params.external.param0 |=
                        CPU_TO_LE32(I40E_AQ_PHY_REPORT_INITIAL_VALUES);
 
-       status = i40e_asq_send_command(hw, &desc, abilities, abilities_size,
-                                   cmd_details);
+               status = i40e_asq_send_command(hw, &desc, abilities,
+                                              abilities_size, cmd_details);
 
-       if (hw->aq.asq_last_status == I40E_AQ_RC_EIO)
-               status = I40E_ERR_UNKNOWN_PHY;
+               if (status != I40E_SUCCESS)
+                       break;
 
+               if (hw->aq.asq_last_status == I40E_AQ_RC_EIO) {
+                       status = I40E_ERR_UNKNOWN_PHY;
+                       break;
+               } else if (hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN) {
+                       i40e_msec_delay(1);
+                       total_delay++;
+                       status = I40E_ERR_TIMEOUT;
+               }
+       } while ((hw->aq.asq_last_status != I40E_AQ_RC_OK) &&
+                (total_delay < max_delay));
+
+       if (status != I40E_SUCCESS)
+               return status;
+
        if (report_init) {
-               hw->phy.phy_types = LE32_TO_CPU(abilities->phy_type);
-               hw->phy.phy_types |= ((u64)abilities->phy_type_ext << 32);
+               if (hw->mac.type ==  I40E_MAC_XL710 &&
+                   hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
+                   hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) {
+                       status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL);
+               } else {
+                       hw->phy.phy_types = LE32_TO_CPU(abilities->phy_type);
+                       hw->phy.phy_types |=
+                                       ((u64)abilities->phy_type_ext << 32);
+               }
        }
 
        return status;
@@ -1680,6 +1716,8 @@ enum i40e_status_code i40e_aq_set_phy_config(struct i4
 /**
  * i40e_set_fc
  * @hw: pointer to the hw struct
+ * @aq_failures: buffer to return AdminQ failure information
+ * @atomic_restart: whether to enable atomic link restart
  *
  * Set the requested flow control mode using set_phy_config.
  **/
@@ -1899,7 +1937,7 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40
        hw_link_info->fec_info = resp->config & (I40E_AQ_CONFIG_FEC_KR_ENA |
                                                 I40E_AQ_CONFIG_FEC_RS_ENA);
        hw_link_info->ext_info = resp->ext_info;
-       hw_link_info->loopback = resp->loopback;
+       hw_link_info->loopback = resp->loopback & I40E_AQ_LOOPBACK_MASK;
        hw_link_info->max_frame_size = LE16_TO_CPU(resp->max_frame_size);
        hw_link_info->pacing = resp->config & I40E_AQ_CONFIG_PACING_MASK;
 
@@ -1930,6 +1968,16 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40
             hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE)
                hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU;
 
+       if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
+           hw->aq.api_min_ver >= 7) {
+               __le32 tmp;
+
+               i40e_memcpy(&tmp, resp->link_type, sizeof(tmp),
+                           I40E_NONDMA_TO_NONDMA);
+               hw->phy.phy_types = LE32_TO_CPU(tmp);
+               hw->phy.phy_types |= ((u64)resp->link_type_ext << 32);
+       }
+
        /* save link status information */
        if (link)
                i40e_memcpy(link, hw_link_info, sizeof(*hw_link_info),
@@ -2069,9 +2117,9 @@ aq_get_partner_advt_exit:
  *
  * Sets loopback modes.
  **/
-enum i40e_status_code i40e_aq_set_lb_modes(struct i40e_hw *hw,
-                               u16 lb_modes,
-                               struct i40e_asq_cmd_details *cmd_details)
+enum i40e_status_code
+i40e_aq_set_lb_modes(struct i40e_hw *hw, u8 lb_level, u8 lb_type, u8 speed,
+                    struct i40e_asq_cmd_details *cmd_details)
 {
        struct i40e_aq_desc desc;
        struct i40e_aqc_set_lb_mode *cmd =
@@ -2081,7 +2129,11 @@ enum i40e_status_code i40e_aq_set_lb_modes(struct i40e
        i40e_fill_default_direct_cmd_desc(&desc,
                                          i40e_aqc_opc_set_lb_modes);
 
-       cmd->lb_mode = CPU_TO_LE16(lb_modes);
+       cmd->lb_level = lb_level;
+       cmd->lb_type = lb_type;
+       cmd->speed = speed;
+       if (speed)
+               cmd->force_speed = 1;
 
        status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
 
@@ -2607,13 +2659,14 @@ enum i40e_status_code i40e_aq_get_switch_config(struct
  * i40e_aq_set_switch_config
  * @hw: pointer to the hardware structure
  * @flags: bit flag values to set
+ * @mode: cloud filter mode
  * @valid_flags: which bit flags to set
  * @cmd_details: pointer to command details structure or NULL
  *
  * Set switch configuration bits
  **/
 enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw,
-                               u16 flags, u16 valid_flags,
+                               u16 flags, u16 valid_flags, u8 mode,
                                struct i40e_asq_cmd_details *cmd_details)
 {
        struct i40e_aq_desc desc;
@@ -2625,7 +2678,12 @@ enum i40e_status_code i40e_aq_set_switch_config(struct
                                          i40e_aqc_opc_set_switch_config);
        scfg->flags = CPU_TO_LE16(flags);
        scfg->valid_flags = CPU_TO_LE16(valid_flags);
-
+       scfg->mode = mode;
+       if (hw->flags & I40E_HW_FLAG_802_1AD_CAPABLE) {
+               scfg->switch_tag = CPU_TO_LE16(hw->switch_tag);
+               scfg->first_tag = CPU_TO_LE16(hw->first_tag);
+               scfg->second_tag = CPU_TO_LE16(hw->second_tag);
+       }
        status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
 
        return status;
@@ -2771,6 +2829,10 @@ enum i40e_status_code i40e_update_link_info(struct i40
                if (status)
                        return status;
 
+               hw->phy.link_info.req_fec_info =
+                       abilities.fec_cfg_curr_mod_ext_info &
+                       (I40E_AQ_REQUEST_FEC_KR | I40E_AQ_REQUEST_FEC_RS);
+
                i40e_memcpy(hw->phy.link_info.module_type, 
&abilities.module_type,
                        sizeof(hw->phy.link_info.module_type), 
I40E_NONDMA_TO_NONDMA);
        }
@@ -3019,8 +3081,8 @@ enum i40e_status_code i40e_aq_remove_macvlan(struct i4
  * @mr_list: list of mirrored VSI SEIDs or VLAN IDs
  * @cmd_details: pointer to command details structure or NULL
  * @rule_id: Rule ID returned from FW
- * @rule_used: Number of rules used in internal switch
- * @rule_free: Number of rules free in internal switch
+ * @rules_used: Number of rules used in internal switch
+ * @rules_free: Number of rules free in internal switch
  *
  * Add/Delete a mirror rule to a specific switch. Mirror rules are supported 
for
  * VEBs/VEPA elements only
@@ -3080,8 +3142,8 @@ static enum i40e_status_code i40e_mirrorrule_op(struct
  * @mr_list: list of mirrored VSI SEIDs or VLAN IDs
  * @cmd_details: pointer to command details structure or NULL
  * @rule_id: Rule ID returned from FW
- * @rule_used: Number of rules used in internal switch
- * @rule_free: Number of rules free in internal switch
+ * @rules_used: Number of rules used in internal switch
+ * @rules_free: Number of rules free in internal switch
  *
  * Add mirror rule. Mirror rules are supported for VEBs or VEPA elements only
  **/
@@ -3111,8 +3173,8 @@ enum i40e_status_code i40e_aq_add_mirrorrule(struct i4
  *             add_mirrorrule.
  * @mr_list: list of mirrored VLAN IDs to be removed
  * @cmd_details: pointer to command details structure or NULL
- * @rule_used: Number of rules used in internal switch
- * @rule_free: Number of rules free in internal switch
+ * @rules_used: Number of rules used in internal switch
+ * @rules_free: Number of rules free in internal switch
  *
  * Delete a mirror rule. Mirror rules are supported for VEBs/VEPA elements only
  **/
@@ -3515,6 +3577,8 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct 
 /**
  * i40e_aq_oem_post_update - triggers an OEM specific flow after update
  * @hw: pointer to the hw struct
+ * @buff: buffer for result
+ * @buff_size: buffer size
  * @cmd_details: pointer to command details structure or NULL
  **/
 enum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw,
@@ -3593,9 +3657,10 @@ static void i40e_parse_discover_capabilities(struct i4
        u32 valid_functions, num_functions;
        u32 number, logical_id, phys_id;
        struct i40e_hw_capabilities *p;
+       enum i40e_status_code status;
+       u16 id, ocp_cfg_word0;
        u8 major_rev;
        u32 i = 0;
-       u16 id;
 
        cap = (struct i40e_aqc_list_capabilities_element_resp *) buff;
 
@@ -3887,6 +3952,26 @@ static void i40e_parse_discover_capabilities(struct i4
                        hw->num_ports++;
        }
 
+       /* OCP cards case: if a mezz is removed the ethernet port is at
+        * disabled state in PRTGEN_CNF register. Additional NVM read is
+        * needed in order to check if we are dealing with OCP card.
+        * Those cards have 4 PFs at minimum, so using PRTGEN_CNF for counting
+        * physical ports results in wrong partition id calculation and thus
+        * not supporting WoL.
+        */
+       if (hw->mac.type == I40E_MAC_X722) {
+               if (i40e_acquire_nvm(hw, I40E_RESOURCE_READ) == I40E_SUCCESS) {
+                       status = i40e_aq_read_nvm(hw, I40E_SR_EMP_MODULE_PTR,
+                                                 2 * I40E_SR_OCP_CFG_WORD0,
+                                                 sizeof(ocp_cfg_word0),
+                                                 &ocp_cfg_word0, TRUE, NULL);
+                       if (status == I40E_SUCCESS &&
+                           (ocp_cfg_word0 & I40E_SR_OCP_ENABLED))
+                               hw->num_ports = 4;
+                       i40e_release_nvm(hw);
+               }
+       }
+
        valid_functions = p->valid_functions;
        num_functions = 0;
        while (valid_functions) {
@@ -3964,13 +4049,14 @@ exit:
  * @length: length of the section to be written (in bytes from the offset)
  * @data: command buffer (size [bytes] = length)
  * @last_command: tells if this is the last command in a series
+ * @preservation_flags: Preservation mode flags
  * @cmd_details: pointer to command details structure or NULL
  *
  * Update the NVM using the admin queue commands
  **/
 enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
                                u32 offset, u16 length, void *data,
-                               bool last_command,
+                               bool last_command, u8 preservation_flags,
                                struct i40e_asq_cmd_details *cmd_details)
 {
        struct i40e_aq_desc desc;
@@ -3991,6 +4077,16 @@ enum i40e_status_code i40e_aq_update_nvm(struct i40e_h
        /* If this is the last command in a series, set the proper flag. */
        if (last_command)
                cmd->command_flags |= I40E_AQ_NVM_LAST_CMD;
+       if (hw->mac.type == I40E_MAC_X722) {
+               if (preservation_flags == I40E_NVM_PRESERVATION_FLAGS_SELECTED)
+                       cmd->command_flags |=
+                               (I40E_AQ_NVM_PRESERVATION_FLAGS_SELECTED <<
+                                I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT);
+               else if (preservation_flags == I40E_NVM_PRESERVATION_FLAGS_ALL)
+                       cmd->command_flags |=
+                               (I40E_AQ_NVM_PRESERVATION_FLAGS_ALL <<
+                                I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT);
+       }
        cmd->module_pointer = module_pointer;
        cmd->offset = CPU_TO_LE32(offset);
        cmd->length = CPU_TO_LE16(length);
@@ -4006,6 +4102,28 @@ i40e_aq_update_nvm_exit:
 }
 
 /**
+ * i40e_aq_nvm_progress
+ * @hw: pointer to the hw struct
+ * @progress: pointer to progress returned from AQ
+ * @cmd_details: pointer to command details structure or NULL
+ *
+ * Gets progress of flash rearrangement process
+ **/
+enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress,
+                               struct i40e_asq_cmd_details *cmd_details)
+{
+       enum i40e_status_code status;
+       struct i40e_aq_desc desc;
+
+       DEBUGFUNC("i40e_aq_nvm_progress");
+
+       i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_nvm_progress);
+       status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+       *progress = desc.params.raw[0];
+       return status;
+}
+
+/**
  * i40e_aq_get_lldp_mib
  * @hw: pointer to the hw struct
  * @bridge_type: type of bridge requested
@@ -4319,7 +4437,39 @@ enum i40e_status_code i40e_aq_start_lldp(struct i40e_h
        i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_start);
 
        cmd->command = I40E_AQ_LLDP_AGENT_START;
+       status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
 
+       return status;
+}
+
+/**
+ * i40e_aq_set_dcb_parameters
+ * @hw: pointer to the hw struct
+ * @cmd_details: pointer to command details structure or NULL
+ * @dcb_enable: True if DCB configuration needs to be applied
+ *
+ **/
+enum i40e_status_code
+i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dcb_enable,
+                          struct i40e_asq_cmd_details *cmd_details)
+{
+       struct i40e_aq_desc desc;
+       struct i40e_aqc_set_dcb_parameters *cmd =
+               (struct i40e_aqc_set_dcb_parameters *)&desc.params.raw;
+       enum i40e_status_code status;
+
+       if ((hw->mac.type != I40E_MAC_XL710) ||
+           ((hw->aq.api_maj_ver < 1) ||
+            ((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver < 6))))
+               return I40E_ERR_DEVICE_NOT_SUPPORTED;
+
+       i40e_fill_default_direct_cmd_desc(&desc,
+                                         i40e_aqc_opc_set_dcb_parameters);
+
+       if (dcb_enable) {
+               cmd->valid_flags = I40E_DCB_VALID;
+               cmd->command = I40E_AQ_DCB_SET_AGENT;
+       }
        status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
 
        return status;
@@ -4387,7 +4537,6 @@ enum i40e_status_code i40e_aq_start_stop_dcbx(struct i
  * i40e_aq_add_udp_tunnel
  * @hw: pointer to the hw struct
  * @udp_port: the UDP port to add in Host byte order
- * @header_len: length of the tunneling header length in DWords
  * @protocol_index: protocol index type
  * @filter_index: pointer to filter index
  * @cmd_details: pointer to command details structure or NULL
@@ -5434,7 +5583,7 @@ enum i40e_status_code i40e_aq_add_rem_control_packet_f
        }
 
        if (mac_addr)
-               i40e_memcpy(cmd->mac, mac_addr, I40E_ETH_LENGTH_OF_ADDRESS,
+               i40e_memcpy(cmd->mac, mac_addr, ETH_ALEN,
                            I40E_NONDMA_TO_NONDMA);
 
        cmd->etype = CPU_TO_LE16(ethtype);
@@ -5458,10 +5607,10 @@ enum i40e_status_code i40e_aq_add_rem_control_packet_f
  * @hw: pointer to the hw struct
  * @seid: VSI seid to add ethertype filter from
  **/
-#define I40E_FLOW_CONTROL_ETHTYPE 0x8808
 void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw,
                                                    u16 seid)
 {
+#define I40E_FLOW_CONTROL_ETHTYPE 0x8808
        u16 flag = I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC |
                   I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP |
                   I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX;
@@ -5892,6 +6041,7 @@ void i40e_set_pci_config_data(struct i40e_hw *hw, u16 
  * @ret_buff_size: actual buffer size returned
  * @ret_next_table: next block to read
  * @ret_next_index: next index to read
+ * @cmd_details: pointer to command details structure or NULL
  *
  * Dump internal FW/HW data for debug purposes.
  *
@@ -6014,7 +6164,7 @@ enum i40e_status_code i40e_aq_configure_partition_bw(s
  * i40e_read_phy_register_clause22
  * @hw: pointer to the HW structure
  * @reg: register address in the page
- * @phy_adr: PHY address on MDIO interface
+ * @phy_addr: PHY address on MDIO interface
  * @value: PHY register value
  *
  * Reads specified PHY register value
@@ -6059,7 +6209,7 @@ enum i40e_status_code i40e_read_phy_register_clause22(
  * i40e_write_phy_register_clause22
  * @hw: pointer to the HW structure
  * @reg: register address in the page
- * @phy_adr: PHY address on MDIO interface
+ * @phy_addr: PHY address on MDIO interface
  * @value: PHY register value
  *
  * Writes specified PHY register value
@@ -6100,7 +6250,7 @@ enum i40e_status_code i40e_write_phy_register_clause22
  * @hw: pointer to the HW structure
  * @page: registers page number
  * @reg: register address in the page
- * @phy_adr: PHY address on MDIO interface
+ * @phy_addr: PHY address on MDIO interface
  * @value: PHY register value
  *
  * Reads specified PHY register value
@@ -6174,7 +6324,7 @@ phy_read_end:
  * @hw: pointer to the HW structure
  * @page: registers page number
  * @reg: register address in the page
- * @phy_adr: PHY address on MDIO interface
+ * @phy_addr: PHY address on MDIO interface
  * @value: PHY register value
  *
  * Writes value to specified PHY register
@@ -6241,7 +6391,7 @@ phy_write_end:
  * @hw: pointer to the HW structure
  * @page: registers page number
  * @reg: register address in the page
- * @phy_adr: PHY address on MDIO interface
+ * @phy_addr: PHY address on MDIO interface
  * @value: PHY register value

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to