Skip to content

Commit a317f87

Browse files
ansamalintelkuba-moo
authored andcommitted
ice: Extend Sideband Queue command to support flags
Current driver implementation for Sideband Queue supports a fixed flag (ICE_AQ_FLAG_RD). To retrieve FEC statistics from firmware, Sideband Queue command is used with a different flag. Extend API for Sideband Queue command to use 'flags' as input argument. Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Jesse Brandeburg <[email protected]> Signed-off-by: Anil Samal <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d00ba1d commit a317f87

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,8 +1497,9 @@ ice_sbq_send_cmd(struct ice_hw *hw, struct ice_sbq_cmd_desc *desc,
14971497
* ice_sbq_rw_reg - Fill Sideband Queue command
14981498
* @hw: pointer to the HW struct
14991499
* @in: message info to be filled in descriptor
1500+
* @flags: control queue descriptor flags
15001501
*/
1501-
int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in)
1502+
int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in, u16 flags)
15021503
{
15031504
struct ice_sbq_cmd_desc desc = {0};
15041505
struct ice_sbq_msg_req msg = {0};
@@ -1522,7 +1523,7 @@ int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in)
15221523
*/
15231524
msg_len -= sizeof(msg.data);
15241525

1525-
desc.flags = cpu_to_le16(ICE_AQ_FLAG_RD);
1526+
desc.flags = cpu_to_le16(flags);
15261527
desc.opcode = cpu_to_le16(ice_sbq_opc_neigh_dev_req);
15271528
desc.param0.cmd_len = cpu_to_le16(msg_len);
15281529
status = ice_sbq_send_cmd(hw, &desc, &msg, msg_len, NULL);

drivers/net/ethernet/intel/ice/ice_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ int ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle);
201201
void ice_replay_post(struct ice_hw *hw);
202202
struct ice_q_ctx *
203203
ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle);
204-
int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in);
204+
int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in, u16 flag);
205205
int
206206
ice_aq_get_cgu_abilities(struct ice_hw *hw,
207207
struct ice_aqc_get_cgu_abilities *abilities);

drivers/net/ethernet/intel/ice/ice_ptp_hw.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ static int ice_read_cgu_reg_e82x(struct ice_hw *hw, u32 addr, u32 *val)
247247
};
248248
int err;
249249

250-
err = ice_sbq_rw_reg(hw, &cgu_msg);
250+
err = ice_sbq_rw_reg(hw, &cgu_msg, ICE_AQ_FLAG_RD);
251251
if (err) {
252252
ice_debug(hw, ICE_DBG_PTP, "Failed to read CGU register 0x%04x, err %d\n",
253253
addr, err);
@@ -280,7 +280,7 @@ static int ice_write_cgu_reg_e82x(struct ice_hw *hw, u32 addr, u32 val)
280280
};
281281
int err;
282282

283-
err = ice_sbq_rw_reg(hw, &cgu_msg);
283+
err = ice_sbq_rw_reg(hw, &cgu_msg, ICE_AQ_FLAG_RD);
284284
if (err) {
285285
ice_debug(hw, ICE_DBG_PTP, "Failed to write CGU register 0x%04x, err %d\n",
286286
addr, err);
@@ -902,7 +902,7 @@ static int ice_write_phy_eth56g(struct ice_hw *hw, u8 phy_idx, u32 addr,
902902
phy_msg.data = val;
903903
phy_msg.dest_dev = hw->ptp.phy.eth56g.phy_addr[phy_idx];
904904

905-
err = ice_sbq_rw_reg(hw, &phy_msg);
905+
err = ice_sbq_rw_reg(hw, &phy_msg, ICE_AQ_FLAG_RD);
906906

907907
if (err)
908908
ice_debug(hw, ICE_DBG_PTP, "PTP failed to send msg to phy %d\n",
@@ -934,7 +934,7 @@ static int ice_read_phy_eth56g(struct ice_hw *hw, u8 phy_idx, u32 addr,
934934
phy_msg.data = 0;
935935
phy_msg.dest_dev = hw->ptp.phy.eth56g.phy_addr[phy_idx];
936936

937-
err = ice_sbq_rw_reg(hw, &phy_msg);
937+
err = ice_sbq_rw_reg(hw, &phy_msg, ICE_AQ_FLAG_RD);
938938
if (err) {
939939
ice_debug(hw, ICE_DBG_PTP, "PTP failed to send msg to phy %d\n",
940940
err);
@@ -2855,7 +2855,7 @@ ice_read_phy_reg_e82x(struct ice_hw *hw, u8 port, u16 offset, u32 *val)
28552855
ice_fill_phy_msg_e82x(hw, &msg, port, offset);
28562856
msg.opcode = ice_sbq_msg_rd;
28572857

2858-
err = ice_sbq_rw_reg(hw, &msg);
2858+
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
28592859
if (err) {
28602860
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
28612861
err);
@@ -2933,7 +2933,7 @@ ice_write_phy_reg_e82x(struct ice_hw *hw, u8 port, u16 offset, u32 val)
29332933
msg.opcode = ice_sbq_msg_wr;
29342934
msg.data = val;
29352935

2936-
err = ice_sbq_rw_reg(hw, &msg);
2936+
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
29372937
if (err) {
29382938
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
29392939
err);
@@ -3094,7 +3094,7 @@ ice_read_quad_reg_e82x(struct ice_hw *hw, u8 quad, u16 offset, u32 *val)
30943094

30953095
msg.opcode = ice_sbq_msg_rd;
30963096

3097-
err = ice_sbq_rw_reg(hw, &msg);
3097+
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
30983098
if (err) {
30993099
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
31003100
err);
@@ -3129,7 +3129,7 @@ ice_write_quad_reg_e82x(struct ice_hw *hw, u8 quad, u16 offset, u32 val)
31293129
msg.opcode = ice_sbq_msg_wr;
31303130
msg.data = val;
31313131

3132-
err = ice_sbq_rw_reg(hw, &msg);
3132+
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
31333133
if (err) {
31343134
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
31353135
err);
@@ -4780,7 +4780,7 @@ static int ice_read_phy_reg_e810(struct ice_hw *hw, u32 addr, u32 *val)
47804780
msg.opcode = ice_sbq_msg_rd;
47814781
msg.dest_dev = rmn_0;
47824782

4783-
err = ice_sbq_rw_reg(hw, &msg);
4783+
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
47844784
if (err) {
47854785
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
47864786
err);
@@ -4811,7 +4811,7 @@ static int ice_write_phy_reg_e810(struct ice_hw *hw, u32 addr, u32 val)
48114811
msg.dest_dev = rmn_0;
48124812
msg.data = val;
48134813

4814-
err = ice_sbq_rw_reg(hw, &msg);
4814+
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
48154815
if (err) {
48164816
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
48174817
err);

0 commit comments

Comments
 (0)