@@ -315,6 +315,71 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse,
315315 return 0 ;
316316}
317317
318+ /**
319+ * ice_fill_tx_timer_and_fc_thresh
320+ * @hw: pointer to the HW struct
321+ * @cmd: pointer to MAC cfg structure
322+ *
323+ * Add Tx timer and FC refresh threshold info to Set MAC Config AQ command
324+ * descriptor
325+ */
326+ static void
327+ ice_fill_tx_timer_and_fc_thresh (struct ice_hw * hw ,
328+ struct ice_aqc_set_mac_cfg * cmd )
329+ {
330+ u16 fc_thres_val , tx_timer_val ;
331+ u32 val ;
332+
333+ /* We read back the transmit timer and FC threshold value of
334+ * LFC. Thus, we will use index =
335+ * PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX.
336+ *
337+ * Also, because we are operating on transmit timer and FC
338+ * threshold of LFC, we don't turn on any bit in tx_tmr_priority
339+ */
340+ #define IDX_OF_LFC PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX
341+
342+ /* Retrieve the transmit timer */
343+ val = rd32 (hw , PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA (IDX_OF_LFC ));
344+ tx_timer_val = val &
345+ PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M ;
346+ cmd -> tx_tmr_value = cpu_to_le16 (tx_timer_val );
347+
348+ /* Retrieve the FC threshold */
349+ val = rd32 (hw , PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER (IDX_OF_LFC ));
350+ fc_thres_val = val & PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M ;
351+
352+ cmd -> fc_refresh_threshold = cpu_to_le16 (fc_thres_val );
353+ }
354+
355+ /**
356+ * ice_aq_set_mac_cfg
357+ * @hw: pointer to the HW struct
358+ * @max_frame_size: Maximum Frame Size to be supported
359+ * @cd: pointer to command details structure or NULL
360+ *
361+ * Set MAC configuration (0x0603)
362+ */
363+ enum ice_status
364+ ice_aq_set_mac_cfg (struct ice_hw * hw , u16 max_frame_size , struct ice_sq_cd * cd )
365+ {
366+ struct ice_aqc_set_mac_cfg * cmd ;
367+ struct ice_aq_desc desc ;
368+
369+ cmd = & desc .params .set_mac_cfg ;
370+
371+ if (max_frame_size == 0 )
372+ return ICE_ERR_PARAM ;
373+
374+ ice_fill_dflt_direct_cmd_desc (& desc , ice_aqc_opc_set_mac_cfg );
375+
376+ cmd -> max_frame_size = cpu_to_le16 (max_frame_size );
377+
378+ ice_fill_tx_timer_and_fc_thresh (hw , cmd );
379+
380+ return ice_aq_send_cmd (hw , & desc , NULL , 0 , cd );
381+ }
382+
318383/**
319384 * ice_init_fltr_mgmt_struct - initializes filter management list and locks
320385 * @hw: pointer to the HW struct
@@ -745,6 +810,10 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
745810 status = ice_aq_manage_mac_read (hw , mac_buf , mac_buf_len , NULL );
746811 devm_kfree (ice_hw_to_dev (hw ), mac_buf );
747812
813+ if (status )
814+ goto err_unroll_fltr_mgmt_struct ;
815+ /* enable jumbo frame support at MAC level */
816+ status = ice_aq_set_mac_cfg (hw , ICE_AQ_SET_MAC_FRAME_SIZE_MAX , NULL );
748817 if (status )
749818 goto err_unroll_fltr_mgmt_struct ;
750819 /* Obtain counter base index which would be used by flow director */
0 commit comments