{"push_id":1159290266,"size":1,"distinct_size":1,"ref":"refs/heads/stable/10","head":"6bb446b900c1a249fac0ca1fa639ca5c3e5b3417","before":"5cf8affbc8376295d083c698b4115114f54675a2","commits":[{"sha":"6bb446b900c1a249fac0ca1fa639ca5c3e5b3417","author":{"name":"sephe","email":"0d6bcc8c34e4768bd207247de4ee55fd5915c840@FreeBSD.org"},"message":"MFC 296178\n\n    buf_ring/drbr: Add buf_ring_peek_clear_sc and use it in drbr_peek\n\n    Unlike buf_ring_peek, it only supports single consumer mode, and it\n    clears the cons_head if DEBUG_BUFRING/INVARIANTS is defined.\n\n    The normal use case of drbr_peek for network drivers is:\n\n    m = drbr_peek(br);\n    err = hw_spec_encap(&m); /* could m_defrag/m_collapse */\n    (*)\n    if (err) {\n        if (m == NULL)\n            drbr_advance(br);\n        else\n            drbr_putback(br, m);\n        /* break the loop */\n    }\n    drbr_advance(br);\n\n    The race is:\n    If hw_spec_encap() m_defrag or m_collapse the mbuf, i.e. the old mbuf\n    was freed, or like the Hyper-V's network driver, that transmission-\n    done does not even require the TX lock; then on the other CPU at the\n    (*) time, the freed mbuf could be recycled and being drbr_enqueue even\n    before the current CPU had the chance to call drbr_{advance,putback}.\n    This triggers a panic in drbr_enqueue duplicated element check, if\n    DEBUG_BUFRING/INVARIANTS is defined.\n\n    Use buf_ring_peek_clear_sc() in drbr_peek() to fix the above race.\n\n    This change is a NO-OP, if neither DEBUG_BUFRING nor INVARIANTS are\n    defined.\n\n    MFC after:  1 week\n    Sponsored by:       Microsoft OSTC\n    Differential Revision:      https://reviews.freebsd.org/D5416","distinct":true,"url":"https://api.github.com/repos/freebsd/freebsd/commits/6bb446b900c1a249fac0ca1fa639ca5c3e5b3417"}]}
{"actor":{"display_login":"uqs"}}