Commit 95c0ec6a authored by Michael S. Tsirkin's avatar Michael S. Tsirkin

vhost: avoid pr_err on condition guest can trigger

Guest can trigger packet truncation by posting
a very short buffer and disabling buffer merging.
Convert pr_err to pr_debug to avoid log from filling
up when this happens.
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 1680e906
...@@ -177,7 +177,7 @@ static void handle_tx(struct vhost_net *net) ...@@ -177,7 +177,7 @@ static void handle_tx(struct vhost_net *net)
break; break;
} }
if (err != len) if (err != len)
pr_err("Truncated TX packet: " pr_debug("Truncated TX packet: "
" len %d != %zd\n", err, len); " len %d != %zd\n", err, len);
vhost_add_used_and_signal(&net->dev, vq, head, 0); vhost_add_used_and_signal(&net->dev, vq, head, 0);
total_len += len; total_len += len;
...@@ -275,7 +275,7 @@ static void handle_rx(struct vhost_net *net) ...@@ -275,7 +275,7 @@ static void handle_rx(struct vhost_net *net)
} }
/* TODO: Should check and handle checksum. */ /* TODO: Should check and handle checksum. */
if (err > len) { if (err > len) {
pr_err("Discarded truncated rx packet: " pr_debug("Discarded truncated rx packet: "
" len %d > %zd\n", err, len); " len %d > %zd\n", err, len);
vhost_discard_vq_desc(vq); vhost_discard_vq_desc(vq);
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment