Skip to content

mlxcx + Robert's IPD 39 changes to support mlxcx #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fb17419
14677 mlxcx NULL deref panic due to race in mlxcx_cmd_taskq
arekinath May 16, 2022
448f240
xxxxx mlxcx needs DDI_DEVICE_ATTR_V1
danmcd Jan 29, 2024
9bb6578
inline ddi_{get,put} wrappers
danmcd Sep 28, 2023
518ed3f
xxxxx mlxcx should lower DMA threshold
gwr Feb 9, 2024
e5984eb
15445 mlxcx MAC_PROP_MEDIA support
rmustacc Feb 24, 2023
3f2b2d4
mlxcx: batch up work under bufshard locks in ISR, don't take and rele…
arekinath Oct 31, 2023
206c020
mlxcx: bufbmtx very hot thanks to sq_ring_dbell
arekinath Nov 7, 2023
f8aaea4
mlxcx: multi-TIS and bf alternation
arekinath Nov 8, 2023
b2f543d
mlxcx: prepare sqes outside wq lock
arekinath Nov 8, 2023
ca01060
mlxcx: lso support
arekinath Nov 15, 2023
cc586c2
mlxcx should wait to free inlined header mblks until tx is done
arekinath Dec 4, 2023
6a16c08
mlxcx: bump max pointers for wq mem, allow deeper rings
arekinath Dec 12, 2023
37df6b6
mlxcx: add tx latency timers with DEBUG
arekinath Dec 4, 2023
3d151f2
Typo in LSO ASSERT() statement
danmcd Feb 9, 2024
e3ba08d
16260 in.rdisc: type of 'a' defaults to 'int'
tsoome Nov 1, 2023
24ca83c
16261 oawk: parameters default to int
tsoome Nov 1, 2023
6c1b0d7
16266 troff: parameter defaults to 'int'
tsoome Nov 1, 2023
30e68a3
16231 git-pbchk -c $CHECK $FILES crashes with python stack trace
Bill-Sommerfeld Feb 2, 2024
547acb7
16278 dis prefetchi support
rmustacc Feb 15, 2024
5721846
16224 mdb_nv_insert() is accidentally quadratic
bcantrill Feb 15, 2024
424c7ee
16188 Make libc safe for <sys/debug.h>
Bill-Sommerfeld Jan 16, 2024
7499242
16310 mdb doesn't re-calculate index after resizing hash table
citrus-it Feb 19, 2024
062627f
16272 python support in pstack should work again
Bill-Sommerfeld Feb 12, 2024
5724c6e
16294 Appease pkglint regarding secondary python version
citrus-it Feb 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions exception_lists/packaging.deps
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ pkg:/runtime/java/openjdk11
pkg:/runtime/java/openjdk8
pkg:/runtime/java/runtime64
pkg:/runtime/perl
pkg:/runtime/python-27
pkg:/runtime/python-310
pkg:/runtime/python-311
pkg:/runtime/python-35
pkg:/runtime/python-39
pkg:/security/sudo
pkg:/service/network/samba
pkg:/shell/bash
Expand Down
76 changes: 44 additions & 32 deletions usr/src/cmd/cmd-inet/usr.sbin/in.rdisc/in.rdisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,12 @@

#include <fcntl.h>
#include <strings.h>
#include <stdarg.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>

#ifdef lint
#define ALIGN(ptr) (ptr ? 0 : 0)
#else
#define ALIGN(ptr) (ptr)
#endif

#ifdef SYSV
#define signal(s, f) sigset(s, (void (*)(int))f)
Expand Down Expand Up @@ -80,7 +77,7 @@ struct icmp_ra_addr {

/* Router constants */
#define MAX_INITIAL_ADVERT_INTERVAL 16
#define MAX_INITIAL_ADVERTISEMENTS 3
#define MAX_INITIAL_ADVERTISEMENTS 3
#define MAX_RESPONSE_DELAY 2 /* Not used */

/* Host constants */
Expand Down Expand Up @@ -190,7 +187,10 @@ char *pr_name(struct in_addr addr);
char *pr_type(int t);

static void initlog(void);
void logerr(), logtrace(), logdebug(), logperror();
static void logerr(char *, ...);
static void logtrace(char *, ...);
static void logdebug(char *, ...);
static void logperror(char *);

/* Local variables */

Expand Down Expand Up @@ -231,7 +231,7 @@ ulong_t g_preference = 0; /* Setable with -p option */
/* Host variables */
int max_solicitations = MAX_SOLICITATIONS;
unsigned int solicitation_interval = SOLICITATION_INTERVAL;
int best_preference = 1; /* Set to record only the router(s) with the */
int best_preference = 1; /* Set to record only the router(s) with the */
/* best preference in the kernel. Not set */
/* puts all routes in the kernel. */

Expand Down Expand Up @@ -2233,42 +2233,54 @@ initlog(void)
openlog("in.rdisc", LOG_PID | LOG_CONS, LOG_DAEMON);
}

/* VARARGS1 */
void
logerr(fmt, a, b, c, d, e, f, g, h)
char *fmt;
static void
logimpl(int pri, char *fmt, va_list ap)
{
FILE *log;

if (pri == LOG_ERR)
log = stderr;
else
log = stdout;

if (logging)
syslog(LOG_ERR, fmt, a, b, c, d, e, f, g, h);
vsyslog(pri, fmt, ap);
else
(void) fprintf(stderr, fmt, a, b, c, d, e, f, g, h);
(void) vfprintf(log, fmt, ap);
}

/* VARARGS1 */
void
logtrace(fmt, a, b, c, d, e, f, g, h)
char *fmt;
static void
logerr(char *fmt, ...)
{
if (logging)
syslog(LOG_INFO, fmt, a, b, c, d, e, f, g, h);
else
(void) fprintf(stdout, fmt, a, b, c, d, e, f, g, h);
va_list ap;

va_start(ap, fmt);
logimpl(LOG_ERR, fmt, ap);
va_end(ap);
}

/* VARARGS1 */
void
logdebug(fmt, a, b, c, d, e, f, g, h)
char *fmt;
static void
logtrace(char *fmt, ...)
{
if (logging)
syslog(LOG_DEBUG, fmt, a, b, c, d, e, f, g, h);
else
(void) fprintf(stdout, fmt, a, b, c, d, e, f, g, h);
va_list ap;

va_start(ap, fmt);
logimpl(LOG_INFO, fmt, ap);
va_end(ap);
}

static void
logdebug(char *fmt, ...)
{
va_list ap;

va_start(ap, fmt);
logimpl(LOG_DEBUG, fmt, ap);
va_end(ap);
}

void
logperror(str)
char *str;
static void
logperror(char *str)
{
if (logging)
syslog(LOG_ERR, "%s: %s\n", str, strerror(errno));
Expand Down
4 changes: 3 additions & 1 deletion usr/src/cmd/mdb/common/kmdb/kmdb_kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Copyright (c) 2013 by Delphix. All rights reserved.
*
* Copyright 2019 Joyent, Inc.
* Copyright 2024 Oxide Computer Company
*/

#include <kmdb/kmdb_kvm.h>
Expand Down Expand Up @@ -2447,7 +2448,8 @@ static const mdb_tgt_ops_t kmt_ops = {
kmt_getareg, /* t_getareg */
kmt_putareg, /* t_putareg */
(int (*)())(uintptr_t)mdb_tgt_nop, /* XXX t_stack_iter */
(int (*)())(uintptr_t)mdb_tgt_notsup /* t_auxv */
(int (*)())(uintptr_t)mdb_tgt_notsup, /* t_auxv */
(int (*)())(uintptr_t)mdb_tgt_notsup /* t_thread_name */
};

/*
Expand Down
64 changes: 33 additions & 31 deletions usr/src/cmd/mdb/common/mdb/mdb_kproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Use is subject to license terms.
*
* Copyright 2018 Joyent, Inc.
* Copyright 2024 Oxide Computer Company
*/

/*
Expand Down Expand Up @@ -885,27 +886,27 @@ kp_auxv(mdb_tgt_t *t, const auxv_t **auxvp)
}

static const mdb_tgt_ops_t kproc_ops = {
(int (*)())(uintptr_t) mdb_tgt_notsup, /* t_setflags */
(int (*)())(uintptr_t)mdb_tgt_notsup, /* t_setflags */
kp_setcontext, /* t_setcontext */
kp_activate, /* t_activate */
kp_deactivate, /* t_deactivate */
(void (*)())(uintptr_t) mdb_tgt_nop, /* t_periodic */
(void (*)())(uintptr_t)mdb_tgt_nop, /* t_periodic */
kp_destroy, /* t_destroy */
kp_name, /* t_name */
kp_isa, /* t_isa */
kp_platform, /* t_platform */
kp_uname, /* t_uname */
kp_dmodel, /* t_dmodel */
(ssize_t (*)()) mdb_tgt_notsup, /* t_aread */
(ssize_t (*)()) mdb_tgt_notsup, /* t_awrite */
(ssize_t (*)())mdb_tgt_notsup, /* t_aread */
(ssize_t (*)())mdb_tgt_notsup, /* t_awrite */
kp_vread, /* t_vread */
kp_vwrite, /* t_vwrite */
(ssize_t (*)()) mdb_tgt_notsup, /* t_pread */
(ssize_t (*)()) mdb_tgt_notsup, /* t_pwrite */
(ssize_t (*)()) mdb_tgt_notsup, /* t_fread */
(ssize_t (*)()) mdb_tgt_notsup, /* t_fwrite */
(ssize_t (*)()) mdb_tgt_notsup, /* t_ioread */
(ssize_t (*)()) mdb_tgt_notsup, /* t_iowrite */
(ssize_t (*)())mdb_tgt_notsup, /* t_pread */
(ssize_t (*)())mdb_tgt_notsup, /* t_pwrite */
(ssize_t (*)())mdb_tgt_notsup, /* t_fread */
(ssize_t (*)())mdb_tgt_notsup, /* t_fwrite */
(ssize_t (*)())mdb_tgt_notsup, /* t_ioread */
(ssize_t (*)())mdb_tgt_notsup, /* t_iowrite */
kp_vtop, /* t_vtop */
kp_lookup_by_name, /* t_lookup_by_name */
kp_lookup_by_addr, /* t_lookup_by_addr */
Expand All @@ -914,28 +915,29 @@ static const mdb_tgt_ops_t kproc_ops = {
kp_object_iter, /* t_object_iter */
kp_addr_to_map, /* t_addr_to_map */
kp_name_to_map, /* t_name_to_map */
(struct ctf_file *(*)()) mdb_tgt_null, /* t_addr_to_ctf */
(struct ctf_file *(*)()) mdb_tgt_null, /* t_name_to_ctf */
(struct ctf_file *(*)())mdb_tgt_null, /* t_addr_to_ctf */
(struct ctf_file *(*)())mdb_tgt_null, /* t_name_to_ctf */
kp_status, /* t_status */
(int (*)())(uintptr_t) mdb_tgt_notsup, /* t_run */
(int (*)())(uintptr_t) mdb_tgt_notsup, /* t_step */
(int (*)())(uintptr_t) mdb_tgt_notsup, /* t_step_out */
(int (*)())(uintptr_t) mdb_tgt_notsup, /* t_next */
(int (*)())(uintptr_t) mdb_tgt_notsup, /* t_cont */
(int (*)())(uintptr_t) mdb_tgt_notsup, /* t_signal */
(int (*)())(uintptr_t) mdb_tgt_null, /* t_add_sbrkpt */
(int (*)())(uintptr_t) mdb_tgt_null, /* t_add_vbrkpt */
(int (*)())(uintptr_t) mdb_tgt_null, /* t_add_pwapt */
(int (*)())(uintptr_t) mdb_tgt_null, /* t_add_vwapt */
(int (*)())(uintptr_t) mdb_tgt_null, /* t_add_iowapt */
(int (*)())(uintptr_t) mdb_tgt_null, /* t_add_sysenter */
(int (*)())(uintptr_t) mdb_tgt_null, /* t_add_sysexit */
(int (*)())(uintptr_t) mdb_tgt_null, /* t_add_signal */
(int (*)())(uintptr_t) mdb_tgt_null, /* t_add_fault */
(int (*)())(uintptr_t) mdb_tgt_notsup, /* t_getareg XXX */
(int (*)())(uintptr_t) mdb_tgt_notsup, /* t_putareg XXX */
(int (*)())(uintptr_t) mdb_tgt_notsup, /* t_stack_iter XXX */
kp_auxv /* t_auxv */
(int (*)())(uintptr_t)mdb_tgt_notsup, /* t_run */
(int (*)())(uintptr_t)mdb_tgt_notsup, /* t_step */
(int (*)())(uintptr_t)mdb_tgt_notsup, /* t_step_out */
(int (*)())(uintptr_t)mdb_tgt_notsup, /* t_next */
(int (*)())(uintptr_t)mdb_tgt_notsup, /* t_cont */
(int (*)())(uintptr_t)mdb_tgt_notsup, /* t_signal */
(int (*)())(uintptr_t)mdb_tgt_null, /* t_add_sbrkpt */
(int (*)())(uintptr_t)mdb_tgt_null, /* t_add_vbrkpt */
(int (*)())(uintptr_t)mdb_tgt_null, /* t_add_pwapt */
(int (*)())(uintptr_t)mdb_tgt_null, /* t_add_vwapt */
(int (*)())(uintptr_t)mdb_tgt_null, /* t_add_iowapt */
(int (*)())(uintptr_t)mdb_tgt_null, /* t_add_sysenter */
(int (*)())(uintptr_t)mdb_tgt_null, /* t_add_sysexit */
(int (*)())(uintptr_t)mdb_tgt_null, /* t_add_signal */
(int (*)())(uintptr_t)mdb_tgt_null, /* t_add_fault */
(int (*)())(uintptr_t)mdb_tgt_notsup, /* t_getareg XXX */
(int (*)())(uintptr_t)mdb_tgt_notsup, /* t_putareg XXX */
(int (*)())(uintptr_t)mdb_tgt_notsup, /* t_stack_iter XXX */
kp_auxv, /* t_auxv */
(int (*)())(uintptr_t)mdb_tgt_notsup /* t_thread_name */
};

int
Expand Down
8 changes: 7 additions & 1 deletion usr/src/cmd/mdb/common/mdb/mdb_modapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright 2016 Nexenta Systems, Inc. All rights reserved.
* Copyright 2019 Joyent, Inc.
* Copyright 2022 Oxide Computer Company
* Copyright 2024 Oxide Computer Company
* Copyright 2023 RackTop Systems, Inc.
* Copyright 2023 OmniOS Community Edition (OmniOSce) Association.
*/
Expand Down Expand Up @@ -322,6 +322,12 @@ mdb_getareg(mdb_tid_t tid, const char *rname, mdb_reg_t *rp)
return (mdb_tgt_getareg(mdb.m_target, tid, rname, rp));
}

