Lines Matching refs:attrs

66 	if (sa_entry->attrs.drop)
72 sa_entry->attrs.drop = true;
147 struct mlx5_accel_esp_xfrm_attrs *attrs)
152 attrs->lft.hard_packet_limit = x->lft.hard_packet_limit;
153 attrs->lft.soft_packet_limit = x->lft.soft_packet_limit;
187 n = attrs->lft.hard_packet_limit / BIT_ULL(31);
188 start_value = attrs->lft.hard_packet_limit - n * BIT_ULL(31);
195 start_value = attrs->lft.hard_packet_limit - n * BIT_ULL(31);
200 attrs->lft.hard_packet_limit = lower_32_bits(start_value);
201 attrs->lft.numb_rounds_hard = (u64)n;
225 n = (x->lft.soft_packet_limit - attrs->lft.hard_packet_limit) / BIT_ULL(31);
226 start_value = attrs->lft.hard_packet_limit + n * BIT_ULL(31) -
238 start_value = attrs->lft.hard_packet_limit + n * BIT_ULL(31) - start_value;
239 if (n != attrs->lft.numb_rounds_hard && start_value < BIT_ULL(30))
247 start_value = attrs->lft.hard_packet_limit + n * BIT_ULL(31) - start_value;
255 attrs->lft.soft_packet_limit = lower_32_bits(start_value);
256 attrs->lft.numb_rounds_soft = (u64)n;
260 struct mlx5_accel_esp_xfrm_attrs *attrs)
270 if (attrs->mode != XFRM_MODE_TUNNEL ||
271 attrs->type != XFRM_DEV_OFFLOAD_PACKET)
277 switch (attrs->dir) {
279 src = attrs->dmac;
280 dst = attrs->smac;
281 pkey = &attrs->saddr.a4;
284 src = attrs->smac;
285 dst = attrs->dmac;
286 pkey = &attrs->daddr.a4;
299 attrs->drop = true;
308 struct mlx5_accel_esp_xfrm_attrs *attrs)
311 struct aes_gcm_keymat *aes_gcm = &attrs->aes_gcm;
317 memset(attrs, 0, sizeof(*attrs));
334 attrs->authsize = crypto_aead_authsize(aead) / 4; /* in dwords */
339 attrs->dir = x->xso.dir;
343 attrs->replay_esn.trigger = true;
344 attrs->replay_esn.esn = sa_entry->esn_state.esn;
345 attrs->replay_esn.esn_msb = sa_entry->esn_state.esn_msb;
346 attrs->replay_esn.overlap = sa_entry->esn_state.overlap;
347 if (attrs->dir == XFRM_DEV_OFFLOAD_OUT)
352 attrs->replay_esn.replay_window =
356 attrs->replay_esn.replay_window =
360 attrs->replay_esn.replay_window =
364 attrs->replay_esn.replay_window =
375 attrs->spi = be32_to_cpu(x->id.spi);
378 memcpy(&attrs->saddr, x->props.saddr.a6, sizeof(attrs->saddr));
379 memcpy(&attrs->daddr, x->id.daddr.a6, sizeof(attrs->daddr));
380 attrs->family = x->props.family;
381 attrs->type = x->xso.type;
382 attrs->reqid = x->props.reqid;
383 attrs->upspec.dport = ntohs(x->sel.dport);
384 attrs->upspec.dport_mask = ntohs(x->sel.dport_mask);
385 attrs->upspec.sport = ntohs(x->sel.sport);
386 attrs->upspec.sport_mask = ntohs(x->sel.sport_mask);
387 attrs->upspec.proto = x->sel.proto;
388 attrs->mode = x->props.mode;
390 mlx5e_ipsec_init_limits(sa_entry, attrs);
391 mlx5e_ipsec_init_macs(sa_entry, attrs);
394 attrs->encap = true;
395 attrs->sport = x->encap->encap_sport;
396 attrs->dport = x->encap->encap_dport;
559 struct mlx5_accel_esp_xfrm_attrs *attrs;
561 attrs = &((struct mlx5e_ipsec_sa_entry *)work->data)->attrs;
563 mlx5_accel_esp_modify_xfrm(sa_entry, attrs);
588 struct mlx5_accel_esp_xfrm_attrs *attrs;
590 attrs = &sa_entry->attrs;
592 switch (attrs->dir) {
594 ether_addr_copy(attrs->smac, data->addr);
597 ether_addr_copy(attrs->dmac, data->addr);
602 attrs->drop = false;
722 mlx5e_ipsec_build_accel_xfrm_attrs(sa_entry, &sa_entry->attrs);
794 struct mlx5_accel_esp_xfrm_attrs *attrs = &sa_entry->attrs;
804 if (attrs->mode == XFRM_MODE_TUNNEL &&
805 attrs->type == XFRM_DEV_OFFLOAD_PACKET)
839 struct mlx5_accel_esp_xfrm_attrs *attrs;
853 attrs = &sa_entry->attrs;
855 if (attrs->family == AF_INET) {
856 if (!neigh_key_eq32(n, &attrs->saddr.a4) &&
857 !neigh_key_eq32(n, &attrs->daddr.a4))
860 if (!neigh_key_eq128(n, &attrs->saddr.a4) &&
861 !neigh_key_eq128(n, &attrs->daddr.a4))
983 mlx5e_ipsec_build_accel_xfrm_attrs(sa_entry, &sa_entry_shadow->attrs);
1001 if (sa_entry->attrs.dir == XFRM_DEV_OFFLOAD_IN) {
1017 if (sa_entry->attrs.dir == XFRM_DEV_OFFLOAD_IN) {
1088 struct mlx5_accel_pol_xfrm_attrs *attrs)
1094 memset(attrs, 0, sizeof(*attrs));
1096 memcpy(&attrs->saddr, sel->saddr.a6, sizeof(attrs->saddr));
1097 memcpy(&attrs->daddr, sel->daddr.a6, sizeof(attrs->daddr));
1098 attrs->family = sel->family;
1099 attrs->dir = x->xdo.dir;
1100 attrs->action = x->action;
1101 attrs->type = XFRM_DEV_OFFLOAD_PACKET;
1102 attrs->reqid = x->xfrm_vec[0].reqid;
1103 attrs->upspec.dport = ntohs(sel->dport);
1104 attrs->upspec.dport_mask = ntohs(sel->dport_mask);
1105 attrs->upspec.sport = ntohs(sel->sport);
1106 attrs->upspec.sport_mask = ntohs(sel->sport_mask);
1107 attrs->upspec.proto = sel->proto;
1108 attrs->prio = x->priority;
1141 mlx5e_ipsec_build_accel_pol_attrs(pol_entry, &pol_entry->attrs);