Re: [PATCH net] octeontx2-af: Promisc enable/disable through mbox

From: Michal Kubiak
Date: Wed Jul 05 2023 - 09:34:17 EST


On Wed, Jul 05, 2023 at 09:08:13AM +0530, Ratheesh Kannoth wrote:
> In Legacy silicon, promisc mode is only modified
> through CGX mbox messages. In CN10KB silicon, it modified
> from CGX mbox and NIX. This breaks legacy application
> behaviour. Fix this by removing call from NIX.
>
> Fixes: d6c9784baf59 ("octeontx2-af: Invoke exact match functions if supported")
> Signed-off-by: Ratheesh Kannoth <rkannoth@xxxxxxxxxxx>

Please follow the Patchwork report.
There are several lines exceeding 80 characters.

Thanks,
Michal

> @@ -1177,13 +1179,16 @@ static u16 __rvu_npc_exact_cmd_rules_cnt_update(struct rvu *rvu, int drop_mcam_i
>
> *enable_or_disable_cam = false;
>
> - /* If all rules are deleted, disable cam */
> + if (promisc)
> + goto done;
> +
> + /* If all rules are deleted and not already in promisc mode; disable cam */

Line length above 80 characters.

> if (!*cnt && val < 0) {
> *enable_or_disable_cam = true;
> goto done;
> }
>
> - /* If rule got added, enable cam */
> + /* If rule got added and not already in promisc mode; enable cam */
> if (!old_cnt && val > 0) {
> *enable_or_disable_cam = true;
> goto done;
> @@ -1462,6 +1467,11 @@ int rvu_npc_exact_promisc_disable(struct rvu *rvu, u16 pcifunc)
> *promisc = false;
> mutex_unlock(&table->lock);
>
> + /* Enable drop rule */
> + rvu_npc_enable_mcam_by_entry_index(rvu, drop_mcam_idx, NIX_INTF_RX, true);

Line length above 80 characters.

> +
> + dev_dbg(rvu->dev, "%s: disabled promisc mode (cgx=%d lmac=%d)\n",
> + __func__, cgx_id, lmac_id);
> return 0;
> }
>
> @@ -1503,6 +1513,11 @@ int rvu_npc_exact_promisc_enable(struct rvu *rvu, u16 pcifunc)
> *promisc = true;
> mutex_unlock(&table->lock);
>
> + /* disable drop rule */
> + rvu_npc_enable_mcam_by_entry_index(rvu, drop_mcam_idx, NIX_INTF_RX, false);

Line length above 80 characters.