From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Bin Meng <bmeng.cn@gmail.com>,
David Gibson <david@gibson.dropbear.id.au>,
Greg Kurz <groug@kaod.org>, Jason Wang <jasowang@redhat.com>
Cc: slirp@lists.freedesktop.org,
Samuel Thibault <samuel.thibault@ens-lyon.org>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/net: fsl_etsec: Do not reject short frames
Date: Mon, 8 Feb 2021 12:58:56 +0100 [thread overview]
Message-ID: <c1d6ec7c-bea6-69ac-af5d-11cd9606924f@redhat.com> (raw)
In-Reply-To: <1612766465-7639-1-git-send-email-bin.meng@windriver.com>
Cc'ing libSLiRP.
On 2/8/21 7:41 AM, Bin Meng wrote:
> As of today both slirp and tap networking do not pad short frames
> (e.g.: an ARP packet) to the minimum frame size of 60 bytes.
>
> If eTSEC is programmed to reject short frames, ARP requests will be
> dropped, preventing the guest from becoming visible on the network.
>
> The same issue was reported on e1000 and vmxenet3 before, see:
>
> commit 78aeb23eded2 ("e1000: Pad short frames to minimum size (60 bytes)")
> commit 40a87c6c9b11 ("vmxnet3: Pad short frames to minimum size (60 bytes)")
>
> Ideally this should be fixed on the slirp/tap networking side to
> pad short frames to the minimum frame length, but I am not sure
> whether that's doable.
>
> This commit changes to codes to ignore the RCTRL_RSF setting and
> still allow receiving the short frame. The log message is updated
> to mention the reject short frames functionality is unimplemented.
>
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> ---
>
> hw/net/fsl_etsec/rings.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/hw/net/fsl_etsec/rings.c b/hw/net/fsl_etsec/rings.c
> index 121415a..503b4d3 100644
> --- a/hw/net/fsl_etsec/rings.c
> +++ b/hw/net/fsl_etsec/rings.c
> @@ -502,10 +502,17 @@ ssize_t etsec_rx_ring_write(eTSEC *etsec, const uint8_t *buf, size_t size)
> return -1;
> }
>
> + /*
> + * Both slirp and tap networking do not pad short frames
> + * (e.g.: an ARP packet) to the minimum frame size of 60 bytes.
> + *
> + * If eTSEC is programmed to reject short frames, ARP requests
> + * will be dropped, preventing the guest from becoming visible
> + * on the network.
> + */
> if ((etsec->regs[RCTRL].value & RCTRL_RSF) && (size < 60)) {
> /* CRC is not in the packet yet, so short frame is below 60 bytes */
> - RING_DEBUG("%s: Drop short frame\n", __func__);
> - return -1;
> + RING_DEBUG("%s: Drop short frame not implemented\n", __func__);
> }
>
> rx_init_frame(etsec, buf, size);
>
prev parent reply other threads:[~2021-02-08 18:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 6:41 [PATCH] hw/net: fsl_etsec: Do not reject short frames Bin Meng
2021-02-08 11:58 ` Philippe Mathieu-Daudé [this message]
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=c1d6ec7c-bea6-69ac-af5d-11cd9606924f@redhat.com \
--to=philmd@redhat.com \
--cc=bmeng.cn@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=jasowang@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=slirp@lists.freedesktop.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).