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 9A0FDA0C45; Wed, 16 Jun 2021 06:15:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2B08410ED; Wed, 16 Jun 2021 06:15:42 +0200 (CEST) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id 03AE440DFD for ; Wed, 16 Jun 2021 06:15:39 +0200 (CEST) Received: by mail-pg1-f180.google.com with SMTP id n12so872273pgs.13 for ; Tue, 15 Jun 2021 21:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=093Yo7ZRcB2aZcsIZhC3lC9AQUqWZcZLNzDZ8TVoQcE=; b=w78jiFWtAzhYfJXT4bSdTuGBZn3tSQHre+ntAr2tmo2PNr8lSNFH7KNXGnkxW+zBS3 A7QmQ0tGspqZNkr4JaHFpxnfj/mYNTuysklJTindtei6GwWxOiVopIMM5QQk5n7S0AgA dP1uRqqrixy6AQWsQL1Jn11c1X+4/emCpZn9m8M/fkg8yyInZS6rc591oZAiF3iOTR9S FmAYsOVypMr9kHx/iXZ7+clTWjvJXF6Xud4bvI8TxiR4m5tDfjf11yFfpiZ3spWdARci 3Ws/aXAvh2Uh75IexQQ2IFCgTJ8HCRvm+m9Yw1OTFhoQsclR4574JxEG6bHj65c8V1OD g2AQ== 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:mime-version:content-transfer-encoding; bh=093Yo7ZRcB2aZcsIZhC3lC9AQUqWZcZLNzDZ8TVoQcE=; b=U6LHCVM5sY1MorZaKjP0g26ZqDHZL/pqTH/u4Su6/pg7CW3WixziFKxoHvU75vW510 HsEoPBuckFVLDxPI6viKkMM8PKGYT4NrVSuu9lWPNGCMpe/rwIC1Tn8Zh37BbtFmfGt0 +5e9Y9BKSwDcXJ0HOngZLT2C3xwJkxyR8mInR1ANoFnmqcR8xdLqR3nAZdyTfJj0JBkg uJZzc815DYgfaJsl95MWW1UquCl5MgvPQJuma/zKvoNNFoYxTt1244zAC8UnTgu/vxWA CBTahjOh/QmlNjIF4v+hONjbipluBfDVFexaS0KjH3Eb7we1G0qbDAyUXtnD9sm8RDQJ 917w== X-Gm-Message-State: AOAM530+hCDrlJ4lLl9QcVrqZHU1zw4BBmVeMdgwBKR7DOE4+78lGbGg GBPC6bGRSkir2W78hA8CXJJJdQ== X-Google-Smtp-Source: ABdhPJwep7+UXO777BMD/NknIwgevwuCKo5i8REdKMwTtfaC+ij8QUZkH9Jmx0SqzO/CORLbmXLZRw== X-Received: by 2002:a63:185b:: with SMTP id 27mr3078149pgy.164.1623816939256; Tue, 15 Jun 2021 21:15:39 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id 21sm568749pfh.103.2021.06.15.21.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 21:15:38 -0700 (PDT) From: Stephen Hemminger To: Keith Wiles Cc: dev@dpdk.org, Stephen Hemminger Date: Tue, 15 Jun 2021 21:15:28 -0700 Message-Id: <20210616041528.4229-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210616041528.4229-1-stephen@networkplumber.org> References: <20210616041528.4229-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/2] net/tap: replace offload_capa function with define 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" Since the offload values are always the same, these can just be data instead of code. Signed-off-by: Stephen Hemminger --- drivers/net/tap/rte_eth_tap.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index aeae6e8f5e93..c31739abf967 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -70,6 +70,17 @@ #define TAP_IOV_DEFAULT_MAX 1024 +#define TAP_RX_OFFLOAD (DEV_RX_OFFLOAD_SCATTER | \ + DEV_RX_OFFLOAD_IPV4_CKSUM | \ + DEV_RX_OFFLOAD_UDP_CKSUM | \ + DEV_RX_OFFLOAD_TCP_CKSUM) + +#define TAP_TX_OFFLOAD (DEV_TX_OFFLOAD_MULTI_SEGS | \ + DEV_TX_OFFLOAD_IPV4_CKSUM | \ + DEV_TX_OFFLOAD_UDP_CKSUM | \ + DEV_TX_OFFLOAD_TCP_CKSUM | \ + DEV_TX_OFFLOAD_TCP_TSO) + static int tap_devices_count; static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] = { @@ -373,15 +384,6 @@ tap_verify_csum(struct rte_mbuf *mbuf) } } -static uint64_t -tap_rx_offload_get_queue_capa(void) -{ - return DEV_RX_OFFLOAD_SCATTER | - DEV_RX_OFFLOAD_IPV4_CKSUM | - DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM; -} - static void tap_rxq_pool_free(struct rte_mbuf *pool) { @@ -497,16 +499,6 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) return num_rx; } -static uint64_t -tap_tx_offload_get_queue_capa(void) -{ - return DEV_TX_OFFLOAD_MULTI_SEGS | - DEV_TX_OFFLOAD_IPV4_CKSUM | - DEV_TX_OFFLOAD_UDP_CKSUM | - DEV_TX_OFFLOAD_TCP_CKSUM | - DEV_TX_OFFLOAD_TCP_TSO; -} - /* Finalize l4 checksum calculation */ static void tap_tx_l4_cksum(uint16_t *l4_cksum, uint16_t l4_phdr_cksum, @@ -997,9 +989,9 @@ tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_tx_queues = RTE_PMD_TAP_MAX_QUEUES; dev_info->min_rx_bufsize = 0; dev_info->speed_capa = tap_dev_speed_capa(); - dev_info->rx_queue_offload_capa = tap_rx_offload_get_queue_capa(); + dev_info->rx_queue_offload_capa = TAP_RX_OFFLOAD; dev_info->rx_offload_capa = dev_info->rx_queue_offload_capa; - dev_info->tx_queue_offload_capa = tap_tx_offload_get_queue_capa(); + dev_info->tx_queue_offload_capa = TAP_TX_OFFLOAD; dev_info->tx_offload_capa = dev_info->tx_queue_offload_capa; dev_info->hash_key_size = TAP_RSS_HASH_KEY_SIZE; /* -- 2.30.2