History

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next

Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2014-11-18 This series contains updates to i40e only. Shannon provides a patch to clean up the driver to only warn once that PTP is not supported when linked at 100Mbps. Mitch provides a fix for i40e where the VF interrupt processing takes a long time and it is possible that we could lose a VFLR event if it happens while processing a VFLR on another VF. To correct this situation, we enable the VFLR interrupt cause before we begin processing any pending resets. Neerav provides several patches to update DCB support in i40e. When there are DCB configuration changes based on DCBx, the firmware suspends the port's Tx and generates an event to the PF. The PF is then responsible to reconfigure the PF VSIs and switching topology as per the updated DCB configuration and then resume the port's Tx by calling the "Resume Port Tx" AQ command, so add this call to the flow that handles DCB re-configuration in the PF. Allow the driver to query and use DCB configuration from firmware when firmware DCBx agent is in CEE mode. Add a check whether LLDP Agent's default AdminStatus is enabled or disabled on a given port, and sets DCBx status to disabled if the status is disabled. Fix an issue when the port TC configuration changes as a result of DCBx and the driver modifies the enabled TCs for the VEBs it manages but does not update the enabled_tc value that was cached on a per VEB basis. Add a new PF state so that if a port's Tx is in suspended state the Tx queue disable flow would just put the request for the queue to be disabled and return without waiting for the queue to be actually disabled. Allows the driver to enable/disable the XPS based on the number of TCs being enabled for the given VSI. v2: Dropped patch "i40e: Handle a single mss packet with more than 8 frags" while we rework the patch after we test a bit more based on feedback from Eric Dumazet. ====================

David S. Miller committed 12 years ago

Commit 1bbf1482 parents cadaecd 3ffa03714 files · +575 −56Browse files

Unified · Split

14 files
  1. drivers/net/ethernet/intel/i40e/i40e.h +1 −0
  2. drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +43 −2
  3. drivers/net/ethernet/intel/i40e/i40e_common.c +48 −0
  4. drivers/net/ethernet/intel/i40e/i40e_dcb.c +251 −1
  5. drivers/net/ethernet/intel/i40e/i40e_dcb.h +5 −0
  6. drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c +4 −4
  7. drivers/net/ethernet/intel/i40e/i40e_debugfs.c +2 −0
  8. drivers/net/ethernet/intel/i40e/i40e_ethtool.c +12 −2
  9. drivers/net/ethernet/intel/i40e/i40e_fcoe.c +1 −1
  10. drivers/net/ethernet/intel/i40e/i40e_main.c +151 −19
  11. drivers/net/ethernet/intel/i40e/i40e_prototype.h +7 −0
  12. drivers/net/ethernet/intel/i40e/i40e_ptp.c +9 −3
  13. drivers/net/ethernet/intel/i40e/i40e_type.h +35 −18
  14. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +6 −6
drivers/net/ethernet/intel/i40e/i40e.h+1−0
@@ -146,6 +146,7 @@ enum i40e_state_t { · 145 unmodified lines
146146 __I40E_DOWN_REQUESTED,
147147 __I40E_FD_FLUSH_REQUESTED,
148148 __I40E_RESET_FAILED,
149+ __I40E_PORT_TX_SUSPENDED,
149150 };
150151
151152 enum i40e_interrupt_policy {
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h+43−2
@@ -255,6 +255,7 @@ enum i40e_admin_queue_opc { · 254 unmodified lines
255255 i40e_aqc_opc_lldp_delete_tlv = 0x0A04,
256256 i40e_aqc_opc_lldp_stop = 0x0A05,
257257 i40e_aqc_opc_lldp_start = 0x0A06,
258+ i40e_aqc_opc_get_cee_dcb_cfg = 0x0A07,
258259
259260 /* Tunnel commands */
260261 i40e_aqc_opc_add_udp_tunnel = 0x0B00,
@@ -1987,10 +1988,50 @@ struct i40e_aqc_lldp_start { · 1726 unmodified lines
19871988
19881989 I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
19891990
1990−/* Apply MIB changes (0x0A07)
1991− * uses the generic struc as it contains no data
1991+/* Get CEE DCBX Oper Config (0x0A07)
1992+ * uses the generic descriptor struct
1993+ * returns below as indirect response
19921994 */
19931995
1996+#define I40E_AQC_CEE_APP_FCOE_SHIFT 0x0
1997+#define I40E_AQC_CEE_APP_FCOE_MASK (0x7 << I40E_AQC_CEE_APP_FCOE_SHIFT)
1998+#define I40E_AQC_CEE_APP_ISCSI_SHIFT 0x3
1999+#define I40E_AQC_CEE_APP_ISCSI_MASK (0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT)
2000+#define I40E_AQC_CEE_APP_FIP_SHIFT 0x8
2001+#define I40E_AQC_CEE_APP_FIP_MASK (0x7 << I40E_AQC_CEE_APP_FIP_SHIFT)
2002+#define I40E_AQC_CEE_PG_STATUS_SHIFT 0x0
2003+#define I40E_AQC_CEE_PG_STATUS_MASK (0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT)
2004+#define I40E_AQC_CEE_PFC_STATUS_SHIFT 0x3
2005+#define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT)
2006+#define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8
2007+#define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT)
2008+struct i40e_aqc_get_cee_dcb_cfg_v1_resp {
2009+ u8 reserved1;
2010+ u8 oper_num_tc;
2011+ u8 oper_prio_tc[4];
2012+ u8 reserved2;
2013+ u8 oper_tc_bw[8];
2014+ u8 oper_pfc_en;
2015+ u8 reserved3;
2016+ __le16 oper_app_prio;
2017+ u8 reserved4;
2018+ __le16 tlv_status;
2019+};
2020+
2021+I40E_CHECK_STRUCT_LEN(0x18, i40e_aqc_get_cee_dcb_cfg_v1_resp);
2022+
2023+struct i40e_aqc_get_cee_dcb_cfg_resp {
2024+ u8 oper_num_tc;
2025+ u8 oper_prio_tc[4];
2026+ u8 oper_tc_bw[8];
2027+ u8 oper_pfc_en;
2028+ __le16 oper_app_prio;
2029+ __le32 tlv_status;
2030+ u8 reserved[12];
2031+};
2032+
2033+I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_cee_dcb_cfg_resp);
2034+
19942035 /* Add Udp Tunnel command and completion (direct 0x0B00) */
19952036 struct i40e_aqc_add_udp_tunnel {
19962037 __le16 udp_port;
drivers/net/ethernet/intel/i40e/i40e_common.c+48−0
@@ -2659,6 +2659,34 @@ i40e_status i40e_aq_start_lldp(struct i40e_hw *hw, · 2658 unmodified lines
26592659 return status;
26602660 }
26612661
2662+/**
2663+ * i40e_aq_get_cee_dcb_config
2664+ * @hw: pointer to the hw struct
2665+ * @buff: response buffer that stores CEE operational configuration
2666+ * @buff_size: size of the buffer passed
2667+ * @cmd_details: pointer to command details structure or NULL
2668+ *
2669+ * Get CEE DCBX mode operational configuration from firmware
2670+ **/
2671+i40e_status i40e_aq_get_cee_dcb_config(struct i40e_hw *hw,
2672+ void *buff, u16 buff_size,
2673+ struct i40e_asq_cmd_details *cmd_details)
2674+{
2675+ struct i40e_aq_desc desc;
2676+ i40e_status status;
2677+
2678+ if (buff_size == 0 || !buff)
2679+ return I40E_ERR_PARAM;
2680+
2681+ i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_get_cee_dcb_cfg);
2682+
2683+ desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_BUF);
2684+ status = i40e_asq_send_command(hw, &desc, (void *)buff, buff_size,
2685+ cmd_details);
2686+
2687+ return status;
2688+}
2689+
26622690 /**
26632691 * i40e_aq_add_udp_tunnel
26642692 * @hw: pointer to the hw struct
@@ -3216,6 +3244,26 @@ i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw, · 551 unmodified lines
32163244 return status;
32173245 }
32183246
3247+/**
3248+ * i40e_aq_resume_port_tx
3249+ * @hw: pointer to the hardware structure
3250+ * @cmd_details: pointer to command details structure or NULL
3251+ *
3252+ * Resume port's Tx traffic
3253+ **/
3254+i40e_status i40e_aq_resume_port_tx(struct i40e_hw *hw,
3255+ struct i40e_asq_cmd_details *cmd_details)
3256+{
3257+ struct i40e_aq_desc desc;
3258+ i40e_status status;
3259+
3260+ i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_resume_port_tx);
3261+
3262+ status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
3263+
3264+ return status;
3265+}
3266+
32193267 /**
32203268 * i40e_set_pci_config_data - store PCI bus info
32213269 * @hw: pointer to hardware structure
drivers/net/ethernet/intel/i40e/i40e_dcb.c+251−1
@@ -59,7 +59,7 @@ i40e_status i40e_get_dcbx_status(struct i40e_hw *hw, u16 *status) · 58 unmodified lines
5959 static void i40e_parse_ieee_etscfg_tlv(struct i40e_lldp_org_tlv *tlv,
6060 struct i40e_dcbx_config *dcbcfg)
6161 {
62− struct i40e_ieee_ets_config *etscfg;
62+ struct i40e_dcb_ets_config *etscfg;
6363 u8 *buf = tlv->tlvinfo;
6464 u16 offset = 0;
6565 u8 priority;
@@ -406,6 +406,166 @@ free_mem: · 340 unmodified lines
406406 return ret;
407407 }
408408
409+/**
410+ * i40e_cee_to_dcb_v1_config
411+ * @cee_cfg: pointer to CEE v1 response configuration struct
412+ * @dcbcfg: DCB configuration struct
413+ *
414+ * Convert CEE v1 configuration from firmware to DCB configuration
415+ **/
416+static void i40e_cee_to_dcb_v1_config(
417+ struct i40e_aqc_get_cee_dcb_cfg_v1_resp *cee_cfg,
418+ struct i40e_dcbx_config *dcbcfg)
419+{
420+ u16 status, tlv_status = le16_to_cpu(cee_cfg->tlv_status);
421+ u16 app_prio = le16_to_cpu(cee_cfg->oper_app_prio);
422+ u8 i, tc, err, sync, oper;
423+
424+ /* CEE PG data to ETS config */
425+ dcbcfg->etscfg.maxtcs = cee_cfg->oper_num_tc;
426+
427+ for (i = 0; i < 4; i++) {
428+ tc = (u8)((cee_cfg->oper_prio_tc[i] &
429+ I40E_CEE_PGID_PRIO_1_MASK) >>
430+ I40E_CEE_PGID_PRIO_1_SHIFT);
431+ dcbcfg->etscfg.prioritytable[i*2] = tc;
432+ tc = (u8)((cee_cfg->oper_prio_tc[i] &
433+ I40E_CEE_PGID_PRIO_0_MASK) >>
434+ I40E_CEE_PGID_PRIO_0_SHIFT);
435+ dcbcfg->etscfg.prioritytable[i*2 + 1] = tc;
436+ }
437+
438+ for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
439+ dcbcfg->etscfg.tcbwtable[i] = cee_cfg->oper_tc_bw[i];
440+
441+ for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
442+ if (dcbcfg->etscfg.prioritytable[i] == I40E_CEE_PGID_STRICT) {
443+ /* Map it to next empty TC */
444+ dcbcfg->etscfg.prioritytable[i] =
445+ cee_cfg->oper_num_tc - 1;
446+ dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_STRICT;
447+ } else {
448+ dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_ETS;
449+ }
450+ }
451+
452+ /* CEE PFC data to ETS config */
453+ dcbcfg->pfc.pfcenable = cee_cfg->oper_pfc_en;
454+ dcbcfg->pfc.pfccap = I40E_MAX_TRAFFIC_CLASS;
455+
456+ status = (tlv_status & I40E_AQC_CEE_APP_STATUS_MASK) >>
457+ I40E_AQC_CEE_APP_STATUS_SHIFT;
458+ err = (status & I40E_TLV_STATUS_ERR) ? 1 : 0;
459+ sync = (status & I40E_TLV_STATUS_SYNC) ? 1 : 0;
460+ oper = (status & I40E_TLV_STATUS_OPER) ? 1 : 0;
461+ /* Add APPs if Error is False and Oper/Sync is True */
462+ if (!err && sync && oper) {
463+ /* CEE operating configuration supports FCoE/iSCSI/FIP only */
464+ dcbcfg->numapps = I40E_CEE_OPER_MAX_APPS;
465+
466+ /* FCoE APP */
467+ dcbcfg->app[0].priority =
468+ (app_prio & I40E_AQC_CEE_APP_FCOE_MASK) >>
469+ I40E_AQC_CEE_APP_FCOE_SHIFT;
470+ dcbcfg->app[0].selector = I40E_APP_SEL_ETHTYPE;
471+ dcbcfg->app[0].protocolid = I40E_APP_PROTOID_FCOE;
472+
473+ /* iSCSI APP */
474+ dcbcfg->app[1].priority =
475+ (app_prio & I40E_AQC_CEE_APP_ISCSI_MASK) >>
476+ I40E_AQC_CEE_APP_ISCSI_SHIFT;
477+ dcbcfg->app[1].selector = I40E_APP_SEL_TCPIP;
478+ dcbcfg->app[1].protocolid = I40E_APP_PROTOID_ISCSI;
479+
480+ /* FIP APP */
481+ dcbcfg->app[2].priority =
482+ (app_prio & I40E_AQC_CEE_APP_FIP_MASK) >>
483+ I40E_AQC_CEE_APP_FIP_SHIFT;
484+ dcbcfg->app[2].selector = I40E_APP_SEL_ETHTYPE;
485+ dcbcfg->app[2].protocolid = I40E_APP_PROTOID_FIP;
486+ }
487+}
488+
489+/**
490+ * i40e_cee_to_dcb_config
491+ * @cee_cfg: pointer to CEE configuration struct
492+ * @dcbcfg: DCB configuration struct
493+ *
494+ * Convert CEE configuration from firmware to DCB configuration
495+ **/
496+static void i40e_cee_to_dcb_config(
497+ struct i40e_aqc_get_cee_dcb_cfg_resp *cee_cfg,
498+ struct i40e_dcbx_config *dcbcfg)
499+{
500+ u32 status, tlv_status = le32_to_cpu(cee_cfg->tlv_status);
501+ u16 app_prio = le16_to_cpu(cee_cfg->oper_app_prio);
502+ u8 i, tc, err, sync, oper;
503+
504+ /* CEE PG data to ETS config */
505+ dcbcfg->etscfg.maxtcs = cee_cfg->oper_num_tc;
506+
507+ for (i = 0; i < 4; i++) {
508+ tc = (u8)((cee_cfg->oper_prio_tc[i] &
509+ I40E_CEE_PGID_PRIO_1_MASK) >>
510+ I40E_CEE_PGID_PRIO_1_SHIFT);
511+ dcbcfg->etscfg.prioritytable[i*2] = tc;
512+ tc = (u8)((cee_cfg->oper_prio_tc[i] &
513+ I40E_CEE_PGID_PRIO_0_MASK) >>
514+ I40E_CEE_PGID_PRIO_0_SHIFT);
515+ dcbcfg->etscfg.prioritytable[i*2 + 1] = tc;
516+ }
517+
518+ for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
519+ dcbcfg->etscfg.tcbwtable[i] = cee_cfg->oper_tc_bw[i];
520+
521+ for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
522+ if (dcbcfg->etscfg.prioritytable[i] == I40E_CEE_PGID_STRICT) {
523+ /* Map it to next empty TC */
524+ dcbcfg->etscfg.prioritytable[i] =
525+ cee_cfg->oper_num_tc - 1;
526+ dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_STRICT;
527+ } else {
528+ dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_ETS;
529+ }
530+ }
531+
532+ /* CEE PFC data to ETS config */
533+ dcbcfg->pfc.pfcenable = cee_cfg->oper_pfc_en;
534+ dcbcfg->pfc.pfccap = I40E_MAX_TRAFFIC_CLASS;
535+
536+ status = (tlv_status & I40E_AQC_CEE_APP_STATUS_MASK) >>
537+ I40E_AQC_CEE_APP_STATUS_SHIFT;
538+ err = (status & I40E_TLV_STATUS_ERR) ? 1 : 0;
539+ sync = (status & I40E_TLV_STATUS_SYNC) ? 1 : 0;
540+ oper = (status & I40E_TLV_STATUS_OPER) ? 1 : 0;
541+ /* Add APPs if Error is False and Oper/Sync is True */
542+ if (!err && sync && oper) {
543+ /* CEE operating configuration supports FCoE/iSCSI/FIP only */
544+ dcbcfg->numapps = I40E_CEE_OPER_MAX_APPS;
545+
546+ /* FCoE APP */
547+ dcbcfg->app[0].priority =
548+ (app_prio & I40E_AQC_CEE_APP_FCOE_MASK) >>
549+ I40E_AQC_CEE_APP_FCOE_SHIFT;
550+ dcbcfg->app[0].selector = I40E_APP_SEL_ETHTYPE;
551+ dcbcfg->app[0].protocolid = I40E_APP_PROTOID_FCOE;
552+
553+ /* iSCSI APP */
554+ dcbcfg->app[1].priority =
555+ (app_prio & I40E_AQC_CEE_APP_ISCSI_MASK) >>
556+ I40E_AQC_CEE_APP_ISCSI_SHIFT;
557+ dcbcfg->app[1].selector = I40E_APP_SEL_TCPIP;
558+ dcbcfg->app[1].protocolid = I40E_APP_PROTOID_ISCSI;
559+
560+ /* FIP APP */
561+ dcbcfg->app[2].priority =
562+ (app_prio & I40E_AQC_CEE_APP_FIP_MASK) >>
563+ I40E_AQC_CEE_APP_FIP_SHIFT;
564+ dcbcfg->app[2].selector = I40E_APP_SEL_ETHTYPE;
565+ dcbcfg->app[2].protocolid = I40E_APP_PROTOID_FIP;
566+ }
567+}
568+
409569 /**
410570 * i40e_get_dcb_config
411571 * @hw: pointer to the hw struct
@@ -415,7 +575,44 @@ free_mem: · 3 unmodified lines
415575 i40e_status i40e_get_dcb_config(struct i40e_hw *hw)
416576 {
417577 i40e_status ret = 0;
578+ struct i40e_aqc_get_cee_dcb_cfg_resp cee_cfg;
579+ struct i40e_aqc_get_cee_dcb_cfg_v1_resp cee_v1_cfg;
580+
581+ /* If Firmware version < v4.33 IEEE only */
582+ if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) ||
583+ (hw->aq.fw_maj_ver < 4))
584+ goto ieee;
585+
586+ /* If Firmware version == v4.33 use old CEE struct */
587+ if ((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver == 33)) {
588+ ret = i40e_aq_get_cee_dcb_config(hw, &cee_v1_cfg,
589+ sizeof(cee_v1_cfg), NULL);
590+ if (!ret) {
591+ /* CEE mode */
592+ hw->local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_CEE;
593+ i40e_cee_to_dcb_v1_config(&cee_v1_cfg,
594+ &hw->local_dcbx_config);
595+ }
596+ } else {
597+ ret = i40e_aq_get_cee_dcb_config(hw, &cee_cfg,
598+ sizeof(cee_cfg), NULL);
599+ if (!ret) {
600+ /* CEE mode */
601+ hw->local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_CEE;
602+ i40e_cee_to_dcb_config(&cee_cfg,
603+ &hw->local_dcbx_config);
604+ }
605+ }
606+
607+ /* CEE mode not enabled try querying IEEE data */
608+ if (hw->aq.asq_last_status == I40E_AQ_RC_ENOENT)
609+ goto ieee;
610+ else
611+ goto out;
418612
613+ieee:
614+ /* IEEE mode */
615+ hw->local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_IEEE;
419616 /* Get Local DCB Config */
420617 ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_LOCAL, 0,
421618 &hw->local_dcbx_config);
@@ -426,6 +623,10 @@ i40e_status i40e_get_dcb_config(struct i40e_hw *hw) · 4 unmodified lines
426623 ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_REMOTE,
427624 I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE,
428625 &hw->remote_dcbx_config);
626+ /* Don't treat ENOENT as an error for Remote MIBs */
627+ if (hw->aq.asq_last_status == I40E_AQ_RC_ENOENT)
628+ ret = 0;
629+
429630 out:
430631 return ret;
431632 }
@@ -439,10 +640,27 @@ out: · 7 unmodified lines
439640 i40e_status i40e_init_dcb(struct i40e_hw *hw)
440641 {
441642 i40e_status ret = 0;
643+ struct i40e_lldp_variables lldp_cfg;
644+ u8 adminstatus = 0;
442645
443646 if (!hw->func_caps.dcb)
444647 return ret;
445648
649+ /* Read LLDP NVM area */
650+ ret = i40e_read_lldp_cfg(hw, &lldp_cfg);
651+ if (ret)
652+ return ret;
653+
654+ /* Get the LLDP AdminStatus for the current port */
655+ adminstatus = lldp_cfg.adminstatus >> (hw->port * 4);
656+ adminstatus &= 0xF;
657+
658+ /* LLDP agent disabled */
659+ if (!adminstatus) {
660+ hw->dcbx_status = I40E_DCBX_STATUS_DISABLED;
661+ return ret;
662+ }
663+
446664 /* Get DCBX status */
447665 ret = i40e_get_dcbx_status(hw, &hw->dcbx_status);
448666 if (ret)
@@ -454,6 +672,8 @@ i40e_status i40e_init_dcb(struct i40e_hw *hw) · 5 unmodified lines
454672 case I40E_DCBX_STATUS_IN_PROGRESS:
455673 /* Get current DCBX configuration */
456674 ret = i40e_get_dcb_config(hw);
675+ if (ret)
676+ return ret;
457677 break;
458678 case I40E_DCBX_STATUS_DISABLED:
459679 return ret;
@@ -470,3 +690,33 @@ i40e_status i40e_init_dcb(struct i40e_hw *hw) · 10 unmodified lines
470690
471691 return ret;
472692 }
693+
694+/**
695+ * i40e_read_lldp_cfg - read LLDP Configuration data from NVM
696+ * @hw: pointer to the HW structure
697+ * @lldp_cfg: pointer to hold lldp configuration variables
698+ *
699+ * Reads the LLDP configuration data from NVM
700+ **/
701+i40e_status i40e_read_lldp_cfg(struct i40e_hw *hw,
702+ struct i40e_lldp_variables *lldp_cfg)
703+{
704+ i40e_status ret = 0;
705+ u32 offset = (2 * I40E_NVM_LLDP_CFG_PTR);
706+
707+ if (!lldp_cfg)
708+ return I40E_ERR_PARAM;
709+
710+ ret = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
711+ if (ret)
712+ goto err_lldp_cfg;
713+
714+ ret = i40e_aq_read_nvm(hw, I40E_SR_EMP_MODULE_PTR, offset,
715+ sizeof(struct i40e_lldp_variables),
716+ (u8 *)lldp_cfg,
717+ true, NULL);
718+ i40e_release_nvm(hw);
719+
720+err_lldp_cfg:
721+ return ret;
722+}
drivers/net/ethernet/intel/i40e/i40e_dcb.h+5−0
@@ -65,6 +65,11 @@ · 64 unmodified lines
6565 #define I40E_IEEE_ETS_PRIO_0_MASK (0x7 << I40E_IEEE_ETS_PRIO_0_SHIFT)
6666 #define I40E_IEEE_ETS_PRIO_1_SHIFT 4
6767 #define I40E_IEEE_ETS_PRIO_1_MASK (0x7 << I40E_IEEE_ETS_PRIO_1_SHIFT)
68+#define I40E_CEE_PGID_PRIO_0_SHIFT 0
69+#define I40E_CEE_PGID_PRIO_0_MASK (0xF << I40E_CEE_PGID_PRIO_0_SHIFT)
70+#define I40E_CEE_PGID_PRIO_1_SHIFT 4
71+#define I40E_CEE_PGID_PRIO_1_MASK (0xF << I40E_CEE_PGID_PRIO_1_SHIFT)
72+#define I40E_CEE_PGID_STRICT 15
6873
6974 /* Defines for IEEE TSA types */
7075 #define I40E_IEEE_TSA_STRICT 0
drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c+4−4
@@ -207,7 +207,7 @@ void i40e_dcbnl_set_all(struct i40e_vsi *vsi) · 206 unmodified lines
207207 * VSI
208208 **/
209209 static int i40e_dcbnl_vsi_del_app(struct i40e_vsi *vsi,
210− struct i40e_ieee_app_priority_table *app)
210+ struct i40e_dcb_app_priority_table *app)
211211 {
212212 struct net_device *dev = vsi->netdev;
213213 struct dcb_app sapp;
@@ -229,7 +229,7 @@ static int i40e_dcbnl_vsi_del_app(struct i40e_vsi *vsi, · 15 unmodified lines
229229 * Delete given APP from all the VSIs for given PF
230230 **/
231231 static void i40e_dcbnl_del_app(struct i40e_pf *pf,
232− struct i40e_ieee_app_priority_table *app)
232+ struct i40e_dcb_app_priority_table *app)
233233 {
234234 int v, err;
235235 for (v = 0; v < pf->num_alloc_vsi; v++) {
@@ -252,7 +252,7 @@ static void i40e_dcbnl_del_app(struct i40e_pf *pf, · 16 unmodified lines
252252 * Find given APP in the DCB configuration
253253 **/
254254 static bool i40e_dcbnl_find_app(struct i40e_dcbx_config *cfg,
255− struct i40e_ieee_app_priority_table *app)
255+ struct i40e_dcb_app_priority_table *app)
256256 {
257257 int i;
258258
@@ -277,7 +277,7 @@ static bool i40e_dcbnl_find_app(struct i40e_dcbx_config *cfg, · 18 unmodified lines
277277 void i40e_dcbnl_flush_apps(struct i40e_pf *pf,
278278 struct i40e_dcbx_config *new_cfg)
279279 {
280− struct i40e_ieee_app_priority_table app;
280+ struct i40e_dcb_app_priority_table app;
281281 struct i40e_dcbx_config *dcbxcfg;
282282 struct i40e_hw *hw = &pf->hw;
283283 int i;
drivers/net/ethernet/intel/i40e/i40e_debugfs.c+2−0
@@ -1312,6 +1312,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp, · 1311 unmodified lines
13121312 kfree(bw_data);
13131313 bw_data = NULL;
13141314
1315+ dev_info(&pf->pdev->dev,
1316+ "port dcbx_mode=%d\n", cfg->dcbx_mode);
13151317 dev_info(&pf->pdev->dev,
13161318 "port ets_cfg: willing=%d cbs=%d, maxtcs=%d\n",
13171319 cfg->etscfg.willing, cfg->etscfg.cbs,
drivers/net/ethernet/intel/i40e/i40e_ethtool.c+12−2
@@ -644,11 +644,19 @@ static void i40e_get_pauseparam(struct net_device *netdev, · 643 unmodified lines
644644 struct i40e_pf *pf = np->vsi->back;
645645 struct i40e_hw *hw = &pf->hw;
646646 struct i40e_link_status *hw_link_info = &hw->phy.link_info;
647+ struct i40e_dcbx_config *dcbx_cfg = &hw->local_dcbx_config;
647648
648649 pause->autoneg =
649650 ((hw_link_info->an_info & I40E_AQ_AN_COMPLETED) ?
650651 AUTONEG_ENABLE : AUTONEG_DISABLE);
651652
653+ /* PFC enabled so report LFC as off */
654+ if (dcbx_cfg->pfc.pfcenable) {
655+ pause->rx_pause = 0;
656+ pause->tx_pause = 0;
657+ return;
658+ }
659+
652660 if (hw->fc.current_mode == I40E_FC_RX_PAUSE) {
653661 pause->rx_pause = 1;
654662 } else if (hw->fc.current_mode == I40E_FC_TX_PAUSE) {
@@ -672,6 +680,7 @@ static int i40e_set_pauseparam(struct net_device *netdev, · 17 unmodified lines
672680 struct i40e_vsi *vsi = np->vsi;
673681 struct i40e_hw *hw = &pf->hw;
674682 struct i40e_link_status *hw_link_info = &hw->phy.link_info;
683+ struct i40e_dcbx_config *dcbx_cfg = &hw->local_dcbx_config;
675684 bool link_up = hw_link_info->link_info & I40E_AQ_LINK_UP;
676685 i40e_status status;
677686 u8 aq_failures;
@@ -693,8 +702,9 @@ static int i40e_set_pauseparam(struct net_device *netdev, · 15 unmodified lines
693702 netdev_info(netdev, "Autoneg did not complete so changing settings may not result in an actual change.\n");
694703 }
695704
696− if (hw->fc.current_mode == I40E_FC_PFC) {
697− netdev_info(netdev, "Priority flow control enabled. Cannot set link flow control.\n");
705+ if (dcbx_cfg->pfc.pfcenable) {
706+ netdev_info(netdev,
707+ "Priority flow control enabled. Cannot set link flow control.\n");
698708 return -EOPNOTSUPP;
699709 }
700710
drivers/net/ethernet/intel/i40e/i40e_fcoe.c+1−1
@@ -343,7 +343,7 @@ int i40e_init_pf_fcoe(struct i40e_pf *pf) · 342 unmodified lines
343343 **/
344344 u8 i40e_get_fcoe_tc_map(struct i40e_pf *pf)
345345 {
346− struct i40e_ieee_app_priority_table app;
346+ struct i40e_dcb_app_priority_table app;
347347 struct i40e_hw *hw = &pf->hw;
348348 u8 enabled_tc = 0;
349349 u8 tc, i;
drivers/net/ethernet/intel/i40e/i40e_main.c+151−19
@@ -38,8 +38,8 @@ static const char i40e_driver_string[] = · 37 unmodified lines
3838 #define DRV_KERN "-k"
3939
4040 #define DRV_VERSION_MAJOR 1
41−#define DRV_VERSION_MINOR 0
42−#define DRV_VERSION_BUILD 21
41+#define DRV_VERSION_MINOR 1
42+#define DRV_VERSION_BUILD 23
4343 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
4444 __stringify(DRV_VERSION_MINOR) "." \
4545 __stringify(DRV_VERSION_BUILD) DRV_KERN
@@ -2381,6 +2381,35 @@ static void i40e_vsi_free_rx_resources(struct i40e_vsi *vsi) · 2335 unmodified lines
23812381 #endif
23822382 }
23832383
2384+/**
2385+ * i40e_config_xps_tx_ring - Configure XPS for a Tx ring
2386+ * @ring: The Tx ring to configure
2387+ *
2388+ * This enables/disables XPS for a given Tx descriptor ring
2389+ * based on the TCs enabled for the VSI that ring belongs to.
2390+ **/
2391+static void i40e_config_xps_tx_ring(struct i40e_ring *ring)
2392+{
2393+ struct i40e_vsi *vsi = ring->vsi;
2394+ cpumask_var_t mask;
2395+
2396+ if (ring->q_vector && ring->netdev) {
2397+ /* Single TC mode enable XPS */
2398+ if (vsi->tc_config.numtc <= 1 &&
2399+ !test_and_set_bit(__I40E_TX_XPS_INIT_DONE, &ring->state)) {
2400+ netif_set_xps_queue(ring->netdev,
2401+ &ring->q_vector->affinity_mask,
2402+ ring->queue_index);
2403+ } else if (alloc_cpumask_var(&mask, GFP_KERNEL)) {
2404+ /* Disable XPS to allow selection based on TC */
2405+ bitmap_zero(cpumask_bits(mask), nr_cpumask_bits);
2406+ netif_set_xps_queue(ring->netdev, mask,
2407+ ring->queue_index);
2408+ free_cpumask_var(mask);
2409+ }
2410+ }
2411+}
2412+
23842413 /**
23852414 * i40e_configure_tx_ring - Configure a transmit ring context and rest
23862415 * @ring: The Tx ring to configure
@@ -2404,13 +2433,8 @@ static int i40e_configure_tx_ring(struct i40e_ring *ring) · 17 unmodified lines
24042433 ring->atr_sample_rate = 0;
24052434 }
24062435
2407− /* initialize XPS */
2408− if (ring->q_vector && ring->netdev &&
2409− vsi->tc_config.numtc <= 1 &&
2410− !test_and_set_bit(__I40E_TX_XPS_INIT_DONE, &ring->state))
2411− netif_set_xps_queue(ring->netdev,
2412− &ring->q_vector->affinity_mask,
2413− ring->queue_index);
2436+ /* configure XPS */
2437+ i40e_config_xps_tx_ring(ring);
24142438
24152439 /* clear the context structure first */
24162440 memset(&tx_ctx, 0, sizeof(tx_ctx));
@@ -3492,6 +3516,9 @@ static int i40e_vsi_control_tx(struct i40e_vsi *vsi, bool enable) · 1075 unmodified lines
34923516 }
34933517
34943518 wr32(hw, I40E_QTX_ENA(pf_q), tx_reg);
3519+ /* No waiting for the Tx queue to disable */
3520+ if (!enable && test_bit(__I40E_PORT_TX_SUSPENDED, &pf->state))
3521+ continue;
34953522
34963523 /* wait for the change to finish */
34973524 ret = i40e_pf_txq_wait(pf, pf_q, enable);
@@ -3859,6 +3886,15 @@ static void i40e_quiesce_vsi(struct i40e_vsi *vsi) · 361 unmodified lines
38593886 if (test_bit(__I40E_DOWN, &vsi->state))
38603887 return;
38613888
3889+ /* No need to disable FCoE VSI when Tx suspended */
3890+ if ((test_bit(__I40E_PORT_TX_SUSPENDED, &vsi->back->state)) &&
3891+ vsi->type == I40E_VSI_FCOE) {
3892+ dev_dbg(&vsi->back->pdev->dev,
3893+ "%s: VSI seid %d skipping FCoE VSI disable\n",
3894+ __func__, vsi->seid);
3895+ return;
3896+ }
3897+
38623898 set_bit(__I40E_NEEDS_RESTART, &vsi->state);
38633899 if (vsi->netdev && netif_running(vsi->netdev)) {
38643900 vsi->netdev->netdev_ops->ndo_stop(vsi->netdev);
@@ -3911,6 +3947,57 @@ static void i40e_pf_unquiesce_all_vsi(struct i40e_pf *pf) · 46 unmodified lines
39113947 }
39123948 }
39133949
3950+#ifdef CONFIG_I40E_DCB
3951+/**
3952+ * i40e_vsi_wait_txq_disabled - Wait for VSI's queues to be disabled
3953+ * @vsi: the VSI being configured
3954+ *
3955+ * This function waits for the given VSI's Tx queues to be disabled.
3956+ **/
3957+static int i40e_vsi_wait_txq_disabled(struct i40e_vsi *vsi)
3958+{
3959+ struct i40e_pf *pf = vsi->back;
3960+ int i, pf_q, ret;
3961+
3962+ pf_q = vsi->base_queue;
3963+ for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
3964+ /* Check and wait for the disable status of the queue */
3965+ ret = i40e_pf_txq_wait(pf, pf_q, false);
3966+ if (ret) {
3967+ dev_info(&pf->pdev->dev,
3968+ "%s: VSI seid %d Tx ring %d disable timeout\n",
3969+ __func__, vsi->seid, pf_q);
3970+ return ret;
3971+ }
3972+ }
3973+
3974+ return 0;
3975+}
3976+
3977+/**
3978+ * i40e_pf_wait_txq_disabled - Wait for all queues of PF VSIs to be disabled
3979+ * @pf: the PF
3980+ *
3981+ * This function waits for the Tx queues to be in disabled state for all the
3982+ * VSIs that are managed by this PF.
3983+ **/
3984+static int i40e_pf_wait_txq_disabled(struct i40e_pf *pf)
3985+{
3986+ int v, ret = 0;
3987+
3988+ for (v = 0; v < pf->hw.func_caps.num_vsis; v++) {
3989+ /* No need to wait for FCoE VSI queues */
3990+ if (pf->vsi[v] && pf->vsi[v]->type != I40E_VSI_FCOE) {
3991+ ret = i40e_vsi_wait_txq_disabled(pf->vsi[v]);
3992+ if (ret)
3993+ break;
3994+ }
3995+ }
3996+
3997+ return ret;
3998+}
3999+
4000+#endif
39144001 /**
39154002 * i40e_dcb_get_num_tc - Get the number of TCs from DCBx config
39164003 * @dcbcfg: the corresponding DCBx configuration structure
@@ -4381,6 +4468,31 @@ static void i40e_dcb_reconfigure(struct i40e_pf *pf) · 464 unmodified lines
43814468 }
43824469 }
43834470
4471+/**
4472+ * i40e_resume_port_tx - Resume port Tx
4473+ * @pf: PF struct
4474+ *
4475+ * Resume a port's Tx and issue a PF reset in case of failure to
4476+ * resume.
4477+ **/
4478+static int i40e_resume_port_tx(struct i40e_pf *pf)
4479+{
4480+ struct i40e_hw *hw = &pf->hw;
4481+ int ret;
4482+
4483+ ret = i40e_aq_resume_port_tx(hw, NULL);
4484+ if (ret) {
4485+ dev_info(&pf->pdev->dev,
4486+ "AQ command Resume Port Tx failed = %d\n",
4487+ pf->hw.aq.asq_last_status);
4488+ /* Schedule PF reset to recover */
4489+ set_bit(__I40E_PF_RESET_REQUESTED, &pf->state);
4490+ i40e_service_event_schedule(pf);
4491+ }
4492+
4493+ return ret;
4494+}
4495+
43844496 /**
43854497 * i40e_init_pf_dcb - Initialize DCB configuration
43864498 * @pf: PF being configured
@@ -4417,6 +4529,8 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf) · 30 unmodified lines
44174529 /* Enable DCB tagging only when more than one TC */
44184530 if (i40e_dcb_get_num_tc(&hw->local_dcbx_config) > 1)
44194531 pf->flags |= I40E_FLAG_DCB_ENABLED;
4532+ dev_dbg(&pf->pdev->dev,
4533+ "DCBX offload is supported for this PF.\n");
44204534 }
44214535 } else {
44224536 dev_info(&pf->pdev->dev, "AQ Querying DCB configuration failed: %d\n",
@@ -4998,6 +5112,8 @@ bool i40e_dcb_need_reconfig(struct i40e_pf *pf, · 575 unmodified lines
49985112 dev_dbg(&pf->pdev->dev, "APP Table change detected.\n");
49995113 }
50005114
5115+ dev_dbg(&pf->pdev->dev, "%s: need_reconfig=%d\n", __func__,
5116+ need_reconfig);
50015117 return need_reconfig;
50025118 }
50035119
@@ -5025,11 +5141,16 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, · 21 unmodified lines
50255141 /* Ignore if event is not for Nearest Bridge */
50265142 type = ((mib->type >> I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT)
50275143 & I40E_AQ_LLDP_BRIDGE_TYPE_MASK);
5144+ dev_dbg(&pf->pdev->dev,
5145+ "%s: LLDP event mib bridge type 0x%x\n", __func__, type);
50285146 if (type != I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE)
50295147 return ret;
50305148
50315149 /* Check MIB Type and return if event for Remote MIB update */
50325150 type = mib->type & I40E_AQ_LLDP_MIB_TYPE_MASK;
5151+ dev_dbg(&pf->pdev->dev,
5152+ "%s: LLDP event mib type %s\n", __func__,
5153+ type ? "remote" : "local");
50335154 if (type == I40E_AQ_LLDP_MIB_REMOTE) {
50345155 /* Update the remote cached instance and return */
50355156 ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_REMOTE,
@@ -5038,12 +5159,14 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, · 2 unmodified lines
50385159 goto exit;
50395160 }
50405161
5041− /* Convert/store the DCBX data from LLDPDU temporarily */
50425162 memset(&tmp_dcbx_cfg, 0, sizeof(tmp_dcbx_cfg));
5043− ret = i40e_lldp_to_dcb_config(e->msg_buf, &tmp_dcbx_cfg);
5163+ /* Store the old configuration */
5164+ tmp_dcbx_cfg = *dcbx_cfg;
5165+
5166+ /* Get updated DCBX data from firmware */
5167+ ret = i40e_get_dcb_config(&pf->hw);
50445168 if (ret) {
5045− /* Error in LLDPDU parsing return */
5046− dev_info(&pf->pdev->dev, "Failed parsing LLDPDU from event buffer\n");
5169+ dev_info(&pf->pdev->dev, "Failed querying DCB configuration data from firmware.\n");
50475170 goto exit;
50485171 }
50495172
@@ -5053,12 +5176,9 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, · 3 unmodified lines
50535176 goto exit;
50545177 }
50555178
5056− need_reconfig = i40e_dcb_need_reconfig(pf, dcbx_cfg, &tmp_dcbx_cfg);
5179+ need_reconfig = i40e_dcb_need_reconfig(pf, &tmp_dcbx_cfg, dcbx_cfg);
50575180
5058− i40e_dcbnl_flush_apps(pf, &tmp_dcbx_cfg);
5059−
5060− /* Overwrite the new configuration */
5061− *dcbx_cfg = tmp_dcbx_cfg;
5181+ i40e_dcbnl_flush_apps(pf, dcbx_cfg);
50625182
50635183 if (!need_reconfig)
50645184 goto exit;
@@ -5069,13 +5189,24 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, · 4 unmodified lines
50695189 else
50705190 pf->flags &= ~I40E_FLAG_DCB_ENABLED;
50715191
5192+ set_bit(__I40E_PORT_TX_SUSPENDED, &pf->state);
50725193 /* Reconfiguration needed quiesce all VSIs */
50735194 i40e_pf_quiesce_all_vsi(pf);
50745195
50755196 /* Changes in configuration update VEB/VSI */
50765197 i40e_dcb_reconfigure(pf);
50775198
5078− i40e_pf_unquiesce_all_vsi(pf);
5199+ ret = i40e_resume_port_tx(pf);
5200+
5201+ clear_bit(__I40E_PORT_TX_SUSPENDED, &pf->state);
5202+ /* In case of error no point in resuming VSIs */
5203+ if (ret)
5204+ goto exit;
5205+
5206+ /* Wait for the PF's Tx queues to be disabled */
5207+ ret = i40e_pf_wait_txq_disabled(pf);
5208+ if (!ret)
5209+ i40e_pf_unquiesce_all_vsi(pf);
50795210 exit:
50805211 return ret;
50815212 }
@@ -8242,6 +8373,7 @@ static int i40e_veb_get_bw_info(struct i40e_veb *veb) · 3160 unmodified lines
82428373 veb->bw_limit = le16_to_cpu(ets_data.port_bw_limit);
82438374 veb->bw_max_quanta = ets_data.tc_bw_max;
82448375 veb->is_abs_credits = bw_data.absolute_credits_enable;
8376+ veb->enabled_tc = ets_data.tc_valid_bits;
82458377 tc_bw_max = le16_to_cpu(bw_data.tc_bw_max[0]) |
82468378 (le16_to_cpu(bw_data.tc_bw_max[1]) << 16);
82478379 for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
drivers/net/ethernet/intel/i40e/i40e_prototype.h+7−0
@@ -175,6 +175,9 @@ i40e_status i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent, · 174 unmodified lines
175175 struct i40e_asq_cmd_details *cmd_details);
176176 i40e_status i40e_aq_start_lldp(struct i40e_hw *hw,
177177 struct i40e_asq_cmd_details *cmd_details);
178+i40e_status i40e_aq_get_cee_dcb_config(struct i40e_hw *hw,
179+ void *buff, u16 buff_size,
180+ struct i40e_asq_cmd_details *cmd_details);
178181 i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
179182 u16 udp_port, u8 protocol_index,
180183 u8 *filter_index,
@@ -230,6 +233,10 @@ i40e_status i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw, · 49 unmodified lines
230233 u16 seid,
231234 struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data,
232235 struct i40e_asq_cmd_details *cmd_details);
236+i40e_status i40e_aq_resume_port_tx(struct i40e_hw *hw,
237+ struct i40e_asq_cmd_details *cmd_details);
238+i40e_status i40e_read_lldp_cfg(struct i40e_hw *hw,
239+ struct i40e_lldp_variables *lldp_cfg);
233240 /* i40e_common */
234241 i40e_status i40e_init_shared_code(struct i40e_hw *hw);
235242 i40e_status i40e_pf_reset(struct i40e_hw *hw);
drivers/net/ethernet/intel/i40e/i40e_ptp.c+9−3
@@ -382,11 +382,17 @@ void i40e_ptp_set_increment(struct i40e_pf *pf) · 381 unmodified lines
382382 incval = I40E_PTP_1GB_INCVAL;
383383 break;
384384 case I40E_LINK_SPEED_100MB:
385− dev_warn(&pf->pdev->dev,
386− "%s: 1588 functionality is not supported at 100 Mbps. Stopping the PHC.\n",
387− __func__);
385+ {
386+ static int warn_once;
387+
388+ if (!warn_once) {
389+ dev_warn(&pf->pdev->dev,
390+ "1588 functionality is not supported at 100 Mbps. Stopping the PHC.\n");
391+ warn_once++;
392+ }
388393 incval = 0;
389394 break;
395+ }
390396 case I40E_LINK_SPEED_40GB:
391397 default:
392398 incval = I40E_PTP_40GB_INCVAL;
drivers/net/ethernet/intel/i40e/i40e_type.h+35−18
@@ -381,9 +381,18 @@ struct i40e_fc_info { · 380 unmodified lines
381381 #define I40E_MAX_USER_PRIORITY 8
382382 #define I40E_DCBX_MAX_APPS 32
383383 #define I40E_LLDPDU_SIZE 1500
384−
385−/* IEEE 802.1Qaz ETS Configuration data */
386−struct i40e_ieee_ets_config {
384+#define I40E_TLV_STATUS_OPER 0x1
385+#define I40E_TLV_STATUS_SYNC 0x2
386+#define I40E_TLV_STATUS_ERR 0x4
387+#define I40E_CEE_OPER_MAX_APPS 3
388+#define I40E_APP_PROTOID_FCOE 0x8906
389+#define I40E_APP_PROTOID_ISCSI 0x0cbc
390+#define I40E_APP_PROTOID_FIP 0x8914
391+#define I40E_APP_SEL_ETHTYPE 0x1
392+#define I40E_APP_SEL_TCPIP 0x2
393+
394+/* CEE or IEEE 802.1Qaz ETS Configuration data */
395+struct i40e_dcb_ets_config {
387396 u8 willing;
388397 u8 cbs;
389398 u8 maxtcs;
@@ -392,34 +401,30 @@ struct i40e_ieee_ets_config { · 2 unmodified lines
392401 u8 tsatable[I40E_MAX_TRAFFIC_CLASS];
393402 };
394403
395−/* IEEE 802.1Qaz ETS Recommendation data */
396−struct i40e_ieee_ets_recommend {
397− u8 prioritytable[I40E_MAX_TRAFFIC_CLASS];
398− u8 tcbwtable[I40E_MAX_TRAFFIC_CLASS];
399− u8 tsatable[I40E_MAX_TRAFFIC_CLASS];
400−};
401−
402−/* IEEE 802.1Qaz PFC Configuration data */
403−struct i40e_ieee_pfc_config {
404+/* CEE or IEEE 802.1Qaz PFC Configuration data */
405+struct i40e_dcb_pfc_config {
404406 u8 willing;
405407 u8 mbc;
406408 u8 pfccap;
407409 u8 pfcenable;
408410 };
409411
410−/* IEEE 802.1Qaz Application Priority data */
411−struct i40e_ieee_app_priority_table {
412+/* CEE or IEEE 802.1Qaz Application Priority data */
413+struct i40e_dcb_app_priority_table {
412414 u8 priority;
413415 u8 selector;
414416 u16 protocolid;
415417 };
416418
417419 struct i40e_dcbx_config {
420+ u8 dcbx_mode;
421+#define I40E_DCBX_MODE_CEE 0x1
422+#define I40E_DCBX_MODE_IEEE 0x2
418423 u32 numapps;
419− struct i40e_ieee_ets_config etscfg;
420− struct i40e_ieee_ets_recommend etsrec;
421− struct i40e_ieee_pfc_config pfc;
422− struct i40e_ieee_app_priority_table app[I40E_DCBX_MAX_APPS];
424+ struct i40e_dcb_ets_config etscfg;
425+ struct i40e_dcb_ets_config etsrec;
426+ struct i40e_dcb_pfc_config pfc;
427+ struct i40e_dcb_app_priority_table app[I40E_DCBX_MAX_APPS];
423428 };
424429
425430 /* Port hardware description */
@@ -1372,6 +1377,18 @@ enum i40e_reset_type { · 946 unmodified lines
13721377 I40E_RESET_EMPR = 3,
13731378 };
13741379
1380+/* IEEE 802.1AB LLDP Agent Variables from NVM */
1381+#define I40E_NVM_LLDP_CFG_PTR 0xD
1382+struct i40e_lldp_variables {
1383+ u16 length;
1384+ u16 adminstatus;
1385+ u16 msgfasttx;
1386+ u16 msgtxinterval;
1387+ u16 txparams;
1388+ u16 timers;
1389+ u16 crc8;
1390+};
1391+
13751392 /* RSS Hash Table Size */
13761393 #define I40E_PFQF_CTL_0_HASHLUTSIZE_512 0x00010000
13771394 #endif /* _I40E_TYPE_H_ */
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+6−6
@@ -1869,6 +1869,12 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf) · 1868 unmodified lines
18691869 if (!test_bit(__I40E_VFLR_EVENT_PENDING, &pf->state))
18701870 return 0;
18711871
1872+ /* re-enable vflr interrupt cause */
1873+ reg = rd32(hw, I40E_PFINT_ICR0_ENA);
1874+ reg |= I40E_PFINT_ICR0_ENA_VFLR_MASK;
1875+ wr32(hw, I40E_PFINT_ICR0_ENA, reg);
1876+ i40e_flush(hw);
1877+
18721878 clear_bit(__I40E_VFLR_EVENT_PENDING, &pf->state);
18731879 for (vf_id = 0; vf_id < pf->num_alloc_vfs; vf_id++) {
18741880 reg_idx = (hw->func_caps.vf_base_id + vf_id) / 32;
@@ -1885,12 +1891,6 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf) · 10 unmodified lines
18851891 }
18861892 }
18871893
1888− /* re-enable vflr interrupt cause */
1889− reg = rd32(hw, I40E_PFINT_ICR0_ENA);
1890− reg |= I40E_PFINT_ICR0_ENA_VFLR_MASK;
1891− wr32(hw, I40E_PFINT_ICR0_ENA, reg);
1892− i40e_flush(hw);
1893−
18941894 return 0;
18951895 }
18961896

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t