DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bingbin Chen <chen.bingbin@zte.com.cn>
To: stephen@networkplumber.org
Cc: dev@dpdk.org
Subject: Re: [PATCH v5 14/14] net/zxdh: fix debugging errors
Date: Fri, 21 Mar 2025 11:07:57 +0800	[thread overview]
Message-ID: <20250321030757.2004831-1-chen.bingbin@zte.com.cn> (raw)
In-Reply-To: <20250319085808.1912523-15-chen.bingbin@zte.com.cn>


[-- Attachment #1.1.1: Type: text/plain, Size: 1938 bytes --]

>>  +struct zxdh_ifc_hw_np_stats_bits {
>>  +    uint8_t rx_unicast_pkts[0x40];
>>  +    uint8_t tx_unicast_pkts[0x40];
>>  +    uint8_t rx_unicast_bytes[0x40];
>>  +    uint8_t tx_unicast_bytes[0x40];
>>  +    uint8_t rx_multicast_pkts[0x40];
>>  +    uint8_t tx_multicast_pkts[0x40];
>>  +    uint8_t rx_multicast_bytes[0x40];
>>  +    uint8_t tx_multicast_bytes[0x40];
>>  +    uint8_t rx_broadcast_pkts[0x40];
>>  +    uint8_t tx_broadcast_pkts[0x40];
>>  +    uint8_t rx_broadcast_bytes[0x40];
>>  +    uint8_t tx_broadcast_bytes[0x40];
>>  +    uint8_t rx_mtu_drop_pkts[0x40];
>>  +    uint8_t tx_mtu_drop_pkts[0x40];
>>  +    uint8_t rx_mtu_drop_bytes[0x40];
>>  +    uint8_t tx_mtu_drop_bytes[0x40];
>>  +    uint8_t rx_mtr_drop_pkts[0x40];
>>  +    uint8_t tx_mtr_drop_pkts[0x40];
>>  +    uint8_t rx_mtr_drop_bytes[0x40];
>>  +    uint8_t tx_mtr_drop_bytes[0x40];
>>  +    uint8_t tx_ssvpc_pkts[0x40];
>>  +};

> Seems like 0x40 (ie 64) is a magic constant here. Is it based
> on number of VF's or other value. Should be defined as constant
> rather than open coded.

Hi maintainer,
    it's not based on number of VF's or other value. it is just a uint64_t number.
    and the number will not be modified in the future.

    Due to the fact that our PF and VF use message retrieval statistics,
    when defining the return message result, the firmware did not align the header message according to 4 bytes.
    Therefore, we used a byte stream approach to retrieve the message by byte here.

    here is we used to convert struct zxdh_ifc_hw_np_stats_bits to byte stream.

    #define ZXDH_ST_SZ_BYTES(typ) (sizeof(struct zxdh_ifc_##typ##_bits) / 8)

    #define ZXDH_GET(typ, p, fld) ({ \
	BUILD_BUG_ON(__zxdh_bit_sz(typ, fld) % 8); \
	uint32_t fld_sz = __zxdh_bit_sz(typ, fld) / 8; \
	uint8_t *addr = ZXDH_ADDR_OF(typ, p, fld); \
	zxdh_get_value(fld_sz, addr); \
    })

Thanks.

