qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@daynix.com>
To: Tomasz Dzieciol <t.dzieciol@partner.samsung.com>, qemu-devel@nongnu.org
Cc: sriram.yagnaraman@est.tech, jasowang@redhat.com,
	k.kwiecien@samsung.com, m.sochacki@samsung.com
Subject: Re: [PATCH v4 5/5] igb: packet-split descriptors support
Date: Fri, 5 May 2023 00:06:35 +0900	[thread overview]
Message-ID: <5377fd3f-a4e4-0ec1-8a27-e7958ee290aa@daynix.com> (raw)
In-Reply-To: <20230504131055.11767-6-t.dzieciol@partner.samsung.com>

On 2023/05/04 22:10, Tomasz Dzieciol wrote:
> Packet-split descriptors are used by Linux VF driver for MTU values from 2048
> 
> Signed-off-by: Tomasz Dzieciol <t.dzieciol@partner.samsung.com>
> ---
>   hw/net/igb_core.c   | 368 ++++++++++++++++++++++++++++++++++++++------
>   hw/net/igb_regs.h   |   8 +
>   hw/net/trace-events |   2 +-
>   3 files changed, 332 insertions(+), 46 deletions(-)
> 
> diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c
> index 8c0291665f..9c1a2fa136 100644
> --- a/hw/net/igb_core.c
> +++ b/hw/net/igb_core.c
> @@ -276,6 +276,20 @@ typedef struct E1000ERingInfo {
>       int idx;
>   } E1000ERingInfo;
>   
> +static uint32_t
> +igb_rx_queue_desctyp_get(IGBCore *core, const E1000ERingInfo *r)
> +{
> +    return core->mac[E1000_SRRCTL(r->idx) >> 2] & E1000_SRRCTL_DESCTYPE_MASK;
> +}
> +
> +static bool
> +igb_rx_use_ps_descriptor(IGBCore *core, const E1000ERingInfo *r)
> +{
> +    uint32_t desctyp = igb_rx_queue_desctyp_get(core, r);
> +    return desctyp == E1000_SRRCTL_DESCTYPE_HDR_SPLIT ||
> +           desctyp == E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS;
> +}
> +
>   static inline bool
>   igb_rss_enabled(IGBCore *core)
>   {
> @@ -1233,21 +1247,70 @@ igb_read_lgcy_rx_descr(IGBCore *core, struct e1000_rx_desc *desc,
>   }
>   
>   static inline void
> -igb_read_adv_rx_descr(IGBCore *core, union e1000_adv_rx_desc *desc,
> -                      hwaddr *buff_addr)
> +igb_read_adv_rx_single_buf_descr(IGBCore *core, union e1000_adv_rx_desc *desc,
> +                                 hwaddr *buff_addr)
>   {
>       *buff_addr = le64_to_cpu(desc->read.pkt_addr);
>   }
>   
>   static inline void
> -igb_read_rx_descr(IGBCore *core, union e1000_rx_desc_union *desc,
> -                  hwaddr *buff_addr)
> +igb_read_adv_rx_split_buf_descr(IGBCore *core, union e1000_adv_rx_desc *desc,
> +                                hwaddr *buff_addr)
>   {
> +    buff_addr[0] = le64_to_cpu(desc->read.hdr_addr);
> +    buff_addr[1] = le64_to_cpu(desc->read.pkt_addr);
> +}
> +
> +typedef struct IGBBaState {
> +    uint16_t written[IGB_MAX_PS_BUFFERS];
> +    uint8_t cur_idx;
> +} IGBBaState;

This struct derives from e1000e so you should rename the corresponding 
struct of e1000e.

> +
> +typedef struct IGBPacketRxDMAState {
> +    size_t size;
> +    size_t total_size;
> +    size_t ps_hdr_len;
> +    size_t desc_size;
> +    size_t desc_offset;
> +    uint32_t rx_desc_packet_buf_size;
> +    uint32_t rx_desc_header_buf_size;
> +    struct iovec *iov;
> +    size_t iov_ofs;
> +    bool do_ps;
> +    bool is_first;
> +    IGBBaState bastate;
> +    hwaddr ba[IGB_MAX_PS_BUFFERS];

I meant this should not be an array but instead should be defined as a 
struct as it is in the "read" member of union e1000_adv_rx_desc. It's 
defined in a way different from e1000e's extended packet split 
descriptor (union e1000_rx_desc_packet_split) and that is based on the 
differences of notations in e1000e's and igb's datasheets so I want you 
to respect that.

Also, this definition is moved from the place where it is defined at 
first in an earlier patch, but I suggest to place it here in the earlier 
patch to keep this patch concise unless there is something to prevent that.


      reply	other threads:[~2023-05-04 17:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230504131105eucas1p1cc725f17aa42262be597f5ee81aca037@eucas1p1.samsung.com>
2023-05-04 13:10 ` [PATCH v4 0/5] igb: packet-split descriptors support Tomasz Dzieciol
     [not found]   ` <CGME20230504131105eucas1p2610f7bcc7c4fabba29cd198c52ac30f2@eucas1p2.samsung.com>
2023-05-04 13:10     ` [PATCH v4 1/5] igb: remove TCP ACK detection Tomasz Dzieciol
     [not found]   ` <CGME20230504131106eucas1p1714e019395c941f51155c0e9ae52a66b@eucas1p1.samsung.com>
2023-05-04 13:10     ` [PATCH v4 2/5] igb: rename E1000E_RingInfo_st Tomasz Dzieciol
2023-05-04 14:51       ` Akihiko Odaki
     [not found]   ` <CGME20230504131106eucas1p13530e4d1f10ca1086b39b37feddc3e28@eucas1p1.samsung.com>
2023-05-04 13:10     ` [PATCH v4 3/5] igb: RX descriptors handling cleanup Tomasz Dzieciol
2023-05-04 15:12       ` Akihiko Odaki
     [not found]   ` <CGME20230504131107eucas1p1bb75dd2ba7baf4f269ec2476feba69ac@eucas1p1.samsung.com>
2023-05-04 13:10     ` [PATCH v4 4/5] igb: add IPv6 extended headers traffic detection Tomasz Dzieciol
     [not found]   ` <CGME20230504131107eucas1p2aae525d7b23725b4efd8713e14943fb6@eucas1p2.samsung.com>
2023-05-04 13:10     ` [PATCH v4 5/5] igb: packet-split descriptors support Tomasz Dzieciol
2023-05-04 15:06       ` Akihiko Odaki [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=5377fd3f-a4e4-0ec1-8a27-e7958ee290aa@daynix.com \
    --to=akihiko.odaki@daynix.com \
    --cc=jasowang@redhat.com \
    --cc=k.kwiecien@samsung.com \
    --cc=m.sochacki@samsung.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sriram.yagnaraman@est.tech \
    --cc=t.dzieciol@partner.samsung.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).