Re: [net-next PATCH V3] octeontx2-af: Install TC filter rules in hardware based on priority

From: Simon Horman
Date: Wed Jul 19 2023 - 16:31:44 EST


On Tue, Jul 18, 2023 at 10:10:49AM +0530, Suman Ghosh wrote:
> As of today, hardware does not support installing tc filter
> rules based on priority. This patch adds support to install
> the hardware rules based on priority. The final hardware rules
> will not be dependent on rule installation order, it will be strictly
> priority based, same as software.
>
> Signed-off-by: Suman Ghosh <sumang@xxxxxxxxxxx>

...

> @@ -729,22 +816,106 @@ static int otx2_del_mcam_flow_entry(struct otx2_nic *nic, u16 entry)
> mutex_unlock(&nic->mbox.lock);
> return -EFAULT;
> }
> +
> + if (cntr_val) {
> + rsp = (struct npc_delete_flow_rsp *)otx2_mbox_get_rsp(&nic->mbox.mbox,
> + 0, &req->hdr);
> + *cntr_val = rsp->cntr_val;

Hi Suman,

otx2_mbox_get_rsp may return an ERR_PTR.
Is it ok not to check that before dereferencing rsp?

> + }
> +
> mutex_unlock(&nic->mbox.lock);
> + return 0;
> +}

...