Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2138382pxj; Thu, 20 May 2021 00:37:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYBbcJR8BcqcVmcsBY6E8jMctpMbLVs/aSarE5IHtE7qsUJ4/MGOSxhA614FguBQWlR6Tw X-Received: by 2002:a05:6638:1650:: with SMTP id a16mr4324424jat.23.1621496255190; Thu, 20 May 2021 00:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621496255; cv=none; d=google.com; s=arc-20160816; b=GD/ZYoUm4ly3Md6gfu+ZpT7mE3bR1JkLHbyJHhaRF5hWJHw643u82BZMqZ23tT8CTP IIB8s7ei60ENbXV4kM76Sf7ZIyNvdlO2qMpzdG73jt2LwOhTC94Ywbo+HwTUxJgCcfKg XfirwtZJf6FFersIdAkThp9gF3IkC864ypyFCQIVvB11+qQCqbafgpin9itx9EKK0xTK Lh0nysR7GYwLf+Plee4K5rn7fD5zLimBQqfp7LIIGZjeas0nAb6idtkjHQ3PnaGD4eEk tJyo3UQNK10YWSJBKD783PkKUiVBVfzvVKlf+gLwT1cISsLpKzCQyMKTbNMST/0Hy5PN Pq1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=c2GC6XfcAGM7klDITVVJQzbY0FDd+BlAJFrTDoANgwk=; b=O8YlDlDKm+TDHz2rIgKKi5Lv40gKtWiss+uiErIXCGPBeeHEqG7ZrgwWwdwmHq5tbY sXejAyPQJp4gl2V50izIub64epbwnXfkh7CANLMJSj5rPyEPgRkqhL1+UuC9xch5TmWe s63MrE+2EpXrMUEeKakaJUhvmD/5v2HxpzkKU86aemj3I9LDHM9PnUUya/NDPKRkc8Og k5KOR/04KQKeYC2fUnADRwjQapWJ0ygkVH9B143yY4nsCImleL/lieBMQwRxhq/PEA/l wsUo6/qDJb7mm1MKmFmdlRdfv5spktArwQOhDz7oc43fiYJrXNbfKZl+oW+P/ZLzHuWH hciQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i3AZHTyr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si1973198jat.68.2021.05.20.00.37.20; Thu, 20 May 2021 00:37:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i3AZHTyr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230447AbhETHhE (ORCPT + 99 others); Thu, 20 May 2021 03:37:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56936 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbhETHhC (ORCPT ); Thu, 20 May 2021 03:37:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621496141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=c2GC6XfcAGM7klDITVVJQzbY0FDd+BlAJFrTDoANgwk=; b=i3AZHTyrCrZ0+/w4ZhB1hQPD1w7N8dZp4b5hGYBAZLqinpMhUdsajaKxY9uOurc6mUoVGg zAUztllzJu9SFlWS31rUv7qTgvLhx/rVq24H8KLZQ98uhMSccELzIFvHtZia6G7IcO/xb8 Bp3LwJM+SLFpl5TZQg1lE9i2i2UIdAU= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-516-Dkbx3AwlO7GIgxa_uNblkA-1; Thu, 20 May 2021 03:35:40 -0400 X-MC-Unique: Dkbx3AwlO7GIgxa_uNblkA-1 Received: by mail-ej1-f69.google.com with SMTP id x20-20020a1709061354b02903cff4894505so4607201ejb.14 for ; Thu, 20 May 2021 00:35:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=c2GC6XfcAGM7klDITVVJQzbY0FDd+BlAJFrTDoANgwk=; b=jwu9b9lBraCqPmPgyn3ltHkQNucrG3jOLAcIZWji6K2XkW9fGsczuLEPi7Qbcqi/7v Er5wXpoI3gGmH8/xTTtGhZq6C8isJ12SVeV00Jol8IZ0l5gWG5/sA3ygEFDBa0XH/IAz +OA5BtxQEBQ5+g+H+LAllURTAiKTASK9Lqbp0vz5gx/JBuTFcwqOqZ2dCmbVxbbIFRRY b/r+JoFnr3NdEmKyxUcFt8LEYMo5wNuiqsq80bIsRwfe5Eh2fxu9fmVIr72Or+aacctZ G8Jr7ODivEuZWACyKVD9pj5ItKQoTzM3xhA7k/ivbqAHqqNS96ibaTyvB6cY4bHyyNCE zjsg== X-Gm-Message-State: AOAM533uIZt+bwhfTPzK13FXnNGiuwaqkpPCEzXomNpcH+5nHJvkXerk S7wuLds62rjq/5U8JDmvzvCl3jcMUGCmV5OqvHwbclj5vKARxm5a8eN20rsGCdXp/stkhc/K1zi hldV6wNQFS4WY0asu7/1DOVfa X-Received: by 2002:a17:906:5fd1:: with SMTP id k17mr3268852ejv.78.1621496138922; Thu, 20 May 2021 00:35:38 -0700 (PDT) X-Received: by 2002:a17:906:5fd1:: with SMTP id k17mr3268844ejv.78.1621496138769; Thu, 20 May 2021 00:35:38 -0700 (PDT) Received: from steredhat (host-79-18-148-79.retail.telecomitalia.it. [79.18.148.79]) by smtp.gmail.com with ESMTPSA id ga3sm951545ejb.34.2021.05.20.00.35.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 00:35:38 -0700 (PDT) Date: Thu, 20 May 2021 09:35:36 +0200 From: Stefano Garzarella To: Xianting Tian Cc: mst@redhat.com, jasowang@redhat.com, davem@davemloft.net, kuba@kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] virtio_net: Remove BUG() to aviod machine dead Message-ID: <20210520073536.wwt35gsz62bv27hm@steredhat> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If you need to respin, there is a typo in the title s/aviod/avoid/ On Tue, May 18, 2021 at 05:46:56PM +0800, Xianting Tian wrote: >When met error, we output a print to avoid a BUG(). > >Signed-off-by: Xianting Tian >--- > drivers/net/virtio_net.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > >diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c >index c921ebf3ae82..a66174d13e81 100644 >--- a/drivers/net/virtio_net.c >+++ b/drivers/net/virtio_net.c >@@ -1647,9 +1647,8 @@ static int xmit_skb(struct send_queue *sq, >struct sk_buff *skb) > hdr = skb_vnet_hdr(skb); > > if (virtio_net_hdr_from_skb(skb, &hdr->hdr, >- virtio_is_little_endian(vi->vdev), false, >- 0)) >- BUG(); >+ virtio_is_little_endian(vi->vdev), false, 0)) ^ This change is not related. >+ return -EPROTO; > > if (vi->mergeable_rx_bufs) > hdr->num_buffers = 0; >-- >2.17.1 >