|
@@ -115,10 +115,11 @@ bnxt_vf_rep_get_stats64(struct net_device *dev,
|
|
stats->tx_bytes = vf_rep->tx_stats.bytes;
|
|
stats->tx_bytes = vf_rep->tx_stats.bytes;
|
|
}
|
|
}
|
|
|
|
|
|
-static int bnxt_vf_rep_setup_tc(struct net_device *dev, enum tc_setup_type type,
|
|
|
|
- void *type_data)
|
|
|
|
|
|
+static int bnxt_vf_rep_setup_tc_block_cb(enum tc_setup_type type,
|
|
|
|
+ void *type_data,
|
|
|
|
+ void *cb_priv)
|
|
{
|
|
{
|
|
- struct bnxt_vf_rep *vf_rep = netdev_priv(dev);
|
|
|
|
|
|
+ struct bnxt_vf_rep *vf_rep = cb_priv;
|
|
struct bnxt *bp = vf_rep->bp;
|
|
struct bnxt *bp = vf_rep->bp;
|
|
int vf_fid = bp->pf.vf[vf_rep->vf_idx].fw_fid;
|
|
int vf_fid = bp->pf.vf[vf_rep->vf_idx].fw_fid;
|
|
|
|
|
|
@@ -130,6 +131,42 @@ static int bnxt_vf_rep_setup_tc(struct net_device *dev, enum tc_setup_type type,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int bnxt_vf_rep_setup_tc_block(struct net_device *dev,
|
|
|
|
+ struct tc_block_offload *f)
|
|
|
|
+{
|
|
|
|
+ struct bnxt_vf_rep *vf_rep = netdev_priv(dev);
|
|
|
|
+
|
|
|
|
+ if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
|
|
|
|
+ return -EOPNOTSUPP;
|
|
|
|
+
|
|
|
|
+ switch (f->command) {
|
|
|
|
+ case TC_BLOCK_BIND:
|
|
|
|
+ return tcf_block_cb_register(f->block,
|
|
|
|
+ bnxt_vf_rep_setup_tc_block_cb,
|
|
|
|
+ vf_rep, vf_rep);
|
|
|
|
+ return 0;
|
|
|
|
+ case TC_BLOCK_UNBIND:
|
|
|
|
+ tcf_block_cb_unregister(f->block,
|
|
|
|
+ bnxt_vf_rep_setup_tc_block_cb, vf_rep);
|
|
|
|
+ return 0;
|
|
|
|
+ default:
|
|
|
|
+ return -EOPNOTSUPP;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int bnxt_vf_rep_setup_tc(struct net_device *dev, enum tc_setup_type type,
|
|
|
|
+ void *type_data)
|
|
|
|
+{
|
|
|
|
+ switch (type) {
|
|
|
|
+ case TC_SETUP_CLSFLOWER:
|
|
|
|
+ return 0; /* will be removed after conversion from ndo */
|
|
|
|
+ case TC_SETUP_BLOCK:
|
|
|
|
+ return bnxt_vf_rep_setup_tc_block(dev, type_data);
|
|
|
|
+ default:
|
|
|
|
+ return -EOPNOTSUPP;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code)
|
|
struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code)
|
|
{
|
|
{
|
|
u16 vf_idx;
|
|
u16 vf_idx;
|