Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jul 2015 20:25:55 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286140 - head/sys/net
Message-ID:  <201507312025.t6VKPt8w010902@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loos
Date: Fri Jul 31 20:25:54 2015
New Revision: 286140
URL: https://svnweb.freebsd.org/changeset/base/286140

Log:
  Remove the sleep from the buffer allocation routine.
  
  The buffer must be allocated (or even changed) before the interface is set
  and thus, there is no need to verify if the buffer is in use.
  
  MFC after:	2 weeks
  Sponsored by:	Rubicon Communications (Netgate)

Modified:
  head/sys/net/bpf_buffer.c

Modified: head/sys/net/bpf_buffer.c
==============================================================================
--- head/sys/net/bpf_buffer.c	Fri Jul 31 20:02:12 2015	(r286139)
+++ head/sys/net/bpf_buffer.c	Fri Jul 31 20:25:54 2015	(r286140)
@@ -79,8 +79,6 @@ __FBSDID("$FreeBSD$");
 #include <net/bpf_buffer.h>
 #include <net/bpfdesc.h>
 
-#define PRINET  26			/* interruptible */
-
 /*
  * Implement historical kernel memory buffering model for BPF: two malloc(9)
  * kernel buffers are hung off of the descriptor.  The size is fixed prior to
@@ -191,9 +189,6 @@ bpf_buffer_ioctl_sblen(struct bpf_d *d, 
 		return (EINVAL);
 	}
 
-	while (d->bd_hbuf_in_use)
-		mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock,
-		    PRINET, "bd_hbuf", 0);
 	/* Free old buffers if set */
 	if (d->bd_fbuf != NULL)
 		free(d->bd_fbuf, M_BPF);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507312025.t6VKPt8w010902>