/* Interface Speed in Mb/s */
uint32_t speed;
+ /* TX queue len */
+ uint32_t txqlen;
+
/* Interface MTU. */
unsigned int mtu; /* IPv4 MTU */
unsigned int
STREAM_GETC(s, ifp->ptm_status);
STREAM_GETL(s, ifp->metric);
STREAM_GETL(s, ifp->speed);
+ STREAM_GETL(s, ifp->txqlen);
STREAM_GETL(s, ifp->mtu);
STREAM_GETL(s, ifp->mtu6);
STREAM_GETL(s, ifp->bandwidth);
ns_id_t link_nsid = ns_id;
ifindex_t master_infindex = IFINDEX_INTERNAL;
uint8_t bypass = 0;
+ uint32_t txqlen = 0;
frrtrace(3, frr_zebra, netlink_interface, h, ns_id, startup);
link_nsid = ns_id_get_absolute(ns_id, link_nsid);
}
+ if (tb[IFLA_TXQLEN])
+ txqlen = *(uint32_t *)RTA_DATA(tb[IFLA_TXQLEN]);
+
struct zebra_dplane_ctx *ctx = dplane_ctx_alloc();
dplane_ctx_set_ns_id(ctx, ns_id);
dplane_ctx_set_ifp_link_nsid(ctx, link_nsid);
dplane_ctx_set_ifname(ctx, name);
dplane_ctx_set_ifp_startup(ctx, startup);
dplane_ctx_set_ifp_family(ctx, ifi->ifi_family);
+ dplane_ctx_set_intf_txqlen(ctx, txqlen);
/* We are interested in some AF_BRIDGE notifications. */
#ifndef AF_BRIDGE
ifp->metric = 0;
ifp->speed = kernel_get_speed(ifp, NULL);
ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
+ ifp->txqlen = dplane_ctx_get_intf_txqlen(ctx);
/* Set interface type */
zebra_if_set_ziftype(ifp, zif_type, zif_slave_type);
set_ifindex(ifp, ifindex, zns);
ifp->mtu6 = ifp->mtu = mtu;
ifp->metric = 0;
+ ifp->txqlen = dplane_ctx_get_intf_txqlen(ctx);
/*
* Update interface type - NOTE: Only slave_type can
return;
}
- vty_out(vty, " index %d metric %d mtu %d speed %u ", ifp->ifindex,
- ifp->metric, ifp->mtu, ifp->speed);
+ vty_out(vty, " index %d metric %d mtu %d speed %u txqlen %u",
+ ifp->ifindex, ifp->metric, ifp->mtu, ifp->speed, ifp->txqlen);
if (ifp->mtu6 != ifp->mtu)
vty_out(vty, "mtu6 %d ", ifp->mtu6);
vty_out(vty, "\n flags: %s\n", if_flag_dump(ifp->flags));
if (ifp->mtu6 != ifp->mtu)
json_object_int_add(json_if, "mtu6", ifp->mtu6);
json_object_int_add(json_if, "speed", ifp->speed);
+ json_object_int_add(json_if, "txqlen", ifp->txqlen);
json_object_string_add(json_if, "flags", if_flag_dump(ifp->flags));
/* Hardware address. */
stream_putc(s, ifp->ptm_status);
stream_putl(s, ifp->metric);
stream_putl(s, ifp->speed);
+ stream_putl(s, ifp->txqlen);
stream_putl(s, ifp->mtu);
stream_putl(s, ifp->mtu6);
stream_putl(s, ifp->bandwidth);
uint32_t rc_bitfield;
+ uint32_t txqlen;
+
uint32_t metric;
uint32_t flags;
}
}
+void dplane_ctx_set_intf_txqlen(struct zebra_dplane_ctx *ctx, uint32_t txqlen)
+{
+ DPLANE_CTX_VALID(ctx);
+
+ ctx->u.intf.txqlen = txqlen;
+}
+
+uint32_t dplane_ctx_get_intf_txqlen(const struct zebra_dplane_ctx *ctx)
+{
+ DPLANE_CTX_VALID(ctx);
+
+ return ctx->u.intf.txqlen;
+}
+
/* Accessors for MAC information */
vlanid_t dplane_ctx_mac_get_vlan(const struct zebra_dplane_ctx *ctx)
{
bool dplane_ctx_intf_has_label(const struct zebra_dplane_ctx *ctx);
const char *dplane_ctx_get_intf_label(const struct zebra_dplane_ctx *ctx);
void dplane_ctx_set_intf_label(struct zebra_dplane_ctx *ctx, const char *label);
+void dplane_ctx_set_intf_txqlen(struct zebra_dplane_ctx *ctx, uint32_t txqlen);
+uint32_t dplane_ctx_get_intf_txqlen(const struct zebra_dplane_ctx *ctx);
/* Accessors for MAC information */
vlanid_t dplane_ctx_mac_get_vlan(const struct zebra_dplane_ctx *ctx);