zt
extern void sme_save_state(void *state, int zt);
extern void sme_load_state(void const *state, int zt);
if (err == 0 && system_supports_sme2() && user.zt)
struct zt_context __user *zt;
if (__copy_from_user(&nregs, &(user->zt->nregs), sizeof(nregs)))
(char __user const *)user->zt +
user->zt = NULL;
if (user->zt)
user->zt = (struct zt_context __user *)head;
struct zt za[MAX_D_FRAMES + 1];
struct zt za[MAX_B_FRAMES + 1]; /* only range 0x0..0x1F allowed */
struct zt *zp;
struct zt *zp;
struct zt *zp;
static int nfp_ct_do_nft_merge(struct nfp_fl_ct_zone_entry *zt,
nft_m_entry = get_hashentry(&zt->nft_merge_tb,
nft_m_entry->zt = zt;
err = rhashtable_insert_fast(&zt->nft_merge_tb, &nft_m_entry->hash_node,
zt->nft_merge_count++;
nfp_fl_ct_del_offload(zt->priv->app, nft_m_entry->tc_flower_cookie,
static int nfp_ct_do_tc_merge(struct nfp_fl_ct_zone_entry *zt,
m_entry = get_hashentry(&zt->tc_merge_tb, &new_cookie,
m_entry->zt = zt;
err = rhashtable_insert_fast(&zt->tc_merge_tb, &m_entry->hash_node,
zt->tc_merge_count++;
list_for_each_entry_safe(nft_entry, nft_tmp, &zt->nft_flows_list,
nfp_ct_do_nft_merge(zt, nft_entry, m_entry);
struct nfp_fl_ct_zone_entry *zt;
zt = get_hashentry(&priv->ct_zone_table, &zone,
nfp_zone_table_params, sizeof(*zt));
if (IS_ERR(zt) || zt->priv)
return zt;
zt = kzalloc_obj(*zt);
if (!zt)
zt->zone = zone;
zt->priv = priv;
zt->nft = NULL;
INIT_LIST_HEAD(&zt->pre_ct_list);
INIT_LIST_HEAD(&zt->post_ct_list);
INIT_LIST_HEAD(&zt->nft_flows_list);
err = rhashtable_init(&zt->tc_merge_tb, &nfp_tc_ct_merge_params);
err = rhashtable_init(&zt->nft_merge_tb, &nfp_nft_ct_merge_params);
priv->ct_zone_wc = zt;
&zt->hash_node,
return zt;
rhashtable_destroy(&zt->nft_merge_tb);
rhashtable_destroy(&zt->tc_merge_tb);
kfree(zt);
nfp_fl_ct_flow_entry *nfp_fl_ct_add_flow(struct nfp_fl_ct_zone_entry *zt,
entry->zt = zt;
map = get_hashentry(&zt->priv->ct_map_table, &flow->cookie,
err = rhashtable_insert_fast(&zt->priv->ct_map_table,
struct nfp_fl_ct_zone_entry *zt;
zt = m_entry->zt;
err = nfp_fl_ct_del_offload(zt->priv->app, m_entry->tc_flower_cookie,
WARN_ON_ONCE(rhashtable_remove_fast(&zt->nft_merge_tb,
zt->nft_merge_count--;
struct nfp_fl_ct_zone_entry *zt;
zt = m_ent->zt;
err = rhashtable_remove_fast(&zt->tc_merge_tb,
zt->tc_merge_count--;
struct nfp_fl_ct_zone_entry *zt)
rhashtable_walk_enter(&zt->tc_merge_tb, &iter);
nfp_ct_do_nft_merge(zt, nft_entry, tc_merge_entry);
struct nfp_fl_ct_zone_entry *zt;
zt = get_nfp_zone_entry(priv, ct_act->ct.zone, false);
if (IS_ERR(zt)) {
return PTR_ERR(zt);
if (!zt->nft) {
zt->nft = ct_act->ct.flow_table;
err = nf_flow_table_offload_add_cb(zt->nft, nfp_fl_ct_handle_nft_flow, zt);
ct_entry = nfp_fl_ct_add_flow(zt, netdev, flow, false, extack);
list_add(&ct_entry->list_node, &zt->pre_ct_list);
zt->pre_ct_count++;
nfp_ct_merge_tc_entries(ct_entry, zt, zt);
nfp_ct_merge_tc_entries(ct_entry, priv->ct_zone_wc, zt);
struct nfp_fl_ct_zone_entry *zt;
zt = get_nfp_zone_entry(priv, ct.key->ct_zone, wildcarded);
if (IS_ERR(zt)) {
return PTR_ERR(zt);
ct_entry = nfp_fl_ct_add_flow(zt, netdev, flow, false, extack);
list_add(&ct_entry->list_node, &zt->post_ct_list);
zt->post_ct_count++;
nfp_ct_merge_tc_entries(ct_entry, zt, zt);
err = nfp_fl_ct_handle_pre_ct(pre_ct_entry->zt->priv,
struct nfp_flower_priv *priv = nft_merge->zt->priv;
spin_lock_bh(&ct_entry->zt->priv->stats_lock);
spin_unlock_bh(&ct_entry->zt->priv->stats_lock);
nfp_fl_ct_offload_nft_flow(struct nfp_fl_ct_zone_entry *zt, struct flow_cls_offload *flow)
ct_map_ent = rhashtable_lookup_fast(&zt->priv->ct_map_table, &flow->cookie,
ct_entry = nfp_fl_ct_add_flow(zt, NULL, flow, true, extack);
list_add(&ct_entry->list_node, &zt->nft_flows_list);
zt->nft_flows_count++;
nfp_ct_merge_nft_with_tc(ct_entry, zt);
ct_map_ent = rhashtable_lookup_fast(&zt->priv->ct_map_table, &flow->cookie,
ct_map_ent = rhashtable_lookup_fast(&zt->priv->ct_map_table, &flow->cookie,
struct nfp_fl_ct_zone_entry *zt = cb_priv;
while (!mutex_trylock(&zt->priv->nfp_fl_lock)) {
if (!zt->nft) /* avoid deadlock */
err = nfp_fl_ct_offload_nft_flow(zt, flow);
mutex_unlock(&zt->priv->nfp_fl_lock);
nfp_fl_ct_clean_nft_entries(struct nfp_fl_ct_zone_entry *zt)
list_for_each_entry_safe(nft_entry, ct_tmp, &zt->nft_flows_list,
ct_map_ent = rhashtable_lookup_fast(&zt->priv->ct_map_table,
struct nfp_fl_ct_zone_entry *zt;
zt = ct_map_ent->ct_entry->zt;
m_table = &zt->priv->ct_map_table;
zt->pre_ct_count--;
if (!zt->pre_ct_count && zt->nft) {
nft = zt->nft;
zt->nft = NULL; /* avoid deadlock */
zt);
nfp_fl_ct_clean_nft_entries(zt);
zt->post_ct_count--;
zt->nft_flows_count--;
struct nfp_fl_ct_zone_entry *zt = m_entry->zt;
struct nfp_flower_priv *priv = zt->priv;
struct nfp_fl_ct_zone_entry *zt;
struct nfp_fl_ct_zone_entry *zt;
struct nfp_fl_ct_zone_entry *zt;
static void nfp_zone_table_entry_destroy(struct nfp_fl_ct_zone_entry *zt)
if (!zt)
if (!list_empty(&zt->pre_ct_list)) {
struct rhashtable *m_table = &zt->priv->ct_map_table;
list_for_each_entry_safe(entry, tmp, &zt->pre_ct_list,
if (!list_empty(&zt->post_ct_list)) {
struct rhashtable *m_table = &zt->priv->ct_map_table;
list_for_each_entry_safe(entry, tmp, &zt->post_ct_list,
if (zt->nft) {
nf_flow_table_offload_del_cb(zt->nft,
zt);
zt->nft = NULL;
if (!list_empty(&zt->nft_flows_list)) {
struct rhashtable *m_table = &zt->priv->ct_map_table;
list_for_each_entry_safe(entry, tmp, &zt->nft_flows_list,
rhashtable_free_and_destroy(&zt->tc_merge_tb,
rhashtable_free_and_destroy(&zt->nft_merge_tb,
kfree(zt);
struct nfp_fl_ct_zone_entry *zt = ptr;
nfp_zone_table_entry_destroy(zt);
if ((entry->zt & 0xf) != NVME_ZONE_TYPE_SEQWRITE_REQ) {
dev_err(ns->ctrl->device, "invalid zone type %#x\n", entry->zt);
zdesc.zt = z->type;
struct ubifs_zbranch zbr, *zt;
zt = &znode->zbranch[n];
*lnum = zt->lnum;
*offs = zt->offs;
err = tnc_read_hashed_node(c, zt, node);
err = ubifs_tnc_read_node(c, zt, node);
__u8 zt;
enum zone_type zt;
for (zt = 0; zt <= ZONE_NORMAL; zt++)
normal_pages += pgdat->node_zones[zt].present_pages;
static int get_zt(pid_t pid, char zt[ZT_SIG_REG_BYTES])
iov.iov_base = zt;
static int set_zt(pid_t pid, const char zt[ZT_SIG_REG_BYTES])
iov.iov_base = (void *)zt;
char zt[ZT_SIG_REG_BYTES];
ret = get_zt(child, zt);
for (i = 0; i < ARRAY_SIZE(zt); i++) {
if (zt[i]) {
ksft_print_msg("zt[%d]: 0x%x != 0\n", i, zt[i]);
char zt[ZT_SIG_REG_BYTES];
fill_buf(zt, sizeof(zt));
ret = set_zt(child, zt);
if (zt->head.size != ZT_SIG_CONTEXT_SIZE(zt->nregs)) {
struct zt_context *zt = NULL;
zt = (struct zt_context *)head;
if (!validate_zt_context(zt, err))
bool validate_zt_context(struct zt_context *zt, char **err)
if (!zt || !err)
if (zt->nregs == 0) {
struct zt_context *zt;
zt = (struct zt_context *)head;
if (zt->nregs == 0) {
head->size, zt->nregs);
zeros = malloc(ZT_SIG_REGS_SIZE(zt->nregs));
fprintf(stderr, "Out of memory, nregs=%u\n", zt->nregs);
memset(zeros, 0, ZT_SIG_REGS_SIZE(zt->nregs));
if (memcmp(zeros, (char *)zt + ZT_SIG_REGS_OFFSET,
ZT_SIG_REGS_SIZE(zt->nregs)) != 0) {