Skip to content

Commit 21e2f6b

Browse files
jpirkogregkh
authored andcommitted
iavf: use tc_cls_can_offload_and_chain0() instead of chain check
[ Upstream commit bb0858d ] Looks like the iavf code actually experienced a race condition, when a developer took code before the check for chain 0 was put to helper. So use tc_cls_can_offload_and_chain0() helper instead of direct check and move the check to _cb() so this is similar to i40e code. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0d5984b commit 21e2f6b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3077,9 +3077,6 @@ static int iavf_delete_clsflower(struct iavf_adapter *adapter,
30773077
static int iavf_setup_tc_cls_flower(struct iavf_adapter *adapter,
30783078
struct flow_cls_offload *cls_flower)
30793079
{
3080-
if (cls_flower->common.chain_index)
3081-
return -EOPNOTSUPP;
3082-
30833080
switch (cls_flower->command) {
30843081
case FLOW_CLS_REPLACE:
30853082
return iavf_configure_clsflower(adapter, cls_flower);
@@ -3103,6 +3100,11 @@ static int iavf_setup_tc_cls_flower(struct iavf_adapter *adapter,
31033100
static int iavf_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
31043101
void *cb_priv)
31053102
{
3103+
struct iavf_adapter *adapter = cb_priv;
3104+
3105+
if (!tc_cls_can_offload_and_chain0(adapter->netdev, type_data))
3106+
return -EOPNOTSUPP;
3107+
31063108
switch (type) {
31073109
case TC_SETUP_CLSFLOWER:
31083110
return iavf_setup_tc_cls_flower(cb_priv, type_data);

0 commit comments

Comments
 (0)