提交 2a84bbaf 编写于 作者: J Jakub Kicinski 提交者: David S. Miller

cxgb4: use tc_cls_can_offload_and_chain0()

Make use of tc_cls_can_offload_and_chain0() to set extack msg in case
ethtool tc offload flag is not set or chain unsupported.
Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: NSimon Horman <simon.horman@netronome.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3107fdc8
...@@ -2928,9 +2928,6 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate) ...@@ -2928,9 +2928,6 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate)
static int cxgb_setup_tc_flower(struct net_device *dev, static int cxgb_setup_tc_flower(struct net_device *dev,
struct tc_cls_flower_offload *cls_flower) struct tc_cls_flower_offload *cls_flower)
{ {
if (cls_flower->common.chain_index)
return -EOPNOTSUPP;
switch (cls_flower->command) { switch (cls_flower->command) {
case TC_CLSFLOWER_REPLACE: case TC_CLSFLOWER_REPLACE:
return cxgb4_tc_flower_replace(dev, cls_flower); return cxgb4_tc_flower_replace(dev, cls_flower);
...@@ -2946,9 +2943,6 @@ static int cxgb_setup_tc_flower(struct net_device *dev, ...@@ -2946,9 +2943,6 @@ static int cxgb_setup_tc_flower(struct net_device *dev,
static int cxgb_setup_tc_cls_u32(struct net_device *dev, static int cxgb_setup_tc_cls_u32(struct net_device *dev,
struct tc_cls_u32_offload *cls_u32) struct tc_cls_u32_offload *cls_u32)
{ {
if (cls_u32->common.chain_index)
return -EOPNOTSUPP;
switch (cls_u32->command) { switch (cls_u32->command) {
case TC_CLSU32_NEW_KNODE: case TC_CLSU32_NEW_KNODE:
case TC_CLSU32_REPLACE_KNODE: case TC_CLSU32_REPLACE_KNODE:
...@@ -2974,7 +2968,7 @@ static int cxgb_setup_tc_block_cb(enum tc_setup_type type, void *type_data, ...@@ -2974,7 +2968,7 @@ static int cxgb_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
return -EINVAL; return -EINVAL;
} }
if (!tc_can_offload(dev)) if (!tc_cls_can_offload_and_chain0(dev, type_data))
return -EOPNOTSUPP; return -EOPNOTSUPP;
switch (type) { switch (type) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册