From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by dpdk.org (Postfix) with ESMTP id A5D3E2C55 for ; Mon, 8 Apr 2019 12:27:51 +0200 (CEST) Received: by mail-lf1-f65.google.com with SMTP id h18so645871lfj.11 for ; Mon, 08 Apr 2019 03:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=PZjdmZlvAyAe4PVzTPYRRwWbbcMEUUeeHFYIm25TUoA=; b=fkQg/8vPmsKA2tAFOuqae+8cvNv2wKdmHYzpzIu1OlM3hVZ6rHC9ApmP+FHK/dpxnV P2g7f3G9IfstyD7UhuB6CKNC6uy1k50uGUxTzLBXZnbSLsWOO+veDyZVPt6wN7DqZ26+ owJ0rst6eFMwMEIXMhoLt0IZYsIyKLGSRwxJchiH+fSmNh7lZTJLJTBZNiAX8N/ziJd/ GYWf+2eDHP6FFTzHtKRjW5zMUJavPdCzgByE8ZlgivcMQ5kggMfoADJIT6kNMejhNkRn 2Z1WJOPEDlHpipqW5wx/pJXxxAt9Z4BM+INYT3El2s2nBcD34XqFK9rJqbwnXRAySC5k +bug== 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; bh=PZjdmZlvAyAe4PVzTPYRRwWbbcMEUUeeHFYIm25TUoA=; b=qbsearJQsi7T+O0hMp9S2SVphODQVICk1bWu72SM+rVWuI1q3G8jxSemBc6S5KhpMQ bP3w8KMEe5/3/osZlSs+e6NHgUvXlnk5uszQBSYfjdxTCO4oCK39anC0X++DK/a+wynL SIHt3oYNND+UwFdlI7Wm/sEywiuMbBxvkQtqRRbCJ88DBi3ixR1EIa8o/t/u/9QTVO4g nht2PlpXP1bWRl4uC57cE/CmJ51V598t1SwxCSwOEjdilByAjRn66WB3t29g1CJyzBW4 gLBVW69BL49lTuP2vPoVWCNYH9SXf5/R/sThJfWAYeeMBDCzOBvqSO9ucQ3e8tb3ESIi ygSw== X-Gm-Message-State: APjAAAUfiNi+anAvGw/KQo47RV7RccvLnbAwusuEL1ZhozWsXyrIpz59 dQqd6YRNDofDsZJtdaxfgC8iPCNP5h0= X-Google-Smtp-Source: APXvYqzCIRRwuxC53C/0GmyY0gqiTvu5IqQ3nlPjXYjTIVRFBEZd5eC+hw4R2S4bR/BivR4f6IiW5A== X-Received: by 2002:a19:7d84:: with SMTP id y126mr15437714lfc.124.1554719271050; Mon, 08 Apr 2019 03:27:51 -0700 (PDT) Received: from mkPC.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id j6sm5020473ljc.0.2019.04.08.03.27.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Apr 2019 03:27:50 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: gtzalik@amazon.com, mw@semihalf.com, matua@amazon.com, Michal Krawczyk , stable@dpdk.org Date: Mon, 8 Apr 2019 12:27:44 +0200 Message-Id: <20190408102744.2942-1-mk@semihalf.com> X-Mailer: git-send-email 2.14.1 Subject: [dpdk-dev] [PATCH] net/ena: fix assigning Rx csum support to Tx flag 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: Mon, 08 Apr 2019 10:27:51 -0000 The boolean value was assigned to Tx flag twice, so it could cause bug whenever Rx checksum will not be supported and Tx will be. It was detected by the coverity scan, with CID 336831. Fixes: 117ba4a60488 ("net/ena: get device info statically") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk --- drivers/net/ena/ena_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index a55b4a719..3eb38165c 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1808,7 +1808,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev) ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV4_MASK) != 0; adapter->offloads.tx_csum_supported = (get_feat_ctx.offload.tx & ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_PART_MASK) != 0; - adapter->offloads.tx_csum_supported = + adapter->offloads.rx_csum_supported = (get_feat_ctx.offload.rx_supported & ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L4_IPV4_CSUM_MASK) != 0; -- 2.14.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 34A79A0096 for ; Mon, 8 Apr 2019 12:27:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 772044CA9; Mon, 8 Apr 2019 12:27:52 +0200 (CEST) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by dpdk.org (Postfix) with ESMTP id A5D3E2C55 for ; Mon, 8 Apr 2019 12:27:51 +0200 (CEST) Received: by mail-lf1-f65.google.com with SMTP id h18so645871lfj.11 for ; Mon, 08 Apr 2019 03:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=PZjdmZlvAyAe4PVzTPYRRwWbbcMEUUeeHFYIm25TUoA=; b=fkQg/8vPmsKA2tAFOuqae+8cvNv2wKdmHYzpzIu1OlM3hVZ6rHC9ApmP+FHK/dpxnV P2g7f3G9IfstyD7UhuB6CKNC6uy1k50uGUxTzLBXZnbSLsWOO+veDyZVPt6wN7DqZ26+ owJ0rst6eFMwMEIXMhoLt0IZYsIyKLGSRwxJchiH+fSmNh7lZTJLJTBZNiAX8N/ziJd/ GYWf+2eDHP6FFTzHtKRjW5zMUJavPdCzgByE8ZlgivcMQ5kggMfoADJIT6kNMejhNkRn 2Z1WJOPEDlHpipqW5wx/pJXxxAt9Z4BM+INYT3El2s2nBcD34XqFK9rJqbwnXRAySC5k +bug== 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; bh=PZjdmZlvAyAe4PVzTPYRRwWbbcMEUUeeHFYIm25TUoA=; b=qbsearJQsi7T+O0hMp9S2SVphODQVICk1bWu72SM+rVWuI1q3G8jxSemBc6S5KhpMQ bP3w8KMEe5/3/osZlSs+e6NHgUvXlnk5uszQBSYfjdxTCO4oCK39anC0X++DK/a+wynL SIHt3oYNND+UwFdlI7Wm/sEywiuMbBxvkQtqRRbCJ88DBi3ixR1EIa8o/t/u/9QTVO4g nht2PlpXP1bWRl4uC57cE/CmJ51V598t1SwxCSwOEjdilByAjRn66WB3t29g1CJyzBW4 gLBVW69BL49lTuP2vPoVWCNYH9SXf5/R/sThJfWAYeeMBDCzOBvqSO9ucQ3e8tb3ESIi ygSw== X-Gm-Message-State: APjAAAUfiNi+anAvGw/KQo47RV7RccvLnbAwusuEL1ZhozWsXyrIpz59 dQqd6YRNDofDsZJtdaxfgC8iPCNP5h0= X-Google-Smtp-Source: APXvYqzCIRRwuxC53C/0GmyY0gqiTvu5IqQ3nlPjXYjTIVRFBEZd5eC+hw4R2S4bR/BivR4f6IiW5A== X-Received: by 2002:a19:7d84:: with SMTP id y126mr15437714lfc.124.1554719271050; Mon, 08 Apr 2019 03:27:51 -0700 (PDT) Received: from mkPC.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id j6sm5020473ljc.0.2019.04.08.03.27.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Apr 2019 03:27:50 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: gtzalik@amazon.com, mw@semihalf.com, matua@amazon.com, Michal Krawczyk , stable@dpdk.org Date: Mon, 8 Apr 2019 12:27:44 +0200 Message-Id: <20190408102744.2942-1-mk@semihalf.com> X-Mailer: git-send-email 2.14.1 Subject: [dpdk-dev] [PATCH] net/ena: fix assigning Rx csum support to Tx flag 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190408102744.PJQxL5VDbyKPzUxXbJlXLSkrqoLGQD_IKSJjAEScTmU@z> The boolean value was assigned to Tx flag twice, so it could cause bug whenever Rx checksum will not be supported and Tx will be. It was detected by the coverity scan, with CID 336831. Fixes: 117ba4a60488 ("net/ena: get device info statically") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk --- drivers/net/ena/ena_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index a55b4a719..3eb38165c 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1808,7 +1808,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev) ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV4_MASK) != 0; adapter->offloads.tx_csum_supported = (get_feat_ctx.offload.tx & ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_PART_MASK) != 0; - adapter->offloads.tx_csum_supported = + adapter->offloads.rx_csum_supported = (get_feat_ctx.offload.rx_supported & ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L4_IPV4_CSUM_MASK) != 0; -- 2.14.1