qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Alexander Bulekov <alxndr@bu.edu>
Cc: Jason Wang <jasowang@redhat.com>,
	Dmitry Fleytman <dmitry.fleytman@gmail.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH] vmxnet3: add stub for encapsulation offload
Date: Mon, 9 Aug 2021 09:32:09 +0200	[thread overview]
Message-ID: <47ef48b9-7bde-3b6c-03d2-b6474f238557@redhat.com> (raw)
In-Reply-To: <20210807202518.jrqobxx3nygszbus@mozz.bu.edu>

On 8/7/21 10:25 PM, Alexander Bulekov wrote:
> On 210807 1019, Philippe Mathieu-Daudé wrote:
>> On 8/7/21 12:23 AM, Alexander Bulekov wrote:
>>> Encapsulation offload (offload mode 1) is a valid mode present in the
>>> kernel that isn't implemented in QEMU, yet.
>>>
>>> https://lore.kernel.org/lkml/20200528015426.8285-4-doshir@vmware.com/
>>>
>>> Add a stub for this mode, to avoid the guest-triggerable assertion.
>>>
>>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/517
>>> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
>>> ---
>>>  hw/net/vmxnet3.c | 5 +++++
>>>  hw/net/vmxnet3.h | 1 +
>>>  2 files changed, 6 insertions(+)
>>>
>>> diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
>>> index 41f796a247..62e11d0e3e 100644
>>> --- a/hw/net/vmxnet3.c
>>> +++ b/hw/net/vmxnet3.c
>>> @@ -443,6 +443,11 @@ vmxnet3_setup_tx_offloads(VMXNET3State *s)
>>>          net_tx_pkt_build_vheader(s->tx_pkt, false, false, 0);
>>>          break;
>>>  
>>> +    case VMXNET3_OM_ENCAP:
>>> +        VMW_PKPRN("Encapsulation offload requested, but not available\n");
>>> +        return false;
>>> +        break;
>>
>> No need to break if you returned (unreachable).
> 
> I included it in case the feature ends up being added, so there is one
> less thing to worry about, but I can remove it. There are a couple of
> places in QEMU where this occurs, so I wasn't sure about the best
> practice.

I don't know if there is an official "best practice". My style /
recommendation is to try to use single exit point when possible
so I can easily add trace events.



  reply	other threads:[~2021-08-09  7:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 22:23 [PATCH] vmxnet3: add stub for encapsulation offload Alexander Bulekov
2021-08-07  8:19 ` Philippe Mathieu-Daudé
2021-08-07 20:25   ` Alexander Bulekov
2021-08-09  7:32     ` Philippe Mathieu-Daudé [this message]
2022-08-05 14:57 ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47ef48b9-7bde-3b6c-03d2-b6474f238557@redhat.com \
    --to=philmd@redhat.com \
    --cc=alxndr@bu.edu \
    --cc=dmitry.fleytman@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).