From: Jacob Keller <jacob.e.keller@intel.com>
To: Intel Wired LAN <intel-wired-lan@lists.osuosl.org>
Subject: [Intel-wired-lan] [net-next v2 1/6] ice: set tx_tstamps when creating new Tx rings via ethtool
Date: Wed, 27 Jul 2022 16:15:57 -0700 [thread overview]
Message-ID: <20220727231602.1625980-2-jacob.e.keller@intel.com> (raw)
In-Reply-To: <20220727231602.1625980-1-jacob.e.keller@intel.com>
When the user changes the number of queues via ethtool, the driver
allocates new rings. This allocation did not initialize tx_tstamps. This
results in the tx_tstamps field being zero (due to kcalloc allocation), and
would result in a NULL pointer dereference when attempting a transmit
timestamp on the new ring.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
drivers/net/ethernet/intel/ice/ice_ethtool.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index 238706d94ab2..bea87c5acd26 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -2823,6 +2823,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring,
tx_rings[i].count = new_tx_cnt;
tx_rings[i].desc = NULL;
tx_rings[i].tx_buf = NULL;
+ tx_rings[i].tx_tstamps = &pf->ptp.port.tx;
err = ice_setup_tx_ring(&tx_rings[i]);
if (err) {
while (i--)
--
2.37.1.208.ge72d93e88cb2
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2022-07-27 23:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 23:15 [Intel-wired-lan] [net-next v2 0/6] ice: detect and report PTP timestamp issues Jacob Keller
2022-07-27 23:15 ` Jacob Keller [this message]
2022-08-10 10:21 ` [Intel-wired-lan] [net-next v2 1/6] ice: set tx_tstamps when creating new Tx rings via ethtool G, GurucharanX
2022-07-27 23:15 ` [Intel-wired-lan] [net-next v2 2/6] ice: initialize cached_phctime when creating Rx rings Jacob Keller
2022-08-10 7:49 ` G, GurucharanX
2022-07-27 23:15 ` [Intel-wired-lan] [net-next v2 3/6] ice: track Tx timestamp stats similar to other Intel drivers Jacob Keller
2022-08-10 10:31 ` G, GurucharanX
2022-07-27 23:16 ` [Intel-wired-lan] [net-next v2 4/6] ice: track and warn when PHC update is late Jacob Keller
2022-08-10 6:53 ` G, GurucharanX
2022-07-27 23:16 ` [Intel-wired-lan] [net-next v2 5/6] ice: re-arrange some static functions in ice_ptp.c Jacob Keller
2022-08-10 6:57 ` G, GurucharanX
2022-07-27 23:16 ` [Intel-wired-lan] [net-next v2 6/6] ice: introduce ice_ptp_reset_cached_phctime function Jacob Keller
2022-08-10 12:41 ` G, GurucharanX
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=20220727231602.1625980-2-jacob.e.keller@intel.com \
--to=jacob.e.keller@intel.com \
--cc=intel-wired-lan@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox