From owner-freebsd-net@FreeBSD.ORG Sun Dec 15 00:08:14 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AC1D1E4 for ; Sun, 15 Dec 2013 00:08:14 +0000 (UTC) Received: from mail-qc0-x22c.google.com (mail-qc0-x22c.google.com [IPv6:2607:f8b0:400d:c01::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CE5131887 for ; Sun, 15 Dec 2013 00:08:13 +0000 (UTC) Received: by mail-qc0-f172.google.com with SMTP id e16so2734832qcx.31 for ; Sat, 14 Dec 2013 16:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=PyfrfCfc/HJ0xE127FH5YhaadIdrjxpmDCD5CglniHQ=; b=RBrl7ONZQeOCxeDJDmbzEO9AVjmt+yFTqjEMYwXwSX4b2PwEs7dl6wh9MMIr9qEL9b NdRa1uxuL+KxvMP70KqLGEuvkCkEhOFHFYrsdHiL+C21ID83gkEaYBpTDVmb0D//EPCv OlJT2byNxKzE1GvsYMZ72NULN+Fhe0awoHky2H3KTnTaYhN4mZ5In5qYQ4ldur4u5YUo 5vVOb6rYLgVYuqdsLJKVlFpbAPtQG1I+sK05WNMIqBX8PcCJqvpGzL7gUzx0xClKXBU8 mxJUVa+gaTOr7Eyu/bO6eg0sSVN7lffICweCSim1tXnq5eYEcC1Xmfjlm6t6vgh9p5sF x+oQ== MIME-Version: 1.0 X-Received: by 10.49.129.38 with SMTP id nt6mr19104063qeb.78.1387066092954; Sat, 14 Dec 2013 16:08:12 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Sat, 14 Dec 2013 16:08:12 -0800 (PST) In-Reply-To: References: Date: Sat, 14 Dec 2013 16:08:12 -0800 X-Google-Sender-Auth: 0im3w8BUl5JfKvn9H0DhSfuXQOQ Message-ID: Subject: Re: buf_ring in HEAD is racy From: Adrian Chadd To: Ryan Stone Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2013 00:08:14 -0000 Also, I think it's a good idea to get a bullet-proof bufring implementation that uses atomics rather than mutexes. We really want there to be a cheap way to insert things into the queue. Honestly, we could just do with a generic multi-writer, single-reader ring type that we can re-use for other things, rather than just mbufs. We could also have the code run in userland and do some very in-depth stress testing of it there rather than needing it to be in the kernel. Hm.. -adrian