#define V_TCB_TIMESTAMP(x) ((x) << S_TCB_TIMESTAMP)
/* 223:192 */
+#define W_TCB_T_RTT_TS_RECENT_AGE 6
#define S_TCB_T_RTT_TS_RECENT_AGE 0
#define M_TCB_T_RTT_TS_RECENT_AGE 0xffffffffULL
#define V_TCB_T_RTT_TS_RECENT_AGE(x) ((x) << S_TCB_T_RTT_TS_RECENT_AGE)
+/* 255:224 */
+#define S_TCB_T_RTSEQ_RECENT 0
+#define M_TCB_T_RTSEQ_RECENT 0xffffffffULL
+#define V_TCB_T_RTSEQ_RECENT(x) ((x) << S_TCB_T_RTSEQ_RECENT)
+
#define S_TF_CCTRL_RFR 62
#endif /* _T4_TCB_DEFS_H */
return 0;
}
+/*
+ * Clear the packet count for the specified filter.
+ */
+int cxgbe_clear_filter_count(struct adapter *adapter, unsigned int fidx,
+ int hash, bool clear_byte)
+{
+ u64 tcb_mask = 0, tcb_val = 0;
+ struct filter_entry *f = NULL;
+ u16 tcb_word = 0;
+
+ if (is_hashfilter(adapter) && hash) {
+ if (fidx >= adapter->tids.ntids)
+ return -ERANGE;
+
+ /* No hitcounts supported for T5 hashfilters */
+ if (is_t5(adapter->params.chip))
+ return 0;
+
+ f = adapter->tids.tid_tab[fidx];
+ } else {
+ if (fidx >= adapter->tids.nftids)
+ return -ERANGE;
+
+ f = &adapter->tids.ftid_tab[fidx];
+ }
+
+ if (!f || !f->valid)
+ return -EINVAL;
+
+ tcb_word = W_TCB_TIMESTAMP;
+ tcb_mask = V_TCB_TIMESTAMP(M_TCB_TIMESTAMP);
+ tcb_val = V_TCB_TIMESTAMP(0ULL);
+
+ set_tcb_field(adapter, f->tid, tcb_word, tcb_mask, tcb_val, 1);
+
+ if (clear_byte) {
+ tcb_word = W_TCB_T_RTT_TS_RECENT_AGE;
+ tcb_mask =
+ V_TCB_T_RTT_TS_RECENT_AGE(M_TCB_T_RTT_TS_RECENT_AGE) |
+ V_TCB_T_RTSEQ_RECENT(M_TCB_T_RTSEQ_RECENT);
+ tcb_val = V_TCB_T_RTT_TS_RECENT_AGE(0ULL) |
+ V_TCB_T_RTSEQ_RECENT(0ULL);
+
+ set_tcb_field(adapter, f->tid, tcb_word, tcb_mask, tcb_val, 1);
+ }
+
+ return 0;
+}
+
/**
* Handle a Hash filter delete reply.
*/
int validate_filter(struct adapter *adap, struct ch_filter_specification *fs);
int cxgbe_get_filter_count(struct adapter *adapter, unsigned int fidx,
u64 *c, int hash, bool get_byte);
+int cxgbe_clear_filter_count(struct adapter *adapter, unsigned int fidx,
+ int hash, bool clear_byte);
#endif /* _CXGBE_FILTER_H_ */
const struct rte_flow_action *action, void *data,
struct rte_flow_error *e)
{
+ struct adapter *adap = ethdev2adap(flow->dev);
struct ch_filter_specification fs;
struct rte_flow_query_count *c;
struct filter_entry *f;
/* Query was successful */
c->bytes_set = 1;
c->hits_set = 1;
+ if (c->reset)
+ cxgbe_clear_filter_count(adap, flow->fidx, f->fs.cap, true);
return 0; /* success / partial_success */
}