]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bnxt_en: Remove an impossible condition check for PTP TX pending SKB
authorPavan Chebbi <pavan.chebbi@broadcom.com>
Fri, 28 Jun 2024 19:30:02 +0000 (12:30 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Jul 2024 10:23:21 +0000 (11:23 +0100)
In the current 5750X PTP code paths, there is always at most one TX
SKB requested for timestamp and we won't accept another one until we
have retrieved the timestamp or it has timed out.  Remove the
unnecessary check in bnxt_get_tx_ts_p5() for a pending SKB and change
the function to void.

Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h

index a9741faa960ce86794fc9c8a0de059fd548180db..78ccfac0644e8c3cffd2f22cf3ff02b0f2715567 100644 (file)
@@ -837,12 +837,8 @@ static bool __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
                if (unlikely(is_ts_pkt)) {
                        if (BNXT_CHIP_P5(bp)) {
                                /* PTP worker takes ownership of the skb */
-                               if (!bnxt_get_tx_ts_p5(bp, skb)) {
-                                       skb = NULL;
-                               } else {
-                                       atomic64_inc(&bp->ptp_cfg->stats.ts_err);
-                                       atomic_inc(&bp->ptp_cfg->tx_avail);
-                               }
+                               bnxt_get_tx_ts_p5(bp, skb);
+                               skb = NULL;
                        }
                }
 
index 8431cd0ed9e9f2f1781d9592cc8a85250acbcbe8..baf191959b13f731be209a415a973306e7a2e385 100644 (file)
@@ -750,17 +750,12 @@ static long bnxt_ptp_ts_aux_work(struct ptp_clock_info *ptp_info)
        return HZ;
 }
 
-int bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb)
+void bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb)
 {
        struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
 
-       if (ptp->txts_req.tx_skb) {
-               netdev_err(bp->dev, "deferring skb:one SKB is still outstanding\n");
-               return -EBUSY;
-       }
        ptp->txts_req.tx_skb = skb;
        ptp_schedule_worker(ptp->ptp_clock, 0);
-       return 0;
 }
 
 int bnxt_get_rx_ts_p5(struct bnxt *bp, u64 *ts, u32 pkt_ts)
index 90f1418211e9a70103238e612a09cb10c79546d7..ee1709cda47efe0fc4b3e6bc03403ffe97027eee 100644 (file)
@@ -159,7 +159,7 @@ int bnxt_ptp_cfg_tstamp_filters(struct bnxt *bp);
 void bnxt_ptp_reapply_pps(struct bnxt *bp);
 int bnxt_hwtstamp_set(struct net_device *dev, struct ifreq *ifr);
 int bnxt_hwtstamp_get(struct net_device *dev, struct ifreq *ifr);
-int bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb);
+void bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb);
 int bnxt_get_rx_ts_p5(struct bnxt *bp, u64 *ts, u32 pkt_ts);
 void bnxt_tx_ts_cmp(struct bnxt *bp, struct bnxt_napi *bnapi,
                    struct tx_ts_cmp *tscmp);