Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153196115
D18174.id50773.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D18174.id50773.diff
View Options
Index: sys/dev/sfxge/common/efx_mcdi.c
===================================================================
--- sys/dev/sfxge/common/efx_mcdi.c
+++ sys/dev/sfxge/common/efx_mcdi.c
@@ -1843,9 +1843,15 @@
MAC_STATS_IN_PERIODIC_NOEVENT, !events,
MAC_STATS_IN_PERIOD_MS, (enable | events) ? period_ms : 0);
- if (esmp != NULL) {
+ if (enable || events || upload) {
uint32_t bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t);
+ /* Periodic stats or stats upload require a DMA buffer */
+ if (esmp == NULL) {
+ rc = EINVAL;
+ goto fail1;
+ }
+
EFX_STATIC_ASSERT(MC_CMD_MAC_NSTATS * sizeof (uint64_t) <=
EFX_MAC_STATS_SIZE);
@@ -1856,8 +1862,6 @@
MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_ADDR_HI,
EFSYS_MEM_ADDR(esmp) >> 32);
MCDI_IN_SET_DWORD(req, MAC_STATS_IN_DMA_LEN, bytes);
- } else {
- EFSYS_ASSERT(!upload && !enable && !events);
}
/*
@@ -1875,12 +1879,14 @@
if ((req.emr_rc != ENOENT) ||
(enp->en_rx_qcount + enp->en_tx_qcount != 0)) {
rc = req.emr_rc;
- goto fail1;
+ goto fail2;
}
}
return (0);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 20, 6:01 PM (31 m, 54 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31855497
Default Alt Text
D18174.id50773.diff (1 KB)
Attached To
Mode
D18174: sfxge(4): improve robustness of MAC stats get via MCDI
Attached
Detach File
Event Timeline
Log In to Comment