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 3AC92A0C41; Tue, 14 Sep 2021 20:08:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA11C406FF; Tue, 14 Sep 2021 20:08:41 +0200 (CEST) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mails.dpdk.org (Postfix) with ESMTP id EC56E4068F for ; Tue, 14 Sep 2021 20:08:39 +0200 (CEST) Received: by mail-wm1-f51.google.com with SMTP id k5-20020a05600c1c8500b002f76c42214bso2839488wms.3 for ; Tue, 14 Sep 2021 11:08:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RuiOav7i49EmGX+tmbhA7S5N67xk/dYbzael4pEG83s=; b=wQzShz+JYEVNR2kk7DRAokDELUT4vAaaB00N0tWcSoYgiSOIWQ0HHGn85ByqEVO7Es BaegWTaITRBlJ2eHBjUxs6NunZMLApi16+znRmt9pv8vAn+0TW+btg5S2u8+2p43u89d Zkhecld/uYrTOaSrmpFJaXkj50k3ctEDIBSG+v6T6i9uIKzgKZMzKR7EbPZcSuT4waRs lh1BqvuG59kT5kzMrVM+Y/K/8T67X4E1ScbTGbq5grURPFsoVoVm6usFqxZ56Ezo2Kv2 vixxPDnU+iOwVf+2Qle7K/ODy+MQy6PoFBOxjKntTwF1+NqfHyUeqiF3cJlgBCFl/kPJ Pd8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RuiOav7i49EmGX+tmbhA7S5N67xk/dYbzael4pEG83s=; b=HQYBwKacwFM1eftPVtHsZB2z1uuU6TSo0lFP1pErhWmUPOwRN0533eLkd8hPJnGkOR 32KTnf+YyAYYZuSZD6ypcTGA28G+kwEB52W1cCfQsQt4b+upHz7wKn5zXWmNEOSkDD3z ATNbzYUyYzIRmgl7pLjcKv+S6lg8oxJY05ZX4Uctt6TY1ctRGebyV41yNk/rc/QIojLb LxMOYs1A+Qpixdh0s9TSlZi8U4IAIjkkqmP2K8i8fAZLxzMO1MwaUHY5Yi6QoIDonui7 PRlzD/1iYSzVDnbbfA8+usD7dSASAxKZTed+RwonH2ox6Hyhs+PiKO8KNAnuKHIR4K9H bgJA== X-Gm-Message-State: AOAM533RLKF+9/fgLGowoSD7kPLCLaktyyJrpwW5P6Ru1CN4AcsXBdwU 61UkLqJFyOgcVjQZH4zRoaWbVBqP71CgwIM= X-Google-Smtp-Source: ABdhPJxs3CLeW9zlaq9NlYLxpLWBvXNSHXALNeghtY26a+oLcw5T2OcNpO9IZoAEc9I/L9sE3F9vbg== X-Received: by 2002:a1c:7201:: with SMTP id n1mr375755wmc.19.1631642919731; Tue, 14 Sep 2021 11:08:39 -0700 (PDT) Received: from usama-Inspiron-5570.www.tendawifi.com ([115.42.76.45]) by smtp.gmail.com with ESMTPSA id r2sm11825699wrg.31.2021.09.14.11.08.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 11:08:39 -0700 (PDT) From: Usama Nadeem To: thomas@monjalon.net Cc: dev@dpdk.org, usamanadeem321 Date: Tue, 14 Sep 2021 23:08:27 +0500 Message-Id: <20210914180827.184123-1-usama.nadeem@emumba.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210913120951.103968-1-usama.nadeem@emumba.com> References: <20210913120951.103968-1-usama.nadeem@emumba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] Warns if IPv4, UDP or TCP checksum offload not available 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 Sender: "dev" From: usamanadeem321 Checks if IPV4, UDP and TCP Checksum offloads are available. If not available, prints a warning message. Bugzilla ID: 545 Signed-off-by: usamanadeem321 --- examples/l3fwd/main.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 00ac267af1..ae62bc570d 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -123,7 +123,6 @@ static struct rte_eth_conf port_conf = { .mq_mode = ETH_MQ_RX_RSS, .max_rx_pkt_len = RTE_ETHER_MAX_LEN, .split_hdr_size = 0, - .offloads = DEV_RX_OFFLOAD_CHECKSUM, }, .rx_adv_conf = { .rss_conf = { @@ -1039,6 +1038,27 @@ l3fwd_poll_resource_setup(void) local_port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_IPV4_CKSUM) + local_port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_IPV4_CKSUM; + else { + printf("WARNING: IPV4 Checksum offload not available.\n"); + } + + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_UDP_CKSUM) + local_port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_UDP_CKSUM; + + else + printf("WARNING: UDP Checksum offload not available.\n"); + + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) + local_port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_TCP_CKSUM; + + else + printf("WARNING: TCP Checksum offload not available.\n"); + local_port_conf.rx_adv_conf.rss_conf.rss_hf &= dev_info.flow_type_rss_offloads; -- 2.25.1