From patchwork Wed May 31 14:40:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bogdan Pricope X-Patchwork-Id: 100790 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp356421qge; Wed, 31 May 2017 07:41:48 -0700 (PDT) X-Received: by 10.55.120.199 with SMTP id t190mr27880585qkc.235.1496241708849; Wed, 31 May 2017 07:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496241708; cv=none; d=google.com; s=arc-20160816; b=wPrAl1V/h2yBsoReevOk8avU6A9JkS7wZoyXtRnf8Ccmue0dt2AI8SotW1SbPea5E4 7xmOMdnExZ5+QtJhA1aGyEoSc5KMua7EIM0RkMVYHoSOp6qmjfrY9xiwCvIvgyPFFvnK iF/2PY1jDuY2Li/omoAxesl3qmqdrZZz7esn4IHnlbBblKOrDeV7N5KUeqPHYkl1FbkL ey5e8+soZJoUoFjLShNMMNaa9nHqK0ddaqcGujkhmSHHizvZ3c8e2I8USH1kyowwVZCu 24pb4s09op5zHRZmXj8vkNsBhKb9Z1JQGmFV3DIqHeqL2MZzpI9iwnsi1mwx8yfe2XmD qaaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=N3yETDjnVb9ONUOlR+yu6G8DQehEmTUfjgSXKfjPQAw=; b=00AC4aQkdXNiWcJbG99fL4HIo0X0EFc8IhuN3oNQmSoMeiimHx0vsioZusq0XurHrL 6+EH7oE4DyiVpCbztjoZeEkQP+zDL2L2QirDYJqC+j6WOQF7oqj7jqnTDW6VFo7gOhxp ltmqnFAffZl9i0cViwqZd74VzUFL5rUwEt2Awlw7EIXdbnCv5AjyPxu8TGRQCjD9+Fd6 c0O5vIywPPD3o3GjAIt4QW6QipBtDQCM2xC7hhwd2Tzj8Sp1v2yYBEBAjXpRQ6IvinVx gbzkniFCAzoVh1zeLHDJBMo+vH4sjt8xs+weYTvcji5br32wrb4a36sA8OLoYmo7GIz8 mOjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c50si16418445qtc.249.2017.05.31.07.41.48; Wed, 31 May 2017 07:41:48 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 89BE0606A6; Wed, 31 May 2017 14:41:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 2F56860729; Wed, 31 May 2017 14:41:23 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1A15260690; Wed, 31 May 2017 14:41:16 +0000 (UTC) Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by lists.linaro.org (Postfix) with ESMTPS id 51CB760694 for ; Wed, 31 May 2017 14:41:11 +0000 (UTC) Received: by mail-wm0-f49.google.com with SMTP id d127so22358789wmf.0 for ; Wed, 31 May 2017 07:41:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=N3yETDjnVb9ONUOlR+yu6G8DQehEmTUfjgSXKfjPQAw=; b=nlypzlc7BBTO8NJLRtwgQlBRfLrKeQyhKMKdspt/GwHkiGb8owSwfluzAG64UbGUbj WU9e68urIseH9sBcZJgvxOOwj9P+RWgFdtW0lCz6IhZLT1TZ5duH4N1T2HwpZPRPHy/t 0PnuK7NwqF9MgdOOBnY5QK6o28Qn+mAiFVN0Jpgu37Pk0FE7wbT4HgHZLoDJ6PagQuFf pIACYGQfmp+ddDDvfTVOh743QZ5LPfUUo6VurqTswVedeMiL17VSu+VeSBcs0ZSzDuUv XXYG6w775+PVGF1BWlX2ESPrJqR17J79k6vdAQ96CSM0FbUJohexb1Kwf96nonUusGMI eyOA== X-Gm-Message-State: AODbwcBq1hcNrenORIYvumx1XQa0SZwSPrTCD0VhcTEPDP3b2vRp6C+f dcbG1MZZ9lURxxHSbYOvBRVp X-Received: by 10.28.84.67 with SMTP id p3mr5759800wmi.40.1496241668615; Wed, 31 May 2017 07:41:08 -0700 (PDT) Received: from netbricks-team.enea.se ([193.202.22.66]) by smtp.gmail.com with ESMTPSA id e23sm22483032wre.54.2017.05.31.07.41.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 07:41:08 -0700 (PDT) From: Bogdan Pricope To: lng-odp@lists.linaro.org Date: Wed, 31 May 2017 17:40:55 +0300 Message-Id: <1496241660-27492-2-git-send-email-bogdan.pricope@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> References: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> Subject: [lng-odp] [PATCH 1/6] Initialize pktio configuration structure X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Bogdan Pricope --- platform/linux-generic/odp_packet_io.c | 2 ++ 1 file changed, 2 insertions(+) -- 1.9.1 diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 50a000e..dc24ee9 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -150,6 +150,8 @@ static void init_pktio_entry(pktio_entry_t *entry) init_out_queues(entry); pktio_classifier_init(entry); + + odp_pktio_config_init(&entry->s.config); } static odp_pktio_t alloc_lock_pktio_entry(void) From patchwork Wed May 31 14:40:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bogdan Pricope X-Patchwork-Id: 100791 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp356578qge; Wed, 31 May 2017 07:42:13 -0700 (PDT) X-Received: by 10.55.43.142 with SMTP id r14mr21274349qkr.78.1496241733685; Wed, 31 May 2017 07:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496241733; cv=none; d=google.com; s=arc-20160816; b=b9+4QBFlom/1d5JbW52gxBlpgamdPlLKMJkp5KrthoTybu61bORYGj0eUuxIMg5Mea jAPb4wpVJmviEq/kn9/9pdrlT4FvO4Vz1hfuQLqAsidRu/6xPRJKyUaCLXpTBcslbHTs VWopkJPF6YlCZl0jtktnnSwnhHYQvF8RL4Y8u3btAQ4WaHCwC6Cz4EWxfvC9BTd5inbC raarPe9Qy5AbO5evvXT6x9LYofci3YcykpDTJ6cO8gjoVFOaWPndSVkLpC4PLMMDNOW6 P6PMbMnWxXy2XKZ7L92ayhSDFoouyJWTyvHEmEYtqMzlNRiYoQY6iWlPtFntfZ+sc6+F ZEeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=Ti7c3BiF3/UhbQeKiJ15Scrb8Y0zIXWGCrRjnEG+9JA=; b=wDxR9PAsHLUEFfS7LP7uWzO5Y6c+OfR4XwXm9LgAvlOdpgxbf6v8hiVDU0FzVOSaLz kmWwmud/1WKT73aCA+a/8YdE0nuWvk0T/6xSXp1QFP0rgMZnmmZz6GDMq5k8Cs5IjrKH /XO9IVva1bbc2Nxa2bD7AvMOGqBH3tAoDnhQ2ugXloHRI73s2B+fg/85lpEgzAjfDvFN vARqdpX8fLBSUX2DnRAGHO4idExYdP9TNIk0WomAQiFVx5NqFFreDeyChRoyKa+sVqXX B627kBynDPzjwsyN4pYQOqFg9B5x5tdh1l3+CWZ98DKMvq+sy7HdQmbThj9yY0TASAj1 k7Vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f15si17937526qki.151.2017.05.31.07.42.13; Wed, 31 May 2017 07:42:13 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 4D42760CDC; Wed, 31 May 2017 14:42:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 9D98160CC6; Wed, 31 May 2017 14:41:25 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 013CB6069B; Wed, 31 May 2017 14:41:17 +0000 (UTC) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by lists.linaro.org (Postfix) with ESMTPS id 953B8606A6 for ; Wed, 31 May 2017 14:41:13 +0000 (UTC) Received: by mail-wm0-f43.google.com with SMTP id 7so121389588wmo.1 for ; Wed, 31 May 2017 07:41:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ti7c3BiF3/UhbQeKiJ15Scrb8Y0zIXWGCrRjnEG+9JA=; b=FYMpD0LaZXRrQHvtkTehO7TmEgsur6VrmwAZYu/t03u5BGJ1BzEL/ScdfQQ67gWzSK 9E9wPxbJZklD6oEFZPAFSol08HUKbAEt01IYNR9+icestn/33Utx6PhypbU4lP0n9gjT 9MOdXcfX51HIt9KXtKP3V+9ArLfSWOxvjY0h9b+7/ABMKdrtemZb3/o6tm4tUSzW6cEf Dje2gcGaHlmA0LuPco5D/GhOzXqt+2lrX3zOxG664/k+MVSC1E/QVNGCtehcRrVwklYw puYjkt97PTXANBlnEZ5lkZUZvdzVwPYmvXUMzOn7kpCw0EV6HNR0iSAmkJeBokCzrabD o3GA== X-Gm-Message-State: AODbwcCSK/AGG7i3Ll1Ua3JlfPPE/58tJTUlieUBcqtQp1F07Owt5ExB ReW3rDVcDmjOy+UMsBe0wOcT X-Received: by 10.28.54.206 with SMTP id y75mr5822459wmh.72.1496241672470; Wed, 31 May 2017 07:41:12 -0700 (PDT) Received: from netbricks-team.enea.se ([193.202.22.66]) by smtp.gmail.com with ESMTPSA id e23sm22483032wre.54.2017.05.31.07.41.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 07:41:12 -0700 (PDT) From: Bogdan Pricope To: lng-odp@lists.linaro.org Date: Wed, 31 May 2017 17:40:56 +0300 Message-Id: <1496241660-27492-3-git-send-email-bogdan.pricope@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> References: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> Subject: [lng-odp] [PATCH 2/6] dpdk: retrieve offload capabilities X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Bogdan Pricope --- platform/linux-generic/pktio/dpdk.c | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) -- 1.9.1 diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 6ac89bd..a7fb888 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -420,6 +420,11 @@ static void dpdk_init_capability(pktio_entry_t *pktio_entry, { pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk; odp_pktio_capability_t *capa = &pkt_dpdk->capa; + int ptype_cnt; + int ptype_l3_ipv4 = 0; + int ptype_l4_tcp = 0; + int ptype_l4_udp = 0; + uint32_t ptype_mask = RTE_PTYPE_L3_MASK | RTE_PTYPE_L4_MASK; memset(dev_info, 0, sizeof(struct rte_eth_dev_info)); memset(capa, 0, sizeof(odp_pktio_capability_t)); @@ -431,9 +436,56 @@ static void dpdk_init_capability(pktio_entry_t *pktio_entry, PKTIO_MAX_QUEUES); capa->set_op.op.promisc_mode = 1; + ptype_cnt = rte_eth_dev_get_supported_ptypes(pkt_dpdk->port_id, + ptype_mask, NULL, 0); + if (ptype_cnt > 0) { + uint32_t ptypes[ptype_cnt]; + int i; + + ptype_cnt = rte_eth_dev_get_supported_ptypes(pkt_dpdk->port_id, + ptype_mask, ptypes, + ptype_cnt); + for (i = 0; i < ptype_cnt; i++) + switch (ptypes[i]) { + case RTE_PTYPE_L3_IPV4: + case RTE_PTYPE_L3_IPV4_EXT_UNKNOWN: + case RTE_PTYPE_L3_IPV4_EXT: + ptype_l3_ipv4 = 1; + break; + case RTE_PTYPE_L4_TCP: + ptype_l4_tcp = 1; + break; + case RTE_PTYPE_L4_UDP: + ptype_l4_udp = 1; + break; + } + } + odp_pktio_config_init(&capa->config); capa->config.pktin.bit.ts_all = 1; capa->config.pktin.bit.ts_ptp = 1; + + capa->config.pktin.bit.ipv4_chksum = ptype_l3_ipv4 && + (dev_info->rx_offload_capa & DEV_RX_OFFLOAD_IPV4_CKSUM) ? 1 : 0; + if (capa->config.pktin.bit.ipv4_chksum) + capa->config.pktin.bit.drop_ipv4_err = 1; + + capa->config.pktin.bit.udp_chksum = ptype_l4_udp && + (dev_info->rx_offload_capa & DEV_RX_OFFLOAD_UDP_CKSUM) ? 1 : 0; + if (capa->config.pktin.bit.udp_chksum) + capa->config.pktin.bit.drop_udp_err = 1; + + capa->config.pktin.bit.tcp_chksum = ptype_l4_tcp && + (dev_info->rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) ? 1 : 0; + if (capa->config.pktin.bit.tcp_chksum) + capa->config.pktin.bit.drop_tcp_err = 1; + + capa->config.pktout.bit.ipv4_chksum = + (dev_info->tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM) ? 1 : 0; + capa->config.pktout.bit.udp_chksum = + (dev_info->tx_offload_capa & DEV_TX_OFFLOAD_UDP_CKSUM) ? 1 : 0; + capa->config.pktout.bit.tcp_chksum = + (dev_info->tx_offload_capa & DEV_TX_OFFLOAD_TCP_CKSUM) ? 1 : 0; } static int dpdk_open(odp_pktio_t id ODP_UNUSED, From patchwork Wed May 31 14:40:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bogdan Pricope X-Patchwork-Id: 100792 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp356761qge; Wed, 31 May 2017 07:42:43 -0700 (PDT) X-Received: by 10.200.56.243 with SMTP id g48mr28802833qtc.79.1496241763280; Wed, 31 May 2017 07:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496241763; cv=none; d=google.com; s=arc-20160816; b=Yxo8uJchvrOFh2LA6PlDAPklzZHOUst/edfEtR2pLfdCtnMaYoVq5iWUBW1IU3oRb6 YhQgIDFh3HvPgyqYr7SmpTZz+mbBS9TnKV/fupxZRf4EXnq/wohTBDGpo1JioMgENRSd 9U7YnuXwGEyqlC3YuY4ZNYTUqcNDydzfQNVpzESzHYkX9+ZmK1Mqb5PHeNclJHcF8Ffe cMYel49dAAAalViB8EIKTmVS3rhPTKrHqQygb3pGgcbDbmVpRsgsU78eEBsCoOgPHOYs oLIdIOlzNl5OLjfAhYDKXmYuzIy+w0RryozV8f9cuikm0udEpHVLGtaeSv+kx+/13cbM ecrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=LF3Xz8YPzLpI8yIgv2It+t/LTYDKVpKnbrwyjxuY//I=; b=YyO+q4qL5CWrVg/bP8b8lRpXdH7kzrfCWXfQSU+O0TvHuSXou7hiQGP7530gsA1Yu5 VhNH0GO37EelzGA8X5iCubpYyiRNlaTwvZz7sypzCXtm/FWuEz+aqpqSXqVGm+2kOFIK a3hsdjxBaDgJ6gxH5VnsU9GVtvJeAXAsrrrh6y9tileltOxoRjbxbnWwiLV6xifGTlxk zHBl71rYgTBWDsLjw7U1UllD4WKo2QbEGZ3AqMSqoqbEu2GiMXrSqbjM0diqXI1DL3S5 BVR/SmCLXSo3yCS1wZp9iNY3yu4D4FTRDoRMrXxQvrrQpFF6cBo818bLkgqxdePl7qHe thdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d127si15895579qkf.71.2017.05.31.07.42.43; Wed, 31 May 2017 07:42:43 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E892660D3C; Wed, 31 May 2017 14:42:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id DFCE760CA0; Wed, 31 May 2017 14:41:27 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7FE1F60690; Wed, 31 May 2017 14:41:19 +0000 (UTC) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by lists.linaro.org (Postfix) with ESMTPS id DAE6060690 for ; Wed, 31 May 2017 14:41:16 +0000 (UTC) Received: by mail-wm0-f42.google.com with SMTP id m7so34457555wmg.0 for ; Wed, 31 May 2017 07:41:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LF3Xz8YPzLpI8yIgv2It+t/LTYDKVpKnbrwyjxuY//I=; b=R3yySs1JfyQrOVOJba1V9FrL9IQLhrIrouKzy61cPKWac5ED3Ftj8u4ZZ5mianoqSd RTBoQRyb+LbrSmv24X3uvmUy5fwwIpKymb8k0Ylw2XSZ/fc7BSqrmfdsLqStpn3mrmCO Qsdj1lMx/3Ot1C3n7oXIb+BlR4lRmo/p3OFVPomvJU7g9KzGTF+hFOjnsAbs1GBSrRy4 DWas/WDxlXobE+qLd4HO0RWQa5FPiYE5YDatchxtPdbDlUyCzc2/LvBgwm6h1eZ7x3H2 SY2W5BLS96Q/cT11EaRLo0ohLMEVfuWkBYWqkn5h7glzV5aaZCogRJloeBntrslweoy5 /6FQ== X-Gm-Message-State: AODbwcAY+FdvtCLDW2S7Q2GDWgpIuTg6qb7Kl2HRwYZy9CUCFQXshJN+ 1yMHol1EYQ0tlX/oS+9nSjdv X-Received: by 10.223.183.20 with SMTP id l20mr18094475wre.178.1496241675792; Wed, 31 May 2017 07:41:15 -0700 (PDT) Received: from netbricks-team.enea.se ([193.202.22.66]) by smtp.gmail.com with ESMTPSA id e23sm22483032wre.54.2017.05.31.07.41.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 07:41:15 -0700 (PDT) From: Bogdan Pricope To: lng-odp@lists.linaro.org Date: Wed, 31 May 2017 17:40:57 +0300 Message-Id: <1496241660-27492-4-git-send-email-bogdan.pricope@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> References: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> Subject: [lng-odp] [PATCH 3/6] dpdk: enable per pktio RX IP/UDP/TCP checksum offload X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Bogdan Pricope --- platform/linux-generic/pktio/dpdk.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index a7fb888..94d2abe 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -189,6 +189,7 @@ static int dpdk_setup_port(pktio_entry_t *pktio_entry) int ret; pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk; struct rte_eth_rss_conf rss_conf; + uint16_t hw_ip_checksum = 0; /* Always set some hash functions to enable DPDK RSS hash calculation */ if (pkt_dpdk->hash.all_bits == 0) { @@ -198,13 +199,18 @@ static int dpdk_setup_port(pktio_entry_t *pktio_entry) rss_conf_to_hash_proto(&rss_conf, &pkt_dpdk->hash); } + if (pktio_entry->s.config.pktin.bit.ipv4_chksum || + pktio_entry->s.config.pktin.bit.udp_chksum || + pktio_entry->s.config.pktin.bit.tcp_chksum) + hw_ip_checksum = 1; + struct rte_eth_conf port_conf = { .rxmode = { .mq_mode = ETH_MQ_RX_RSS, .max_rx_pkt_len = pkt_dpdk->data_room, .split_hdr_size = 0, .header_split = 0, - .hw_ip_checksum = 0, + .hw_ip_checksum = hw_ip_checksum, .hw_vlan_filter = 0, .jumbo_frame = 1, .hw_strip_crc = 0, From patchwork Wed May 31 14:40:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bogdan Pricope X-Patchwork-Id: 100793 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp356953qge; Wed, 31 May 2017 07:43:09 -0700 (PDT) X-Received: by 10.237.62.115 with SMTP id m48mr30446363qtf.179.1496241789446; Wed, 31 May 2017 07:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496241789; cv=none; d=google.com; s=arc-20160816; b=k0UxlNLAhVg4jGB5mtGwmgmi0oKZ8LG2c+BVc/nUM8Jh8RXN+TJ+x0SDthgZJuS0s+ IhyBoQAhk2mtyYIa4J0uSoMw6V/V672cpxnTyTfR5L2gUaGcJx83KPpZ+jRObWoLCWot VWeTdhXfUs3UaUgvBdU7xaJ1Emm+oRbgxCMK75rh0L7lpVULPLIyuvUW3gOimLErQuBA Mtt5J6OP6jEUxqVv/axJSEq+aQo7ObuRsiMFYglF16AzrslxB3TZH0xN9sdw9D7bIMWO Ar5JQK3E/ptomrvVmELMgi5gP7SX4DdbzI31QECdkwtbi8wzha4iPeJtIa+DDkzj6KnH caLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=3InCbwKle5Qoza8L3a5RSq2fnOTAlGP1Y/2uZ3YjR/s=; b=XygGb54AxfJrVMAvHaN+tWPBJGY/5UW19pIVyLEKTDth3EFgv4dQqcFtLj+tSyEblb LeIYZvh5Aecio0ZZoi0W26oCD2Xi0EE85IAKVsEbXyRWe2ZOCZ7bNABeyp0SpEkcQgso bP1pCDGqd8cdJL+u5TzZKMxRqW7odEiz00UeXqXjMUzQ7mRzRNoJikXH9f7XRHzN2zXA yiF9Guftqtc9sk2+Liyz6qsu33DiB1m4MzASVLEBlLxrLXVr2J4R7n8EBWm8e2cKYwYj aoNTb6UcxUJGU4jP4GefrRTZ254D+MFnjtjPO0bYCIHpcwFq7SPiMppPODAys1cO2c3R 3P5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p68si16292697qkb.237.2017.05.31.07.43.09; Wed, 31 May 2017 07:43:09 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2124F60CBA; Wed, 31 May 2017 14:43:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 362CA60CE2; Wed, 31 May 2017 14:41:34 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9B68660729; Wed, 31 May 2017 14:41:22 +0000 (UTC) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by lists.linaro.org (Postfix) with ESMTPS id BE6EE60690 for ; Wed, 31 May 2017 14:41:20 +0000 (UTC) Received: by mail-wm0-f44.google.com with SMTP id e127so23686862wmg.1 for ; Wed, 31 May 2017 07:41:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3InCbwKle5Qoza8L3a5RSq2fnOTAlGP1Y/2uZ3YjR/s=; b=X8wW4CGCaRh6PnQroIKk2/k4dcFow9lVHb+6xbR0U9CLTei2Y/hCOylmN5QbgO9Mxr C7z4zbxXaEAlawt2Nkt0gf2OkcvvRDpu5ggfiCXVIKfy28ztxt/o1QiuidB8CClJiMgV KwACjHS+Si3Ia6whNBuppZHmVUFAdtGEqPLSny5RA9UFCLtlC6UXclDuJuIPYgiwx9WS eLysZPAwtikxRsZ7PWsZZkviGSAzXhssKtIJoKx0b88+KGQWxTJSwRHQbB8LMVK3M2Aj /PpWe5kGwqq4frPH775ApNj+S6s4i4jgfAt37WHSx7og1/cQyOpdHA8FOCxQz8mo3CpQ O0lQ== X-Gm-Message-State: AODbwcDYVKGRJxB4EO+6sOw9jLkaXM/672tiWcXosRZGFBcixn3CvNk4 WeKr3VsS8v5Ccn+q/LwmGMz3 X-Received: by 10.223.177.215 with SMTP id r23mr21421917wra.97.1496241679676; Wed, 31 May 2017 07:41:19 -0700 (PDT) Received: from netbricks-team.enea.se ([193.202.22.66]) by smtp.gmail.com with ESMTPSA id e23sm22483032wre.54.2017.05.31.07.41.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 07:41:19 -0700 (PDT) From: Bogdan Pricope To: lng-odp@lists.linaro.org Date: Wed, 31 May 2017 17:40:58 +0300 Message-Id: <1496241660-27492-5-git-send-email-bogdan.pricope@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> References: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> Subject: [lng-odp] [PATCH 4/6] dpdk: RX - process checksum validation offload flags X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Bogdan Pricope --- platform/linux-generic/pktio/dpdk.c | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) -- 1.9.1 diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 94d2abe..58e6db0 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -649,6 +649,8 @@ static int dpdk_stop(pktio_entry_t *pktio_entry) return 0; } +#define HAS_L4_PROTO(m, proto) ((m->packet_type & RTE_PTYPE_L4_MASK) == proto) + static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry, odp_packet_t pkt_table[], struct rte_mbuf *mbuf_table[], @@ -663,9 +665,11 @@ static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry, int nb_pkts = 0; int alloc_len, num; odp_pool_t pool = pktio_entry->s.pkt_dpdk.pool; + odp_pktin_config_opt_t *pktin_cfg; /* Allocate maximum sized packets */ alloc_len = pktio_entry->s.pkt_dpdk.data_room; + pktin_cfg = &pktio_entry->s.config.pktin; num = packet_alloc_multi(pool, alloc_len, pkt_table, mbuf_num); if (num != mbuf_num) { @@ -718,6 +722,40 @@ static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry, packet_set_ts(pkt_hdr, ts); + if (pktin_cfg->bit.ipv4_chksum && + (mbuf->packet_type & RTE_PTYPE_L3_IPV4) && + mbuf->ol_flags & PKT_RX_IP_CKSUM_BAD) { + if (pktin_cfg->bit.drop_ipv4_err) { + odp_packet_free(pkt); + rte_pktmbuf_free(mbuf); + continue; + } else { + pkt_hdr->p.error_flags.ip_err = 1; + } + } + + if (pktin_cfg->bit.udp_chksum && + HAS_L4_PROTO(mbuf, RTE_PTYPE_L4_UDP) && + mbuf->ol_flags & PKT_RX_L4_CKSUM_BAD) { + if (pktin_cfg->bit.drop_udp_err) { + odp_packet_free(pkt); + rte_pktmbuf_free(mbuf); + continue; + } else { + pkt_hdr->p.error_flags.udp_err = 1; + } + } else if (pktin_cfg->bit.tcp_chksum && + HAS_L4_PROTO(mbuf, RTE_PTYPE_L4_TCP) && + mbuf->ol_flags & PKT_RX_L4_CKSUM_BAD) { + if (pktin_cfg->bit.drop_tcp_err) { + odp_packet_free(pkt); + rte_pktmbuf_free(mbuf); + continue; + } else { + pkt_hdr->p.error_flags.tcp_err = 1; + } + } + pkt_table[nb_pkts++] = pkt; rte_pktmbuf_free(mbuf); From patchwork Wed May 31 14:40:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bogdan Pricope X-Patchwork-Id: 100794 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp357147qge; Wed, 31 May 2017 07:43:39 -0700 (PDT) X-Received: by 10.237.59.225 with SMTP id s30mr30909584qte.192.1496241819120; Wed, 31 May 2017 07:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496241819; cv=none; d=google.com; s=arc-20160816; b=EZLMRxIuEbeCN1jHe33JAQyPYB+dJ0Ib26GZyhY6SbEVpAhrHHToPAix8Cw9kSsyEG MPljo+lhf43kpcMq8e6f/88kPO5iAYQJfNqW4ttufjDpQZQZQ2BiBk0ULzyORLwhKP7G CdCjvXf/1AShvKPSgYT6NapgkDwoLmsfwn9C4y/Gr1QMNNUHLypOIzmwizE0gBt+z5ji smaMnWAiLcnq8G3Gmlv8qnN4nokjwY9/6S7bQoguuNqbJPBkWt8C9SV5udPNthtMCKE8 Hnx1ywaAW0Td155bxqO/u+AVrNmy/milvtr23NqGwEHyJ7DeyaV3KaflRIz4PvOc2PPP 0iZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=YgYPFH6N1gOWR78RH2abOqMeHgdkxNexAk9BPS3IbFI=; b=RaB5GVAAtL5h8qvT5dbbkDjRXPnRzDWHpns0PDbA7lQXZIxI56Iw4WuVvNzTkVUDgA 2whmZ+GuyXJNfPWX7zxobZe9DJmVEJttVqJRKlDJM5UcaiVeF7GFjDx/4Q/IDch5wyWO hZlgDbMMQtl1Y5gJMFqQpz3C6YBixhXCVLgGbHQNb7/ub4FePxNKl76tf3AQuVUHxp56 7G6HH1NR6R5uQmaYl3Gw2TpAT9KVrsnXPmJB/9tNAljDCLjpGA3AY1KP0uRT4Nj1SVau TlFeYjXcGfaumbJoOwaQ2BKbi/kpwf1wuuDwJYi0Mr4imD5rrmvDyGRMk/IEkmfnAISI rY0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j16si16470729qtj.215.2017.05.31.07.43.38; Wed, 31 May 2017 07:43:39 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C2CBE6069C; Wed, 31 May 2017 14:43:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 923E260718; Wed, 31 May 2017 14:41:53 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9D10660CDC; Wed, 31 May 2017 14:41:48 +0000 (UTC) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by lists.linaro.org (Postfix) with ESMTPS id DCB7160690 for ; Wed, 31 May 2017 14:41:22 +0000 (UTC) Received: by mail-wm0-f51.google.com with SMTP id e127so23688748wmg.1 for ; Wed, 31 May 2017 07:41:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YgYPFH6N1gOWR78RH2abOqMeHgdkxNexAk9BPS3IbFI=; b=lUqhFPDeS1eDunL6JZnTi/GdOB+lGRGdvFrgh4S83Df+qAD1X9EirMRX5PysnrhXrv I18rxfOwk4FktiyLaBfD3wsdQqLLll/M7dqzXb5rMvoiEtATET/RFoztDiUx8RGb2Fov /Pc3ZcUWWd0xa2Rn//hhRIuyCu08a8w7BGS6sS51qg/IXQFNoyok5Sf4UDIwIgI70Q+R i25CA8QERRsskP/WfxU6IL3K7p8Ty1If+61kX8vw+GMyc7Nl8Nz+bzRTxGwFhnpHkjHc btvUxadORwnELUt4naIk2EHq6C52XNQajej4dr+/jnKQurctNiLymuBjowG3RIQqjZ5R GAiw== X-Gm-Message-State: AODbwcCDBFAIsICAKxtLh9qBc/uKWIuBkcqB4t0OllDE5azWJHmBWvxH maKwxJaukH4LWqrIJq/gVVfP X-Received: by 10.223.135.248 with SMTP id c53mr4939272wrc.109.1496241681784; Wed, 31 May 2017 07:41:21 -0700 (PDT) Received: from netbricks-team.enea.se ([193.202.22.66]) by smtp.gmail.com with ESMTPSA id e23sm22483032wre.54.2017.05.31.07.41.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 07:41:21 -0700 (PDT) From: Bogdan Pricope To: lng-odp@lists.linaro.org Date: Wed, 31 May 2017 17:40:59 +0300 Message-Id: <1496241660-27492-6-git-send-email-bogdan.pricope@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> References: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> Subject: [lng-odp] [PATCH 5/6] dpdk: TX - set checksum calculation offload flags X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Bogdan Pricope --- platform/linux-generic/pktio/dpdk.c | 105 ++++++++++++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 58e6db0..b721bf6 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -27,6 +27,10 @@ #include #include #include +#include +#include +#include +#include #include static int disable_pktio; /** !0 this pktio disabled, 0 enabled */ @@ -772,6 +776,41 @@ fail: return (i > 0 ? i : -1); } +static inline int packet_parse(void *l3_hdr, uint8_t *l3_proto_v4, + uint8_t *l4_proto) +{ + uint8_t l3_proto_ver = _ODP_IPV4HDR_VER(*(uint8_t *)l3_hdr); + + if (l3_proto_ver == _ODP_IPV4) { + struct ipv4_hdr *ip = (struct ipv4_hdr *)l3_hdr; + + *l3_proto_v4 = 1; + if (!rte_ipv4_frag_pkt_is_fragmented(ip)) + *l4_proto = ip->next_proto_id; + else + *l4_proto = 0; + + return 0; + } else if (l3_proto_ver == _ODP_IPV6) { + struct ipv6_hdr *ipv6 = (struct ipv6_hdr *)l3_hdr; + + *l3_proto_v4 = 0; + *l4_proto = ipv6->proto; + return 0; + } + + return -1; +} + +static inline uint16_t phdr_csum(int ipv4, void *l3_hdr, + uint64_t ol_flags) +{ + if (ipv4) + return rte_ipv4_phdr_cksum(l3_hdr, ol_flags); + else /*ipv6*/ + return rte_ipv6_phdr_cksum(l3_hdr, ol_flags); +} + static inline int pkt_to_mbuf(pktio_entry_t *pktio_entry, struct rte_mbuf *mbuf_table[], const odp_packet_t pkt_table[], uint16_t num) @@ -779,15 +818,30 @@ static inline int pkt_to_mbuf(pktio_entry_t *pktio_entry, pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk; int i, j; char *data; + odp_packet_t pkt; uint16_t pkt_len; + packet_parser_t *pkt_p; + struct rte_mbuf *mbuf; + void *l3_hdr, *l4_hdr; + odp_bool_t ipv4_chksum_cfg, udp_chksum_cfg, tcp_chksum_cfg; + odp_bool_t ipv4_chksum_pkt, udp_chksum_pkt, tcp_chksum_pkt; + uint8_t l3_proto_v4, l4_proto; if (odp_unlikely((rte_pktmbuf_alloc_bulk(pkt_dpdk->pkt_pool, mbuf_table, num)))) { ODP_ERR("Failed to alloc mbuf\n"); return 0; } + + ipv4_chksum_cfg = pktio_entry->s.config.pktout.bit.ipv4_chksum; + udp_chksum_cfg = pktio_entry->s.config.pktout.bit.udp_chksum; + tcp_chksum_cfg = pktio_entry->s.config.pktout.bit.tcp_chksum; + for (i = 0; i < num; i++) { - pkt_len = _odp_packet_len(pkt_table[i]); + mbuf = mbuf_table[i]; + pkt = pkt_table[i]; + pkt_len = _odp_packet_len(pkt); + pkt_p = &odp_packet_hdr(pkt)->p; if (pkt_len > pkt_dpdk->mtu) { if (i == 0) @@ -796,9 +850,54 @@ static inline int pkt_to_mbuf(pktio_entry_t *pktio_entry, } /* Packet always fits in mbuf */ - data = rte_pktmbuf_append(mbuf_table[i], pkt_len); + data = rte_pktmbuf_append(mbuf, pkt_len); + + odp_packet_copy_to_mem(pkt, 0, pkt_len, data); + + if (!pktio_entry->s.config.pktout.all_bits) + continue; + + l3_hdr = (void *)(data + pkt_p->l3_offset); + + if (packet_parse(l3_hdr, &l3_proto_v4, &l4_proto)) + continue; + + ipv4_chksum_pkt = ipv4_chksum_cfg && l3_proto_v4; + udp_chksum_pkt = udp_chksum_cfg && + (l4_proto == _ODP_IPPROTO_UDP); + tcp_chksum_pkt = tcp_chksum_cfg && + (l4_proto == _ODP_IPPROTO_TCP); + + if (!ipv4_chksum_pkt && !udp_chksum_pkt && !tcp_chksum_pkt) + continue; + + mbuf->l2_len = pkt_p->l3_offset - pkt_p->l2_offset; + mbuf->l3_len = pkt_p->l4_offset - pkt_p->l3_offset; - odp_packet_copy_to_mem(pkt_table[i], 0, pkt_len, data); + if (l3_proto_v4) + mbuf->ol_flags = PKT_TX_IPV4; + else + mbuf->ol_flags = PKT_TX_IPV6; + + if (ipv4_chksum_pkt) { + mbuf->ol_flags |= PKT_TX_IP_CKSUM; + + ((struct ipv4_hdr *)l3_hdr)->hdr_checksum = 0; + } + + l4_hdr = (void *)(data + pkt_p->l4_offset); + + if (udp_chksum_pkt) { + mbuf->ol_flags |= PKT_TX_UDP_CKSUM; + + ((struct udp_hdr *)l4_hdr)->dgram_cksum = + phdr_csum(l3_proto_v4, l3_hdr, mbuf->ol_flags); + } else if (tcp_chksum_pkt) { + mbuf->ol_flags |= PKT_TX_TCP_CKSUM; + + ((struct tcp_hdr *)l4_hdr)->cksum = + phdr_csum(l3_proto_v4, l3_hdr, mbuf->ol_flags); + } } return i; From patchwork Wed May 31 14:41:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bogdan Pricope X-Patchwork-Id: 100795 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp357412qge; Wed, 31 May 2017 07:44:17 -0700 (PDT) X-Received: by 10.55.66.80 with SMTP id p77mr26236459qka.225.1496241857079; Wed, 31 May 2017 07:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496241857; cv=none; d=google.com; s=arc-20160816; b=F5aJd0FtJBgeOvKfrhEFyWhYEYQ+QlicpUYnmctEoRXsj4rQUC8ri2ERpr8Gr5PGtF IvQGBLYF16LGsjF3f+mxUwndpywaTYXoAJAHDywDd1/IWCgEzJx94LSaYvxSaZVjiLEj +6J5f2MAK7Z0+CkEvGqL9Sd71GxtQEoPEVRxtl7qFegOdUAOv+yHBIRMPzEqpQ7zSU4u bpVdLdGJlyEzUcrfAGo5eliT/mJdGxHgcTETCUfQhuDzdCNnf2MDbxNeIoBpDIUbqCfN ocqxizcl1n1QrLnakvl+SABxAZFSj+sWFSUHoxJpRV57ukr5+9d0d/rgcb9bMQZ8DjFw sl7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=hVxLDku1a8zrKLR2vIKoAx4l+1VfaytVbvwAWNDtx6U=; b=h1yP/Frm6ypigrCXh5BSOu3eXORhKhTVWx8yq5yaVQtQlv6t2f/5NB1UPom6rzjBou GnaictjFQDk5jYyF07DbEq9hfAPcH2vDapB5kKQ6gYJU0hlnqaiRvjdNFr4xffrXXDTZ NlDa8O442TpMGaz5d4Z+TKOut2yChjjNh13u+fTiBXz19JR1d+RXN45+0FVpqAm1luU2 5CVVRWcWDV6o3vUQ1VttlD59OhLaG5fL0uQyOXpGmR8zj0LH2CUcX4Vp8J5Gmi/ABsAb ImhKM7JLB45wmZdSsTynMQw5N9xxeOSXfm2h0kHGzYOL9ihZqmAEiffJflYWpixzdw2p hxcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p65si16192819qkd.290.2017.05.31.07.44.16; Wed, 31 May 2017 07:44:17 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C0E6860C51; Wed, 31 May 2017 14:44:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 2E282607C6; Wed, 31 May 2017 14:42:16 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 595C160B4B; Wed, 31 May 2017 14:42:10 +0000 (UTC) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by lists.linaro.org (Postfix) with ESMTPS id 6757060694 for ; Wed, 31 May 2017 14:41:25 +0000 (UTC) Received: by mail-wm0-f48.google.com with SMTP id 7so121396818wmo.1 for ; Wed, 31 May 2017 07:41:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hVxLDku1a8zrKLR2vIKoAx4l+1VfaytVbvwAWNDtx6U=; b=o+XJndDHkteyMDxURjYGJP7fOxKlO1/OiNC1kJ+h90bEcEHO5baYNg+XCxko81Gjqd rw2LV/so9hgefd8PxlfR8Mik/zPiIa5zvubb6NKZBwLKi81YWX8v9UsVW6qI6LQGa4eA 35rVpnNiaa3XxDxj/ZOGZw3hB/MwD9P0Unlco86x9uIPLVrOUluyZZcwgVB09XWsNSl4 CvsOVyXc0D/Er7IuIPcrpdRz5qulxSIlUdHLSpNnmfKxCYk2kWIsgopB3+p23S1dIhQg zTN5L7CfaUcwyQbDgf6Ha7i10uZyxoWjjTH1MIpQs3IPwRNkKw0BXwrPoAOp9eGERIXZ 199g== X-Gm-Message-State: AODbwcBim4stAF7Ge3/yzfe5urpD3Ng7skfDVneXxKGkQsvl2cH43Teg lsn6ZHQ26T+3eCu7f0mu7E39 X-Received: by 10.28.185.200 with SMTP id j191mr5945510wmf.48.1496241683968; Wed, 31 May 2017 07:41:23 -0700 (PDT) Received: from netbricks-team.enea.se ([193.202.22.66]) by smtp.gmail.com with ESMTPSA id e23sm22483032wre.54.2017.05.31.07.41.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 07:41:23 -0700 (PDT) From: Bogdan Pricope To: lng-odp@lists.linaro.org Date: Wed, 31 May 2017 17:41:00 +0300 Message-Id: <1496241660-27492-7-git-send-email-bogdan.pricope@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> References: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> Subject: [lng-odp] [PATCH 6/6] examples: generator: update odp_generator to use HW checksum capabilities X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Bogdan Pricope --- example/generator/odp_generator.c | 107 ++++++++++++++++++++++++++++++++------ 1 file changed, 92 insertions(+), 15 deletions(-) -- 1.9.1 diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 3ec7d8d..78d568a 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -46,6 +46,7 @@ typedef struct { odp_pktio_t pktio; + odp_pktio_config_t config; odp_pktout_queue_t pktout[MAX_WORKERS]; unsigned pktout_count; } interface_t; @@ -92,6 +93,7 @@ static struct { */ typedef struct { odp_pktout_queue_t pktout; /**< Packet output queue to use*/ + odp_pktout_config_opt_t *pktout_cfg; /**< Packet output offload config*/ odp_pool_t pool; /**< Pool for packet IO */ odp_timer_pool_t tp; /**< Timer pool handle */ odp_queue_t tq; /**< Queue for timeouts */ @@ -116,6 +118,9 @@ static args_t *args; /** Barrier to sync threads execution */ static odp_barrier_t barrier; +/** List of interfaces */ +static interface_t *ifs; + /* helper funcs */ static void parse_args(int argc, char *argv[], appl_args_t *appl_args); static void print_info(char *progname, appl_args_t *appl_args); @@ -193,7 +198,8 @@ static int scan_ip(char *buf, unsigned int *paddr) * @return Handle of created packet * @retval ODP_PACKET_INVALID Packet could not be created */ -static odp_packet_t setup_udp_pkt_ref(odp_pool_t pool) +static odp_packet_t setup_udp_pkt_ref(odp_pool_t pool, + odp_pktout_config_opt_t *pktout_cfg) { odp_packet_t pkt; char *buf; @@ -237,8 +243,10 @@ static odp_packet_t setup_udp_pkt_ref(odp_pool_t pool) udp->src_port = odp_cpu_to_be_16(args->appl.srcport); udp->dst_port = odp_cpu_to_be_16(args->appl.dstport); udp->length = odp_cpu_to_be_16(args->appl.payload + ODPH_UDPHDR_LEN); - udp->chksum = 0; - udp->chksum = odph_ipv4_udp_chksum(pkt); + if (!pktout_cfg->bit.udp_chksum) { + udp->chksum = 0; + udp->chksum = odph_ipv4_udp_chksum(pkt); + } return pkt; } @@ -252,7 +260,8 @@ static odp_packet_t setup_udp_pkt_ref(odp_pool_t pool) * @return Handle of created packet * @retval ODP_PACKET_INVALID Packet could not be created */ -static odp_packet_t pack_udp_pkt(odp_pool_t pool, odp_packet_t pkt_ref) +static odp_packet_t pack_udp_pkt(odp_pool_t pool, odp_packet_t pkt_ref, + odp_pktout_config_opt_t *pktout_cfg) { odp_packet_t pkt; char *buf; @@ -274,7 +283,15 @@ static odp_packet_t pack_udp_pkt(odp_pool_t pool, odp_packet_t pkt_ref) ip = (odph_ipv4hdr_t *)(buf + ODPH_ETHHDR_LEN); seq = odp_atomic_fetch_add_u64(&counters.seq, 1) % 0xFFFF; ip->id = odp_cpu_to_be_16(seq); - ip->chksum = odph_chksum(ip, ODPH_IPV4HDR_LEN); + if (!pktout_cfg->bit.ipv4_chksum) + ip->chksum = odph_chksum(ip, ODPH_IPV4HDR_LEN); + + if (pktout_cfg->bit.ipv4_chksum || pktout_cfg->bit.udp_chksum) { + odp_packet_l2_offset_set(pkt, 0); + odp_packet_l3_offset_set(pkt, ODPH_ETHHDR_LEN); + odp_packet_l4_offset_set(pkt, ODPH_ETHHDR_LEN + + ODPH_IPV4HDR_LEN); + } return pkt; } @@ -343,7 +360,8 @@ static odp_packet_t setup_icmp_pkt_ref(odp_pool_t pool) * @return Handle of created packet * @retval ODP_PACKET_INVALID Packet could not be created */ -static odp_packet_t pack_icmp_pkt(odp_pool_t pool, odp_packet_t pkt_ref) +static odp_packet_t pack_icmp_pkt(odp_pool_t pool, odp_packet_t pkt_ref, + odp_pktout_config_opt_t *pktout_cfg) { odp_packet_t pkt; char *buf; @@ -368,7 +386,8 @@ static odp_packet_t pack_icmp_pkt(odp_pool_t pool, odp_packet_t pkt_ref) ip = (odph_ipv4hdr_t *)(buf + ODPH_ETHHDR_LEN); seq = odp_atomic_fetch_add_u64(&counters.seq, 1) % 0xffff; ip->id = odp_cpu_to_be_16(seq); - ip->chksum = odph_chksum(ip, ODPH_IPV4HDR_LEN); + if (!pktout_cfg->bit.ipv4_chksum) + ip->chksum = odph_chksum(ip, ODPH_IPV4HDR_LEN); /* icmp */ icmp = (odph_icmphdr_t *)(buf + ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN); @@ -382,6 +401,13 @@ static odp_packet_t pack_icmp_pkt(odp_pool_t pool, odp_packet_t pkt_ref) icmp->chksum = 0; icmp->chksum = odph_chksum(icmp, args->appl.payload + ODPH_ICMPHDR_LEN); + if (pktout_cfg->bit.ipv4_chksum) { + odp_packet_l2_offset_set(pkt, 0); + odp_packet_l3_offset_set(pkt, ODPH_ETHHDR_LEN); + odp_packet_l4_offset_set(pkt, ODPH_ETHHDR_LEN + + ODPH_IPV4HDR_LEN); + } + return pkt; } @@ -422,6 +448,23 @@ static int create_pktio(const char *dev, odp_pool_t pool, dev); return -1; } + + odp_pktio_config_init(&itf->config); + itf->config.pktin.bit.ipv4_chksum = capa.config.pktin.bit.ipv4_chksum; + itf->config.pktin.bit.udp_chksum = capa.config.pktin.bit.udp_chksum; + itf->config.pktin.bit.drop_ipv4_err = + capa.config.pktin.bit.drop_ipv4_err; + itf->config.pktin.bit.drop_udp_err = capa.config.pktin.bit.drop_udp_err; + + itf->config.pktout.bit.ipv4_chksum = capa.config.pktout.bit.ipv4_chksum; + itf->config.pktout.bit.udp_chksum = capa.config.pktout.bit.udp_chksum; + + if (odp_pktio_config(itf->pktio, &itf->config)) { + EXAMPLE_ERR("Error: Failed to set interface configuration %s\n", + dev); + return -1; + } + if (num_rx_queues > capa.max_input_queues) num_rx_queues = capa.max_input_queues; @@ -482,6 +525,7 @@ static int gen_send_thread(void *arg) int ret, i; thread_args_t *thr_args; odp_pktout_queue_t pktout; + odp_pktout_config_opt_t *pktout_cfg; odp_packet_t pkt_array[MAX_UDP_TX_BURST]; int pkt_array_size; int burst_start, burst_size; @@ -491,9 +535,10 @@ static int gen_send_thread(void *arg) thr_args = arg; pktout = thr_args->pktout; + pktout_cfg = thr_args->pktout_cfg; if (args->appl.mode == APPL_MODE_UDP) { - pkt_ref = setup_udp_pkt_ref(thr_args->pool); + pkt_ref = setup_udp_pkt_ref(thr_args->pool, pktout_cfg); pkt_array_size = args->appl.udp_tx_burst; } else if (args->appl.mode == APPL_MODE_PING) { pkt_ref = setup_icmp_pkt_ref(thr_args->pool); @@ -522,7 +567,7 @@ static int gen_send_thread(void *arg) if (args->appl.mode == APPL_MODE_UDP) { for (i = 0; i < pkt_array_size; i++) { pkt_array[i] = pack_udp_pkt(thr_args->pool, - pkt_ref); + pkt_ref, pktout_cfg); if (!odp_packet_is_valid(pkt_array[i])) break; } @@ -533,7 +578,8 @@ static int gen_send_thread(void *arg) break; } } else if (args->appl.mode == APPL_MODE_PING) { - pkt_array[0] = pack_icmp_pkt(thr_args->pool, pkt_ref); + pkt_array[0] = pack_icmp_pkt(thr_args->pool, pkt_ref, + pktout_cfg); if (!odp_packet_is_valid(pkt_array[0])) { EXAMPLE_ERR(" [%2i] alloc_single failed\n", thr); @@ -684,6 +730,7 @@ static int gen_recv_thread(void *arg) odp_packet_t pkts[MAX_RX_BURST], pkt; odp_event_t events[MAX_RX_BURST]; int pkt_cnt, ev_cnt, i; + interface_t *itf; thr = odp_thread_id(); (void)arg; @@ -705,6 +752,30 @@ static int gen_recv_thread(void *arg) continue; for (i = 0, pkt_cnt = 0; i < ev_cnt; i++) { pkt = odp_packet_from_event(events[i]); + itf = &ifs[odp_pktio_index(odp_packet_input(pkt))]; + + if (odp_packet_has_ipv4(pkt)) { + if (itf->config.pktin.bit.ipv4_chksum) { + /* HW validation */ + if (odp_packet_has_l3_error(pkt)) + printf("HW detected L3 error\n"); + } /* else SW validation */ + } + + if (odp_packet_has_udp(pkt)) { + if (itf->config.pktin.bit.udp_chksum) { + /* HW validation*/ + if (odp_packet_has_l4_error(pkt)) + printf("HW detected L4 error\n"); + } /* else SW validation */ + } + if (odp_packet_has_tcp(pkt)) { + if (itf->config.pktin.bit.tcp_chksum) { + /* HW validation */ + if (odp_packet_has_l4_error(pkt)) + printf("HW detected L4 error\n"); + } /*else SW validation */ + } /* Drop packets with errors */ if (odp_unlikely(odp_packet_has_error(pkt))) { @@ -714,9 +785,11 @@ static int gen_recv_thread(void *arg) pkts[pkt_cnt++] = pkt; } - print_pkts(thr, pkts, pkt_cnt); + if (pkt_cnt) { + print_pkts(thr, pkts, pkt_cnt); - odp_packet_free_multi(pkts, pkt_cnt); + odp_packet_free_multi(pkts, pkt_cnt); + } } return 0; @@ -810,7 +883,6 @@ int main(int argc, char *argv[]) odp_pool_t tmop; odp_queue_t tq; odp_event_t ev; - interface_t *ifs; odp_instance_t instance; odph_odpthread_params_t thr_params; @@ -972,6 +1044,7 @@ int main(int argc, char *argv[]) abort(); } (void)args->thread[1].pktout; /* Not used*/ + (void)args->thread[1].pktout_cfg; /* Not used*/ args->thread[1].pool = pool; args->thread[1].tp = tp; args->thread[1].tq = tq; @@ -1001,6 +1074,7 @@ int main(int argc, char *argv[]) abort(); } args->thread[0].pktout = ifs[0].pktout[0]; + args->thread[0].pktout_cfg = &ifs[0].config.pktout; args->thread[0].pool = pool; args->thread[0].tp = tp; args->thread[0].tq = tq; @@ -1032,15 +1106,18 @@ int main(int argc, char *argv[]) int (*thr_run_func)(void *); int if_idx, pktout_idx; - if (args->appl.mode == APPL_MODE_RCV) + if (args->appl.mode == APPL_MODE_RCV) { (void)args->thread[i].pktout; /*not used*/ - else { + (void)args->thread[i].pktout_cfg; /*not used*/ + } else { if_idx = i % args->appl.if_count; pktout_idx = (i / args->appl.if_count) % ifs[if_idx].pktout_count; args->thread[i].pktout = ifs[if_idx].pktout[pktout_idx]; + args->thread[i].pktout_cfg = + &ifs[if_idx].config.pktout; } tq = odp_queue_create("", NULL); if (tq == ODP_QUEUE_INVALID) {