vhost: avoid pr_err on condition guest can trigger
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 24 Jun 2010 14:10:25 +0000 (17:10 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 16 Jul 2010 09:18:17 +0000 (12:18 +0300)
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: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/net.c

index 2764e0fbf29b957be432a210b349ce06000e8472..2f6185c845e03618ca679513aecd55bfb96c76d5 100644 (file)
@@ -177,8 +177,8 @@ static void handle_tx(struct vhost_net *net)
                        break;
                }
                if (err != len)
-                       pr_err("Truncated TX packet: "
-                              " len %d != %zd\n", err, len);
+                       pr_debug("Truncated TX packet: "
+                                " len %d != %zd\n", err, len);
                vhost_add_used_and_signal(&net->dev, vq, head, 0);
                total_len += len;
                if (unlikely(total_len >= VHOST_NET_WEIGHT)) {
@@ -275,8 +275,8 @@ static void handle_rx(struct vhost_net *net)
                }
                /* TODO: Should check and handle checksum. */
                if (err > len) {
-                       pr_err("Discarded truncated rx packet: "
-                              " len %d > %zd\n", err, len);
+                       pr_debug("Discarded truncated rx packet: "
+                                " len %d > %zd\n", err, len);
                        vhost_discard_vq_desc(vq);
                        continue;
                }