int
mdb_thread_name(mdb_tid_t tid, char *buf, size_t bufsize)
{
return (mdb_tgt_thread_name(mdb.m_target, tid, buf, bufsize));
}

static u_longlong_t
mdb_strtoull_int(const char *s, int radix)
{
Expand Down
2 changes: 2 additions & 0 deletions usr/src/cmd/mdb/common/mdb/mdb_modapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Copyright 2019 Joyent, Inc.
* Copyright 2023 RackTop Systems, Inc.
* Copyright 2023 OmniOS Community Edition (OmniOSce) Association.
* Copyright 2024 Oxide Computer Company
*/

#ifndef _MDB_MODAPI_H
Expand Down Expand Up @@ -246,6 +247,7 @@ typedef uintptr_t mdb_tid_t;
typedef uint64_t mdb_reg_t;

extern int mdb_getareg(mdb_tid_t, const char *, mdb_reg_t *);
extern int mdb_thread_name(mdb_tid_t, char *, size_t);

#define MDB_OPT_SETBITS 1 /* Set specified flag bits */
#define MDB_OPT_CLRBITS 2 /* Clear specified flag bits */
Expand Down
56 changes: 53 additions & 3 deletions usr/src/cmd/mdb/common/mdb/mdb_nv.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
/*
* Copyright (c) 2013 Josef 'Jeff' Sipek <[email protected]>
* Copyright 2024 Oxide Computer Company
*/

#include <mdb/mdb_debug.h>
Expand Down Expand Up @@ -65,7 +66,7 @@ nv_hashstring(const char *key)

static mdb_var_t *
nv_var_alloc(const char *name, const mdb_nv_disc_t *disc,
uintmax_t value, uint_t flags, uint_t um_flags, mdb_var_t *next)
uintmax_t value, uint_t flags, uint_t um_flags, mdb_var_t *next)
{
size_t nbytes;
mdb_var_t *v;
Expand Down Expand Up @@ -154,7 +155,7 @@ mdb_nv_destroy(mdb_nv_t *nv)
}
}

