{
struct bnxt *bp = cb_priv;
- if (!bnxt_tc_flower_enabled(bp))
+ if (!bnxt_tc_flower_enabled(bp) || !tc_can_offload(bp->dev))
return -EOPNOTSUPP;
switch (type) {
struct bnxt *bp = vf_rep->bp;
int vf_fid = bp->pf.vf[vf_rep->vf_idx].fw_fid;
- if (!bnxt_tc_flower_enabled(vf_rep->bp))
+ if (!bnxt_tc_flower_enabled(vf_rep->bp) || !tc_can_offload(bp->dev))
return -EOPNOTSUPP;
switch (type) {
return -EINVAL;
}
+ if (!tc_can_offload(dev))
+ return -EOPNOTSUPP;
+
switch (type) {
case TC_SETUP_CLSU32:
return cxgb_setup_tc_cls_u32(dev, type_data);
{
struct ixgbe_adapter *adapter = cb_priv;
+ if (!tc_can_offload(adapter->netdev))
+ return -EOPNOTSUPP;
+
switch (type) {
case TC_SETUP_CLSU32:
return ixgbe_setup_tc_cls_u32(adapter, type_data);
{
struct mlx5e_priv *priv = cb_priv;
+ if (!tc_can_offload(priv->netdev))
+ return -EOPNOTSUPP;
+
switch (type) {
case TC_SETUP_CLSFLOWER:
return mlx5e_setup_tc_cls_flower(priv, type_data);
{
struct mlx5e_priv *priv = cb_priv;
+ if (!tc_can_offload(priv->netdev))
+ return -EOPNOTSUPP;
+
switch (type) {
case TC_SETUP_CLSFLOWER:
return mlx5e_rep_setup_tc_cls_flower(priv, type_data);
{
struct mlxsw_sp_port *mlxsw_sp_port = cb_priv;
+ if (!tc_can_offload(mlxsw_sp_port->dev))
+ return -EOPNOTSUPP;
+
switch (type) {
case TC_SETUP_CLSMATCHALL:
return mlxsw_sp_setup_tc_cls_matchall(mlxsw_sp_port, type_data,
struct tc_cls_bpf_offload *cls_bpf = type_data;
struct nfp_net *nn = cb_priv;
+ if (!tc_can_offload(nn->dp.netdev))
+ return -EOPNOTSUPP;
+
switch (type) {
case TC_SETUP_CLSBPF:
if (!nfp_net_ebpf_capable(nn) ||
{
struct nfp_net *nn = cb_priv;
+ if (!tc_can_offload(nn->dp.netdev))
+ return -EOPNOTSUPP;
+
switch (type) {
case TC_SETUP_CLSFLOWER:
return nfp_flower_repr_offload(nn->app, nn->port->netdev,
{
struct net_device *dev = cb_priv;
+ if (!tc_can_offload(dev))
+ return -EOPNOTSUPP;
+
switch (type) {
case TC_SETUP_CLSMATCHALL:
return dsa_slave_setup_tc_cls_matchall(dev, type_data, ingress);
struct net_device *dev = q->dev_queue->dev;
struct tc_block_offload bo = {};
- if (!tc_can_offload(dev))
+ if (!dev->netdev_ops->ndo_setup_tc)
return;
bo.command = command;
bo.binder_type = ei->binder_type;