diff options
author | Damjan Marion <damarion@cisco.com> | 2017-11-17 09:46:41 +0100 |
---|---|---|
committer | Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com> | 2017-11-20 11:41:22 +0000 |
commit | 45b485099d8bdf5985e9869bc8221852073f9369 (patch) | |
tree | 184c75dbe758a9606c16b89a56d4f62965c01663 /src/plugins | |
parent | 9d1d73a9010dcd0929dc932af1fd7117863f6758 (diff) |
dpdk: add support for DPDK 17.11
Also remove DPDK 17.05 support.
Change-Id: I4f96cb3f002cd90b12d800d6904f2364d7c4e270
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/dpdk.am | 6 | ||||
-rw-r--r-- | src/plugins/dpdk/buffer.c | 10 | ||||
-rw-r--r-- | src/plugins/dpdk/device/common.c | 23 | ||||
-rw-r--r-- | src/plugins/dpdk/device/dpdk.h | 22 | ||||
-rw-r--r-- | src/plugins/dpdk/device/format.c | 12 | ||||
-rwxr-xr-x | src/plugins/dpdk/device/init.c | 2 | ||||
-rw-r--r-- | src/plugins/dpdk/ipsec/cli.c | 11 | ||||
-rw-r--r-- | src/plugins/dpdk/ipsec/esp_decrypt.c | 16 | ||||
-rw-r--r-- | src/plugins/dpdk/ipsec/esp_encrypt.c | 6 | ||||
-rw-r--r-- | src/plugins/dpdk/ipsec/ipsec.c | 76 | ||||
-rw-r--r-- | src/plugins/dpdk/ipsec/ipsec.h | 41 |
11 files changed, 46 insertions, 179 deletions
diff --git a/src/plugins/dpdk.am b/src/plugins/dpdk.am index 99abded7cd2..41430f3a722 100644 --- a/src/plugins/dpdk.am +++ b/src/plugins/dpdk.am @@ -28,12 +28,8 @@ endif if WITH_IBVERBS_LIB dpdk_plugin_la_LDFLAGS += -Wl,-libverbs endif -if DPDK_IS_1702_OR_1705 -dpdk_plugin_la_CFLAGS = $(AM_CFLAGS) -DDPDK_VOID_CALLBACK=1 -DDPDK_NO_AEAD=1 -else -dpdk_plugin_la_CFLAGS = $(AM_CFLAGS) -DDPDK_VOID_CALLBACK=0 -DDPDK_NO_AEAD=0 +dpdk_plugin_la_CFLAGS = $(AM_CFLAGS) dpdk_plugin_la_LDFLAGS += -Wl,-lnuma -endif dpdk_plugin_la_LDFLAGS += -Wl,-lm,-ldl dpdk_plugin_la_LIBADD = diff --git a/src/plugins/dpdk/buffer.c b/src/plugins/dpdk/buffer.c index d0e13ae001a..53afd11b530 100644 --- a/src/plugins/dpdk/buffer.c +++ b/src/plugins/dpdk/buffer.c @@ -502,7 +502,11 @@ dpdk_pool_create (vlib_main_t * vm, u8 * pool_name, u32 elt_size, i32 ret; obj_size = rte_mempool_calc_obj_size (elt_size, 0, 0); +#if RTE_VERSION < RTE_VERSION_NUM(17, 11, 0, 0) size = rte_mempool_xmem_size (num_elts, obj_size, 21); +#else + size = rte_mempool_xmem_size (num_elts, obj_size, 21, 0); +#endif error = vlib_physmem_region_alloc (vm, (i8 *) pool_name, size, numa, 0, pri); @@ -519,9 +523,15 @@ dpdk_pool_create (vlib_main_t * vm, u8 * pool_name, u32 elt_size, rte_mempool_set_ops_byname (mp, RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL); +#if RTE_VERSION < RTE_VERSION_NUM(17, 11, 0, 0) ret = rte_mempool_populate_phys_tab (mp, pr->mem, pr->page_table, pr->n_pages, pr->log2_page_size, NULL, NULL); +#else + ret = + rte_mempool_populate_iova_tab (mp, pr->mem, pr->page_table, pr->n_pages, + pr->log2_page_size, NULL, NULL); +#endif if (ret != (i32) mp->size) { rte_mempool_free (mp); diff --git a/src/plugins/dpdk/device/common.c b/src/plugins/dpdk/device/common.c index c65cec6734d..d488d69e553 100644 --- a/src/plugins/dpdk/device/common.c +++ b/src/plugins/dpdk/device/common.c @@ -155,11 +155,11 @@ dpdk_device_start (dpdk_device_t * xd) if (xd->pmd == VNET_DPDK_PMD_BOND) { - u8 slink[16]; + dpdk_portid_t slink[16]; int nlink = rte_eth_bond_slaves_get (xd->device_index, slink, 16); while (nlink >= 1) { - u8 dpdk_port = slink[--nlink]; + dpdk_portid_t dpdk_port = slink[--nlink]; rte_eth_allmulticast_enable (dpdk_port); } } @@ -177,11 +177,11 @@ dpdk_device_stop (dpdk_device_t * xd) /* For bonded interface, stop slave links */ if (xd->pmd == VNET_DPDK_PMD_BOND) { - u8 slink[16]; + dpdk_portid_t slink[16]; int nlink = rte_eth_bond_slaves_get (xd->device_index, slink, 16); while (nlink >= 1) { - u8 dpdk_port = slink[--nlink]; + dpdk_portid_t dpdk_port = slink[--nlink]; rte_eth_dev_stop (dpdk_port); } } @@ -246,7 +246,7 @@ garp_na_proc_callback (uword * dpdk_port) } always_inline int -dpdk_port_state_callback_inline (uint8_t port_id, +dpdk_port_state_callback_inline (dpdk_portid_t port_id, enum rte_eth_event_type type, void *param) { struct rte_eth_link link; @@ -294,24 +294,15 @@ dpdk_port_state_callback_inline (uint8_t port_id, return 0; } -#if DPDK_VOID_CALLBACK -void -dpdk_port_state_callback (uint8_t port_id, - enum rte_eth_event_type type, void *param) -{ - dpdk_port_state_callback_inline (port_id, type, param); -} - -#else int -dpdk_port_state_callback (uint8_t port_id, +dpdk_port_state_callback (dpdk_portid_t port_id, enum rte_eth_event_type type, void *param, void *ret_param __attribute__ ((unused))) { return dpdk_port_state_callback_inline (port_id, type, param); } -#endif + /* * fd.io coding-style-patch-verification: ON * diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h index 669629293c0..efcc5a766bf 100644 --- a/src/plugins/dpdk/device/dpdk.h +++ b/src/plugins/dpdk/device/dpdk.h @@ -39,6 +39,9 @@ #include <rte_eth_bond.h> #include <rte_sched.h> #include <rte_net.h> +#if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 0) +#include <rte_bus_pci.h> +#endif #include <vnet/unix/pcap.h> #include <vnet/devices/devices.h> @@ -115,6 +118,12 @@ typedef struct u64 tx_tail; } tx_ring_hdr_t; +#if RTE_VERSION < RTE_VERSION_NUM(17, 11, 0, 0) +typedef uint8_t dpdk_portid_t; +#else +typedef uint16_t dpdk_portid_t; +#endif + typedef struct { struct rte_ring *swq; @@ -150,7 +159,7 @@ typedef struct volatile u32 **lockp; /* Instance ID */ - u32 device_index; + dpdk_portid_t device_index; u32 hw_if_index; u32 vlib_sw_if_index; @@ -203,11 +212,11 @@ typedef struct dpdk_device_hqos_per_hqos_thread_t *hqos_ht; /* af_packet or BondEthernet instance number */ - u8 port_id; + dpdk_portid_t port_id; /* Bonded interface port# of a slave - only valid if DPDK_DEVICE_FLAG_BOND_SLAVE bit is set */ - u8 bond_port; + dpdk_portid_t bond_port; struct rte_eth_link link; f64 time_last_link_update; @@ -422,14 +431,9 @@ void dpdk_device_setup (dpdk_device_t * xd); void dpdk_device_start (dpdk_device_t * xd); void dpdk_device_stop (dpdk_device_t * xd); -#if DPDK_VOID_CALLBACK -void dpdk_port_state_callback (uint8_t port_id, - enum rte_eth_event_type type, void *param); -#else -int dpdk_port_state_callback (uint8_t port_id, +int dpdk_port_state_callback (dpdk_portid_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); -#endif #define foreach_dpdk_error \ _(NONE, "no error") \ diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c index a2635c53ca4..8f1f729d89a 100644 --- a/src/plugins/dpdk/device/format.c +++ b/src/plugins/dpdk/device/format.c @@ -79,18 +79,24 @@ _(DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM, "outer-ipv4-cksum") \ _(DEV_TX_OFFLOAD_QINQ_INSERT, "qinq-insert") +#if RTE_VERSION < RTE_VERSION_NUM(17, 11, 0, 0) +#define PKT_RX_VLAN PKT_RX_VLAN_PKT +#endif + #define foreach_dpdk_pkt_rx_offload_flag \ - _ (PKT_RX_VLAN_PKT, "RX packet is a 802.1q VLAN packet") \ + _ (PKT_RX_VLAN, "RX packet is a 802.1q VLAN packet") \ _ (PKT_RX_RSS_HASH, "RX packet with RSS hash result") \ _ (PKT_RX_FDIR, "RX packet with FDIR infos") \ _ (PKT_RX_L4_CKSUM_BAD, "L4 cksum of RX pkt. is not OK") \ _ (PKT_RX_IP_CKSUM_BAD, "IP cksum of RX pkt. is not OK") \ + _ (PKT_RX_EIP_CKSUM_BAD, "External IP header checksum error") \ _ (PKT_RX_VLAN_STRIPPED, "RX packet VLAN tag stripped") \ _ (PKT_RX_IP_CKSUM_GOOD, "IP cksum of RX pkt. is valid") \ _ (PKT_RX_L4_CKSUM_GOOD, "L4 cksum of RX pkt. is valid") \ _ (PKT_RX_IEEE1588_PTP, "RX IEEE1588 L2 Ethernet PT Packet") \ _ (PKT_RX_IEEE1588_TMST, "RX IEEE1588 L2/L4 timestamped packet") \ - _ (PKT_RX_QINQ_STRIPPED, "RX packet QinQ tags stripped") + _ (PKT_RX_QINQ_STRIPPED, "RX packet QinQ tags stripped") \ + _ (PKT_RX_TIMESTAMP, "Timestamp field is valid") #define foreach_dpdk_pkt_type \ _ (L2, ETHER, "Ethernet packet") \ @@ -728,7 +734,7 @@ format_dpdk_rte_mbuf (u8 * s, va_list * va) s = format (s, "\n%U%U", format_white_space, indent, format_dpdk_pkt_offload_flags, &mb->ol_flags); - if ((mb->ol_flags & PKT_RX_VLAN_PKT) && + if ((mb->ol_flags & PKT_RX_VLAN) && ((mb->ol_flags & (PKT_RX_VLAN_STRIPPED | PKT_RX_QINQ_STRIPPED)) == 0)) { ethernet_vlan_header_tv_t *vlan_hdr = diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 9e7bb75d6f3..3cd040a0577 100755 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -1441,7 +1441,7 @@ dpdk_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) if (xd->pmd == VNET_DPDK_PMD_BOND) { u8 addr[6]; - u8 slink[16]; + dpdk_portid_t slink[16]; int nlink = rte_eth_bond_slaves_get (i, slink, 16); if (nlink > 0) { diff --git a/src/plugins/dpdk/ipsec/cli.c b/src/plugins/dpdk/ipsec/cli.c index 9f470bfe990..b5ac105a4b1 100644 --- a/src/plugins/dpdk/ipsec/cli.c +++ b/src/plugins/dpdk/ipsec/cli.c @@ -532,7 +532,6 @@ show_dpdk_crypto_pools_fn (vlib_main_t * vm, { if (data->crypto_op) vlib_cli_output (vm, "%U\n", format_dpdk_mempool, data->crypto_op); -#if ! DPDK_NO_AEAD if (data->session_h) vlib_cli_output (vm, "%U\n", format_dpdk_mempool, data->session_h); @@ -540,19 +539,9 @@ show_dpdk_crypto_pools_fn (vlib_main_t * vm, vec_foreach (mp, data->session_drv) if (mp[0]) vlib_cli_output (vm, "%U\n", format_dpdk_mempool, mp[0]); -#endif } /* *INDENT-ON* */ -#if DPDK_NO_AEAD - crypto_dev_t *dev; - /* *INDENT-OFF* */ - vec_foreach (dev, dcm->dev) if (rte_cryptodevs[dev->id].data->session_pool) - vlib_cli_output (vm, "%U\n", format_dpdk_mempool, - rte_cryptodevs[dev->id].data->session_pool); - /* *INDENT-ON* */ -#endif - return NULL; } diff --git a/src/plugins/dpdk/ipsec/esp_decrypt.c b/src/plugins/dpdk/ipsec/esp_decrypt.c index ab98d56bbfd..6815f53e2b1 100644 --- a/src/plugins/dpdk/ipsec/esp_decrypt.c +++ b/src/plugins/dpdk/ipsec/esp_decrypt.c @@ -170,13 +170,7 @@ dpdk_esp_decrypt_node_fn (vlib_main_t * vm, cipher_alg = vec_elt_at_index (dcm->cipher_algs, sa0->crypto_alg); auth_alg = vec_elt_at_index (dcm->auth_algs, sa0->integ_alg); -#if DPDK_NO_AEAD - is_aead = (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 || - sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192 || - sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_256); -#else is_aead = (cipher_alg->type == RTE_CRYPTO_SYM_XFORM_AEAD); -#endif if (is_aead) auth_alg = cipher_alg; @@ -291,11 +285,7 @@ dpdk_esp_decrypt_node_fn (vlib_main_t * vm, u32 *_iv = (u32 *) iv; crypto_set_icb (icb, sa0->salt, _iv[0], _iv[1]); -#if DPDK_NO_AEAD - iv_size = 16; -#else iv_size = 12; -#endif } if (is_aead) @@ -470,13 +460,7 @@ dpdk_esp_decrypt_post_node_fn (vlib_main_t * vm, cipher_alg = vec_elt_at_index (dcm->cipher_algs, sa0->crypto_alg); auth_alg = vec_elt_at_index (dcm->auth_algs, sa0->integ_alg); -#if DPDK_NO_AEAD - is_aead = (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 || - sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192 || - sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_256); -#else is_aead = cipher_alg->type == RTE_CRYPTO_SYM_XFORM_AEAD; -#endif if (is_aead) auth_alg = cipher_alg; diff --git a/src/plugins/dpdk/ipsec/esp_encrypt.c b/src/plugins/dpdk/ipsec/esp_encrypt.c index ac60fdd589f..eea3e81605d 100644 --- a/src/plugins/dpdk/ipsec/esp_encrypt.c +++ b/src/plugins/dpdk/ipsec/esp_encrypt.c @@ -197,13 +197,7 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm, vec_elt_at_index (dcm->cipher_algs, sa0->crypto_alg); auth_alg = vec_elt_at_index (dcm->auth_algs, sa0->integ_alg); -#if DPDK_NO_AEAD - is_aead = ((sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128) || - (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192) || - (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_256)); -#else is_aead = (cipher_alg->type == RTE_CRYPTO_SYM_XFORM_AEAD); -#endif if (is_aead) auth_alg = cipher_alg; diff --git a/src/plugins/dpdk/ipsec/ipsec.c b/src/plugins/dpdk/ipsec/ipsec.c index fdfe0e65c70..b42d208094b 100644 --- a/src/plugins/dpdk/ipsec/ipsec.c +++ b/src/plugins/dpdk/ipsec/ipsec.c @@ -91,13 +91,8 @@ algos_init (u32 n_mains) a->key_len = 32; a->iv_len = 8; -#if DPDK_NO_AEAD -#define AES_GCM_TYPE RTE_CRYPTO_SYM_XFORM_CIPHER -#define AES_GCM_ALG RTE_CRYPTO_CIPHER_AES_GCM -#else #define AES_GCM_TYPE RTE_CRYPTO_SYM_XFORM_AEAD #define AES_GCM_ALG RTE_CRYPTO_AEAD_AES_GCM -#endif a = &dcm->cipher_algs[IPSEC_CRYPTO_ALG_AES_GCM_128]; a->type = AES_GCM_TYPE; @@ -209,13 +204,11 @@ cipher_cap_to_alg (const struct rte_cryptodev_capabilities *cap, u8 key_len) (cap->sym.cipher.algo == alg->alg) && (alg->key_len == key_len)) return alg; -#if ! DPDK_NO_AEAD if ((cap->sym.xform_type == RTE_CRYPTO_SYM_XFORM_AEAD) && (alg->type == RTE_CRYPTO_SYM_XFORM_AEAD) && (cap->sym.aead.algo == alg->alg) && (alg->key_len == key_len)) return alg; -#endif } /* *INDENT-ON* */ @@ -244,7 +237,6 @@ auth_cap_to_alg (const struct rte_cryptodev_capabilities *cap, u8 trunc_size) return NULL; } -#if ! DPDK_NO_AEAD static void crypto_set_aead_xform (struct rte_crypto_sym_xform *xform, ipsec_sa_t * sa, u8 is_outbound) @@ -272,7 +264,6 @@ crypto_set_aead_xform (struct rte_crypto_sym_xform *xform, else xform->aead.op = RTE_CRYPTO_AEAD_OP_DECRYPT; } -#endif static void crypto_set_cipher_xform (struct rte_crypto_sym_xform *xform, @@ -289,11 +280,9 @@ crypto_set_cipher_xform (struct rte_crypto_sym_xform *xform, xform->cipher.algo = c->alg; xform->cipher.key.data = sa->crypto_key; xform->cipher.key.length = c->key_len; -#if ! DPDK_NO_AEAD xform->cipher.iv.offset = crypto_op_get_priv_offset () + offsetof (dpdk_op_priv_t, cb); xform->cipher.iv.length = c->iv_len; -#endif xform->next = NULL; if (is_outbound) @@ -318,20 +307,6 @@ crypto_set_auth_xform (struct rte_crypto_sym_xform *xform, xform->auth.key.data = sa->integ_key; xform->auth.key.length = a->key_len; xform->auth.digest_length = a->trunc_size; -#if DPDK_NO_AEAD - if (sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 || - sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192 || - sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_256) - xform->auth.algo = RTE_CRYPTO_AUTH_AES_GCM; - xform->auth.add_auth_data_length = sa->use_esn ? 12 : 8; -#else -#if 0 - xform->auth.iv.offset = - sizeof (struct rte_crypto_op) + sizeof (struct rte_crypto_sym_op) + - offsetof (dpdk_op_priv_t, cb); - xform->auth.iv.length = a->iv_len; -#endif -#endif xform->next = NULL; if (is_outbound) @@ -360,7 +335,6 @@ create_sym_session (struct rte_cryptodev_sym_session **session, sa = pool_elt_at_index (im->sad, sa_idx); -#if ! DPDK_NO_AEAD if ((sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128) | (sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192) | (sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_256)) @@ -369,7 +343,6 @@ create_sym_session (struct rte_cryptodev_sym_session **session, xfs = &cipher_xform; } else -#endif /* ! DPDK_NO_AEAD */ { crypto_set_cipher_xform (&cipher_xform, sa, is_outbound); crypto_set_auth_xform (&auth_xform, sa, is_outbound); @@ -388,19 +361,6 @@ create_sym_session (struct rte_cryptodev_sym_session **session, data = vec_elt_at_index (dcm->data, res->numa); -#if DPDK_NO_AEAD - /* - * DPDK_VER <= 1705: - * Each worker/thread has its own session per device driver - */ - session[0] = rte_cryptodev_sym_session_create (res->dev_id, xfs); - if (!session[0]) - { - data->session_drv_failed[res->drv_id] += 1; - return clib_error_return (0, "failed to create session for dev %u", - res->dev_id); - } -#else /* * DPDK_VER >= 1708: * Multiple worker/threads share the session for an SA @@ -431,7 +391,6 @@ create_sym_session (struct rte_cryptodev_sym_session **session, return clib_error_return (0, "failed to init session for drv %u", res->drv_id); } -#endif /* DPDK_NO_AEAD */ hash_set (cwm->session_by_drv_id_and_sa_index, key.val, session[0]); @@ -447,7 +406,6 @@ static void __attribute__ ((unused)) clear_and_free_obj (void *obj) rte_mempool_put (mp, obj); } -#if ! DPDK_NO_AEAD /* This is from rte_cryptodev_pmd.h */ static inline void * get_session_private_data (const struct rte_cryptodev_sym_session *sess, @@ -463,7 +421,6 @@ set_session_private_data (struct rte_cryptodev_sym_session *sess, { sess->sess_private_data[driver_id] = private_data; } -#endif static clib_error_t * add_del_sa_session (u32 sa_index, u8 is_add) @@ -515,16 +472,11 @@ add_del_sa_session (u32 sa_index, u8 is_add) if (!s) continue; -#if DPDK_NO_AEAD - ret = (rte_cryptodev_sym_session_free (s->dev_id, s) == NULL); - ASSERT (ret); -#endif hash_unset (cwm->session_by_drv_id_and_sa_index, key.val); } } /* *INDENT-ON* */ -#if ! DPDK_NO_AEAD crypto_data_t *data; /* *INDENT-OFF* */ vec_foreach (data, dcm->data) @@ -558,7 +510,6 @@ add_del_sa_session (u32 sa_index, u8 is_add) ASSERT (!ret); } /* *INDENT-ON* */ -#endif return 0; } @@ -609,9 +560,7 @@ crypto_parse_capabilities (crypto_dev_t * dev, /* A single capability maps to multiple cipher/auth algorithms */ switch (cap->sym.xform_type) { -#if ! DPDK_NO_AEAD case RTE_CRYPTO_SYM_XFORM_AEAD: -#endif case RTE_CRYPTO_SYM_XFORM_CIPHER: inc = cap->sym.cipher.key_size.increment; inc = inc ? inc : 1; @@ -662,10 +611,6 @@ crypto_dev_conf (u8 dev, u16 n_qp, u8 numa) dev_conf.socket_id = numa; dev_conf.nb_queue_pairs = n_qp; -#if DPDK_NO_AEAD - dev_conf.session_mp.nb_objs = DPDK_CRYPTO_NB_SESS_OBJS; - dev_conf.session_mp.cache_size = 512; -#endif error_str = "failed to configure crypto device %u"; ret = rte_cryptodev_configure (dev, &dev_conf); @@ -676,11 +621,7 @@ crypto_dev_conf (u8 dev, u16 n_qp, u8 numa) qp_conf.nb_descriptors = DPDK_CRYPTO_N_QUEUE_DESC; for (qp = 0; qp < n_qp; qp++) { -#if DPDK_NO_AEAD - ret = rte_cryptodev_queue_pair_setup (dev, qp, &qp_conf, numa); -#else ret = rte_cryptodev_queue_pair_setup (dev, qp, &qp_conf, numa, NULL); -#endif if (ret < 0) return clib_error_return (0, error_str, dev, qp); } @@ -716,11 +657,7 @@ crypto_scan_devs (u32 n_mains) dev->numa = rte_cryptodev_socket_id (i); dev->features = info.feature_flags; dev->max_qp = info.max_nb_queue_pairs; -#if DPDK_NO_AEAD - drv_id = cryptodev->dev_type; -#else drv_id = info.driver_id; -#endif if (drv_id >= vec_len (dcm->drv)) vec_validate_init_empty (dcm->drv, drv_id, (crypto_drv_t) EMPTY_STRUCT); @@ -842,12 +779,7 @@ crypto_op_init (struct rte_mempool *mempool, { struct rte_crypto_op *op = _obj; -#if DPDK_NO_AEAD - op->sym = (struct rte_crypto_sym_op *) (op + 1); - op->sym->sess_type = RTE_CRYPTO_SYM_OP_WITH_SESSION; -#else op->sess_type = RTE_CRYPTO_OP_WITH_SESSION; -#endif op->type = RTE_CRYPTO_OP_TYPE_SYMMETRIC; op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED; op->phys_addr = rte_mem_virt2phy (_obj); @@ -900,9 +832,6 @@ crypto_create_crypto_op_pool (vlib_main_t * vm, u8 numa) static clib_error_t * crypto_create_session_h_pool (vlib_main_t * vm, u8 numa) { -#if DPDK_NO_AEAD - return NULL; -#else dpdk_crypto_main_t *dcm = &dpdk_crypto_main; crypto_data_t *data; u8 *pool_name; @@ -932,15 +861,11 @@ crypto_create_session_h_pool (vlib_main_t * vm, u8 numa) data->session_h = mp; return NULL; -#endif } static clib_error_t * crypto_create_session_drv_pool (vlib_main_t * vm, crypto_dev_t * dev) { -#if DPDK_NO_AEAD - return NULL; -#else dpdk_crypto_main_t *dcm = &dpdk_crypto_main; crypto_data_t *data; u8 *pool_name; @@ -973,7 +898,6 @@ crypto_create_session_drv_pool (vlib_main_t * vm, crypto_dev_t * dev) data->session_drv[dev->drv_id] = mp; return NULL; -#endif } static clib_error_t * diff --git a/src/plugins/dpdk/ipsec/ipsec.h b/src/plugins/dpdk/ipsec/ipsec.h index d40e480ae42..c902ce097b8 100644 --- a/src/plugins/dpdk/ipsec/ipsec.h +++ b/src/plugins/dpdk/ipsec/ipsec.h @@ -249,7 +249,9 @@ crypto_alloc_ops (u8 numa, struct rte_crypto_op ** ops, u32 n) ret = rte_mempool_get_bulk (data->crypto_op, (void **) ops, n); + /* *INDENT-OFF* */ data->crypto_op_get_failed += ! !ret; + /* *INDENT-ON* */ return ret; } @@ -306,20 +308,16 @@ crypto_set_icb (dpdk_gcm_cnt_blk * icb, u32 salt, u32 seq, u32 seq_hi) icb->salt = salt; icb->iv[0] = seq; icb->iv[1] = seq_hi; -#if DPDK_NO_AEAD - icb->cnt = clib_host_to_net_u32 (1); -#endif } -#define __unused __attribute__((unused)) static_always_inline void crypto_op_setup (u8 is_aead, struct rte_mbuf *mb0, struct rte_crypto_op *op, void *session, u32 cipher_off, u32 cipher_len, - u8 * icb __unused, u32 iv_size __unused, + u8 * icb __clib_unused, u32 iv_size __clib_unused, u32 auth_off, u32 auth_len, - u8 * aad __unused, u32 aad_size __unused, - u8 * digest, u64 digest_paddr, u32 digest_size __unused) + u8 * aad __clib_unused, u32 aad_size __clib_unused, + u8 * digest, u64 digest_paddr, u32 digest_size __clib_unused) { struct rte_crypto_sym_op *sym_op; @@ -328,32 +326,6 @@ crypto_op_setup (u8 is_aead, struct rte_mbuf *mb0, sym_op->m_src = mb0; sym_op->session = session; -#if DPDK_NO_AEAD - sym_op->cipher.data.offset = cipher_off; - sym_op->cipher.data.length = cipher_len; - - sym_op->cipher.iv.data = icb; - sym_op->cipher.iv.phys_addr = - op->phys_addr + (uintptr_t) icb - (uintptr_t) op; - sym_op->cipher.iv.length = iv_size; - - if (is_aead) - { - sym_op->auth.aad.data = aad; - sym_op->auth.aad.phys_addr = - op->phys_addr + (uintptr_t) aad - (uintptr_t) op; - sym_op->auth.aad.length = aad_size; - } - else - { - sym_op->auth.data.offset = auth_off; - sym_op->auth.data.length = auth_len; - } - - sym_op->auth.digest.data = digest; - sym_op->auth.digest.phys_addr = digest_paddr; - sym_op->auth.digest.length = digest_size; -#else /* ! DPDK_NO_AEAD */ if (is_aead) { sym_op->aead.data.offset = cipher_off; @@ -377,11 +349,8 @@ crypto_op_setup (u8 is_aead, struct rte_mbuf *mb0, sym_op->auth.digest.data = digest; sym_op->auth.digest.phys_addr = digest_paddr; } -#endif /* DPDK_NO_AEAD */ } -#undef __unused - #endif /* __DPDK_IPSEC_H__ */ /* |