#undef S
#undef U
+ /*
+ * If the user is requesting that the filter action loop
+ * matching packets back out one of our ports, make sure that
+ * the egress port is in range.
+ */
+ if (fs->action == FILTER_SWITCH &&
+ fs->eport >= adapter->params.nports)
+ return -ERANGE;
+
/*
* Don't allow various trivially obvious bogus out-of-range
* values ...
req->opt0 = cpu_to_be64(V_DELACK(f->fs.hitcnts) |
V_SMAC_SEL((cxgbe_port_viid(f->dev) & 0x7F)
<< 1) |
+ V_TX_CHAN(f->fs.eport) |
V_ULP_MODE(ULP_MODE_NONE) |
F_TCAM_BYPASS | F_NON_OFFLOAD);
req->params = cpu_to_be64(V_FILTER_TUPLE(hash_filter_ntuple(f)));
F_T5_OPT_2_VALID |
F_RX_CHANNEL |
V_CONG_CNTRL((f->fs.action == FILTER_DROP) |
- (f->fs.dirsteer << 1)));
+ (f->fs.dirsteer << 1)) |
+ V_CCTRL_ECN(f->fs.action == FILTER_SWITCH));
}
/**
req->opt0 = cpu_to_be64(V_DELACK(f->fs.hitcnts) |
V_SMAC_SEL((cxgbe_port_viid(f->dev) & 0x7F)
<< 1) |
+ V_TX_CHAN(f->fs.eport) |
V_ULP_MODE(ULP_MODE_NONE) |
F_TCAM_BYPASS | F_NON_OFFLOAD);
req->params = cpu_to_be64(V_FILTER_TUPLE(hash_filter_ntuple(f)));
F_T5_OPT_2_VALID |
F_RX_CHANNEL |
V_CONG_CNTRL((f->fs.action == FILTER_DROP) |
- (f->fs.dirsteer << 1)));
+ (f->fs.dirsteer << 1)) |
+ V_CCTRL_ECN(f->fs.action == FILTER_SWITCH));
}
/**
fwr->del_filter_to_l2tix =
cpu_to_be32(V_FW_FILTER_WR_DROP(f->fs.action == FILTER_DROP) |
V_FW_FILTER_WR_DIRSTEER(f->fs.dirsteer) |
+ V_FW_FILTER_WR_LPBK(f->fs.action == FILTER_SWITCH) |
V_FW_FILTER_WR_HITCNTS(f->fs.hitcnts) |
+ V_FW_FILTER_WR_TXCHAN(f->fs.eport) |
V_FW_FILTER_WR_PRIO(f->fs.prio));
fwr->ethtype = cpu_to_be16(f->fs.val.ethtype);
fwr->ethtypem = cpu_to_be16(f->fs.mask.ethtype);