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 891C0A0032; Fri, 1 Oct 2021 17:02:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 071FC4118A; Fri, 1 Oct 2021 17:02:32 +0200 (CEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id D6C9E4067A for ; Fri, 1 Oct 2021 17:02:30 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id x4so6483561pln.5 for ; Fri, 01 Oct 2021 08:02:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MU2LH3ovov2u/qgXEe1tz2s4sTm6LgMAF0Ee4hxMLfE=; b=EqZt0QjpeneZko9IaBjGQadY8Qhg+gciyYDtB752DdH9TaSzTKgPJtWHQ1i8uOUpbE y7+CIaz5yfAuT0xYhQ5BV5tDhNGTAuf4QldhsHONwmPPJCIbhEJ2vnC0ZP6VJGXJ614/ OMdnY0Z8I4cQ58KJq6o1nGHhVAuoL+6Zc5b1Tr6jde6vDNCRAnSGAx7/RRC2VYscw5sN 8ygvri/RcCSbDliY5Lm9WRcsQ7k4WSXWEcZ/AFWiQdJvbInyJLGPxW+3jrUfKvAfqSAD xgnIaPvCnVkv+cbNrv/4OzuhJdAqSyQ+HBTQN1cza36DJN3ku8mgtfyFC41t3gYFbKPB tRDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MU2LH3ovov2u/qgXEe1tz2s4sTm6LgMAF0Ee4hxMLfE=; b=n1+qLnPpN/xFxzRAzPSyXs65TBaWCyOSBcHWbZNups7gTNxa06QgfD89uAV6cToEdC 63lhI5zqUUijFrjiHxRyadLcWCo+Ne2vAw1sWQIeHbVeoJsW5otE5SDtoG0WfOOT8MPb JAitJ5Nij+oFibhZm06jdwJT4HNOkBZ71C7khEuV6blSVhb7IziDn9B3TOnK18sLnHL1 nM/HVJ5x3KySjZuzWnT9Qf8fPafJqCrwX+OwN6hs1LNm6tsd1nB2nyXqQM2taKg27cFc mUEAFiSDc3kZLwfZ4khzqAuZWyfqKnEirFLmpLmeyJ0cBefrIxZ81imwNQg3sz6F/xwQ xf6g== X-Gm-Message-State: AOAM530E0NXPuKR1hue35HqcVwbJBlhmAyFOIuwRYjQl3/+rmOMGMuWV s81igu0BoBM+LBj8NloGXKTxNg== X-Google-Smtp-Source: ABdhPJyAPq/grw6ES8qOc6I/8ORwXzweERoG8PeRj6/LBDOseh2C8xtTzHHwMLv78rajdUDAqfZjKw== X-Received: by 2002:a17:90b:911:: with SMTP id bo17mr18317726pjb.232.1633100549825; Fri, 01 Oct 2021 08:02:29 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id y3sm6937324pfr.140.2021.10.01.08.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 08:02:28 -0700 (PDT) Date: Fri, 1 Oct 2021 08:02:25 -0700 From: Stephen Hemminger To: Tudor Cornea Cc: ferruh.yigit@intel.com, linville@tuxdriver.com, andrew.rybchenko@oktetlabs.ru, thomas@monjalon.net, jerinj@marvell.com, dev@dpdk.org Message-ID: <20211001080225.442806c4@hermes.local> In-Reply-To: <1633077301-68561-1-git-send-email-tudor.cornea@gmail.com> References: <1632924497-60394-1-git-send-email-tudor.cornea@gmail.com> <1633077301-68561-1-git-send-email-tudor.cornea@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5] net/af_packet: reinsert the stripped vlan tag 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" On Fri, 1 Oct 2021 11:35:01 +0300 Tudor Cornea wrote: > The af_packet pmd driver binds to a raw socket and allows > sending and receiving of packets through the kernel. > > Since commit [1], the kernel strips the vlan tags early in > __netif_receive_skb_core(), so we receive untagged packets while > running with the af_packet pmd. > > Luckily for us, the skb vlan-related fields are still populated from the > stripped vlan tags, so we end up having all the information > that we need in the mbuf. > > Having the pmd driver support DEV_RX_OFFLOAD_VLAN_STRIP allows the > application to control the desired vlan stripping behavior, > until we have a way to describe offloads that can't be disabled by > pmd drivers. > > This patch will cause a change in the default way that the af_packet > pmd treats received vlan-tagged frames. While previously, the > application was required to check the PKT_RX_VLAN_STRIPPED flag, after > this patch, the pmd will re-insert the vlan tag transparently to the > user, unless the DEV_RX_OFFLOAD_VLAN_STRIP is enabled in > rxmode.offloads. > > I've attempted a preliminary benchmark to understand if the change could > cause a sizable performance hit. > > Setup: > Two virtual machines running on top of an ESXi hypervisor > > Tx: DPDK app (running on top of vmxnet3 PMD) > Rx: af_packet (running on top of a kernel vmxnet3 interface) > Packet size :68 (packet contains a vlan tag) > > Rates: > Tx - 1.419 Mpps > Rx (without vlan insertion) - 1227636 pps > Rx (with vlan insertion) - 1220081 pps > > At a first glance, we don't seem to have a large degradation in terms > of packet rate. > > [1] https://github.com/torvalds/linux/commit/bcc6d47903612c3861201cc3a866fb604f26b8b2 > > Signed-off-by: Tudor Cornea Acked-by: Stephen Hemminger