@@ -1748,16 +1748,32 @@ static void bnxt_tpa_agg(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
1748
1748
static void bnxt_deliver_skb (struct bnxt * bp , struct bnxt_napi * bnapi ,
1749
1749
struct sk_buff * skb )
1750
1750
{
1751
+ skb_mark_for_recycle (skb );
1752
+
1751
1753
if (skb -> dev != bp -> dev ) {
1752
1754
/* this packet belongs to a vf-rep */
1753
1755
bnxt_vf_rep_rx (bp , skb );
1754
1756
return ;
1755
1757
}
1756
1758
skb_record_rx_queue (skb , bnapi -> index );
1757
- skb_mark_for_recycle (skb );
1758
1759
napi_gro_receive (& bnapi -> napi , skb );
1759
1760
}
1760
1761
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
+
1761
1777
/* returns the following:
1762
1778
* 1 - 1 packet successfully received
1763
1779
* 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,
1783
1799
struct sk_buff * skb ;
1784
1800
struct xdp_buff xdp ;
1785
1801
u32 flags , misc ;
1802
+ u32 cmpl_ts ;
1786
1803
void * data ;
1787
1804
int rc = 0 ;
1788
1805
@@ -2005,10 +2022,8 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
2005
2022
}
2006
2023
}
2007
2024
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 )) {
2010
2026
if (bp -> flags & BNXT_FLAG_CHIP_P5 ) {
2011
- u32 cmpl_ts = le32_to_cpu (rxcmp1 -> rx_cmp_timestamp );
2012
2027
u64 ns , ts ;
2013
2028
2014
2029
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,
10731
10746
bnxt_free_mem (bp , irq_re_init );
10732
10747
}
10733
10748
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 )
10735
10750
{
10736
- int rc = 0 ;
10737
-
10738
10751
if (test_bit (BNXT_STATE_IN_FW_RESET , & bp -> state )) {
10739
10752
/* If we get here, it means firmware reset is in progress
10740
10753
* 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)
10749
10762
10750
10763
#ifdef CONFIG_BNXT_SRIOV
10751
10764
if (bp -> sriov_cfg ) {
10765
+ int rc ;
10766
+
10752
10767
rc = wait_event_interruptible_timeout (bp -> sriov_cfg_wait ,
10753
10768
!bp -> sriov_cfg ,
10754
10769
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" );
10757
10774
}
10758
10775
#endif
10759
10776
__bnxt_close_nic (bp , irq_re_init , link_re_init );
10760
- return rc ;
10761
10777
}
10762
10778
10763
10779
static int bnxt_close (struct net_device * dev )
@@ -13940,6 +13956,8 @@ static int bnxt_resume(struct device *device)
13940
13956
if (rc )
13941
13957
goto resume_exit ;
13942
13958
13959
+ bnxt_clear_reservations (bp , true);
13960
+
13943
13961
if (bnxt_hwrm_func_drv_rgtr (bp , NULL , 0 , false)) {
13944
13962
rc = - ENODEV ;
13945
13963
goto resume_exit ;
0 commit comments