Skip to content

Commit 573f2a4

Browse files
Pavan Chebbidavem330
authored andcommitted
bnxt_en: Remove an impossible condition check for PTP TX pending SKB
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 <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 92595a0 commit 573f2a4

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -837,12 +837,8 @@ static bool __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
837837
if (unlikely(is_ts_pkt)) {
838838
if (BNXT_CHIP_P5(bp)) {
839839
/* PTP worker takes ownership of the skb */
840-
if (!bnxt_get_tx_ts_p5(bp, skb)) {
841-
skb = NULL;
842-
} else {
843-
atomic64_inc(&bp->ptp_cfg->stats.ts_err);
844-
atomic_inc(&bp->ptp_cfg->tx_avail);
845-
}
840+
bnxt_get_tx_ts_p5(bp, skb);
841+
skb = NULL;
846842
}
847843
}
848844

drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -750,17 +750,12 @@ static long bnxt_ptp_ts_aux_work(struct ptp_clock_info *ptp_info)
750750
return HZ;
751751
}
752752

753-
int bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb)
753+
void bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb)
754754
{
755755
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
756756

757-
if (ptp->txts_req.tx_skb) {
758-
netdev_err(bp->dev, "deferring skb:one SKB is still outstanding\n");
759-
return -EBUSY;
760-
}
761757
ptp->txts_req.tx_skb = skb;
762758
ptp_schedule_worker(ptp->ptp_clock, 0);
763-
return 0;
764759
}
765760

766761
int bnxt_get_rx_ts_p5(struct bnxt *bp, u64 *ts, u32 pkt_ts)

drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ int bnxt_ptp_cfg_tstamp_filters(struct bnxt *bp);
159159
void bnxt_ptp_reapply_pps(struct bnxt *bp);
160160
int bnxt_hwtstamp_set(struct net_device *dev, struct ifreq *ifr);
161161
int bnxt_hwtstamp_get(struct net_device *dev, struct ifreq *ifr);
162-
int bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb);
162+
void bnxt_get_tx_ts_p5(struct bnxt *bp, struct sk_buff *skb);
163163
int bnxt_get_rx_ts_p5(struct bnxt *bp, u64 *ts, u32 pkt_ts);
164164
void bnxt_tx_ts_cmp(struct bnxt *bp, struct bnxt_napi *bnapi,
165165
struct tx_ts_cmp *tscmp);

0 commit comments

Comments
 (0)