Lines Matching refs:fs
128 static void cxgb4_action_natmode_tweak(struct ch_filter_specification *fs, in cxgb4_action_natmode_tweak() argument
140 fs->nat_mode = cxgb4_natmode_config_array[i].natmode; in cxgb4_action_natmode_tweak()
164 struct ch_filter_specification *fs) in cxgb4_process_flow_match() argument
193 fs->type = 1; in cxgb4_process_flow_match()
195 fs->val.ethtype = ethtype_key; in cxgb4_process_flow_match()
196 fs->mask.ethtype = ethtype_mask; in cxgb4_process_flow_match()
197 fs->val.proto = match.key->ip_proto; in cxgb4_process_flow_match()
198 fs->mask.proto = match.mask->ip_proto; in cxgb4_process_flow_match()
205 fs->type = 0; in cxgb4_process_flow_match()
206 memcpy(&fs->val.lip[0], &match.key->dst, sizeof(match.key->dst)); in cxgb4_process_flow_match()
207 memcpy(&fs->val.fip[0], &match.key->src, sizeof(match.key->src)); in cxgb4_process_flow_match()
208 memcpy(&fs->mask.lip[0], &match.mask->dst, sizeof(match.mask->dst)); in cxgb4_process_flow_match()
209 memcpy(&fs->mask.fip[0], &match.mask->src, sizeof(match.mask->src)); in cxgb4_process_flow_match()
212 memcpy(&fs->nat_lip[0], &match.key->dst, sizeof(match.key->dst)); in cxgb4_process_flow_match()
213 memcpy(&fs->nat_fip[0], &match.key->src, sizeof(match.key->src)); in cxgb4_process_flow_match()
220 fs->type = 1; in cxgb4_process_flow_match()
221 memcpy(&fs->val.lip[0], match.key->dst.s6_addr, in cxgb4_process_flow_match()
223 memcpy(&fs->val.fip[0], match.key->src.s6_addr, in cxgb4_process_flow_match()
225 memcpy(&fs->mask.lip[0], match.mask->dst.s6_addr, in cxgb4_process_flow_match()
227 memcpy(&fs->mask.fip[0], match.mask->src.s6_addr, in cxgb4_process_flow_match()
231 memcpy(&fs->nat_lip[0], match.key->dst.s6_addr, in cxgb4_process_flow_match()
233 memcpy(&fs->nat_fip[0], match.key->src.s6_addr, in cxgb4_process_flow_match()
241 fs->val.lport = be16_to_cpu(match.key->dst); in cxgb4_process_flow_match()
242 fs->mask.lport = be16_to_cpu(match.mask->dst); in cxgb4_process_flow_match()
243 fs->val.fport = be16_to_cpu(match.key->src); in cxgb4_process_flow_match()
244 fs->mask.fport = be16_to_cpu(match.mask->src); in cxgb4_process_flow_match()
247 fs->nat_lport = fs->val.lport; in cxgb4_process_flow_match()
248 fs->nat_fport = fs->val.fport; in cxgb4_process_flow_match()
255 fs->val.tos = match.key->tos; in cxgb4_process_flow_match()
256 fs->mask.tos = match.mask->tos; in cxgb4_process_flow_match()
263 fs->val.vni = be32_to_cpu(match.key->keyid); in cxgb4_process_flow_match()
264 fs->mask.vni = be32_to_cpu(match.mask->keyid); in cxgb4_process_flow_match()
265 if (fs->mask.vni) { in cxgb4_process_flow_match()
266 fs->val.encap_vld = 1; in cxgb4_process_flow_match()
267 fs->mask.encap_vld = 1; in cxgb4_process_flow_match()
280 fs->val.ivlan = vlan_tci; in cxgb4_process_flow_match()
281 fs->mask.ivlan = vlan_tci_mask; in cxgb4_process_flow_match()
283 fs->val.ivlan_vld = 1; in cxgb4_process_flow_match()
284 fs->mask.ivlan_vld = 1; in cxgb4_process_flow_match()
295 if (fs->val.ethtype == ETH_P_8021Q) { in cxgb4_process_flow_match()
296 fs->val.ethtype = 0; in cxgb4_process_flow_match()
297 fs->mask.ethtype = 0; in cxgb4_process_flow_match()
304 fs->val.iport = netdev2pinfo(dev)->port_id; in cxgb4_process_flow_match()
305 fs->mask.iport = ~0; in cxgb4_process_flow_match()
356 static void offload_pedit(struct ch_filter_specification *fs, u32 val, u32 mask, in offload_pedit() argument
371 memcpy((u8 *)fs + offset, &set_val, size); in offload_pedit()
374 static void process_pedit_field(struct ch_filter_specification *fs, u32 val, in process_pedit_field() argument
382 fs->newdmac = 1; in process_pedit_field()
383 offload_pedit(fs, val, mask, ETH_DMAC_31_0); in process_pedit_field()
387 offload_pedit(fs, val, mask, ETH_DMAC_47_32); in process_pedit_field()
389 offload_pedit(fs, val >> 16, mask >> 16, in process_pedit_field()
393 fs->newsmac = 1; in process_pedit_field()
394 offload_pedit(fs, val, mask, ETH_SMAC_47_16); in process_pedit_field()
400 offload_pedit(fs, val, mask, IP4_SRC); in process_pedit_field()
404 offload_pedit(fs, val, mask, IP4_DST); in process_pedit_field()
411 offload_pedit(fs, val, mask, IP6_SRC_31_0); in process_pedit_field()
415 offload_pedit(fs, val, mask, IP6_SRC_63_32); in process_pedit_field()
419 offload_pedit(fs, val, mask, IP6_SRC_95_64); in process_pedit_field()
423 offload_pedit(fs, val, mask, IP6_SRC_127_96); in process_pedit_field()
427 offload_pedit(fs, val, mask, IP6_DST_31_0); in process_pedit_field()
431 offload_pedit(fs, val, mask, IP6_DST_63_32); in process_pedit_field()
435 offload_pedit(fs, val, mask, IP6_DST_95_64); in process_pedit_field()
439 offload_pedit(fs, val, mask, IP6_DST_127_96); in process_pedit_field()
447 fs->nat_fport = val; in process_pedit_field()
450 fs->nat_lport = val >> 16; in process_pedit_field()
459 fs->nat_fport = val; in process_pedit_field()
462 fs->nat_lport = val >> 16; in process_pedit_field()
493 struct ch_filter_specification *fs) in cxgb4_process_flow_actions() argument
502 fs->action = FILTER_PASS; in cxgb4_process_flow_actions()
505 fs->action = FILTER_DROP; in cxgb4_process_flow_actions()
512 fs->action = FILTER_SWITCH; in cxgb4_process_flow_actions()
513 fs->eport = pi->port_id; in cxgb4_process_flow_actions()
524 fs->newvlan |= VLAN_REMOVE; in cxgb4_process_flow_actions()
527 fs->newvlan |= VLAN_INSERT; in cxgb4_process_flow_actions()
528 fs->vlan = vlan_tci; in cxgb4_process_flow_actions()
531 fs->newvlan |= VLAN_REWRITE; in cxgb4_process_flow_actions()
532 fs->vlan = vlan_tci; in cxgb4_process_flow_actions()
548 process_pedit_field(fs, val, mask, offset, htype, in cxgb4_process_flow_actions()
553 fs->action = FILTER_PASS; in cxgb4_process_flow_actions()
554 fs->dirsteer = 1; in cxgb4_process_flow_actions()
555 fs->iq = act->queue.index; in cxgb4_process_flow_actions()
562 cxgb4_action_natmode_tweak(fs, natmode_flags); in cxgb4_process_flow_actions()
828 if (fe->fs.hash && in cxgb4_tc_flower_hash_prio_del()
829 fe->fs.tc_prio <= t->tc_hash_tids_max_prio) { in cxgb4_tc_flower_hash_prio_del()
830 t->tc_hash_tids_max_prio = fe->fs.tc_prio; in cxgb4_tc_flower_hash_prio_del()
837 if (fe->fs.tc_prio == tc_prio) in cxgb4_tc_flower_hash_prio_del()
857 struct ch_filter_specification *fs, u32 *tid) in cxgb4_flow_rule_replace() argument
870 cxgb4_process_flow_match(dev, rule, fs); in cxgb4_flow_rule_replace()
871 cxgb4_process_flow_actions(dev, &rule->action, fs); in cxgb4_flow_rule_replace()
873 fs->hash = is_filter_exact_match(adap, fs); in cxgb4_flow_rule_replace()
874 inet_family = fs->type ? PF_INET6 : PF_INET; in cxgb4_flow_rule_replace()
880 fidx = cxgb4_get_free_ftid(dev, inet_family, fs->hash, in cxgb4_flow_rule_replace()
889 fs->prio = 1; in cxgb4_flow_rule_replace()
890 fs->hash = 0; in cxgb4_flow_rule_replace()
896 if (fs->hash) in cxgb4_flow_rule_replace()
899 fs->tc_prio = tc_prio; in cxgb4_flow_rule_replace()
902 ret = __cxgb4_set_filter(dev, fidx, fs, &ctx); in cxgb4_flow_rule_replace()
920 if (fs->hash) in cxgb4_flow_rule_replace()
933 struct ch_filter_specification *fs; in cxgb4_tc_flower_replace() local
942 fs = &ch_flower->fs; in cxgb4_tc_flower_replace()
943 fs->hitcnts = 1; in cxgb4_tc_flower_replace()
944 fs->tc_cookie = cls->cookie; in cxgb4_tc_flower_replace()
946 ret = cxgb4_flow_rule_replace(dev, rule, cls->common.prio, extack, fs, in cxgb4_tc_flower_replace()
960 if (fs->hash) in cxgb4_tc_flower_replace()
963 cxgb4_del_filter(dev, ch_flower->filter_id, &ch_flower->fs); in cxgb4_tc_flower_replace()
971 struct ch_filter_specification *fs, int tid) in cxgb4_flow_rule_destroy() argument
977 hash = fs->hash; in cxgb4_flow_rule_destroy()
979 ret = cxgb4_del_filter(dev, tid, fs); in cxgb4_flow_rule_destroy()
1003 ret = cxgb4_flow_rule_destroy(dev, ch_flower->fs.tc_prio, in cxgb4_tc_flower_destroy()
1004 &ch_flower->fs, ch_flower->filter_id); in cxgb4_tc_flower_destroy()
1033 flower_entry->fs.hash); in ch_flower_stats_handler()
1078 ch_flower->fs.hash); in cxgb4_tc_flower_stats()