Commit 54fdd80f authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller

qed: PF to reply to unknown messages

If a future VF would send the PF an unknown message, the PF today would
not send a reply. This would have 2 bad effects:
  a. VF would have to timeout on the request.
  b. If VF were to send an additional message to PF, firmware would mark
     it as malicious.

Instead, if there's some valid reply-address on the message - let the PF
answer and tell the VF it doesn't know the message.
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8246d0b4
...@@ -2857,7 +2857,6 @@ static void qed_iov_process_mbx_req(struct qed_hwfn *p_hwfn, ...@@ -2857,7 +2857,6 @@ static void qed_iov_process_mbx_req(struct qed_hwfn *p_hwfn,
{ {
struct qed_iov_vf_mbx *mbx; struct qed_iov_vf_mbx *mbx;
struct qed_vf_info *p_vf; struct qed_vf_info *p_vf;
int i;
p_vf = qed_iov_get_vf_info(p_hwfn, (u16) vfid, true); p_vf = qed_iov_get_vf_info(p_hwfn, (u16) vfid, true);
if (!p_vf) if (!p_vf)
...@@ -2866,9 +2865,8 @@ static void qed_iov_process_mbx_req(struct qed_hwfn *p_hwfn, ...@@ -2866,9 +2865,8 @@ static void qed_iov_process_mbx_req(struct qed_hwfn *p_hwfn,
mbx = &p_vf->vf_mbx; mbx = &p_vf->vf_mbx;
/* qed_iov_process_mbx_request */ /* qed_iov_process_mbx_request */
DP_VERBOSE(p_hwfn, DP_VERBOSE(p_hwfn, QED_MSG_IOV,
QED_MSG_IOV, "VF[%02x]: Processing mailbox message\n", p_vf->abs_vf_id);
"qed_iov_process_mbx_req vfid %d\n", p_vf->abs_vf_id);
mbx->first_tlv = mbx->req_virt->first_tlv; mbx->first_tlv = mbx->req_virt->first_tlv;
...@@ -2922,15 +2920,28 @@ static void qed_iov_process_mbx_req(struct qed_hwfn *p_hwfn, ...@@ -2922,15 +2920,28 @@ static void qed_iov_process_mbx_req(struct qed_hwfn *p_hwfn,
* support them. Or this may be because someone wrote a crappy * support them. Or this may be because someone wrote a crappy
* VF driver and is sending garbage over the channel. * VF driver and is sending garbage over the channel.
*/ */
DP_ERR(p_hwfn, DP_NOTICE(p_hwfn,
"unknown TLV. type %d length %d. first 20 bytes of mailbox buffer:\n", "VF[%02x]: unknown TLV. type %04x length %04x padding %08x reply address %llu\n",
mbx->first_tlv.tl.type, mbx->first_tlv.tl.length); p_vf->abs_vf_id,
mbx->first_tlv.tl.type,
for (i = 0; i < 20; i++) { mbx->first_tlv.tl.length,
mbx->first_tlv.padding, mbx->first_tlv.reply_address);
/* Try replying in case reply address matches the acquisition's
* posted address.
*/
if (p_vf->acquire.first_tlv.reply_address &&
(mbx->first_tlv.reply_address ==
p_vf->acquire.first_tlv.reply_address)) {
qed_iov_prepare_resp(p_hwfn, p_ptt, p_vf,
mbx->first_tlv.tl.type,
sizeof(struct pfvf_def_resp_tlv),
PFVF_STATUS_NOT_SUPPORTED);
} else {
DP_VERBOSE(p_hwfn, DP_VERBOSE(p_hwfn,
QED_MSG_IOV, QED_MSG_IOV,
"%x ", "VF[%02x]: Can't respond to TLV - no valid reply address\n",
mbx->req_virt->tlv_buf_size.tlv_buffer[i]); p_vf->abs_vf_id);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment