[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220725194547.0702bd73@kernel.org>
Date: Mon, 25 Jul 2022 19:45:47 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Tony Nguyen <anthony.l.nguyen@...el.com>
Cc: davem@...emloft.net, pabeni@...hat.com, edumazet@...gle.com,
Sudheer Mogilappagari <sudheer.mogilappagari@...el.com>,
netdev@...r.kernel.org, Jun Zhang <xuejun.zhang@...el.com>,
Bharathi Sreenivas <bharathi.sreenivas@...el.com>
Subject: Re: [PATCH net 3/3] iavf: enable tc filter configuration only if
hw-tc-offload is on
On Mon, 25 Jul 2022 10:04:52 -0700 Tony Nguyen wrote:
> From: Sudheer Mogilappagari <sudheer.mogilappagari@...el.com>
>
> Allow configuration of tc filter only if NETIF_F_HW_TC is set for the
> device.
>
> Fixes: 0075fa0fadd0 ("i40evf: Add support to apply cloud filters")
> Signed-off-by: Sudheer Mogilappagari <sudheer.mogilappagari@...el.com>
> Signed-off-by: Jun Zhang <xuejun.zhang@...el.com>
> Tested-by: Bharathi Sreenivas <bharathi.sreenivas@...el.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>
> ---
> drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 3dbfaead2ac7..9279bb37e4aa 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -3802,6 +3802,12 @@ static int iavf_configure_clsflower(struct iavf_adapter *adapter,
> return -EINVAL;
> }
>
> + if (!(adapter->netdev->features & NETIF_F_HW_TC)) {
> + dev_err(&adapter->pdev->dev,
> + "Can't apply TC flower filters, turn ON hw-tc-offload and try again");
> + return -EOPNOTSUPP;
> + }
> +
> filter = kzalloc(sizeof(*filter), GFP_KERNEL);
> if (!filter)
> return -ENOMEM;
tc_can_offload() checks this in the core already, no?
Powered by blists - more mailing lists