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
146 __I40E_DOWN_REQUESTED,146 __I40E_DOWN_REQUESTED,
147 __I40E_FD_FLUSH_REQUESTED,147 __I40E_FD_FLUSH_REQUESTED,
148 __I40E_RESET_FAILED,148 __I40E_RESET_FAILED,
149 __I40E_PORT_TX_SUSPENDED,
149};150};
150 151
151enum i40e_interrupt_policy {152enum 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
255 i40e_aqc_opc_lldp_delete_tlv = 0x0A04,255 i40e_aqc_opc_lldp_delete_tlv = 0x0A04,
256 i40e_aqc_opc_lldp_stop = 0x0A05,256 i40e_aqc_opc_lldp_stop = 0x0A05,
257 i40e_aqc_opc_lldp_start = 0x0A06,257 i40e_aqc_opc_lldp_start = 0x0A06,
258 i40e_aqc_opc_get_cee_dcb_cfg = 0x0A07,
258 259
259 /* Tunnel commands */260 /* Tunnel commands */
260 i40e_aqc_opc_add_udp_tunnel = 0x0B00,261 i40e_aqc_opc_add_udp_tunnel = 0x0B00,
@@ -1987,10 +1988,50 @@ struct i40e_aqc_lldp_start { · 1726 unmodified lines
1987 1988
1988I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);1989I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
1989 1990
1990/* Apply MIB changes (0x0A07)1991/* Get CEE DCBX Oper Config (0x0A07)
1991 * uses the generic struc as it contains no data1992 * uses the generic descriptor struct
1993 * returns below as indirect response
1992 */1994 */
1993 1995
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)
2008struct 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
2021I40E_CHECK_STRUCT_LEN(0x18, i40e_aqc_get_cee_dcb_cfg_v1_resp);
2022
2023struct 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
2033I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_cee_dcb_cfg_resp);
2034
1994/* Add Udp Tunnel command and completion (direct 0x0B00) */2035/* Add Udp Tunnel command and completion (direct 0x0B00) */
1995struct i40e_aqc_add_udp_tunnel {2036struct i40e_aqc_add_udp_tunnel {
1996 __le16 udp_port;2037 __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
2659 return status;2659 return status;
2660}2660}
2661 2661
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 **/
2671i40e_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
2662/**2690/**
2663 * i40e_aq_add_udp_tunnel2691 * i40e_aq_add_udp_tunnel
2664 * @hw: pointer to the hw struct2692 * @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
3216 return status;3244 return status;
3217}3245}
3218 3246
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 **/
3254i40e_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
3219/**3267/**
3220 * i40e_set_pci_config_data - store PCI bus info3268 * i40e_set_pci_config_data - store PCI bus info
3221 * @hw: pointer to hardware structure3269 * @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
59static void i40e_parse_ieee_etscfg_tlv(struct i40e_lldp_org_tlv *tlv,59static void i40e_parse_ieee_etscfg_tlv(struct i40e_lldp_org_tlv *tlv,
60 struct i40e_dcbx_config *dcbcfg)60 struct i40e_dcbx_config *dcbcfg)
61{61{
62 struct i40e_ieee_ets_config *etscfg;62 struct i40e_dcb_ets_config *etscfg;
63 u8 *buf = tlv->tlvinfo;63 u8 *buf = tlv->tlvinfo;
64 u16 offset = 0;64 u16 offset = 0;
65 u8 priority;65 u8 priority;
@@ -406,6 +406,166 @@ free_mem: · 340 unmodified lines
406 return ret;406 return ret;
407}407}
408 408
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 **/
416static 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 **/
496static 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
409/**569/**
410 * i40e_get_dcb_config570 * i40e_get_dcb_config
411 * @hw: pointer to the hw struct571 * @hw: pointer to the hw struct
@@ -415,7 +575,44 @@ free_mem: · 3 unmodified lines
415i40e_status i40e_get_dcb_config(struct i40e_hw *hw)575i40e_status i40e_get_dcb_config(struct i40e_hw *hw)
416{576{
417 i40e_status ret = 0;577 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;
418 612
613ieee:
614 /* IEEE mode */
615 hw->local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_IEEE;
419 /* Get Local DCB Config */616 /* Get Local DCB Config */
420 ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_LOCAL, 0,617 ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_LOCAL, 0,
421 &hw->local_dcbx_config);618 &hw->local_dcbx_config);
@@ -426,6 +623,10 @@ i40e_status i40e_get_dcb_config(struct i40e_hw *hw) · 4 unmodified lines
426 ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_REMOTE,623 ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_REMOTE,
427 I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE,624 I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE,
428 &hw->remote_dcbx_config);625 &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
429out:630out:
430 return ret;631 return ret;
431}632}
@@ -439,10 +640,27 @@ out: · 7 unmodified lines
439i40e_status i40e_init_dcb(struct i40e_hw *hw)640i40e_status i40e_init_dcb(struct i40e_hw *hw)
440{641{
441 i40e_status ret = 0;642 i40e_status ret = 0;
643 struct i40e_lldp_variables lldp_cfg;
644 u8 adminstatus = 0;
442 645
443 if (!hw->func_caps.dcb)646 if (!hw->func_caps.dcb)
444 return ret;647 return ret;
445 648
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
446 /* Get DCBX status */664 /* Get DCBX status */
447 ret = i40e_get_dcbx_status(hw, &hw->dcbx_status);665 ret = i40e_get_dcbx_status(hw, &hw->dcbx_status);
448 if (ret)666 if (ret)
@@ -454,6 +672,8 @@ i40e_status i40e_init_dcb(struct i40e_hw *hw) · 5 unmodified lines
454 case I40E_DCBX_STATUS_IN_PROGRESS:672 case I40E_DCBX_STATUS_IN_PROGRESS:
455 /* Get current DCBX configuration */673 /* Get current DCBX configuration */
456 ret = i40e_get_dcb_config(hw);674 ret = i40e_get_dcb_config(hw);
675 if (ret)
676 return ret;
457 break;677 break;
458 case I40E_DCBX_STATUS_DISABLED:678 case I40E_DCBX_STATUS_DISABLED:
459 return ret;679 return ret;
@@ -470,3 +690,33 @@ i40e_status i40e_init_dcb(struct i40e_hw *hw) · 10 unmodified lines
470 690
471 return ret;691 return ret;
472}692}
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 **/
701i40e_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
720err_lldp_cfg:
721 return ret;
722}
drivers/net/ethernet/intel/i40e/i40e_dcb.h+5−0
@@ -65,6 +65,11 @@ · 64 unmodified lines
65#define I40E_IEEE_ETS_PRIO_0_MASK (0x7 << I40E_IEEE_ETS_PRIO_0_SHIFT)65#define I40E_IEEE_ETS_PRIO_0_MASK (0x7 << I40E_IEEE_ETS_PRIO_0_SHIFT)
66#define I40E_IEEE_ETS_PRIO_1_SHIFT 466#define I40E_IEEE_ETS_PRIO_1_SHIFT 4
67#define I40E_IEEE_ETS_PRIO_1_MASK (0x7 << I40E_IEEE_ETS_PRIO_1_SHIFT)67#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
68 73
69/* Defines for IEEE TSA types */74/* Defines for IEEE TSA types */
70#define I40E_IEEE_TSA_STRICT 075#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
207 * VSI207 * VSI
208 **/208 **/
209static int i40e_dcbnl_vsi_del_app(struct i40e_vsi *vsi,209static 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)
211{211{
212 struct net_device *dev = vsi->netdev;212 struct net_device *dev = vsi->netdev;
213 struct dcb_app sapp;213 struct dcb_app sapp;
@@ -229,7 +229,7 @@ static int i40e_dcbnl_vsi_del_app(struct i40e_vsi *vsi, · 15 unmodified lines
229 * Delete given APP from all the VSIs for given PF229 * Delete given APP from all the VSIs for given PF
230 **/230 **/
231static void i40e_dcbnl_del_app(struct i40e_pf *pf,231static 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)
233{233{
234 int v, err;234 int v, err;
235 for (v = 0; v < pf->num_alloc_vsi; v++) {235 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
252 * Find given APP in the DCB configuration252 * Find given APP in the DCB configuration
253 **/253 **/
254static bool i40e_dcbnl_find_app(struct i40e_dcbx_config *cfg,254static 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)
256{256{
257 int i;257 int i;
258 258
@@ -277,7 +277,7 @@ static bool i40e_dcbnl_find_app(struct i40e_dcbx_config *cfg, · 18 unmodified lines
277void i40e_dcbnl_flush_apps(struct i40e_pf *pf,277void i40e_dcbnl_flush_apps(struct i40e_pf *pf,
278 struct i40e_dcbx_config *new_cfg)278 struct i40e_dcbx_config *new_cfg)
279{279{
280 struct i40e_ieee_app_priority_table app;280 struct i40e_dcb_app_priority_table app;
281 struct i40e_dcbx_config *dcbxcfg;281 struct i40e_dcbx_config *dcbxcfg;
282 struct i40e_hw *hw = &pf->hw;282 struct i40e_hw *hw = &pf->hw;
283 int i;283 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
1312 kfree(bw_data);1312 kfree(bw_data);
1313 bw_data = NULL;1313 bw_data = NULL;
1314 1314
1315 dev_info(&pf->pdev->dev,
1316 "port dcbx_mode=%d\n", cfg->dcbx_mode);
1315 dev_info(&pf->pdev->dev,1317 dev_info(&pf->pdev->dev,
1316 "port ets_cfg: willing=%d cbs=%d, maxtcs=%d\n",1318 "port ets_cfg: willing=%d cbs=%d, maxtcs=%d\n",
1317 cfg->etscfg.willing, cfg->etscfg.cbs,1319 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
644 struct i40e_pf *pf = np->vsi->back;644 struct i40e_pf *pf = np->vsi->back;
645 struct i40e_hw *hw = &pf->hw;645 struct i40e_hw *hw = &pf->hw;
646 struct i40e_link_status *hw_link_info = &hw->phy.link_info;646 struct i40e_link_status *hw_link_info = &hw->phy.link_info;
647 struct i40e_dcbx_config *dcbx_cfg = &hw->local_dcbx_config;
647 648
648 pause->autoneg =649 pause->autoneg =
649 ((hw_link_info->an_info & I40E_AQ_AN_COMPLETED) ?650 ((hw_link_info->an_info & I40E_AQ_AN_COMPLETED) ?
650 AUTONEG_ENABLE : AUTONEG_DISABLE);651 AUTONEG_ENABLE : AUTONEG_DISABLE);
651 652
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
652 if (hw->fc.current_mode == I40E_FC_RX_PAUSE) {660 if (hw->fc.current_mode == I40E_FC_RX_PAUSE) {
653 pause->rx_pause = 1;661 pause->rx_pause = 1;
654 } else if (hw->fc.current_mode == I40E_FC_TX_PAUSE) {662 } 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
672 struct i40e_vsi *vsi = np->vsi;680 struct i40e_vsi *vsi = np->vsi;
673 struct i40e_hw *hw = &pf->hw;681 struct i40e_hw *hw = &pf->hw;
674 struct i40e_link_status *hw_link_info = &hw->phy.link_info;682 struct i40e_link_status *hw_link_info = &hw->phy.link_info;
683 struct i40e_dcbx_config *dcbx_cfg = &hw->local_dcbx_config;
675 bool link_up = hw_link_info->link_info & I40E_AQ_LINK_UP;684 bool link_up = hw_link_info->link_info & I40E_AQ_LINK_UP;
676 i40e_status status;685 i40e_status status;
677 u8 aq_failures;686 u8 aq_failures;
@@ -693,8 +702,9 @@ static int i40e_set_pauseparam(struct net_device *netdev, · 15 unmodified lines
693 netdev_info(netdev, "Autoneg did not complete so changing settings may not result in an actual change.\n");702 netdev_info(netdev, "Autoneg did not complete so changing settings may not result in an actual change.\n");
694 }703 }
695 704
696 if (hw->fc.current_mode == I40E_FC_PFC) {705 if (dcbx_cfg->pfc.pfcenable) {
697 netdev_info(netdev, "Priority flow control enabled. Cannot set link flow control.\n");706 netdev_info(netdev,
707 "Priority flow control enabled. Cannot set link flow control.\n");
698 return -EOPNOTSUPP;708 return -EOPNOTSUPP;
699 }709 }
700 710
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
343 **/343 **/
344u8 i40e_get_fcoe_tc_map(struct i40e_pf *pf)344u8 i40e_get_fcoe_tc_map(struct i40e_pf *pf)
345{345{
346 struct i40e_ieee_app_priority_table app;346 struct i40e_dcb_app_priority_table app;
347 struct i40e_hw *hw = &pf->hw;347 struct i40e_hw *hw = &pf->hw;
348 u8 enabled_tc = 0;348 u8 enabled_tc = 0;
349 u8 tc, i;349 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
38#define DRV_KERN "-k"38#define DRV_KERN "-k"
39 39
40#define DRV_VERSION_MAJOR 140#define DRV_VERSION_MAJOR 1
41#define DRV_VERSION_MINOR 041#define DRV_VERSION_MINOR 1
42#define DRV_VERSION_BUILD 2142#define DRV_VERSION_BUILD 23
43#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \43#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
44 __stringify(DRV_VERSION_MINOR) "." \44 __stringify(DRV_VERSION_MINOR) "." \
45 __stringify(DRV_VERSION_BUILD) DRV_KERN45 __stringify(DRV_VERSION_BUILD) DRV_KERN
@@ -2381,6 +2381,35 @@ static void i40e_vsi_free_rx_resources(struct i40e_vsi *vsi) · 2335 unmodified lines
2381#endif2381#endif
2382}2382}
2383 2383
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 **/
2391static 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
2384/**2413/**
2385 * i40e_configure_tx_ring - Configure a transmit ring context and rest2414 * i40e_configure_tx_ring - Configure a transmit ring context and rest
2386 * @ring: The Tx ring to configure2415 * @ring: The Tx ring to configure
@@ -2404,13 +2433,8 @@ static int i40e_configure_tx_ring(struct i40e_ring *ring) · 17 unmodified lines
2404 ring->atr_sample_rate = 0;2433 ring->atr_sample_rate = 0;
2405 }2434 }
2406 2435
2407 /* initialize XPS */2436 /* configure XPS */
2408 if (ring->q_vector && ring->netdev &&2437 i40e_config_xps_tx_ring(ring);
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);
2414 2438
2415 /* clear the context structure first */2439 /* clear the context structure first */
2416 memset(&tx_ctx, 0, sizeof(tx_ctx));2440 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
3492 }3516 }
3493 3517
3494 wr32(hw, I40E_QTX_ENA(pf_q), tx_reg);3518 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;
3495 3522
3496 /* wait for the change to finish */3523 /* wait for the change to finish */
3497 ret = i40e_pf_txq_wait(pf, pf_q, enable);3524 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
3859 if (test_bit(__I40E_DOWN, &vsi->state))3886 if (test_bit(__I40E_DOWN, &vsi->state))
3860 return;3887 return;
3861 3888
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
3862 set_bit(__I40E_NEEDS_RESTART, &vsi->state);3898 set_bit(__I40E_NEEDS_RESTART, &vsi->state);
3863 if (vsi->netdev && netif_running(vsi->netdev)) {3899 if (vsi->netdev && netif_running(vsi->netdev)) {
3864 vsi->netdev->netdev_ops->ndo_stop(vsi->netdev);3900 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
3911 }3947 }
3912}3948}
3913 3949
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 **/
3957static 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 **/
3984static 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
3914/**4001/**
3915 * i40e_dcb_get_num_tc - Get the number of TCs from DCBx config4002 * i40e_dcb_get_num_tc - Get the number of TCs from DCBx config
3916 * @dcbcfg: the corresponding DCBx configuration structure4003 * @dcbcfg: the corresponding DCBx configuration structure
@@ -4381,6 +4468,31 @@ static void i40e_dcb_reconfigure(struct i40e_pf *pf) · 464 unmodified lines
4381 }4468 }
4382}4469}
4383 4470
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 **/
4478static 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
4384/**4496/**
4385 * i40e_init_pf_dcb - Initialize DCB configuration4497 * i40e_init_pf_dcb - Initialize DCB configuration
4386 * @pf: PF being configured4498 * @pf: PF being configured
@@ -4417,6 +4529,8 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf) · 30 unmodified lines
4417 /* Enable DCB tagging only when more than one TC */4529 /* Enable DCB tagging only when more than one TC */
4418 if (i40e_dcb_get_num_tc(&hw->local_dcbx_config) > 1)4530 if (i40e_dcb_get_num_tc(&hw->local_dcbx_config) > 1)
4419 pf->flags |= I40E_FLAG_DCB_ENABLED;4531 pf->flags |= I40E_FLAG_DCB_ENABLED;
4532 dev_dbg(&pf->pdev->dev,
4533 "DCBX offload is supported for this PF.\n");
4420 }4534 }
4421 } else {4535 } else {
4422 dev_info(&pf->pdev->dev, "AQ Querying DCB configuration failed: %d\n",4536 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
4998 dev_dbg(&pf->pdev->dev, "APP Table change detected.\n");5112 dev_dbg(&pf->pdev->dev, "APP Table change detected.\n");
4999 }5113 }
5000 5114
5115 dev_dbg(&pf->pdev->dev, "%s: need_reconfig=%d\n", __func__,
5116 need_reconfig);
5001 return need_reconfig;5117 return need_reconfig;
5002}5118}
5003 5119
@@ -5025,11 +5141,16 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, · 21 unmodified lines
5025 /* Ignore if event is not for Nearest Bridge */5141 /* Ignore if event is not for Nearest Bridge */
5026 type = ((mib->type >> I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT)5142 type = ((mib->type >> I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT)
5027 & I40E_AQ_LLDP_BRIDGE_TYPE_MASK);5143 & I40E_AQ_LLDP_BRIDGE_TYPE_MASK);
5144 dev_dbg(&pf->pdev->dev,
5145 "%s: LLDP event mib bridge type 0x%x\n", __func__, type);
5028 if (type != I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE)5146 if (type != I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE)
5029 return ret;5147 return ret;
5030 5148
5031 /* Check MIB Type and return if event for Remote MIB update */5149 /* Check MIB Type and return if event for Remote MIB update */
5032 type = mib->type & I40E_AQ_LLDP_MIB_TYPE_MASK;5150 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");
5033 if (type == I40E_AQ_LLDP_MIB_REMOTE) {5154 if (type == I40E_AQ_LLDP_MIB_REMOTE) {
5034 /* Update the remote cached instance and return */5155 /* Update the remote cached instance and return */
5035 ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_REMOTE,5156 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
5038 goto exit;5159 goto exit;
5039 }5160 }
5040 5161
5041 /* Convert/store the DCBX data from LLDPDU temporarily */
5042 memset(&tmp_dcbx_cfg, 0, sizeof(tmp_dcbx_cfg));5162 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);
5044 if (ret) {5168 if (ret) {
5045 /* Error in LLDPDU parsing return */5169 dev_info(&pf->pdev->dev, "Failed querying DCB configuration data from firmware.\n");
5046 dev_info(&pf->pdev->dev, "Failed parsing LLDPDU from event buffer\n");
5047 goto exit;5170 goto exit;
5048 }5171 }
5049 5172
@@ -5053,12 +5176,9 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, · 3 unmodified lines
5053 goto exit;5176 goto exit;
5054 }5177 }
5055 5178
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);
5057 5180
5058 i40e_dcbnl_flush_apps(pf, &tmp_dcbx_cfg);5181 i40e_dcbnl_flush_apps(pf, dcbx_cfg);
5059
5060 /* Overwrite the new configuration */
5061 *dcbx_cfg = tmp_dcbx_cfg;
5062 5182
5063 if (!need_reconfig)5183 if (!need_reconfig)
5064 goto exit;5184 goto exit;
@@ -5069,13 +5189,24 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, · 4 unmodified lines
5069 else5189 else
5070 pf->flags &= ~I40E_FLAG_DCB_ENABLED;5190 pf->flags &= ~I40E_FLAG_DCB_ENABLED;
5071 5191
5192 set_bit(__I40E_PORT_TX_SUSPENDED, &pf->state);
5072 /* Reconfiguration needed quiesce all VSIs */5193 /* Reconfiguration needed quiesce all VSIs */
5073 i40e_pf_quiesce_all_vsi(pf);5194 i40e_pf_quiesce_all_vsi(pf);
5074 5195
5075 /* Changes in configuration update VEB/VSI */5196 /* Changes in configuration update VEB/VSI */
5076 i40e_dcb_reconfigure(pf);5197 i40e_dcb_reconfigure(pf);
5077 5198
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);
5079exit:5210exit:
5080 return ret;5211 return ret;
5081}5212}
@@ -8242,6 +8373,7 @@ static int i40e_veb_get_bw_info(struct i40e_veb *veb) · 3160 unmodified lines
8242 veb->bw_limit = le16_to_cpu(ets_data.port_bw_limit);8373 veb->bw_limit = le16_to_cpu(ets_data.port_bw_limit);
8243 veb->bw_max_quanta = ets_data.tc_bw_max;8374 veb->bw_max_quanta = ets_data.tc_bw_max;
8244 veb->is_abs_credits = bw_data.absolute_credits_enable;8375 veb->is_abs_credits = bw_data.absolute_credits_enable;
8376 veb->enabled_tc = ets_data.tc_valid_bits;
8245 tc_bw_max = le16_to_cpu(bw_data.tc_bw_max[0]) |8377 tc_bw_max = le16_to_cpu(bw_data.tc_bw_max[0]) |
8246 (le16_to_cpu(bw_data.tc_bw_max[1]) << 16);8378 (le16_to_cpu(bw_data.tc_bw_max[1]) << 16);
8247 for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {8379 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
175 struct i40e_asq_cmd_details *cmd_details);175 struct i40e_asq_cmd_details *cmd_details);
176i40e_status i40e_aq_start_lldp(struct i40e_hw *hw,176i40e_status i40e_aq_start_lldp(struct i40e_hw *hw,
177 struct i40e_asq_cmd_details *cmd_details);177 struct i40e_asq_cmd_details *cmd_details);
178i40e_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);
178i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw,181i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
179 u16 udp_port, u8 protocol_index,182 u16 udp_port, u8 protocol_index,
180 u8 *filter_index,183 u8 *filter_index,
@@ -230,6 +233,10 @@ i40e_status i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw, · 49 unmodified lines
230 u16 seid,233 u16 seid,
231 struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data,234 struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data,
232 struct i40e_asq_cmd_details *cmd_details);235 struct i40e_asq_cmd_details *cmd_details);
236i40e_status i40e_aq_resume_port_tx(struct i40e_hw *hw,
237 struct i40e_asq_cmd_details *cmd_details);
238i40e_status i40e_read_lldp_cfg(struct i40e_hw *hw,
239 struct i40e_lldp_variables *lldp_cfg);
233/* i40e_common */240/* i40e_common */
234i40e_status i40e_init_shared_code(struct i40e_hw *hw);241i40e_status i40e_init_shared_code(struct i40e_hw *hw);
235i40e_status i40e_pf_reset(struct i40e_hw *hw);242i40e_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
382 incval = I40E_PTP_1GB_INCVAL;382 incval = I40E_PTP_1GB_INCVAL;
383 break;383 break;
384 case I40E_LINK_SPEED_100MB:384 case I40E_LINK_SPEED_100MB:
385 dev_warn(&pf->pdev->dev,385 {
386 "%s: 1588 functionality is not supported at 100 Mbps. Stopping the PHC.\n",386 static int warn_once;
387 __func__);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 }
388 incval = 0;393 incval = 0;
389 break;394 break;
395 }
390 case I40E_LINK_SPEED_40GB:396 case I40E_LINK_SPEED_40GB:
391 default:397 default:
392 incval = I40E_PTP_40GB_INCVAL;398 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
381#define I40E_MAX_USER_PRIORITY 8381#define I40E_MAX_USER_PRIORITY 8
382#define I40E_DCBX_MAX_APPS 32382#define I40E_DCBX_MAX_APPS 32
383#define I40E_LLDPDU_SIZE 1500383#define I40E_LLDPDU_SIZE 1500
384 384#define I40E_TLV_STATUS_OPER 0x1
385/* IEEE 802.1Qaz ETS Configuration data */385#define I40E_TLV_STATUS_SYNC 0x2
386struct i40e_ieee_ets_config {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 */
395struct i40e_dcb_ets_config {
387 u8 willing;396 u8 willing;
388 u8 cbs;397 u8 cbs;
389 u8 maxtcs;398 u8 maxtcs;
@@ -392,34 +401,30 @@ struct i40e_ieee_ets_config { · 2 unmodified lines
392 u8 tsatable[I40E_MAX_TRAFFIC_CLASS];401 u8 tsatable[I40E_MAX_TRAFFIC_CLASS];
393};402};
394 403
395/* IEEE 802.1Qaz ETS Recommendation data */404/* CEE or IEEE 802.1Qaz PFC Configuration data */
396struct i40e_ieee_ets_recommend {405struct i40e_dcb_pfc_config {
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 */
403struct i40e_ieee_pfc_config {
404 u8 willing;406 u8 willing;
405 u8 mbc;407 u8 mbc;
406 u8 pfccap;408 u8 pfccap;
407 u8 pfcenable;409 u8 pfcenable;
408};410};
409 411
410/* IEEE 802.1Qaz Application Priority data */412/* CEE or IEEE 802.1Qaz Application Priority data */
411struct i40e_ieee_app_priority_table {413struct i40e_dcb_app_priority_table {
412 u8 priority;414 u8 priority;
413 u8 selector;415 u8 selector;
414 u16 protocolid;416 u16 protocolid;
415};417};
416 418
417struct i40e_dcbx_config {419struct i40e_dcbx_config {
420 u8 dcbx_mode;
421#define I40E_DCBX_MODE_CEE 0x1
422#define I40E_DCBX_MODE_IEEE 0x2
418 u32 numapps;423 u32 numapps;
419 struct i40e_ieee_ets_config etscfg;424 struct i40e_dcb_ets_config etscfg;
420 struct i40e_ieee_ets_recommend etsrec;425 struct i40e_dcb_ets_config etsrec;
421 struct i40e_ieee_pfc_config pfc;426 struct i40e_dcb_pfc_config pfc;
422 struct i40e_ieee_app_priority_table app[I40E_DCBX_MAX_APPS];427 struct i40e_dcb_app_priority_table app[I40E_DCBX_MAX_APPS];
423};428};
424 429
425/* Port hardware description */430/* Port hardware description */
@@ -1372,6 +1377,18 @@ enum i40e_reset_type { · 946 unmodified lines
1372 I40E_RESET_EMPR = 3,1377 I40E_RESET_EMPR = 3,
1373};1378};
1374 1379
1380/* IEEE 802.1AB LLDP Agent Variables from NVM */
1381#define I40E_NVM_LLDP_CFG_PTR 0xD
1382struct 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
1375/* RSS Hash Table Size */1392/* RSS Hash Table Size */
1376#define I40E_PFQF_CTL_0_HASHLUTSIZE_512 0x000100001393#define I40E_PFQF_CTL_0_HASHLUTSIZE_512 0x00010000
1377#endif /* _I40E_TYPE_H_ */1394#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
1869 if (!test_bit(__I40E_VFLR_EVENT_PENDING, &pf->state))1869 if (!test_bit(__I40E_VFLR_EVENT_PENDING, &pf->state))
1870 return 0;1870 return 0;
1871 1871
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
1872 clear_bit(__I40E_VFLR_EVENT_PENDING, &pf->state);1878 clear_bit(__I40E_VFLR_EVENT_PENDING, &pf->state);
1873 for (vf_id = 0; vf_id < pf->num_alloc_vfs; vf_id++) {1879 for (vf_id = 0; vf_id < pf->num_alloc_vfs; vf_id++) {
1874 reg_idx = (hw->func_caps.vf_base_id + vf_id) / 32;1880 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
1885 }1891 }
1886 }1892 }
1887 1893
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
1894 return 0;1894 return 0;
1895}1895}
1896 1896

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