Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Creating a link via `apply_port_settings` behaves differently than `link_create -> link_enabled_set`

Abierto
#78 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
rust
Área
networking

Línea de trabajo

Compare dpd/src/port_settings.rs at the settings-apply paths around insert_link() and add_asic_layer_port() with dpd::Switch::create_link(). Trace whether port_kr_set(), port_autoneg_set(), and mac_set() are intentionally omitted, then verify the expected behavior against the autonegotiation concern in omicron issue 3061. Done means the two creation paths have consistent, confirmed parameter behavior without breaking required uplinks.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Originally reported by @jgallagher as https://github.com/oxidecomputer/dendrite-archived/issues/588

On madrid, if I attempt to create a link via swadm, which internally calls link_create and link_enabled_set for each of these two commands:

root@oxz_switch:~# swadm link create qsfp0 --fec none --speed 40G
Created link qsfp0/0
root@oxz_switch:~# swadm link set-prop qsfp0/0 ena true

the link does not come up. If I pass --autoneg when creating the link:

root@oxz_switch:~# swadm link create qsfp0 --fec none --speed 40G --autoneg
Created link qsfp0/0
root@oxz_switch:~# swadm link set-prop qsfp0/0 ena true

the link does come up.

However, if I use the apply_port_settings API endpoint (which is not exposed via swadm, so we use curl):

root@oxz_switch:~# cat /tmp/manual.json
{
    "tag": "manual",
    "links": {
        "0": {
            "params": {
                "speed": "Speed40G",
                "fec": "None",
                "autoneg": false,
                "kr": false
            },
            "addrs": []
        }
    },
    "v4_routes": {},
    "v6_routes": {}
}
root@oxz_switch:~# curl -H "Content-Type: application/json" -X POST http://[::1]:12224/port/qsfp0/settings -d @/tmp/manual.json

the link comes up regardless of whether "autoneg" in the JSON body is true or false.

Pasting some comments from @bnaecker when we were looking at this:

Reading the port-settings-apply stuff, it's certainly taking a different code path than when you do swadm link create. When you add a new link through the settings code path, that seems to go to dpd/src/port_settings.rs:571, which calls SwitchPorts::insert_link() with the new link. That's really an internal method to add the data to the set of ports.

When you call swadm link create, that starts at dpd::Switch::create_link(). That does a whole bunch of stuff first, mostly telling the SDE about the new link.

It looks like the settings apply code does a similar thing through the add_asic_layer_port() method at dpd/src/port_settings.rs:853. I see that doing most things, but notably seems to be leaving out calls to port_kr_set(), port_autoneg_set(), and I think also mac_set(). I'm not sure what happens if you never tell the SDE what those parameters should be.

Our hypothesis is that (perhaps?) the SDE is defaulting autoneg to true, and the fact that we omit a call to port_autoneg_set() in the apply_port_settings code path is a happy accident that causes this particular link (which requires autoneg to come up) to work.

A cautionary note: if we "fix" this before fixing https://github.com/oxidecomputer/omicron/issues/3061, it's possible we'll break any uplinks that actually do require autonegotiation (since the control plane is currently always passing autoneg=false).

Lenguaje dominante
Rust
Estrellas
21
Forks
3
Merge medio
8 h 29 min
PR fusionados (30 d)
2

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de oxidecomputer/dendrite

Todos los issues de oxidecomputer/dendrite

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.