From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 800BE1B33D for ; Sun, 15 Oct 2017 14:54:10 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id i124so29136220wmf.3 for ; Sun, 15 Oct 2017 05:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=/wVophOU2jRVYk0BvlM+bO1ogtVA6kzB3X3ionAQpEE=; b=Wd213CxukEbm5lYC7hbN13CrcoqaZ7jrsm4OiKXcwn8jJyneZxM5vITRhptRW9aq4M OjX2RBJBpIynKXDnflnP86ofZipBcYMv8kXH9bIiApf+1g0WcvazhkYAQ9CCl9MtlpNm 0Qzgyhdefhysx+0/j8n057Lo4JAUM561V3eu6WDf7Sa3/Pn2YMKsbOf4UEeQsaeOS/4/ Ui5wS0yCp6tlrYFwaVT2nhyS+OV4BWu4rWEPLU6NvCzLIEif3J2Drsj5eyf81pCZZtk9 chTD69Te+nIV77lXvUvTIU8OXMMT+ug2BAz5v8rUa8TUHeW6xkxlP5lo/t4j0X6sPp1O vSuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=/wVophOU2jRVYk0BvlM+bO1ogtVA6kzB3X3ionAQpEE=; b=TDDk9fUyua/lJj26dVP7yxBG6EUv0M15jq5vAZgJel6x5q/cyWcpClSqn47Lnfb7Fe IjnyupMx5cxIyZH8bDohw65Gi3sIeoK7ECrF8dvd8ifhH3XnHqCbjTv4Xxd9F2LaWhd9 FPtufIyjAucCEihYLfdfpv6wyywxAfeZsjAY+uZwKxKuL1+Kd9DChVqwhA8xV9erATTs STBBoccXgckYBCQcn9k7dwbgvR5gDEVDMQe+w8bkOT17lPRieh3rxJuXGDjUyon4OVlL 4sh+xsnolw2n+3dQkvrTZ4BeKNawfNNZAKtAS8uxnU3j/pkArNx5tu112vf9pfdr56gE aOIw== X-Gm-Message-State: AMCzsaVEQlkXBJI63uybI0SMGCU27pjqHxVZaANRNlKwIPQTDqLV/W4w yURXH5XX7ROh2+Sf6YHJUAf2tA== X-Google-Smtp-Source: ABhQp+TTo37pkqWKUtzNXNg15irIMrNNNSGg7DohiWVj7vz7kX41yqg75RaYDvNcVrKyHy2X7F9X+Q== X-Received: by 10.28.145.197 with SMTP id t188mr5044576wmd.136.1508072050255; Sun, 15 Oct 2017 05:54:10 -0700 (PDT) Received: from [10.0.38.219] ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id h185sm11663767wma.19.2017.10.15.05.54.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Oct 2017 05:54:09 -0700 (PDT) To: dev@dpdk.org, sergio.gonzalez.monroy@intel.com, pablo.de.lara.guarch@intel.com, aviadye@mellanox.com Cc: borisp@mellanox.com, akhil.goyal@nxp.com, hemant.agrawal@nxp.com, radu.nicolau@intel.com, declan.doherty@intel.com, liranl@mellanox.com, nelio.laranjeiro@6wind.com, thomas@monjalon.net References: <1507987683-12315-1-git-send-email-aviadye@dev.mellanox.co.il> <1507987683-12315-2-git-send-email-aviadye@dev.mellanox.co.il> From: Aviad Yehezkel Message-ID: <6a68e085-2435-53ca-6772-dd95b3b7ed71@dev.mellanox.co.il> Date: Sun, 15 Oct 2017 15:54:07 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1507987683-12315-2-git-send-email-aviadye@dev.mellanox.co.il> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH 02/11] examples/ipsec-secgw: Fixed init of aead crypto devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 12:54:10 -0000 On 10/14/2017 4:27 PM, aviadye@dev.mellanox.co.il wrote: > From: Aviad Yehezkel > > This was broken since new aead xfrom was introduced > > Signed-off-by: Aviad Yehezkel > --- > examples/ipsec-secgw/ipsec-secgw.c | 29 +++++++++++++++++++---------- > examples/ipsec-secgw/ipsec.h | 1 + > 2 files changed, 20 insertions(+), 10 deletions(-) > > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c > index 99dc270..7bf692c 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -1113,7 +1113,8 @@ add_mapping(struct rte_hash *map, const char *str, uint16_t cdev_id, > uint16_t qp, struct lcore_params *params, > struct ipsec_ctx *ipsec_ctx, > const struct rte_cryptodev_capabilities *cipher, > - const struct rte_cryptodev_capabilities *auth) > + const struct rte_cryptodev_capabilities *auth, > + const struct rte_cryptodev_capabilities *aead) > { > int32_t ret = 0; > unsigned long i; > @@ -1124,6 +1125,8 @@ add_mapping(struct rte_hash *map, const char *str, uint16_t cdev_id, > key.cipher_algo = cipher->sym.cipher.algo; > if (auth) > key.auth_algo = auth->sym.auth.algo; > + if (aead) > + key.aead_algo = aead->sym.aead.algo; > > ret = rte_hash_lookup(map, &key); > if (ret != -ENOENT) > @@ -1192,19 +1195,25 @@ add_cdev_mapping(struct rte_cryptodev_info *dev_info, uint16_t cdev_id, > if (i->op != RTE_CRYPTO_OP_TYPE_SYMMETRIC) > continue; > > - if (i->sym.xform_type != RTE_CRYPTO_SYM_XFORM_CIPHER) > + if (i->sym.xform_type == RTE_CRYPTO_SYM_XFORM_AEAD) { > + ret |= add_mapping(map, str, cdev_id, qp, params, > + ipsec_ctx, NULL, NULL, i); > continue; > + } > > - for (j = dev_info->capabilities; > - j->op != RTE_CRYPTO_OP_TYPE_UNDEFINED; j++) { > - if (j->op != RTE_CRYPTO_OP_TYPE_SYMMETRIC) > - continue; > + if (i->sym.xform_type == RTE_CRYPTO_SYM_XFORM_CIPHER) { > + for (j = dev_info->capabilities; > + j->op != RTE_CRYPTO_OP_TYPE_UNDEFINED; j++) { > + if (j->op != RTE_CRYPTO_OP_TYPE_SYMMETRIC) > + continue; > > - if (j->sym.xform_type != RTE_CRYPTO_SYM_XFORM_AUTH) > - continue; > + if (j->sym.xform_type != RTE_CRYPTO_SYM_XFORM_AUTH) > + continue; > > - ret |= add_mapping(map, str, cdev_id, qp, params, > - ipsec_ctx, i, j); > + ret |= add_mapping(map, str, cdev_id, qp, params, > + ipsec_ctx, i, j, NULL); > + } > + continue; > } > } > > diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h > index da1fb1b..7d057ae 100644 > --- a/examples/ipsec-secgw/ipsec.h > +++ b/examples/ipsec-secgw/ipsec.h > @@ -150,6 +150,7 @@ struct cdev_key { > uint16_t lcore_id; > uint8_t cipher_algo; > uint8_t auth_algo; > + uint8_t aead_algo; > }; > > struct socket_ctx { Tested-by: Aviad Yehezkel