MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bstp_tick

Function bstp_tick

freebsd/net/bridgestp.c:1862–1913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1860}
1861
1862static void
1863bstp_tick(void *arg)
1864{
1865 struct bstp_state *bs = arg;
1866 struct bstp_port *bp;
1867
1868 BSTP_LOCK_ASSERT(bs);
1869
1870 if (bs->bs_running == 0)
1871 return;
1872
1873 CURVNET_SET(bs->bs_vnet);
1874
1875 /* poll link events on interfaces that do not support linkstate */
1876 if (bstp_timer_dectest(&bs->bs_link_timer)) {
1877 LIST_FOREACH(bp, &bs->bs_bplist, bp_next) {
1878 if (!(bp->bp_ifp->if_capabilities & IFCAP_LINKSTATE))
1879 taskqueue_enqueue(taskqueue_swi, &bp->bp_mediatask);
1880 }
1881 bstp_timer_start(&bs->bs_link_timer, BSTP_LINK_TIMER);
1882 }
1883
1884 LIST_FOREACH(bp, &bs->bs_bplist, bp_next) {
1885 /* no events need to happen for these */
1886 bstp_timer_dectest(&bp->bp_tc_timer);
1887 bstp_timer_dectest(&bp->bp_recent_root_timer);
1888 bstp_timer_dectest(&bp->bp_forward_delay_timer);
1889 bstp_timer_dectest(&bp->bp_recent_backup_timer);
1890
1891 if (bstp_timer_dectest(&bp->bp_hello_timer))
1892 bstp_hello_timer_expiry(bs, bp);
1893
1894 if (bstp_timer_dectest(&bp->bp_message_age_timer))
1895 bstp_message_age_expiry(bs, bp);
1896
1897 if (bstp_timer_dectest(&bp->bp_migrate_delay_timer))
1898 bstp_migrate_delay_expiry(bs, bp);
1899
1900 if (bstp_timer_dectest(&bp->bp_edge_delay_timer))
1901 bstp_edge_delay_expiry(bs, bp);
1902
1903 /* update the various state machines for the port */
1904 bstp_update_state(bs, bp);
1905
1906 if (bp->bp_txcount > 0)
1907 bp->bp_txcount--;
1908 }
1909
1910 CURVNET_RESTORE();
1911
1912 callout_reset(&bs->bs_bstpcallout, hz, bstp_tick, bs);
1913}
1914
1915static void
1916bstp_timer_start(struct bstp_timer *t, uint16_t v)

Callers

nothing calls this directly

Calls 8

bstp_timer_dectestFunction · 0.85
taskqueue_enqueueFunction · 0.85
bstp_timer_startFunction · 0.85
bstp_hello_timer_expiryFunction · 0.85
bstp_message_age_expiryFunction · 0.85
bstp_edge_delay_expiryFunction · 0.85
bstp_update_stateFunction · 0.85

Tested by

no test coverage detected