mdb_free(nv->nv_hash, sizeof (mdb_var_t *) * NV_HASHSZ);
mdb_free(nv->nv_hash, sizeof (mdb_var_t *) * nv->nv_hashsz);
}

mdb_var_t *
Expand Down Expand Up @@ -208,19 +209,68 @@ nv_var_overload(mdb_var_t *v, mdb_var_t *w)
return (w);
}

static void
nv_resize(mdb_nv_t *nv)
{
size_t i, bucket, new_hashsz = (nv->nv_hashsz << 1) - 1;
mdb_var_t *v, *w, **new_hash =
mdb_zalloc(sizeof (mdb_var_t *) * new_hashsz, nv->nv_um_flags);

if (new_hash == NULL) {
/*
* If this fails (possible only if UM_NOSLEEP was set in our
* flags), we will simply return -- and will presumably attempt
* to rehash again on a subsequent insert.
*/
ASSERT(nv->nv_um_flags & UM_NOSLEEP);
return;
}

/*
* This is a point of no return: we are going to iterate over our
* hash table, rehashing everything. Note that the ordering within
* hash chains is not preserved: if every element of a bucket were
* to rehash to the same bucket in the larger table, the ordering
* will be flipped.
*/
for (i = 0; i < nv->nv_hashsz; i++) {
for (v = nv->nv_hash[i]; v != NULL; v = w) {
w = v->v_next;

bucket = nv_hashstring(NV_NAME(v)) % new_hashsz;
v->v_next = new_hash[bucket];
new_hash[bucket] = v;
}
}

/*
* Everything has been rehashed; free our old hash table and point
* ourselves to the new one.
*/
mdb_free(nv->nv_hash, sizeof (mdb_var_t *) * nv->nv_hashsz);
nv->nv_hash = new_hash;
nv->nv_hashsz = new_hashsz;
}

/*
* Can return NULL only if the nv's memory allocation flags include UM_NOSLEEP
*/
mdb_var_t *
mdb_nv_insert(mdb_nv_t *nv, const char *name, const mdb_nv_disc_t *disc,
uintmax_t value, uint_t flags)
{
size_t i = nv_hashstring(name) % nv->nv_hashsz;
size_t i;
mdb_var_t *v;

ASSERT(!(flags & MDB_NV_EXTNAME) || !(flags & MDB_NV_OVERLOAD));
ASSERT(!(flags & MDB_NV_RDONLY) || !(flags & MDB_NV_OVERLOAD));

if (nv->nv_nelems > nv->nv_hashsz && nv->nv_iter_elt == NULL) {
nv_resize(nv);
}

i = nv_hashstring(name) % nv->nv_hashsz;

/*
* If the specified name is already hashed,
* and MDB_NV_OVERLOAD is set: insert new var into overload chain
Expand Down
Loading