From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org, alexanderduyck@fb.com,
jacob.e.keller@intel.com, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next v2 5/9] eth: fbnic: support allocating FW completions with extra space
Date: Mon, 15 Sep 2025 08:53:08 -0700 [thread overview]
Message-ID: <20250915155312.1083292-6-kuba@kernel.org> (raw)
In-Reply-To: <20250915155312.1083292-1-kuba@kernel.org>
Support allocating extra space after the FW completion.
This makes it easy to pass extra variable size buffer space
to FW response handlers without worrying about synchronization
(completion itself is already refcounted).
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/meta/fbnic/fbnic_fw.h | 2 ++
drivers/net/ethernet/meta/fbnic/fbnic_fw.c | 10 ++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_fw.h b/drivers/net/ethernet/meta/fbnic/fbnic_fw.h
index be7f2dc88698..d4c0fb4c94cc 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_fw.h
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_fw.h
@@ -100,6 +100,8 @@ int fbnic_fw_xmit_tsene_read_msg(struct fbnic_dev *fbd,
int fbnic_fw_xmit_send_logs(struct fbnic_dev *fbd, bool enable,
bool send_log_history);
int fbnic_fw_xmit_rpc_macda_sync(struct fbnic_dev *fbd);
+struct fbnic_fw_completion *__fbnic_fw_alloc_cmpl(u32 msg_type,
+ size_t priv_size);
struct fbnic_fw_completion *fbnic_fw_alloc_cmpl(u32 msg_type);
void fbnic_fw_put_cmpl(struct fbnic_fw_completion *cmpl_data);
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_fw.c b/drivers/net/ethernet/meta/fbnic/fbnic_fw.c
index e40dfd645414..621a574e0b0d 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_fw.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_fw.c
@@ -1542,11 +1542,12 @@ void fbnic_get_fw_ver_commit_str(struct fbnic_dev *fbd, char *fw_version,
fw_version, str_sz);
}
-struct fbnic_fw_completion *fbnic_fw_alloc_cmpl(u32 msg_type)
+struct fbnic_fw_completion *__fbnic_fw_alloc_cmpl(u32 msg_type,
+ size_t priv_size)
{
struct fbnic_fw_completion *cmpl;
- cmpl = kzalloc(sizeof(*cmpl), GFP_KERNEL);
+ cmpl = kzalloc(sizeof(*cmpl) + priv_size, GFP_KERNEL);
if (!cmpl)
return NULL;
@@ -1557,6 +1558,11 @@ struct fbnic_fw_completion *fbnic_fw_alloc_cmpl(u32 msg_type)
return cmpl;
}
+struct fbnic_fw_completion *fbnic_fw_alloc_cmpl(u32 msg_type)
+{
+ return __fbnic_fw_alloc_cmpl(msg_type, 0);
+}
+
void fbnic_fw_put_cmpl(struct fbnic_fw_completion *fw_cmpl)
{
kref_put(&fw_cmpl->ref_count, fbnic_fw_release_cmpl_data);
--
2.51.0
next prev parent reply other threads:[~2025-09-15 15:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-15 15:53 [PATCH net-next v2 0/9] eth: fbnic: add devlink health support for FW crashes and OTP mem corruptions Jakub Kicinski
2025-09-15 15:53 ` [PATCH net-next v2 1/9] eth: fbnic: make fbnic_fw_log_write() parameter const Jakub Kicinski
2025-09-16 12:31 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 2/9] eth: fbnic: use fw uptime to detect fw crashes Jakub Kicinski
2025-09-16 12:34 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 3/9] eth: fbnic: factor out clearing the action TCAM Jakub Kicinski
2025-09-16 12:35 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 4/9] eth: fbnic: reprogram TCAMs after FW crash Jakub Kicinski
2025-09-16 12:36 ` Simon Horman
2025-09-15 15:53 ` Jakub Kicinski [this message]
2025-09-16 12:36 ` [PATCH net-next v2 5/9] eth: fbnic: support allocating FW completions with extra space Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 6/9] eth: fbnic: support FW communication for core dump Jakub Kicinski
2025-09-16 12:36 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 7/9] eth: fbnic: add FW health reporter Jakub Kicinski
2025-09-16 12:36 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 8/9] eth: fbnic: report FW uptime in health diagnose Jakub Kicinski
2025-09-16 1:35 ` Lee Trager
2025-09-16 1:56 ` Jakub Kicinski
2025-09-15 15:53 ` [PATCH net-next v2 9/9] eth: fbnic: add OTP health reporter Jakub Kicinski
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=20250915155312.1083292-6-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=alexanderduyck@fb.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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).