From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, pavan.chebbi@broadcom.com,
andrew.gospodarek@broadcom.com, richardcochran@gmail.com
Subject: [PATCH net-next 07/10] bnxt_en: Remove an impossible condition check for PTP TX pending SKB
Date: Wed, 26 Jun 2024 09:43:04 -0700 [thread overview]
Message-ID: <20240626164307.219568-8-michael.chan@broadcom.com> (raw)
In-Reply-To: <20240626164307.219568-1-michael.chan@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 2946 bytes --]
From: Pavan Chebbi <pavan.chebbi@broadcom.com>
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>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 ++------
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 7 +------
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h | 2 +-
3 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index c284aa370c64..ed2bbdf6b25f 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -838,12 +838,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;
}
}
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
index 8431cd0ed9e9..baf191959b13 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
@@ -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)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
index 90f1418211e9..ee1709cda47e 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
@@ -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);
--
2.30.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
next prev parent reply other threads:[~2024-06-26 16:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 16:42 [PATCH net-next 00/10] bnxt_en: PTP updates for net-next Michael Chan
2024-06-26 16:42 ` [PATCH net-next 01/10] bnxt_en: Add new TX timestamp completion definitions Michael Chan
2024-06-27 9:00 ` Przemek Kitszel
2024-06-27 15:54 ` Michael Chan
2024-06-26 16:42 ` [PATCH net-next 02/10] bnxt_en: Add is_ts_pkt field to struct bnxt_sw_tx_bd Michael Chan
2024-06-28 0:08 ` Jakub Kicinski
2024-06-28 0:39 ` Michael Chan
2024-06-26 16:43 ` [PATCH net-next 03/10] bnxt_en: Allow some TX packets to be unprocessed in NAPI Michael Chan
2024-06-26 16:43 ` [PATCH net-next 04/10] bnxt_en: Add TX timestamp completion logic Michael Chan
2024-06-26 16:43 ` [PATCH net-next 05/10] bnxt_en: Add BCM5760X specific PHC registers mapping Michael Chan
2024-06-26 16:43 ` [PATCH net-next 06/10] bnxt_en: Refactor all PTP TX timestamp fields into a struct Michael Chan
2024-06-26 16:43 ` Michael Chan [this message]
2024-06-26 16:43 ` [PATCH net-next 08/10] bnxt_en: Let bnxt_stamp_tx_skb() return error code Michael Chan
2024-06-26 16:43 ` [PATCH net-next 09/10] bnxt_en: Increase the max total outstanding PTP TX packets to 4 Michael Chan
2024-06-28 17:03 ` Simon Horman
2024-06-28 17:05 ` Simon Horman
2024-06-28 17:37 ` Michael Chan
2024-06-28 18:13 ` Simon Horman
2024-06-26 16:43 ` [PATCH net-next 10/10] bnxt_en: Remove atomic operations on ptp->tx_avail Michael Chan
2024-06-27 9:40 ` Przemek Kitszel
2024-06-27 15:34 ` Pavan Chebbi
2024-06-27 15:43 ` Michael Chan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240626164307.219568-8-michael.chan@broadcom.com \
--to=michael.chan@broadcom.com \
--cc=andrew.gospodarek@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).