From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0077.outbound.protection.outlook.com [104.47.40.77]) by dpdk.org (Postfix) with ESMTP id C330F1E8D7 for ; Mon, 11 Jun 2018 14:45:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=27f+wtv5OTcchZw9C1hhYJ1qooMl6ABtAj3YKe47Mos=; b=A4bTsUo4qIzRaUPN5pM14vSVi2cTjGBmHssS8ZI+4Z/xce2DkWYuJYsX+VOvPzv8ssJJN5efGtecgMsuMp+xs+criNuzt6s4cWlJLvQpt5yXH0HVx2qPod6jpejy4TEC190DZVPbzrdwUxIK8jFP0ZNCzxQem4VxVRziKFyWvbY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (115.113.156.3) by CO2PR07MB2520.namprd07.prod.outlook.com (2603:10b6:102:13::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.13; Mon, 11 Jun 2018 12:45:30 +0000 Date: Mon, 11 Jun 2018 18:15:14 +0530 From: Jerin Jacob To: rkudurumalla Cc: dev@dpdk.org Message-ID: <20180611124512.GE8358@jerin> References: <1527512224-13113-1-git-send-email-rkudurumalla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1527512224-13113-1-git-send-email-rkudurumalla@caviumnetworks.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [115.113.156.3] X-ClientProxiedBy: BM1PR0101CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::34) To CO2PR07MB2520.namprd07.prod.outlook.com (2603:10b6:102:13::7) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(2017052603328)(7153060)(7193020); SRVR:CO2PR07MB2520; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2520; 3:04wWyxnycE+n1aJiS1MnnOuygwmWSf0kzn3K9HTHQx2cHkmsga6XGLvK8QBbjkZdMGLgZmDoa9yMadXRxOzvVZbVD5eBbNUJpV9GcLnj/6U0ay5gvle6sRZ8S845a8cP4e8CNqo4GOyvhVVcqlAWDZb7Jv0RCeXGsBIwGhsKo4aN8/a/cqtWLznKaQMMthRBt/eUnJBdwGHKKxuUVQVgUq4k6G+65HH/MfkttjhhrFrejdMVjP/r/ZULvNCuPXJo; 25:PFCOlDyY4vMC21dwy0xBPK3iAEzbzGtYcQh3s5D6VBxpZ7s9SwA+HFa8qEqoZK5U+NI3PxiYCzaJdP8jsqvbEgqapOxzsw7/0Ck3GH1Xln3SEgw8FYF/FX6nHADe3Ei0Rkb8+JCn+x1PIsYIY+QxdCVrzG2Vtt2QcU8hf9b3Il7tigRTEfAQyvc6o5CUPxQV0YH815cPCOEUSWDKBXDqfPLHKikv82BZaYRMv0AtKVcJFO+DXf5cLExoxj/rNc6hLpnicWcS0iX/OLjh6WxHdWES09IZAnhCxziQVWBhEqH4gWcl0M2m3CNl9dL2d3nSBMuialR7aTvkRTSaoZwRIQ==; 31:t2EwSE1e3MXDSuA50DIg4pXyxJERpN69ZCDUiFrMjyZEqJK1gLTnqpTbsN4tAatlgyrt4/+fL+pvGL7IHkPeIvmLz3jYyw9lHyDecCBka2bcmX1qEeaeQ2+Liq2Uty3+GK1a9sniOaBBVaHki5Szz41/6ny39fsBYxM2GW68cJPOLA52Eify8hjPE7cnAkhIpEXGoQqUTT379iG+Xv2OT4bueVyQP58L5O36K/l3pEY= X-MS-TrafficTypeDiagnostic: CO2PR07MB2520: X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2520; 20:1XuH6qKLmi7YAYaqTSqPWUD1TPQlhCVBuclyhevvqQeR6pn+18Kb+cIZOvYLqRqlzs6AXzTC5SrZXVnlTIRq4bpkNxeKjXrLIHv4I944HwVEOvI3Cq1OYUssJfgAXLdI1M/RJo41UeoP7s6XvRi4Qjs/EGlSo7dwrygDp86NTEX9joScsizENsSO6IJeEW/H1ESH5g9bbhi0nSFv7jobKN+tDpcSqj1Mvu/bB93FKABa3L52rHm6e1DyLI1V3H886X6rNO9CB9Nm1yFvHBg+tkpE7RQtR2ulHgXA9PC7Sc8/n5IkT8rVMz0t+LNzowPQDaEy7MFHG/IxwncLmbf3O9x2cJkDYweVM1gy2VAtOLUVvSvL3WpGuZkVkkAUimUkkqKf1A9C6GWrbHQETUApHkYQCKmGzBPPdH8wmY7AMHw7g9Pbv43/kVBDyv914OiEuqTNfTdO5PeK63rW6vpAmFH+klLY7RG3sUfn5jR0EzRKETruP4LPWwjCHzzd3yShM6HNwv0Jp9TO5zYcP0+0+p+sHxeIr8Tce8H7xKkJWPVphTseCh6UcVae54ggVDaY1ygG+WpAluYoaTk3+KOSh1y3wl56F5kbe2yPWoq7PBk=; 4:HT6s3tevwfgnBcIIOecXaZhi5An/l8NiuL8LCaN9uOvctt6xrtJ2/ebqrNecJdwyLhcfFr4Z3i/yPRGB1gkGjQ3ZRZWhMoy7q0+ZyQTcJUHEPG7j9mMfhnSpIJuuaapdHI6HxvVpPjXde+fiBWbDWnQFkyPvsLFAzAXvRQmIiM7Ma4fZ6KpsmP+wj9RkpJr6KtIMuFYbNIN4dSBwedkgtF0x45f0gjHA2kDzwtSQMfLdLEYW/0+9sma350MYm/m9GTWt2Vs0M/2qNx4WzRHZ4w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:CO2PR07MB2520; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB2520; X-Forefront-PRVS: 070092A9D3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(366004)(346002)(39850400004)(39380400002)(199004)(189003)(13464003)(5660300001)(53936002)(9686003)(16586007)(4326008)(97736004)(316002)(7736002)(478600001)(81166006)(55016002)(81156014)(72206003)(6862004)(8936002)(6246003)(5890100001)(68736007)(6666003)(3846002)(1076002)(25786009)(58126008)(50466002)(33716001)(6116002)(6636002)(42882007)(8676002)(23726003)(33656002)(386003)(6496006)(76176011)(33896004)(2906002)(16526019)(229853002)(66066001)(47776003)(44832011)(59450400001)(486006)(11346002)(446003)(476003)(52116002)(105586002)(106356001)(305945005)(956004)(26005)(575784001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2520; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR07MB2520; 23:kxKH9oAAwf7ZauSPGRoHUbVUqYYR4RdjlgC/3W9j8?= =?us-ascii?Q?QjGuzRcB1k6i0lyj0mFMtf+g45ie6v0Rk7PjliTOMHVHpSTpuDXj9uyr2MP7?= =?us-ascii?Q?/t7zkFG7nLRq4/A4aY5Z5joYQjNMv1nT46zS6Q34U6eiYY07cgpUZEOM2A7W?= =?us-ascii?Q?CtCohdQ5kXL3cTDFNlmoVTX7ShbicD+2c05FvTJhZgjbsbuDJA5/jsipMOIC?= =?us-ascii?Q?InjTOCW9JL9+L1RvNi+JVxGl3F8JKsLBYGmFppaHDygd4HrBf1ZHwfrF2r8H?= =?us-ascii?Q?/2OpY7JgXLBM/hkVYsdF+bvg8SI1xQOIPw4RD39ygWjtGm1HqvKpWlvMZCwv?= =?us-ascii?Q?lyGw6u8dgIWcoExEwds88M1wtpT9COpFOt5edZWsDxOGHDrykTARAP1Ka7sX?= =?us-ascii?Q?bRONkJYp3CFqQAcPwRcgvebfsYLLid13XDRT85oJfc+tE3Wuni2PYdgBlsxu?= =?us-ascii?Q?6Hb5m8xcEhljvmtj15PcjEkfbmE5JQ1d34nuFOEOSrEc4zRGBecolPiHcjr9?= =?us-ascii?Q?8hmFkq+9pXpnfDUqIXPm4LlfARPbWrcFEltM4xlF/kTQn9kYT7l4bbPViGOo?= =?us-ascii?Q?RRADvoI2mE0iuZEU4ghk6FAUP8NOHdmA6PHTJJkAQHX0mng9qZiBHaSR29V5?= =?us-ascii?Q?m6ilQyBeaoFKTvQ9E/12YxENDUu73zKSKWN6zE1ZVrHbQ4VbMGIbtiXw/Ax8?= =?us-ascii?Q?Jp+7Ul8MhMTwSf1dOwiwU8AHA7HdmLrS3x1mEwkmtgkHuAzuaz2ULlZaWJpI?= =?us-ascii?Q?f6UN9u7wf8aShEu4bwRFT4tiQPCrSoVSyCLTGb9BIGFWC1bU0mpE9FRMYSSD?= =?us-ascii?Q?HGOFbXo9Dnqef0wTUHTtGW1ucBnbCMtXWvxNW0wasqJaUGUbfynULUeV2S39?= =?us-ascii?Q?EZR6uDnHkiKlZx90lYZcPiuSzKBT5sqQ52npj/Kit5soGZuOjU9Aw+yhqnmm?= =?us-ascii?Q?w9Xq8UzleDnWG4Ox3eFgKdk7MOyqX9h0kElhiU3k9l/vuTVma3USK4l7y28T?= =?us-ascii?Q?YU+gn/EzbrKTv4pDp3JmA+7uQdC6i9lu02m2u7TrBW6vPB7DQG0nY40Bf2HT?= =?us-ascii?Q?JWKaXnvbh6sTHUlgxPOYAfqXAh0qDHahUQ4xjzd04ANp6AQuEjGhZwHcJDkY?= =?us-ascii?Q?n76+uJiWNjb6qr7S9kjFD23sKKuIlRhWPoFHE/YaBVUnYSZbqQrg4VHfw4at?= =?us-ascii?Q?exrzyVLv5HrrExQbyLEK915aLsARXWJtIMwAURhEiSYA5aCDFLQrkwBIpcwm?= =?us-ascii?Q?xOMxEdeGoaX5db+u5zjy5hAO6A7HNIKgSBKDLwo7qtCr6ykjanOqXQgTvL8Z?= =?us-ascii?Q?8GfL2rlRmiozoq96P92HrrFZmCKpZI/9VBEDcOxgdQsah8I9W4p9fROA2RyT?= =?us-ascii?Q?09InSk/hdsedcn8PKEl7F6Dlhr5VVxxp694kM/En6/Gu3SsugeA0u8053O7L?= =?us-ascii?Q?8/oGbYaTw=3D=3D?= X-Microsoft-Antispam-Message-Info: LYOH9bOMOhIVDeNO4ISkMwcwKLD9IVnL/Y+iSQmSmwzRZDIVAW3FMRr7JsrWikzEdgxpvuzoUnC7uTA6Y82GiCU1Spc0H5GeKOVpz5FR0hogu1/o/wcjpMsevn4LnzqflCQCSWf/2BTKB/V6QJ//u/5KigUWJcY7NzqKxuNAbe1j1KtrEWsY5pEz9WsSkvLK X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2520; 6:jIGT1bFzog+Gt0skmiW2cYA5gMiq2jsQNHIs/4ElxHWn0hxgCQXtI4FowxLfpqbnC9/cbyQJpRwEbAk4IazI3stHlT8O+gQaJxkQdqsR7tDnIKbMz29VGu8KXEhOR5nSos+7nKSqZBsDCFNTzIY23nVTm7AoKXAx8bMziRQT+4BenZ00NXWKM/XmZ75zfvyo1otS8qO2uMBeoT1YI+gDGL9zGm4M/dio5K4S6+77MjQeV0EiO825TFurs3qC+namoxbja8gC8eTDfCpYGnkvbOdXygaQYevDLh/PHGjsSihgKkY8/D7JkizaVSVxGDUNEw1Rs7ji0RDLrQrnWX6z0scGGSA3ETo62puspzkAn5+Lf6i9qhdZD35dEZDqDBIaVxJQd0dtY6ogcwa/Je1cfapeNsNT6DKRXlIv3+HpEUuvxW7KX8Eq9VihnUNV8sCmNjL/kVdUXKDOu7D12ZDfUw==; 5:1zJs+jOmIS179H7ab2KiKnnpgfyk1MxSJs+PWqZiCfN3qrOsz6ob7hDrwoVQf9avejntNlyaPUMhTISb4+I6zO1qByrulSCxJC3TPrR65DPv879j6bLJKt/DiiFsNkBeSniQzkD6Csg7y/UiEsfLTNyuY6U13SdNxnABDobp/T0=; 24:h0vaRe/iDoBNWO+omt75WVj6YJQ4hni5x2/ZkH7ic2MYe38G0VwENZOZ4QmwP6BAUEkcKJsyCi579BbOCfL8ITuHtKvhUVFz7pe5qMD2y34= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2520; 7:/bx2bb4g3J2nUT/x9FQRvJFUCfWJsdo9j4eqcOZl7mOFZhhM1YRKu1mRakBvP+CvX/CP5Vv9M8MnY+AviLfbZMrwS56aEWdlj71m4egq6GSdUaQtHvbbDR27+Xzmc2vnfWttSTWElg7YIKcaIRLNrHNhI7+WLkP4f72+BCQF7XvJbSmzR+VwFHwGHUPnX/+cWQOCYfmlIsmh5S0YI6CxcAdUi+2IRQHGe7bFfLF/Xu+q42ZYUkZe7zjg/5v2m21y X-MS-Office365-Filtering-Correlation-Id: fe1a286f-fb7b-4aba-712d-08d5cf99382a X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2018 12:45:30.8053 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fe1a286f-fb7b-4aba-712d-08d5cf99382a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2520 Subject: Re: [dpdk-dev] [PATCH] net/thunderx: add support for hardware first skip feature 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, 11 Jun 2018 12:45:35 -0000 -----Original Message----- > Date: Mon, 28 May 2018 18:27:04 +0530 > From: rkudurumalla > To: dev@dpdk.org > CC: Rakesh Kudurumalla > Subject: [dpdk-dev] [PATCH] net/thunderx: add support for hardware first > skip feature > X-Mailer: git-send-email 2.7.4 > > This feature is used to create a hole between HEADROOM > and actual data.Size of hole is specified in bytes as > module param to pmd > > Signed-off-by: Rakesh Kudurumalla > --- > doc/guides/nics/thunderx.rst | 26 ++++++++++++ > drivers/net/thunderx/base/nicvf_hw.c | 12 ++++++ > drivers/net/thunderx/base/nicvf_hw.h | 1 + > drivers/net/thunderx/nicvf_ethdev.c | 76 +++++++++++++++++++++++++++++++++++- > drivers/net/thunderx/nicvf_ethdev.h | 1 + > drivers/net/thunderx/nicvf_struct.h | 1 + > 6 files changed, 116 insertions(+), 1 deletion(-) > > diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst > index 2642374..3d68c61 100644 > --- a/doc/guides/nics/thunderx.rst > +++ b/doc/guides/nics/thunderx.rst > @@ -30,6 +30,7 @@ Features of the ThunderX PMD are: > - SR-IOV VF > - NUMA support > - Multi queue set support (up to 96 queues (12 queue sets)) per port > +- First skip support > > Supported ThunderX SoCs > ----------------------- > @@ -312,6 +313,26 @@ We will choose four secondary queue sets from the ending of the list (0002:01:01 > > The nicvf thunderx driver will make use of attached secondary VFs automatically during the interface configuration stage. > > + > +# Module params > + > + This feature is used to create a hole between HEADROOM and actual data. > + Size of hole is specified in bytes as module param to pmd. > + This "Module params" comes under "32.6.3. Example device binding", Which is not correct. > +Configuration and Options > +------------------------- Change the "Configuration and Options" to "Module params" section. Add sub section called "skip_data_bytes". The above sentence can be copied here. i.e --- This feature is used to create a hole between HEADROOM and actual data.Size of hole is specified in bytes as module param("skip_data_bytes") to pmd. This scheme is useful when application would like to insert vlan header without disturbing HEADROOM > + Use ``-w pci_id,skip_data_bytes="number of bytes to skip"`` in the EAL options > + Example: > + > + .. code-block:: console This section is not rendering correctly. Please use "make doc-guides-html" to see the rendered output on the local PC @ dpdk_dir/build/doc/... > + > + ./your_application -w pci_id=skip_data_bytes=bytes_to_skip > + > + Ex: ./build/app/testpmd -w 0001:01:00.1,skip_data_bytes=8 -- --rxq=1 --txq=1 --nb-cores=1 --port-topology=chained -i -- -c 0x1 > + This will create a hole of 8 bytes between HEADROOM and actual data. > + > + Use case: The hole created with first_skip can be used to insert vlan header without disturbing HEADROOM Remove this as it mentioned above. > + > Limitations > ----------- > > @@ -335,3 +356,8 @@ Maximum packet segments > The ThunderX SoC family NICs support up to 12 segments per packet when working > in scatter/gather mode. So, setting MTU will result with ``EINVAL`` when the > frame size does not fit in the maximum number of segments. > + > +First_skip > +~~~~~~~~~~ > + > +Maximum limit on first_skip is 128 bytes and number of bytes should be multiple of 8 period(.) is missing at the end. > diff --git a/drivers/net/thunderx/base/nicvf_hw.c b/drivers/net/thunderx/base/nicvf_hw.c > index ea8092c..b07a293 100644 > --- a/drivers/net/thunderx/base/nicvf_hw.c > +++ b/drivers/net/thunderx/base/nicvf_hw.c > @@ -703,6 +703,18 @@ nicvf_vlan_hw_strip(struct nicvf *nic, bool enable) > } > > void > +nicvf_first_skip_config(struct nicvf *nic, uint8_t num_dwords) > +{ > + uint64_t val; > + > + val = nicvf_reg_read(nic, NIC_VNIC_RQ_GEN_CFG); > + val &= ~(0xfULL); > + val |= (num_dwords & 0xf); > + > + nicvf_reg_write(nic, NIC_VNIC_RQ_GEN_CFG, val); > +} > + > +void > nicvf_apad_config(struct nicvf *nic, bool enable) > { > uint64_t val; > diff --git a/drivers/net/thunderx/base/nicvf_hw.h b/drivers/net/thunderx/base/nicvf_hw.h > index 284d0bd..fd13ea8 100644 > --- a/drivers/net/thunderx/base/nicvf_hw.h > +++ b/drivers/net/thunderx/base/nicvf_hw.h > @@ -193,6 +193,7 @@ uint32_t nicvf_qsize_sq_roundup(uint32_t val); > void nicvf_vlan_hw_strip(struct nicvf *nic, bool enable); > > void nicvf_apad_config(struct nicvf *nic, bool enable); > +void nicvf_first_skip_config(struct nicvf *nic, uint8_t dwords); > > int nicvf_rss_config(struct nicvf *nic, uint32_t qcnt, uint64_t cfg); > int nicvf_rss_term(struct nicvf *nic); > diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c > index 99fcd51..466cb86 100644 > --- a/drivers/net/thunderx/nicvf_ethdev.c > +++ b/drivers/net/thunderx/nicvf_ethdev.c > @@ -34,6 +34,8 @@ > #include > #include > #include > +#include > +#include add it in alphabetical order. > > #include "base/nicvf_plat.h" > > @@ -1230,6 +1232,7 @@ nicvf_rxq_mbuf_setup(struct nicvf_rxq *rxq) > { > uintptr_t p; > struct rte_mbuf mb_def; > + struct nicvf *nic = rxq->nic; > > RTE_BUILD_BUG_ON(sizeof(union mbuf_initializer) != 8); > RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, data_off) % 8 != 0); > @@ -1240,7 +1243,7 @@ nicvf_rxq_mbuf_setup(struct nicvf_rxq *rxq) > RTE_BUILD_BUG_ON(offsetof(struct rte_mbuf, port) - > offsetof(struct rte_mbuf, data_off) != 6); > mb_def.nb_segs = 1; > - mb_def.data_off = RTE_PKTMBUF_HEADROOM; > + mb_def.data_off = RTE_PKTMBUF_HEADROOM + (nic->skip_bytes); > mb_def.port = rxq->port_id; > rte_mbuf_refcnt_set(&mb_def, 1); > > @@ -1260,9 +1263,19 @@ nicvf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, > struct nicvf_rxq *rxq; > struct nicvf *nic = nicvf_pmd_priv(dev); > uint64_t offloads; > + uint32_t buffsz; > + struct rte_pktmbuf_pool_private *mbp_priv; > > PMD_INIT_FUNC_TRACE(); > > + /* First skip check */ > + mbp_priv = rte_mempool_get_priv(mp); > + buffsz = mbp_priv->mbuf_data_room_size - RTE_PKTMBUF_HEADROOM; > + if (buffsz < (uint32_t)(nic->skip_bytes)) { > + PMD_INIT_LOG(ERR, "First skip is more than configured buffer size"); > + return -EINVAL; > + } > + > if (qidx >= MAX_RCV_QUEUES_PER_QS) > nic = nic->snicvf[qidx / MAX_RCV_QUEUES_PER_QS - 1]; > > @@ -1298,6 +1311,7 @@ nicvf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, > return -EINVAL; > } > > + > /* Check rx_free_thresh upper bound */ > rx_free_thresh = (uint16_t)((rx_conf->rx_free_thresh) ? > rx_conf->rx_free_thresh : > @@ -1498,6 +1512,7 @@ nicvf_vf_start(struct rte_eth_dev *dev, struct nicvf *nic, uint32_t rbdrsz) > return -EINVAL; > } > rxq->mbuf_phys_off -= data_off; > + rxq->mbuf_phys_off -= nic->skip_bytes; > > if (mbuf_phys_off == 0) > mbuf_phys_off = rxq->mbuf_phys_off; > @@ -1978,6 +1993,59 @@ static const struct eth_dev_ops nicvf_eth_dev_ops = { > .get_reg = nicvf_dev_get_regs, > }; > > +static inline int > +nicvf_set_first_skip(struct rte_eth_dev *dev) > +{ > + int bytes_to_skip = 0; > + int ret = 0; > + unsigned int i; > + struct rte_kvargs *kvlist; > + static const char *const skip[] = { > + SKIP_DATA_BYTES, > + NULL}; > + struct nicvf *nic = nicvf_pmd_priv(dev); > + > + if (!dev->device->devargs) { > + nicvf_first_skip_config(nic, 0); > + return ret; > + } > + > + kvlist = rte_kvargs_parse(dev->device->devargs->args, skip); > + if (!kvlist) > + return -EINVAL; > + > + if (kvlist->count == 0) > + goto exit; > + > + for (i = 0; i != kvlist->count; ++i) { > + const struct rte_kvargs_pair *pair = &kvlist->pairs[i]; > + > + if (!strcmp(pair->key, SKIP_DATA_BYTES)) > + bytes_to_skip = atoi(pair->value); > + } > + > + /*128 bytes amounts to one cache line*/ Bad comment alignment. > + if (bytes_to_skip >= 0 && bytes_to_skip < 128) { > + if (!(bytes_to_skip % 8)) { > + nicvf_first_skip_config(nic, (bytes_to_skip / 8)); > + nic->skip_bytes = bytes_to_skip; > + goto kvlist_free; > + } else { > + PMD_INIT_LOG(ERR, "skip_data_bytes should be multiple of 8"); > + ret = -EINVAL; > + goto exit; > + } > + } else { > + PMD_INIT_LOG(ERR, "skip_data_bytes should be less than 128"); > + ret = -EINVAL; > + goto exit; > + } > +exit: > + nicvf_first_skip_config(nic, 0); > +kvlist_free: > + rte_kvargs_free(kvlist); > + return ret; > +} > static int > nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) > { > @@ -2087,6 +2155,11 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) > goto malloc_fail; > } > > + ret = nicvf_set_first_skip(eth_dev); > + if (ret) { > + PMD_INIT_LOG(ERR, "Failed to configure first skip"); > + goto malloc_fail; > + } > PMD_INIT_LOG(INFO, "Port %d (%x:%x) mac=%02x:%02x:%02x:%02x:%02x:%02x", > eth_dev->data->port_id, nic->vendor_id, nic->device_id, > nic->mac_addr[0], nic->mac_addr[1], nic->mac_addr[2], > @@ -2159,3 +2232,4 @@ static struct rte_pci_driver rte_nicvf_pmd = { > RTE_PMD_REGISTER_PCI(net_thunderx, rte_nicvf_pmd); > RTE_PMD_REGISTER_PCI_TABLE(net_thunderx, pci_id_nicvf_map); > RTE_PMD_REGISTER_KMOD_DEP(net_thunderx, "* igb_uio | uio_pci_generic | vfio-pci"); > +RTE_PMD_REGISTER_PARAM_STRING(net_thunderx, SKIP_DATA_BYTES "="); > diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h > index ea8dccd..9af5088 100644 > --- a/drivers/net/thunderx/nicvf_ethdev.h > +++ b/drivers/net/thunderx/nicvf_ethdev.h > @@ -51,6 +51,7 @@ > > #define VLAN_TAG_SIZE 4 /* 802.3ac tag */ > > +#define SKIP_DATA_BYTES "skip_data_bytes" > static inline struct nicvf * > nicvf_pmd_priv(struct rte_eth_dev *eth_dev) > { > diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h > index d4a83c3..cf98f7c 100644 > --- a/drivers/net/thunderx/nicvf_struct.h > +++ b/drivers/net/thunderx/nicvf_struct.h > @@ -99,6 +99,7 @@ struct nicvf { > struct rte_intr_handle intr_handle; > uint8_t cpi_alg; > uint16_t mtu; > + int skip_bytes; Since the value comes less than 256, use uint8_t Other that it looks good to me. > bool vlan_filter_en; > uint8_t mac_addr[ETHER_ADDR_LEN]; > /* secondary queue set support */ > -- > 2.7.4 >