Re: [PATCH net-next V4 09/14] net/mlx5e: psp: Add an rx_decap steering table
From: Daniel Zahka
Date: Tue Sep 08 2026 - 19:32:17 EST
On Tue Sep 8, 2026 at 2:52 AM EDT, Tariq Toukan wrote:
> From: Cosmin Ratiu <cratiu@xxxxxxxxxx>
>
> +static void accel_psp_fs_rx_reconfigure(struct mlx5e_psp_fs *fs,
> + bool decap_wanted)
> +{
> + bool decap_supported =
> + MLX5_CAP_FLOWTABLE(fs->mdev,
> + flow_table_properties_nic_receive.reformat_del_psp_transport);
not for this series, but this makes me think having some way of letting
the user know whether or not psp with hw gro is enabled would be nice,
so that they don't wonder why stuff isn't coalescing when they have old
fw like I do :) I could see a similar thing being useful for gso
features if the psp device can't segment something that it otherwise can
for non-psp.
> + bool decap_enable = decap_wanted && decap_supported;
> + struct mlx5_flow_destination dest = {};
> + int err;
> +
> + if (decap_enable == fs->decap_enabled)
> + return;
> +
> + /* Create the decap table if needed. */
> + if (decap_enable && !fs->decap.ft) {
> + err = accel_psp_fs_rx_decap_ft_create(fs, &fs->decap);
> + if (err)
> + goto out_err;
> + }
> +
> + /* Redirect traffic to the correct table. */
> + dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
> + dest.ft = decap_enable ? fs->decap.ft : fs->rx.ft;
> + err = mlx5_modify_rule_destination(fs->check.rule, &dest, NULL);
> + if (err)
> + goto out_err;
> +
> + fs->decap_enabled = decap_enable;
> + return;
> +
> +out_err:
> + mlx5_core_warn(fs->mdev,
> + "Failed to create/modify PSP decapsulation rules (err %d), HW GRO for PSP unavailable\n",
> + err);
> +}