Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
ace62dd1
Commit
ace62dd1
authored
Jul 21, 2011
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'vhost-net-next' of
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
parents
368940d0
9e380825
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
drivers/vhost/net.c
drivers/vhost/net.c
+14
-4
No files found.
drivers/vhost/net.c
View file @
ace62dd1
...
...
@@ -182,15 +182,21 @@ static void handle_tx(struct vhost_net *net)
break
;
/* Nothing new? Wait for eventfd to tell us they refilled. */
if
(
head
==
vq
->
num
)
{
int
num_pends
;
wmem
=
atomic_read
(
&
sock
->
sk
->
sk_wmem_alloc
);
if
(
wmem
>=
sock
->
sk
->
sk_sndbuf
*
3
/
4
)
{
tx_poll_start
(
net
,
sock
);
set_bit
(
SOCK_ASYNC_NOSPACE
,
&
sock
->
flags
);
break
;
}
/* If more outstanding DMAs, queue the work */
if
(
unlikely
(
vq
->
upend_idx
-
vq
->
done_idx
>
VHOST_MAX_PEND
))
{
/* If more outstanding DMAs, queue the work.
* Handle upend_idx wrap around
*/
num_pends
=
likely
(
vq
->
upend_idx
>=
vq
->
done_idx
)
?
(
vq
->
upend_idx
-
vq
->
done_idx
)
:
(
vq
->
upend_idx
+
UIO_MAXIOV
-
vq
->
done_idx
);
if
(
unlikely
(
num_pends
>
VHOST_MAX_PEND
))
{
tx_poll_start
(
net
,
sock
);
set_bit
(
SOCK_ASYNC_NOSPACE
,
&
sock
->
flags
);
break
;
...
...
@@ -711,8 +717,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
mutex_unlock
(
&
vq
->
mutex
);
if
(
oldubufs
)
if
(
oldubufs
)
{
vhost_ubuf_put_and_wait
(
oldubufs
);
mutex_lock
(
&
vq
->
mutex
);
vhost_zerocopy_signal_used
(
vq
);
mutex_unlock
(
&
vq
->
mutex
);
}
if
(
oldsock
)
{
vhost_net_flush_vq
(
n
,
index
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment