All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [net-next v2 01/13] ice: fix Tx queue iteration for Tx timestamp enablement
Date: Thu,  1 Jul 2021 15:04:44 -0700	[thread overview]
Message-ID: <20210701220456.3882767-2-jacob.e.keller@intel.com> (raw)
In-Reply-To: <20210701220456.3882767-1-jacob.e.keller@intel.com>

The driver accidentally copied the ice_for_each_rxq iterator when
implementing enablement of the ptp_tx bit for the Tx rings. We still
load the Tx rings and set the ptp_tx field, but we iterate over the
count of the num_rxq.

If the number of Tx and Rx queues differ, this could either cause
a buffer overrun when accessing the tx_rings list if num_txq is greater
than num_rxq, or it could cause us to fail to enable Tx timestamps for
some rings.

This was not noticed originally as we generally have the same number of
Tx and Rx queues.

Fixes: ea9b847cda64 ("ice: enable transmit timestamps for E810 devices")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index 5d5207b56ca9..e176c7484484 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -22,7 +22,7 @@ static void ice_set_tx_tstamp(struct ice_pf *pf, bool on)
 		return;
 
 	/* Set the timestamp enable flag for all the Tx rings */
-	ice_for_each_rxq(vsi, i) {
+	ice_for_each_txq(vsi, i) {
 		if (!vsi->tx_rings[i])
 			continue;
 		vsi->tx_rings[i]->ptp_tx = on;
-- 
2.31.1.331.gb0c09ab8796f


  reply	other threads:[~2021-07-01 22:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 22:04 [Intel-wired-lan] [net-next v2 00/13] ice: implement support for PTP on E822 hardware Jacob Keller
2021-07-01 22:04 ` Jacob Keller [this message]
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 02/13] ice: remove dead code for allocating pin_config Jacob Keller
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 03/13] ice: add lock around Tx timestamp tracker flush Jacob Keller
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 04/13] ice: restart periodic outputs around time changes Jacob Keller
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 05/13] ice: introduce ice_base_incval function Jacob Keller
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 06/13] ice: PTP: move setting of tstamp_config Jacob Keller
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 07/13] ice: use 'int err' instead of 'int status' Jacob Keller
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 08/13] ice: introduce ice_ptp_init_phc function Jacob Keller
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 09/13] ice: convert clk_freq capability into time_ref Jacob Keller
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 10/13] ice: implement basic E822 PTP support Jacob Keller
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 11/13] ice: ensure the hardware Clock Generation Unit is configured Jacob Keller
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 12/13] ice: exit bypass mode once hardware finishes timestamp calibration Jacob Keller
2021-07-01 22:04 ` [Intel-wired-lan] [net-next v2 13/13] ice: support crosstimestamping on E822 devices if supported Jacob Keller

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=20210701220456.3882767-2-jacob.e.keller@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.