DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] i40e base code updates
@ 2026-10-16 11:39 Anatoly Burakov
  2026-10-16 11:39 ` [PATCH v1 1/2] net/i40e/base: add get wake packet AQ command Anatoly Burakov
  2026-10-16 11:39 ` [PATCH v1 2/2] net/i40e/base: avoid implicit conversions Anatoly Burakov
  0 siblings, 2 replies; 3+ messages in thread
From: Anatoly Burakov @ 2026-10-16 11:39 UTC (permalink / raw)
  To: dev

Small base code update for i40e driver.

Oleg Akhrem (1):
  net/i40e/base: add get wake packet AQ command

Szymon T Cudzilo (1):
  net/i40e/base: avoid implicit conversions

 drivers/net/intel/i40e/base/i40e_adminq_cmd.h | 12 ++++++++++++
 drivers/net/intel/i40e/base/i40e_nvm.c        | 16 ++++++++--------
 2 files changed, 20 insertions(+), 8 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v1 1/2] net/i40e/base: add get wake packet AQ command
  2026-10-16 11:39 [PATCH v1 0/2] i40e base code updates Anatoly Burakov
@ 2026-10-16 11:39 ` Anatoly Burakov
  2026-10-16 11:39 ` [PATCH v1 2/2] net/i40e/base: avoid implicit conversions Anatoly Burakov
  1 sibling, 0 replies; 3+ messages in thread
From: Anatoly Burakov @ 2026-10-16 11:39 UTC (permalink / raw)
  To: dev, Bruce Richardson

From: Oleg Akhrem <oleg.akhrem@intel.com>

Add definitions for the Get Wake Packet Admin Queue command
(opcode 0x0122), which retrieves the firmware-saved packet that
caused a Wake Up event.

Define the command opcode, the command descriptor and the maximum
response buffer size.

Signed-off-by: Oleg Akhrem <oleg.akhrem@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/intel/i40e/base/i40e_adminq_cmd.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/intel/i40e/base/i40e_adminq_cmd.h b/drivers/net/intel/i40e/base/i40e_adminq_cmd.h
index eda19ccf32..d41a6d592a 100644
--- a/drivers/net/intel/i40e/base/i40e_adminq_cmd.h
+++ b/drivers/net/intel/i40e/base/i40e_adminq_cmd.h
@@ -138,6 +138,7 @@ enum i40e_admin_queue_opc {
 	/* WoL commands */
 	i40e_aqc_opc_set_wol_filter	= 0x0120,
 	i40e_aqc_opc_get_wake_reason	= 0x0121,
+	i40e_aqc_opc_get_wake_packet	= 0x0122,
 	i40e_aqc_opc_clear_all_wol_filters = 0x025E,
 
 	/* internal switch commands */
@@ -629,6 +630,17 @@ struct i40e_aqc_get_wake_reason_completion {
 
 I40E_CHECK_CMD_LENGTH(i40e_aqc_get_wake_reason_completion);
 
+/* Get Wake Packet (0x0122) */
+#define I40E_AQC_GET_WAKE_PACKET_BUFFER_SIZE	0x600
+
+struct i40e_aqc_get_wake_packet {
+	u8 reserved[8];
+	__le32 address_high;
+	__le32 address_low;
+};
+
+I40E_CHECK_CMD_LENGTH(i40e_aqc_get_wake_packet);
+
 /* Switch configuration commands (0x02xx) */
 
 /* Used by many indirect commands that only pass an seid and a buffer in the
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v1 2/2] net/i40e/base: avoid implicit conversions
  2026-10-16 11:39 [PATCH v1 0/2] i40e base code updates Anatoly Burakov
  2026-10-16 11:39 ` [PATCH v1 1/2] net/i40e/base: add get wake packet AQ command Anatoly Burakov
@ 2026-10-16 11:39 ` Anatoly Burakov
  1 sibling, 0 replies; 3+ messages in thread
From: Anatoly Burakov @ 2026-10-16 11:39 UTC (permalink / raw)
  To: dev, Bruce Richardson

From: Szymon T Cudzilo <szymon.t.cudzilo@intel.com>

Avoid doing implicit conversion as reported by static analysis tools.

Signed-off-by: Szymon T Cudzilo <szymon.t.cudzilo@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/intel/i40e/base/i40e_nvm.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/intel/i40e/base/i40e_nvm.c b/drivers/net/intel/i40e/base/i40e_nvm.c
index fd1a987c56..c11ebb135a 100644
--- a/drivers/net/intel/i40e/base/i40e_nvm.c
+++ b/drivers/net/intel/i40e/base/i40e_nvm.c
@@ -1414,8 +1414,8 @@ STATIC enum i40e_status_code i40e_nvmupd_state_writing(struct i40e_hw *hw,
 	 */
 	if (status && (hw->aq.asq_last_status == I40E_AQ_RC_EBUSY) &&
 	    !retry_attempt) {
+		enum i40e_admin_queue_err old_asq_status = hw->aq.asq_last_status;
 		enum i40e_status_code old_status = status;
-		u32 old_asq_status = hw->aq.asq_last_status;
 		u32 gtime;
 
 		gtime = rd32(hw, I40E_GLVFGEN_TIMER);
@@ -1656,7 +1656,7 @@ STATIC enum i40e_status_code i40e_nvmupd_exec_aq(struct i40e_hw *hw,
 		}
 
 		if (hw->nvm_buff.va) {
-			buff = hw->nvm_buff.va;
+			buff = (u8 *)hw->nvm_buff.va;
 			i40e_memcpy(buff, &bytes[aq_desc_len], aq_data_len,
 				I40E_NONDMA_TO_NONDMA);
 		}
@@ -1667,19 +1667,19 @@ STATIC enum i40e_status_code i40e_nvmupd_exec_aq(struct i40e_hw *hw,
 
 	/* and away we go! */
 	status = i40e_asq_send_command(hw, aq_desc, buff,
-				       buff_size, &cmd_details);
+				       (u16)buff_size, &cmd_details);
 	if (status) {
 		i40e_debug(hw, I40E_DEBUG_NVM,
-			   "i40e_nvmupd_exec_aq err %s aq_err %s\n",
-			   i40e_stat_str(hw, status),
-			   i40e_aq_str(hw, hw->aq.asq_last_status));
+			   "i40e_nvmupd_exec_aq err %d aq_err %d\n",
+			   status,
+			   hw->aq.asq_last_status);
 		*perrno = i40e_aq_rc_to_posix(status, hw->aq.asq_last_status);
 		return status;
 	}
 
 	/* should we wait for a followup event? */
 	if (cmd->offset) {
-		hw->nvm_wait_opcode = cmd->offset;
+		hw->nvm_wait_opcode = (u16)cmd->offset;
 		hw->nvmupd_state = I40E_NVMUPD_STATE_INIT_WAIT;
 	}
 
@@ -1739,7 +1739,7 @@ STATIC enum i40e_status_code i40e_nvmupd_get_aq_result(struct i40e_hw *hw,
 
 		bytes += len;
 		remainder -= len;
-		buff = hw->nvm_buff.va;
+		buff = (u8 *)hw->nvm_buff.va;
 	} else {
 		buff = (u8 *)hw->nvm_buff.va + (cmd->offset - aq_desc_len);
 	}
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-16 11:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 11:39 [PATCH v1 0/2] i40e base code updates Anatoly Burakov
2026-10-16 11:39 ` [PATCH v1 1/2] net/i40e/base: add get wake packet AQ command Anatoly Burakov
2026-10-16 11:39 ` [PATCH v1 2/2] net/i40e/base: avoid implicit conversions Anatoly Burakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox