From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Michael Chan <michael.chan@broadcom.com>,
davem@davemloft.net, Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
pavan.chebbi@broadcom.com, andrew.gospodarek@broadcom.com,
Richard Cochran <richardcochran@gmail.com>
Subject: Re: [PATCH net-next 01/12] bnxt_en: Add a timeout parameter to bnxt_hwrm_port_ts_query()
Date: Wed, 27 Mar 2024 22:51:30 -0700 [thread overview]
Message-ID: <aca9f551-da56-4c50-b456-cb67f5ca79fe@linux.dev> (raw)
In-Reply-To: <20240325222902.220712-2-michael.chan@broadcom.com>
On 25/03/2024 22:28, Michael Chan wrote:
> The caller can pass this new timeout parameter to the function to
> specify the firmware timeout value when requesting the TX timestamp
> from the firmware. This will allow the caller to precisely control
> the timeout and will be used in the next patch. In this patch, the
> parameter is 0 which means to use the current default value.
>
> Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>
> Cc: Richard Cochran <richardcochran@gmail.com>
> Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
> Signed-off-by: Michael Chan <michael.chan@broadcom.com>
> ---
> drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 16 ++++++++++++----
> drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h | 1 +
> 2 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
> index cc07660330f5..dbfd1b36774c 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
> @@ -109,7 +109,8 @@ static void bnxt_ptp_get_current_time(struct bnxt *bp)
> spin_unlock_bh(&ptp->ptp_lock);
> }
>
> -static int bnxt_hwrm_port_ts_query(struct bnxt *bp, u32 flags, u64 *ts)
> +static int bnxt_hwrm_port_ts_query(struct bnxt *bp, u32 flags, u64 *ts,
> + u32 txts_tmo)
> {
> struct hwrm_port_ts_query_output *resp;
> struct hwrm_port_ts_query_input *req;
> @@ -122,10 +123,15 @@ static int bnxt_hwrm_port_ts_query(struct bnxt *bp, u32 flags, u64 *ts)
> req->flags = cpu_to_le32(flags);
> if ((flags & PORT_TS_QUERY_REQ_FLAGS_PATH) ==
> PORT_TS_QUERY_REQ_FLAGS_PATH_TX) {
> + u32 tmo_us = txts_tmo * 1000;
> +
> req->enables = cpu_to_le16(BNXT_PTP_QTS_TX_ENABLES);
> req->ptp_seq_id = cpu_to_le32(bp->ptp_cfg->tx_seqid);
> req->ptp_hdr_offset = cpu_to_le16(bp->ptp_cfg->tx_hdr_off);
> - req->ts_req_timeout = cpu_to_le16(BNXT_PTP_QTS_TIMEOUT);
> + if (!tmo_us)
> + tmo_us = BNXT_PTP_QTS_TIMEOUT;
> + tmo_us = min(tmo_us, BNXT_PTP_QTS_MAX_TMO_US);
> + req->ts_req_timeout = cpu_to_le16(txts_tmo);
> }
> resp = hwrm_req_hold(bp, req);
>
> @@ -675,7 +681,8 @@ static void bnxt_stamp_tx_skb(struct bnxt *bp, struct sk_buff *skb)
> u64 ts = 0, ns = 0;
> int rc;
>
> - rc = bnxt_hwrm_port_ts_query(bp, PORT_TS_QUERY_REQ_FLAGS_PATH_TX, &ts);
> + rc = bnxt_hwrm_port_ts_query(bp, PORT_TS_QUERY_REQ_FLAGS_PATH_TX, &ts,
> + 0);
> if (!rc) {
> memset(×tamp, 0, sizeof(timestamp));
> spin_lock_bh(&ptp->ptp_lock);
> @@ -891,7 +898,8 @@ int bnxt_ptp_init_rtc(struct bnxt *bp, bool phc_cfg)
> if (rc)
> return rc;
> } else {
> - rc = bnxt_hwrm_port_ts_query(bp, PORT_TS_QUERY_REQ_FLAGS_CURRENT_TIME, &ns);
> + rc = bnxt_hwrm_port_ts_query(bp, PORT_TS_QUERY_REQ_FLAGS_CURRENT_TIME,
> + &ns, 0);
> if (rc)
> return rc;
> }
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
> index fce8dc39a7d0..04886d5f22ad 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
> @@ -23,6 +23,7 @@
> #define BNXT_HI_TIMER_MASK 0xffff00000000UL
>
> #define BNXT_PTP_QTS_TIMEOUT 1000
> +#define BNXT_PTP_QTS_MAX_TMO_US 65535
> #define BNXT_PTP_QTS_TX_ENABLES (PORT_TS_QUERY_REQ_ENABLES_PTP_SEQ_ID | \
> PORT_TS_QUERY_REQ_ENABLES_TS_REQ_TIMEOUT | \
> PORT_TS_QUERY_REQ_ENABLES_PTP_HDR_OFFSET)
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
next prev parent reply other threads:[~2024-03-28 5:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-25 22:28 [PATCH net-next 00/12] bnxt_en: PTP and RSS updates Michael Chan
2024-03-25 22:28 ` [PATCH net-next 01/12] bnxt_en: Add a timeout parameter to bnxt_hwrm_port_ts_query() Michael Chan
2024-03-28 5:51 ` Vadim Fedorenko [this message]
2024-03-25 22:28 ` [PATCH net-next 02/12] bnxt_en: Retry PTP TX timestamp from FW for 1 second Michael Chan
2024-03-28 6:02 ` Vadim Fedorenko
2024-03-25 22:28 ` [PATCH net-next 03/12] bnxt_en: Add helper function bnxt_hwrm_vnic_rss_cfg_p5() Michael Chan
2024-03-25 22:28 ` [PATCH net-next 04/12] bnxt_en: Refactor VNIC alloc and cfg functions Michael Chan
2024-03-25 22:28 ` [PATCH net-next 05/12] bnxt_en: Introduce rss ctx structure, alloc/free functions Michael Chan
2024-03-25 22:28 ` [PATCH net-next 06/12] bnxt_en: Refactor RSS indir alloc/set functions Michael Chan
2024-03-25 22:28 ` [PATCH net-next 07/12] bnxt_en: Simplify bnxt_rfs_capable() Michael Chan
2024-03-25 22:28 ` [PATCH net-next 08/12] bnxt_en: Add a new_rss_ctx parameter to bnxt_rfs_capable() Michael Chan
2024-03-25 22:28 ` [PATCH net-next 09/12] bnxt_en: Refactor bnxt_set_rxfh() Michael Chan
2024-03-25 22:29 ` [PATCH net-next 10/12] bnxt_en: Support RSS contexts in ethtool .{get|set}_rxfh() Michael Chan
2024-03-26 10:50 ` Edward Cree
2024-03-26 11:43 ` Pavan Chebbi
2024-03-25 22:29 ` [PATCH net-next 11/12] bnxt_en: Refactor bnxt_cfg_rfs_ring_tbl_idx() Michael Chan
2024-03-25 22:29 ` [PATCH net-next 12/12] bnxt_en: Support adding ntuple rules on RSS contexts Michael Chan
2024-03-29 5:50 ` [PATCH net-next 00/12] bnxt_en: PTP and RSS updates patchwork-bot+netdevbpf
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=aca9f551-da56-4c50-b456-cb67f5ca79fe@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=andrew.gospodarek@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=michael.chan@broadcom.com \
--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).