Page MenuHomeFreeBSD

D45186.diff
No OneTemporary

D45186.diff

diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -8140,10 +8140,6 @@
int rc;
struct sbuf *sb;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return(rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 128, req);
if (sb == NULL)
return (ENOMEM);
@@ -8161,10 +8157,6 @@
int rc;
struct sbuf *sb;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return(rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 128, req);
if (sb == NULL)
return (ENOMEM);
@@ -8422,10 +8414,6 @@
struct sbuf *sb;
static char *bits = "\20\1RX\2TX\3AUTO";
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return(rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 128, req);
if (sb == NULL)
return (ENOMEM);
@@ -8487,10 +8475,6 @@
struct sbuf *sb;
static char *bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD1\5RSVD2";
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return(rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 128, req);
if (sb == NULL)
return (ENOMEM);
@@ -8518,10 +8502,6 @@
static char *bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD2"
"\5RSVD3\6auto\7module";
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return(rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 128, req);
if (sb == NULL)
return (ENOMEM);
@@ -8597,10 +8577,6 @@
struct sbuf *sb;
static char *bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD2\5RSVD3";
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 128, req);
if (sb == NULL)
return (ENOMEM);
@@ -8627,14 +8603,15 @@
fec = lc->fec_hint;
if (pi->mod_type == FW_PORT_MOD_TYPE_NONE ||
!fec_supported(lc->pcaps)) {
+ PORT_UNLOCK(pi);
sbuf_printf(sb, "n/a");
} else {
if (fec == 0)
fec = FEC_NONE;
+ PORT_UNLOCK(pi);
sbuf_printf(sb, "%b", fec & M_FW_PORT_CAP32_FEC, bits);
}
rc = sbuf_finish(sb);
- PORT_UNLOCK(pi);
done:
sbuf_delete(sb);
end_synchronized_op(sc, 0);
@@ -8854,10 +8831,6 @@
if (rc)
return (rc);
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);
@@ -8887,14 +8860,11 @@
"0.9375"
};
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -8970,10 +8940,6 @@
}
n = rc * sizeof(uint32_t); /* rc has # of words actually read */
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- goto done;
-
sb = sbuf_new_for_sysctl(NULL, NULL, PAGE_SIZE, req);
if (sb == NULL) {
rc = ENOMEM;
@@ -9092,9 +9058,6 @@
struct sbuf *sb;
int rc;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);
@@ -9162,10 +9125,6 @@
uint32_t *buf, *p;
int rc;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);
@@ -9173,6 +9132,7 @@
buf = malloc(2 * CIM_MALA_SIZE * 5 * sizeof(uint32_t), M_CXGBE,
M_ZERO | M_WAITOK);
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -9213,10 +9173,6 @@
uint32_t *buf, *p;
int rc;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);
@@ -9224,6 +9180,7 @@
buf = malloc(2 * CIM_PIFLA_SIZE * 6 * sizeof(uint32_t), M_CXGBE,
M_ZERO | M_WAITOK);
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -9293,10 +9250,6 @@
if (rc)
return (rc);
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, PAGE_SIZE, req);
if (sb == NULL)
return (ENOMEM);
@@ -9329,14 +9282,11 @@
int rc;
struct tp_cpl_stats stats;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 256, req);
if (sb == NULL)
return (ENOMEM);
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -9375,14 +9325,11 @@
int rc;
struct tp_usm_stats stats;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return(rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 256, req);
if (sb == NULL)
return (ENOMEM);
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -9408,14 +9355,11 @@
int rc;
struct tp_tid_stats stats;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return(rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 256, req);
if (sb == NULL)
return (ENOMEM);
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -9552,9 +9496,6 @@
int rc;
struct sbuf *sb;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);
@@ -9597,10 +9538,7 @@
struct tp_fcoe_stats stats[MAX_NCHAN];
int i, nchan = sc->chip_params->nchan;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -9653,16 +9591,13 @@
unsigned int map, kbps, ipg, mode;
unsigned int pace_tab[NTX_SCHED];
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 512, req);
if (sb == NULL)
return (ENOMEM);
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc)) {
+ mtx_unlock(&sc->reg_lock);
rc = ENXIO;
goto done;
}
@@ -9670,6 +9605,7 @@
map = t4_read_reg(sc, A_TP_TX_MOD_QUEUE_REQ_MAP);
mode = G_TIMERMODE(t4_read_reg(sc, A_TP_MOD_CONFIG));
t4_read_pace_tbl(sc, pace_tab);
+ mtx_unlock(&sc->reg_lock);
sbuf_printf(sb, "Scheduler Mode Channel Rate (Kbps) "
"Class IPG (0.1 ns) Flow IPG (us)");
@@ -9695,7 +9631,6 @@
}
rc = sbuf_finish(sb);
done:
- mtx_unlock(&sc->reg_lock);
sbuf_delete(sb);
return (rc);
}
@@ -9718,16 +9653,13 @@
"BG2FramesTrunc:", "BG3FramesTrunc:"
};
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);
memset(s, 0, sizeof(s));
+ rc = 0;
for (i = 0; i < sc->chip_params->nchan; i += 2) {
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
@@ -9750,7 +9682,8 @@
*p0++, *p1++);
}
- rc = sbuf_finish(sb);
+ if (rc == 0)
+ rc = sbuf_finish(sb);
sbuf_delete(sb);
return (rc);
@@ -9764,9 +9697,6 @@
struct link_config *lc = &pi->link_cfg;
struct sbuf *sb;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return(rc);
sb = sbuf_new_for_sysctl(NULL, NULL, 64, req);
if (sb == NULL)
return (ENOMEM);
@@ -10104,10 +10034,6 @@
MPASS(chip_id(sc) <= CHELSIO_T5);
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);
@@ -10115,6 +10041,7 @@
sbuf_printf(sb,
"Idx Ethernet address Mask Vld Ports PF"
" VF Replication P0 P1 P2 P3 ML");
+ rc = 0;
for (i = 0; i < sc->chip_params->mps_tcam_size; i++) {
uint64_t tcamx, tcamy, mask;
uint32_t cls_lo, cls_hi;
@@ -10208,10 +10135,6 @@
MPASS(chip_id(sc) > CHELSIO_T5);
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);
@@ -10221,6 +10144,7 @@
" Replication"
" P0 P1 P2 P3 ML\n");
+ rc = 0;
for (i = 0; i < sc->chip_params->mps_tcam_size; i++) {
uint8_t dip_hit, vlan_vld, lookup_type, port_num;
uint16_t ivlan;
@@ -10390,10 +10314,7 @@
int rc;
uint16_t mtus[NMTUS];
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -10435,10 +10356,7 @@
"Rx FIFO wait", NULL, "Rx latency"
};
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -10499,10 +10417,7 @@
int rc;
struct tp_rdma_stats stats;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -10533,10 +10448,7 @@
int rc;
struct tp_tcp_stats v4, v6;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -10576,10 +10488,7 @@
uint32_t x, y;
struct tid_info *t = &sc->tids;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
+ rc = 0;
sb = sbuf_new_for_sysctl(NULL, NULL, 256, req);
if (sb == NULL)
return (ENOMEM);
@@ -10671,10 +10580,7 @@
int rc;
struct tp_err_stats stats;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -10752,10 +10658,7 @@
int rc;
struct tp_tnl_stats stats;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return(rc);
-
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -11019,10 +10922,7 @@
u_int i, inc;
void (*show_func)(struct sbuf *, uint64_t *, int);
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
+ rc = 0;
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);
@@ -11070,10 +10970,7 @@
int rc;
u64 nrate[MAX_NCHAN], orate[MAX_NCHAN];
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -11116,10 +11013,7 @@
uint32_t *buf, *p;
int rc, i;
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
+ rc = 0;
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);
@@ -11160,10 +11054,7 @@
MPASS(chip_id(sc) >= CHELSIO_T5);
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
+ rc = 0;
mtx_lock(&sc->reg_lock);
if (hw_off_limits(sc))
rc = ENXIO;
@@ -11213,10 +11104,6 @@
if (rc != 0)
return (rc);
- rc = sysctl_wire_old_buffer(req, 0);
- if (rc != 0)
- return (rc);
-
sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
if (sb == NULL)
return (ENOMEM);

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 24, 11:46 PM (4 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16110059
Default Alt Text
D45186.diff (10 KB)

Event Timeline