Skip to contentSkip to conversation

iavf: enable tc filter configuration only if hw-tc-offload is on

PATCH In review Jun Zhang 2 participants 2 messages Jun 21, 2022 – Jul 19, 2022

Subsystems (2)
lore
Share & tools
lore

Jun Zhang

author
#0 lore raw

PATCH 1/1 iavf: enable tc filter configuration only if hw-tc-offload is on

From: Sudheer Mogilappagari <[email protected]>

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")
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/iavf/iavf_main.c +6 -0
index 57c51a15bcbc..0be1652e554c 100644
@@ -3847,6 +3847,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;
Signature · 6 lines
2.35.3

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tested-by on v1 1/1
#1 lore raw
Quoted 12 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jun Zhang
Sent: Wednesday, June 22, 2022 12:09 AM
To: [email protected]
Subject: [Intel-wired-lan] [PATCH net v1] iavf: enable tc filter configuration only if hw-tc-offload is on

From: Sudheer Mogilappagari <[email protected]>

Quoted 9 lines

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")
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan