Lines Matching full:rule
12 struct gve_adminq_queried_flow_rule *rule) in gve_fill_ethtool_flow_spec() argument
14 struct gve_adminq_flow_rule *flow_rule = &rule->flow_rule; in gve_fill_ethtool_flow_spec()
107 struct gve_adminq_flow_rule *rule) in gve_generate_flow_rule() argument
129 rule->action = cpu_to_be16(fsp->ring_cookie); in gve_generate_flow_rule()
135 rule->flow_type = cpu_to_be16(flow_type_lut[flow_type]); in gve_generate_flow_rule()
141 rule->key.src_ip[0] = fsp->h_u.tcp_ip4_spec.ip4src; in gve_generate_flow_rule()
142 rule->key.dst_ip[0] = fsp->h_u.tcp_ip4_spec.ip4dst; in gve_generate_flow_rule()
143 rule->key.src_port = fsp->h_u.tcp_ip4_spec.psrc; in gve_generate_flow_rule()
144 rule->key.dst_port = fsp->h_u.tcp_ip4_spec.pdst; in gve_generate_flow_rule()
145 rule->mask.src_ip[0] = fsp->m_u.tcp_ip4_spec.ip4src; in gve_generate_flow_rule()
146 rule->mask.dst_ip[0] = fsp->m_u.tcp_ip4_spec.ip4dst; in gve_generate_flow_rule()
147 rule->mask.src_port = fsp->m_u.tcp_ip4_spec.psrc; in gve_generate_flow_rule()
148 rule->mask.dst_port = fsp->m_u.tcp_ip4_spec.pdst; in gve_generate_flow_rule()
152 rule->key.src_ip[0] = fsp->h_u.tcp_ip4_spec.ip4src; in gve_generate_flow_rule()
153 rule->key.dst_ip[0] = fsp->h_u.tcp_ip4_spec.ip4dst; in gve_generate_flow_rule()
154 rule->key.spi = fsp->h_u.ah_ip4_spec.spi; in gve_generate_flow_rule()
155 rule->mask.src_ip[0] = fsp->m_u.tcp_ip4_spec.ip4src; in gve_generate_flow_rule()
156 rule->mask.dst_ip[0] = fsp->m_u.tcp_ip4_spec.ip4dst; in gve_generate_flow_rule()
157 rule->mask.spi = fsp->m_u.ah_ip4_spec.spi; in gve_generate_flow_rule()
162 memcpy(&rule->key.src_ip, fsp->h_u.tcp_ip6_spec.ip6src, in gve_generate_flow_rule()
164 memcpy(&rule->key.dst_ip, fsp->h_u.tcp_ip6_spec.ip6dst, in gve_generate_flow_rule()
166 rule->key.src_port = fsp->h_u.tcp_ip6_spec.psrc; in gve_generate_flow_rule()
167 rule->key.dst_port = fsp->h_u.tcp_ip6_spec.pdst; in gve_generate_flow_rule()
168 memcpy(&rule->mask.src_ip, fsp->m_u.tcp_ip6_spec.ip6src, in gve_generate_flow_rule()
170 memcpy(&rule->mask.dst_ip, fsp->m_u.tcp_ip6_spec.ip6dst, in gve_generate_flow_rule()
172 rule->mask.src_port = fsp->m_u.tcp_ip6_spec.psrc; in gve_generate_flow_rule()
173 rule->mask.dst_port = fsp->m_u.tcp_ip6_spec.pdst; in gve_generate_flow_rule()
177 memcpy(&rule->key.src_ip, fsp->h_u.usr_ip6_spec.ip6src, in gve_generate_flow_rule()
179 memcpy(&rule->key.dst_ip, fsp->h_u.usr_ip6_spec.ip6dst, in gve_generate_flow_rule()
181 rule->key.spi = fsp->h_u.ah_ip6_spec.spi; in gve_generate_flow_rule()
182 memcpy(&rule->mask.src_ip, fsp->m_u.usr_ip6_spec.ip6src, in gve_generate_flow_rule()
184 memcpy(&rule->mask.dst_ip, fsp->m_u.usr_ip6_spec.ip6dst, in gve_generate_flow_rule()
186 rule->key.spi = fsp->h_u.ah_ip6_spec.spi; in gve_generate_flow_rule()
201 struct gve_adminq_queried_flow_rule *rule = NULL; in gve_get_flow_rule_entry() local
220 rule = &rules_cache[i]; in gve_get_flow_rule_entry()
225 if (!rule) in gve_get_flow_rule_entry()
228 err = gve_fill_ethtool_flow_spec(fsp, rule); in gve_get_flow_rule_entry()
266 struct gve_adminq_flow_rule *rule = NULL; in gve_add_flow_rule() local
272 rule = kvzalloc(sizeof(*rule), GFP_KERNEL); in gve_add_flow_rule()
273 if (!rule) in gve_add_flow_rule()
276 err = gve_generate_flow_rule(priv, fsp, rule); in gve_add_flow_rule()
280 err = gve_adminq_add_flow_rule(priv, rule, fsp->location); in gve_add_flow_rule()
283 kvfree(rule); in gve_add_flow_rule()
285 dev_err(&priv->pdev->dev, "Failed to add the flow rule: %u", fsp->location); in gve_add_flow_rule()