From: Stephen Hemminger <stephen@networkplumber.org>
To: fengchengwen <fengchengwen@huawei.com>
Cc: Bingbin Chen <chen.bingbin@zte.com.cn>,
<ivan.malov@arknetworks.am>, <wang.junlong1@zte.com.cn>,
<yang.yonggang@zte.com.cn>, <dev@dpdk.org>
Subject: Re: [PATCH v5 2/2] net/zxdh: add support flow director ops
Date: Fri, 15 Aug 2025 09:01:28 -0700 [thread overview]
Message-ID: <20250815090128.1eb86b40@hermes.local> (raw)
In-Reply-To: <8b5a9c85-0c12-4afd-997b-b190a426597d@huawei.com>
On Fri, 15 Aug 2025 09:33:17 +0800
fengchengwen <fengchengwen@huawei.com> wrote:
> Hi Stephen,
>
> On 8/15/2025 12:59 AM, Stephen Hemminger wrote:
> > On Thu, 14 Aug 2025 10:52:42 +0800
> > Bingbin Chen <chen.bingbin@zte.com.cn> wrote:
> >
> >> + } else {
> >> + entry = calloc(1, sizeof(struct rte_flow));
> >> + entry_flow = calloc(1, sizeof(struct zxdh_flow));
> >> + TAILQ_FOREACH(entry, &hw->dh_flow_list, next) {
> >> + entry_flow = (struct zxdh_flow *)entry->driver_flow;
> >> + offlow_key_dump(&entry_flow->flowentry.fd_flow.key,
> >> + &entry_flow->flowentry.fd_flow.key_mask, file);
> >> + offlow_result_dump(&entry_flow->flowentry.fd_flow.result, file);
> >> + }
> >> + rte_free(entry_flow);
> >> + rte_free(entry)
> >
> > Use the right free function!
> >
> > ==== 20 line log output for Ubuntu 24.04 (dpdk_unit_test): ====
> > ../drivers/net/zxdh/zxdh_flow.c:641:36: note: returned from 'calloc'
> > 641 | key_mask = calloc(1, sizeof(struct fd_flow_key) * ZXDH_MAX_FLOW_NUM);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > ../drivers/net/zxdh/zxdh_flow.c:689:9: error: 'rte_free' called on pointer returned from a mismatched allocation function [-Werror=mismatched-dealloc]
> > 689 | rte_free(key);
> > | ^~~~~~~~~~~~~
> > ../drivers/net/zxdh/zxdh_flow.c:640:31: note: returned from 'calloc'
> > 640 | key = calloc(1, sizeof(struct fd_flow_key) * ZXDH_MAX_FLOW_NUM);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > ../drivers/net/zxdh/zxdh_flow.c:690:9: error: 'rte_free' called on pointer returned from a mismatched allocation function [-Werror=mismatched-dealloc]
> > 690 | rte_free(fd_entry);
> > | ^~~~~~~~~~~~~~~~~~
> > ../drivers/net/zxdh/zxdh_flow.c:639:36: note: returned from 'calloc'
> > 639 | fd_entry = calloc(1, sizeof(ZXDH_DTB_ACL_ENTRY_INFO_T) * ZXDH_MAX_FLOW_NUM);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > cc1: all warnings being treated as errors
>
> Just curiosity, which test catch this error? There are no driver rte_flow API test in meson test as I know.
>
> Thanks
>
>
It is caught at compile time with any recent version of Gcc or Clang and glibc.
The function attributes used hint the compiler on what the object free routine is.
next prev parent reply other threads:[~2025-08-15 16:01 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 9:31 [PATCH v1 0/2] " Bingbin Chen
2025-06-17 9:32 ` [PATCH v1 1/2] net/zxdh: npsdk add flow director table ops Bingbin Chen
2025-06-17 14:07 ` Stephen Hemminger
2025-06-17 14:08 ` Stephen Hemminger
2025-06-17 9:32 ` [PATCH v1 2/2] net/zxdh: add support flow director ops Bingbin Chen
2025-06-18 7:49 ` [PATCH v2 0/2] " Bingbin Chen
2025-06-18 7:49 ` [PATCH v2 1/2] net/zxdh: npsdk add flow director table ops Bingbin Chen
2025-06-18 7:49 ` [PATCH v2 2/2] net/zxdh: add support flow director ops Bingbin Chen
2025-06-30 16:56 ` Stephen Hemminger
2025-07-02 7:34 ` [PATCH v3 0/2] " Bingbin Chen
2025-07-02 7:34 ` [PATCH v3 1/2] net/zxdh: npsdk add flow director table ops Bingbin Chen
2025-07-02 7:34 ` [PATCH v3 2/2] net/zxdh: add support flow director ops Bingbin Chen
2025-07-02 15:02 ` Stephen Hemminger
2025-08-03 17:34 ` Stephen Hemminger
2025-08-08 7:10 ` [PATCH v4 0/2] " Junlong Wang
2025-08-08 7:10 ` [PATCH v4 1/2] net/zxdh: npsdk add flow director table ops Junlong Wang
2025-08-08 7:10 ` [PATCH v4 2/2] net/zxdh: add support flow director ops Junlong Wang
2025-08-08 9:15 ` Ivan Malov
2025-08-08 16:12 ` Stephen Hemminger
2025-08-12 1:23 ` [v4,2/2] " Junlong Wang
2025-08-12 4:04 ` Ivan Malov
2025-08-12 7:19 ` Junlong Wang
2025-08-12 7:36 ` Ivan Malov
2025-08-12 10:47 ` Junlong Wang
2025-08-14 2:52 ` [PATCH v5 0/2] " Bingbin Chen
2025-08-14 2:52 ` [PATCH v5 1/2] net/zxdh: npsdk add flow director table ops Bingbin Chen
2025-08-14 2:52 ` [PATCH v5 2/2] net/zxdh: add support flow director ops Bingbin Chen
2025-08-14 16:59 ` Stephen Hemminger
2025-08-15 1:33 ` fengchengwen
2025-08-15 16:01 ` Stephen Hemminger [this message]
2025-08-15 7:42 ` [PATCH v6 0/2] " Bingbin Chen
2025-08-15 7:42 ` [PATCH v6 1/2] net/zxdh: npsdk add flow director table ops Bingbin Chen
2025-08-15 7:42 ` [PATCH v6 2/2] net/zxdh: add support flow director ops Bingbin Chen
2025-08-15 8:00 ` Ivan Malov
2025-08-15 15:23 ` [PATCH v5 0/2] " Patrick Robb
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=20250815090128.1eb86b40@hermes.local \
--to=stephen@networkplumber.org \
--cc=chen.bingbin@zte.com.cn \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=ivan.malov@arknetworks.am \
--cc=wang.junlong1@zte.com.cn \
--cc=yang.yonggang@zte.com.cn \
/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).