@@ -1748,16 +1748,32 @@ static void bnxt_tpa_agg(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
17481748static void bnxt_deliver_skb (struct bnxt * bp , struct bnxt_napi * bnapi ,
17491749 struct sk_buff * skb )
17501750{
1751+ skb_mark_for_recycle (skb );
1752+
17511753 if (skb -> dev != bp -> dev ) {
17521754 /* this packet belongs to a vf-rep */
17531755 bnxt_vf_rep_rx (bp , skb );
17541756 return ;
17551757 }
17561758 skb_record_rx_queue (skb , bnapi -> index );
1757- skb_mark_for_recycle (skb );
17581759 napi_gro_receive (& bnapi -> napi , skb );
17591760}
17601761
1762+ static bool bnxt_rx_ts_valid (struct bnxt * bp , u32 flags ,
1763+ struct rx_cmp_ext * rxcmp1 , u32 * cmpl_ts )
1764+ {
1765+ u32 ts = le32_to_cpu (rxcmp1 -> rx_cmp_timestamp );
1766+
1767+ if (BNXT_PTP_RX_TS_VALID (flags ))
1768+ goto ts_valid ;
1769+ if (!bp -> ptp_all_rx_tstamp || !ts || !BNXT_ALL_RX_TS_VALID (flags ))
1770+ return false;
1771+
1772+ ts_valid :
1773+ * cmpl_ts = ts ;
1774+ return true;
1775+ }
1776+
17611777/* returns the following:
17621778 * 1 - 1 packet successfully received
17631779 * 0 - successful TPA_START, packet not completed yet
@@ -1783,6 +1799,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
17831799 struct sk_buff * skb ;
17841800 struct xdp_buff xdp ;
17851801 u32 flags , misc ;
1802+ u32 cmpl_ts ;
17861803 void * data ;
17871804 int rc = 0 ;
17881805
@@ -2005,10 +2022,8 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
20052022 }
20062023 }
20072024
2008- if (unlikely ((flags & RX_CMP_FLAGS_ITYPES_MASK ) ==
2009- RX_CMP_FLAGS_ITYPE_PTP_W_TS ) || bp -> ptp_all_rx_tstamp ) {
2025+ if (bnxt_rx_ts_valid (bp , flags , rxcmp1 , & cmpl_ts )) {
20102026 if (bp -> flags & BNXT_FLAG_CHIP_P5 ) {
2011- u32 cmpl_ts = le32_to_cpu (rxcmp1 -> rx_cmp_timestamp );
20122027 u64 ns , ts ;
20132028
20142029 if (!bnxt_get_rx_ts_p5 (bp , & ts , cmpl_ts )) {
@@ -10731,10 +10746,8 @@ static void __bnxt_close_nic(struct bnxt *bp, bool irq_re_init,
1073110746 bnxt_free_mem (bp , irq_re_init );
1073210747}
1073310748
10734- int bnxt_close_nic (struct bnxt * bp , bool irq_re_init , bool link_re_init )
10749+ void bnxt_close_nic (struct bnxt * bp , bool irq_re_init , bool link_re_init )
1073510750{
10736- int rc = 0 ;
10737-
1073810751 if (test_bit (BNXT_STATE_IN_FW_RESET , & bp -> state )) {
1073910752 /* If we get here, it means firmware reset is in progress
1074010753 * while we are trying to close. We can safely proceed with
@@ -10749,15 +10762,18 @@ int bnxt_close_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
1074910762
1075010763#ifdef CONFIG_BNXT_SRIOV
1075110764 if (bp -> sriov_cfg ) {
10765+ int rc ;
10766+
1075210767 rc = wait_event_interruptible_timeout (bp -> sriov_cfg_wait ,
1075310768 !bp -> sriov_cfg ,
1075410769 BNXT_SRIOV_CFG_WAIT_TMO );
10755- if (rc )
10756- netdev_warn (bp -> dev , "timeout waiting for SRIOV config operation to complete!\n" );
10770+ if (!rc )
10771+ netdev_warn (bp -> dev , "timeout waiting for SRIOV config operation to complete, proceeding to close!\n" );
10772+ else if (rc < 0 )
10773+ netdev_warn (bp -> dev , "SRIOV config operation interrupted, proceeding to close!\n" );
1075710774 }
1075810775#endif
1075910776 __bnxt_close_nic (bp , irq_re_init , link_re_init );
10760- return rc ;
1076110777}
1076210778
1076310779static int bnxt_close (struct net_device * dev )
@@ -13940,6 +13956,8 @@ static int bnxt_resume(struct device *device)
1394013956 if (rc )
1394113957 goto resume_exit ;
1394213958
13959+ bnxt_clear_reservations (bp , true);
13960+
1394313961 if (bnxt_hwrm_func_drv_rgtr (bp , NULL , 0 , false)) {
1394413962 rc = - ENODEV ;
1394513963 goto resume_exit ;
0 commit comments