From: Akihiko Odaki <akihiko.odaki@daynix.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: "Sriram Yagnaraman" <sriram.yagnaraman@est.tech>,
"Jason Wang" <jasowang@redhat.com>,
"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Beraldo Leal" <bleal@redhat.com>,
"Cleber Rosa" <crosa@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 08/40] igb: Always copy ethernet header
Date: Fri, 21 Apr 2023 21:18:02 +0900 [thread overview]
Message-ID: <c26f49a2-4ee7-f7f3-e162-a181efebadd4@daynix.com> (raw)
In-Reply-To: <95840429-756a-98f9-b336-91e480b37781@linaro.org>
On 2023/04/14 23:46, Philippe Mathieu-Daudé wrote:
> On 14/4/23 13:37, Akihiko Odaki wrote:
>> igb_receive_internal() used to check the iov length to determine
>> copy the iovs to a contiguous buffer, but the check is flawed in two
>> ways:
>> - It does not ensure that iovcnt > 0.
>> - It does not take virtio-net header into consideration.
>>
>> The size of this copy is just 22 octets, which can be even less than
>> the code size required for checks. This (wrong) optimization is probably
>> not worth so just remove it. Removing this also allows igb to assume
>> aligned accesses for the ethernet header.
>>
>> Fixes: 3a977deebe ("Intrdocue igb device emulation")
>> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
>> ---
>> hw/net/igb_core.c | 39 +++++++++++++++++++++------------------
>> 1 file changed, 21 insertions(+), 18 deletions(-)
>>
>> diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c
>> index 53f60fc3d3..1d188b526c 100644
>> --- a/hw/net/igb_core.c
>> +++ b/hw/net/igb_core.c
>
>
>> -static uint16_t igb_receive_assign(IGBCore *core, const struct
>> eth_header *ehdr,
>> +static uint16_t igb_receive_assign(IGBCore *core, const L2Header
>> *l2_header,
>> size_t size, E1000E_RSSInfo
>> *rss_info,
>> bool *external_tx)
>> {
>> static const int ta_shift[] = { 4, 3, 2, 0 };
>> + const struct eth_header *ehdr = &l2_header->eth;
>> uint32_t f, ra[2], *macp, rctl = core->mac[RCTL];
>> uint16_t queues = 0;
>> uint16_t oversized = 0;
>> - uint16_t vid = lduw_be_p(&PKT_GET_VLAN_HDR(ehdr)->h_tci) &
>> VLAN_VID_MASK;
>> + uint16_t vid = be16_to_cpu(l2_header->vlan[0].h_tci) &
>> VLAN_VID_MASK;
>
> Why this API change? Are we certain tci is aligned in host memory?
This change makes the VLAN tag always copied to the host memory, which
ensures that tci is aligned.
next prev parent reply other threads:[~2023-04-21 12:18 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 11:36 [PATCH 00/40] igb: Fix for DPDK Akihiko Odaki
2023-04-14 11:36 ` [PATCH 01/40] hw/net/net_tx_pkt: Decouple from PCI Akihiko Odaki
2023-04-14 14:23 ` Philippe Mathieu-Daudé
2023-04-14 11:36 ` [PATCH 02/40] e1000x: Fix BPRC and MPRC Akihiko Odaki
2023-04-14 11:37 ` [PATCH 03/40] igb: Fix Rx packet type encoding Akihiko Odaki
2023-04-15 19:08 ` Sriram Yagnaraman
2023-04-14 11:37 ` [PATCH 04/40] igb: Include the second VLAN tag in the buffer Akihiko Odaki
2023-04-14 14:28 ` Philippe Mathieu-Daudé
2023-04-14 14:32 ` Philippe Mathieu-Daudé
2023-04-14 14:35 ` Philippe Mathieu-Daudé
2023-04-14 11:37 ` [PATCH 05/40] igb: Do not require CTRL.VME for tx VLAN tagging Akihiko Odaki
2023-04-15 19:08 ` Sriram Yagnaraman
2023-04-14 11:37 ` [PATCH 06/40] net/net_rx_pkt: Use iovec for net_rx_pkt_set_protocols() Akihiko Odaki
2023-04-15 19:09 ` Sriram Yagnaraman
2023-04-14 11:37 ` [PATCH 07/40] e1000e: Always copy ethernet header Akihiko Odaki
2023-04-14 11:37 ` [PATCH 08/40] igb: " Akihiko Odaki
2023-04-14 14:46 ` Philippe Mathieu-Daudé
2023-04-21 12:18 ` Akihiko Odaki [this message]
2023-04-14 11:37 ` [PATCH 09/40] Fix references to igb Avocado test Akihiko Odaki
2023-04-14 14:47 ` Philippe Mathieu-Daudé
2023-04-14 11:37 ` [PATCH 10/40] tests/avocado: Remove unused imports Akihiko Odaki
2023-04-14 11:37 ` [PATCH 11/40] tests/avocado: Remove test_igb_nomsi_kvm Akihiko Odaki
2023-04-14 11:37 ` [PATCH 12/40] hw/net/net_tx_pkt: Remove net_rx_pkt_get_l4_info Akihiko Odaki
2023-04-14 11:37 ` [PATCH 13/40] net/eth: Rename eth_setup_vlan_headers_ex Akihiko Odaki
2023-04-14 11:37 ` [PATCH 14/40] e1000x: Share more Rx filtering logic Akihiko Odaki
2023-04-15 19:10 ` Sriram Yagnaraman
2023-04-14 11:37 ` [PATCH 15/40] e1000x: Take CRC into consideration for size check Akihiko Odaki
2023-04-14 15:03 ` Philippe Mathieu-Daudé
2023-04-14 11:37 ` [PATCH 16/40] e1000e: Always log status after building rx metadata Akihiko Odaki
2023-04-14 15:04 ` Philippe Mathieu-Daudé
2023-04-14 11:37 ` [PATCH 17/40] igb: " Akihiko Odaki
2023-04-14 15:07 ` Philippe Mathieu-Daudé
2023-04-14 11:37 ` [PATCH 18/40] igb: Remove goto Akihiko Odaki
2023-04-15 19:08 ` Sriram Yagnaraman
2023-04-14 11:37 ` [PATCH 19/40] igb: Read DCMD.VLE of the first Tx descriptor Akihiko Odaki
2023-04-15 19:08 ` Sriram Yagnaraman
2023-04-14 11:37 ` [PATCH 20/40] e1000e: Reset packet state after emptying Tx queue Akihiko Odaki
2023-04-14 11:37 ` [PATCH 21/40] vmxnet3: " Akihiko Odaki
2023-04-14 11:37 ` [PATCH 22/40] igb: Add more definitions for Tx descriptor Akihiko Odaki
2023-04-15 19:08 ` Sriram Yagnaraman
2023-04-14 11:37 ` [PATCH 23/40] igb: Share common VF constants Akihiko Odaki
2023-04-14 15:08 ` Philippe Mathieu-Daudé
2023-04-15 19:08 ` Sriram Yagnaraman
2023-04-14 11:37 ` [PATCH 24/40] igb: Fix igb_mac_reg_init alignment Akihiko Odaki
2023-04-14 15:09 ` Philippe Mathieu-Daudé
2023-04-14 11:37 ` [PATCH 25/40] net/eth: Use void pointers Akihiko Odaki
2023-04-14 15:10 ` Philippe Mathieu-Daudé
2023-04-14 11:37 ` [PATCH 26/40] net/eth: Always add VLAN tag Akihiko Odaki
2023-04-14 11:37 ` [PATCH 27/40] hw/net/net_rx_pkt: Enforce alignment for eth_header Akihiko Odaki
2023-04-14 11:37 ` [PATCH 28/40] tests/qtest/libqos/igb: Set GPIE.Multiple_MSIX Akihiko Odaki
2023-04-14 11:37 ` [PATCH 29/40] igb: Implement MSI-X single vector mode Akihiko Odaki
2023-04-15 19:12 ` Sriram Yagnaraman
2023-04-14 11:37 ` [PATCH 30/40] igb: Implement igb-specific oversize check Akihiko Odaki
2023-04-16 11:22 ` Sriram Yagnaraman
2023-04-22 5:45 ` Akihiko Odaki
2023-04-14 11:37 ` [PATCH 31/40] igb: Use UDP for RSS hash Akihiko Odaki
2023-04-15 19:45 ` Sriram Yagnaraman
2023-04-14 11:37 ` [PATCH 32/40] igb: Implement Rx SCTP CSO Akihiko Odaki
2023-04-14 11:37 ` [PATCH 33/40] igb: Implement Tx " Akihiko Odaki
2023-04-14 11:37 ` [PATCH 34/40] igb: Strip the second VLAN tag for extended VLAN Akihiko Odaki
2023-04-14 11:37 ` [PATCH 35/40] igb: Filter with " Akihiko Odaki
2023-04-14 11:37 ` [PATCH 36/40] igb: Implement Rx PTP2 timestamp Akihiko Odaki
2023-04-14 11:37 ` [PATCH 37/40] igb: Implement Tx timestamp Akihiko Odaki
2023-04-15 20:13 ` Sriram Yagnaraman
2023-04-14 11:37 ` [PATCH 38/40] vmxnet3: Do not depend on PC Akihiko Odaki
2023-04-14 15:13 ` Philippe Mathieu-Daudé
2023-04-14 11:37 ` [PATCH 39/40] MAINTAINERS: Add a reviewer for network packet abstractions Akihiko Odaki
2023-04-14 15:13 ` Philippe Mathieu-Daudé
2023-04-14 11:37 ` [PATCH 40/40] docs/system/devices/igb: Note igb is tested for DPDK Akihiko Odaki
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=c26f49a2-4ee7-f7f3-e162-a181efebadd4@daynix.com \
--to=akihiko.odaki@daynix.com \
--cc=alex.bennee@linaro.org \
--cc=bleal@redhat.com \
--cc=crosa@redhat.com \
--cc=dmitry.fleytman@gmail.com \
--cc=jasowang@redhat.com \
--cc=lvivier@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sriram.yagnaraman@est.tech \
--cc=thuth@redhat.com \
--cc=wainersm@redhat.com \
/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).