From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B876143902; Fri, 19 Jan 2024 17:56:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8973940297; Fri, 19 Jan 2024 17:56:26 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 43E0840279 for ; Fri, 19 Jan 2024 17:56:25 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2901f9ea918so792857a91.3 for ; Fri, 19 Jan 2024 08:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1705683384; x=1706288184; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=6BEhUmNYO0gfpeIUO9cJjW7v+Pyj+4qYCS3XnH50H7o=; b=BhBriZnY2sg3vqyEn4f9ET9Cfqyu7bM+/7wpPMQkP0bxbPRWjW2o2HVqqUOKTscKfW ctMBDPzw8qJ80h/qS6YZrtAkp0fVJC5dP9/zengops3Zpq0/jaeaCDST7Pnn+gXLpBxO 8h4+SBTdtXLE4eiYWeRv4W2a42+IEJGtKn19MOlDk/7SPOHMf7/uRtRkg5bto8OL8Bd1 1lR/fybOJ2cJxETQgKQ5DUunzTPNSJPdbYRlNwemcdtNCxm6MFQjfNt/1YLFWhA+sUl5 qsaRPXryoCtgTjp7TerqZ54WPBoBE0DSMMGx1wqfBMGo2rHjKlwq7wNsqBB92/jMqyXL YOxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705683384; x=1706288184; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6BEhUmNYO0gfpeIUO9cJjW7v+Pyj+4qYCS3XnH50H7o=; b=i5uELQV4FJxMi9ZJ2PDR8NMqVzWrEuOGjCAIEgtBU9OAyQZb/+LI7aQN9KWB32xzX7 BJDKCZihKLlTPubYrSUS9txDcZeSKMyybIJEKi3KhvIT3fGkkx4AWwfGPMhKKLlq1dyM gA11r/KyPa8AQv1XXjOxlD6P7mYk0Ro/67NUNR7Kc8ppogfpAtnP7HRNJ4M6LZ5RHIjd /LhFnyvVUBfAjYrZ2upwYcT5sylaxqKBNQq0wOYC/JUbpw0DC6U7xZxEew4D8xaAyX4i 0P16Ea2smrks2GNzSJ9lEBZeZnmeMDpSM8DZyqLerY8UNbeVffUtCC3fU+tTqF3zvGsG GJJA== X-Gm-Message-State: AOJu0YyfHR1RiQSaJ9vjU10at8jSUTjWZnP2NXXzv2puI6M+gZdcB3Ai 1kx7kHa7MqELXH0drjkrUxQaf+o13Yb2HQ9q0ZyWfOvLkOTV7z5pmWNL3rWKaG4= X-Google-Smtp-Source: AGHT+IF7Js0C0bHUTLKlWNwdiWUmjKj9GQixZ/EPz1kztIgbppmVWHdmGDWTMyDzJRx0gQOepG41rg== X-Received: by 2002:a17:90b:2381:b0:28f:efb4:877e with SMTP id mr1-20020a17090b238100b0028fefb4877emr52220pjb.59.1705683384412; Fri, 19 Jan 2024 08:56:24 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id l10-20020a170902eb0a00b001d5e99edcd7sm3237622plb.47.2024.01.19.08.56.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 08:56:24 -0800 (PST) Date: Fri, 19 Jan 2024 08:56:22 -0800 From: Stephen Hemminger To: Rahul Bhansali Cc: , Akhil Goyal , Anoob Joseph Subject: Re: [PATCH] test/security: add inline IPsec Rx inject test Message-ID: <20240119085622.02717d9b@hermes.local> In-Reply-To: <20240119061220.1751531-1-rbhansali@marvell.com> References: <20240119061220.1751531-1-rbhansali@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, 19 Jan 2024 11:42:20 +0530 Rahul Bhansali wrote: > +static int > +test_ipsec_with_rx_inject(struct ip_pkt_vector *vector, const struct ipsec_test_flags *flags) > +{ > + struct rte_security_session_conf sess_conf_out = {0}; > + struct rte_security_session_conf sess_conf_in = {0}; > + uint32_t nb_tx, burst_sz, nb_sent = 0, nb_inj = 0; > + void *out_ses[ENCAP_DECAP_BURST_SZ] = {0}; > + void *in_ses[ENCAP_DECAP_BURST_SZ] = {0}; > + struct rte_crypto_sym_xform cipher_out = {0}; > + struct rte_crypto_sym_xform cipher_in = {0}; > + struct rte_crypto_sym_xform auth_out = {0}; > + struct rte_crypto_sym_xform aead_out = {0}; > + struct rte_crypto_sym_xform auth_in = {0}; > + struct rte_crypto_sym_xform aead_in = {0}; > + uint32_t i, j, nb_rx = 0, nb_inj_rx = 0; > + struct rte_mbuf **inj_pkts_burst; > + struct ipsec_test_data sa_data; > + uint32_t ol_flags; > + bool outer_ipv4; > + int ret = 0; > + void *ctx; > + > + inj_pkts_burst = (struct rte_mbuf **)rte_calloc("inj_buff", > + MAX_TRAFFIC_BURST, > + sizeof(void *), > + RTE_CACHE_LINE_SIZE); Why use rte_calloc(), instead of calloc() this is a test and the buffer does not need to be shared it is on stack. Cast is not necessary here, calloc and rte_calloc return void * > + if (!inj_pkts_burst) > + return TEST_FAILED; > + > + burst_sz = vector->burst ? ENCAP_DECAP_BURST_SZ : 1; > + nb_tx = burst_sz; > + > + memset(tx_pkts_burst, 0, sizeof(tx_pkts_burst[0]) * nb_tx); > + memset(rx_pkts_burst, 0, sizeof(rx_pkts_burst[0]) * nb_tx); > + memset(inj_pkts_burst, 0, sizeof(inj_pkts_burst[0]) * nb_tx); calloc routines return already zero'd buffer