diff mbox series

[v7,9/9] hw/net: ftgmac100: Drop the small packet check in the receive path

Message ID 20230625015321.77987-10-bmeng@tinylab.org (mailing list archive)
State New, archived
Headers show
Series net: Pad short frames for network backends | expand

Commit Message

Bin Meng June 25, 2023, 1:53 a.m. UTC
Now that we have implemented unified short frames padding in the
QEMU networking codes, the small packet check logic in the receive
path is no longer needed.

Suggested-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Bin Meng <bmeng@tinylab.org>

---

Changes in v7:
- new patch: "hw/net: ftgmac100: Drop the small packet check in the receive path"

 hw/net/ftgmac100.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Cédric Le Goater June 26, 2023, 6:20 a.m. UTC | #1
On 6/25/23 03:53, Bin Meng wrote:
> Now that we have implemented unified short frames padding in the
> QEMU networking codes, the small packet check logic in the receive
> path is no longer needed.
> 
> Suggested-by: Cédric Le Goater <clg@kaod.org>
> Signed-off-by: Bin Meng <bmeng@tinylab.org>

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks Bin,

C.


> 
> ---
> 
> Changes in v7:
> - new patch: "hw/net: ftgmac100: Drop the small packet check in the receive path"
> 
>   hw/net/ftgmac100.c | 8 --------
>   1 file changed, 8 deletions(-)
> 
> diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c
> index d3bf14be53..702b001be2 100644
> --- a/hw/net/ftgmac100.c
> +++ b/hw/net/ftgmac100.c
> @@ -968,14 +968,6 @@ static ssize_t ftgmac100_receive(NetClientState *nc, const uint8_t *buf,
>           return -1;
>       }
>   
> -    /* TODO : Pad to minimum Ethernet frame length */
> -    /* handle small packets.  */
> -    if (size < 10) {
> -        qemu_log_mask(LOG_GUEST_ERROR, "%s: dropped frame of %zd bytes\n",
> -                      __func__, size);
> -        return size;
> -    }
> -
>       if (!ftgmac100_filter(s, buf, size)) {
>           return size;
>       }
diff mbox series

Patch

diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c
index d3bf14be53..702b001be2 100644
--- a/hw/net/ftgmac100.c
+++ b/hw/net/ftgmac100.c
@@ -968,14 +968,6 @@  static ssize_t ftgmac100_receive(NetClientState *nc, const uint8_t *buf,
         return -1;
     }
 
-    /* TODO : Pad to minimum Ethernet frame length */
-    /* handle small packets.  */
-    if (size < 10) {
-        qemu_log_mask(LOG_GUEST_ERROR, "%s: dropped frame of %zd bytes\n",
-                      __func__, size);
-        return size;
-    }
-
     if (!ftgmac100_filter(s, buf, size)) {
         return size;
     }