[-- Attachment #1.1.2: Type: text/html , Size: 4007 bytes --]

  parent reply	other threads:[~2025-03-21  3:23 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10  1:44 [PATCH v1 01/14] net/zxdh: add network processor registers ops Bingbin Chen
2025-02-10  1:46 ` [PATCH v1 02/14] net/zxdh: support compatibility check Bingbin Chen
2025-02-10 17:25   ` Stephen Hemminger
2025-02-10  1:47 ` [PATCH v1 03/14] net/zxdh: add agent channel Bingbin Chen
2025-02-10 17:28   ` Stephen Hemminger
2025-02-10 17:30   ` Stephen Hemminger
2025-02-10 17:31   ` Stephen Hemminger
2025-02-10 18:23   ` Stephen Hemminger
2025-02-10  1:47 ` [PATCH v1 04/14] net/zxdh: modify dtb queue ops Bingbin Chen
2025-02-10 17:31   ` Stephen Hemminger
2025-02-10  1:48 ` [PATCH v1 05/14] net/zxdh: add tables dump address ops Bingbin Chen
2025-02-10 17:33   ` Stephen Hemminger
2025-02-10  1:50 ` [PATCH v1 06/14] net/zxdh: add eram tables ops Bingbin Chen
2025-02-10  1:50   ` [PATCH v1 07/14] net/zxdh: get flow tables resources Bingbin Chen
2025-02-10 17:35     ` Stephen Hemminger
2025-02-10 17:35     ` Stephen Hemminger
2025-02-10  1:50   ` [PATCH v1 08/14] net/zxdh: support hash resources configuration Bingbin Chen
2025-02-10 17:36     ` Stephen Hemminger
2025-02-10  1:50   ` [PATCH v1 09/14] net/zxdh: implement tables initialization Bingbin Chen
2025-02-10 17:40     ` Stephen Hemminger
2025-02-10 17:43     ` Stephen Hemminger
2025-02-10  1:50   ` [PATCH v1 10/14] net/zxdh: support hash tables write and delete ops Bingbin Chen
2025-02-10 17:45     ` Stephen Hemminger
2025-02-10  1:50   ` [PATCH v1 11/14] net/zxdh: get hash table entry result Bingbin Chen
2025-02-10 17:46     ` Stephen Hemminger
2025-02-10  1:50   ` [PATCH v1 12/14] net/zxdh: delete all hash entries Bingbin Chen
2025-02-10 17:47     ` Stephen Hemminger
2025-02-10  1:50   ` [PATCH v1 13/14] net/zxdh: add acl tables ops Bingbin Chen
2025-02-10  1:50   ` [PATCH v1 14/14] net/zxdh: clean stat values Bingbin Chen
2025-02-10 17:50     ` Stephen Hemminger
2025-02-10 17:50     ` Stephen Hemminger
2025-02-10 18:19     ` Stephen Hemminger
2025-02-22  7:22 ` [PATCH v2 00/14] add network processor ops Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 01/14] net/zxdh: add network processor registers ops Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 02/14] net/zxdh: support compatibility check Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 03/14] net/zxdh: add agent channel Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 04/14] net/zxdh: modify dtb queue ops Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 05/14] net/zxdh: add tables dump address ops Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 06/14] net/zxdh: add eram tables ops Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 07/14] net/zxdh: get flow tables resources Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 08/14] net/zxdh: support hash resources configuration Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 09/14] net/zxdh: implement tables initialization Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 10/14] net/zxdh: support hash tables write and delete ops Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 11/14] net/zxdh: get hash table entry result Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 12/14] net/zxdh: delete all hash entries Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 13/14] net/zxdh: add acl tables ops Bingbin Chen
2025-02-22  7:22   ` [PATCH v2 14/14] net/zxdh: clean stat values Bingbin Chen
2025-02-22 17:34     ` Stephen Hemminger
2025-03-05  8:13 ` [PATCH v3 00/14] net/zxdh: add network processor ops Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 01/14] net/zxdh: add network processor registers ops Bingbin Chen
2025-03-17 14:57     ` [PATCH v4 00/14] net/zxdh: add network processor ops Bingbin Chen
2025-03-17 14:57       ` [PATCH v4 01/14] net/zxdh: add network processor registers ops Bingbin Chen
2025-03-19  8:57         ` [PATCH v5 00/14] net/zxdh: add network processor ops Bingbin Chen
2025-03-19  8:57           ` [PATCH v5 01/14] net/zxdh: add network processor registers ops Bingbin Chen
2025-03-19  8:57           ` [PATCH v5 02/14] net/zxdh: support compatibility check Bingbin Chen
2025-03-19  8:57           ` [PATCH v5 03/14] net/zxdh: add agent channel Bingbin Chen
2025-03-19  8:57           ` [PATCH v5 04/14] net/zxdh: modify dtb queue ops Bingbin Chen
2025-03-19  8:57           ` [PATCH v5 05/14] net/zxdh: add tables dump address ops Bingbin Chen
2025-03-19  8:58           ` [PATCH v5 06/14] net/zxdh: add eram tables ops Bingbin Chen
2025-03-19  8:58           ` [PATCH v5 07/14] net/zxdh: get flow tables resources Bingbin Chen
2025-03-19  8:58           ` [PATCH v5 08/14] net/zxdh: support hash resources configuration Bingbin Chen
2025-03-19  8:58           ` [PATCH v5 09/14] net/zxdh: implement tables initialization Bingbin Chen
2025-03-19  8:58           ` [PATCH v5 10/14] net/zxdh: support hash tables write and delete ops Bingbin Chen
2025-03-19  8:58           ` [PATCH v5 11/14] net/zxdh: get hash table entry result Bingbin Chen
2025-03-19  8:58           ` [PATCH v5 12/14] net/zxdh: delete all hash entries Bingbin Chen
2025-03-19  8:58           ` [PATCH v5 13/14] net/zxdh: add acl tables ops Bingbin Chen
2025-03-19  8:58           ` [PATCH v5 14/14] net/zxdh: fix debugging errors Bingbin Chen
2025-03-20 19:50             ` Stephen Hemminger
2025-03-21  3:07             ` Bingbin Chen [this message]
2025-03-19  9:31           ` [v5,00/14] net/zxdh: add network processor ops Bingbin Chen
2025-03-21  7:31           ` [PATCH v6 00/14] " Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 01/14] net/zxdh: add network processor registers ops Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 02/14] net/zxdh: support compatibility check Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 03/14] net/zxdh: add agent channel Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 04/14] net/zxdh: modify dtb queue ops Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 05/14] net/zxdh: add tables dump address ops Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 06/14] net/zxdh: add eram tables ops Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 07/14] net/zxdh: get flow tables resources Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 08/14] net/zxdh: support hash resources configuration Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 09/14] net/zxdh: implement tables initialization Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 10/14] net/zxdh: support hash tables write and delete ops Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 11/14] net/zxdh: get hash table entry result Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 12/14] net/zxdh: delete all hash entries Bingbin Chen
2025-03-21  7:31             ` [PATCH v6 13/14] net/zxdh: add acl tables ops Bingbin Chen
2025-03-21  7:32             ` [PATCH v6 14/14] net/zxdh: optimize msg processing ops and modify some issues Bingbin Chen
2025-03-17 14:57       ` [PATCH v4 02/14] net/zxdh: support compatibility check Bingbin Chen
2025-03-17 14:57       ` [PATCH v4 03/14] net/zxdh: add agent channel Bingbin Chen
2025-03-17 14:57       ` [PATCH v4 04/14] net/zxdh: modify dtb queue ops Bingbin Chen
2025-03-17 14:57       ` [PATCH v4 05/14] net/zxdh: add tables dump address ops Bingbin Chen
2025-03-17 14:57       ` [PATCH v4 06/14] net/zxdh: add eram tables ops Bingbin Chen
2025-03-17 14:57       ` [PATCH v4 07/14] net/zxdh: get flow tables resources Bingbin Chen
2025-03-17 14:57       ` [PATCH v4 08/14] net/zxdh: support hash resources configuration Bingbin Chen
2025-03-17 14:57       ` [PATCH v4 09/14] net/zxdh: implement tables initialization Bingbin Chen
2025-03-17 14:57       ` [PATCH v4 10/14] net/zxdh: support hash tables write and delete ops Bingbin Chen
2025-03-17 14:57       ` [PATCH v4 11/14] net/zxdh: get hash table entry result Bingbin Chen
2025-03-17 14:58       ` [PATCH v4 12/14] net/zxdh: delete all hash entries Bingbin Chen
2025-03-17 14:58       ` [PATCH v4 13/14] net/zxdh: add acl tables ops Bingbin Chen
2025-03-17 14:58       ` [PATCH v4 14/14] net/zxdh: fix debugging errors Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 02/14] net/zxdh: support compatibility check Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 03/14] net/zxdh: add agent channel Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 04/14] net/zxdh: modify dtb queue ops Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 05/14] net/zxdh: add tables dump address ops Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 06/14] net/zxdh: add eram tables ops Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 07/14] net/zxdh: get flow tables resources Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 08/14] net/zxdh: support hash resources configuration Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 09/14] net/zxdh: implement tables initialization Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 10/14] net/zxdh: support hash tables write and delete ops Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 11/14] net/zxdh: get hash table entry result Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 12/14] net/zxdh: delete all hash entries Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 13/14] net/zxdh: add acl tables ops Bingbin Chen
2025-03-05  8:13   ` [PATCH v3 14/14] net/zxdh: modify parameters of the plcr function Bingbin Chen
2025-03-10 23:19 ` [PATCH v1 01/14] net/zxdh: add network processor registers ops Stephen Hemminger

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=20250321030757.2004831-1-chen.bingbin@zte.com.cn \
    --to=chen.bingbin@zte.com.cn \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.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).