From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700049.outbound.protection.outlook.com [40.107.70.49]) by dpdk.org (Postfix) with ESMTP id BEA105F33 for ; Mon, 18 Jun 2018 06:02:17 +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=lzmJU/uBIaxF8nQwFGEp3h8VHOIBvAhOU5rwSUzF93Q=; b=EGezWvYg1valzAVbvr6ZWVzR4B26Uajti2Ry8uUc2B9Jq4JmmMa8pe0orHjn2ypXPV6MC3jk5ZrPyS6v3hJpRky9qkSZvFYZvrlGFiszCII+H8XVOlrQm+tshGX01gCx7mJcsNWpWDuXD0ouqiaaPxLbjmIqKoNhgX95P4g6j2Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (171.61.94.72) by CO2PR07MB2517.namprd07.prod.outlook.com (2603:10b6:102:12::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.14; Mon, 18 Jun 2018 04:02:13 +0000 Date: Mon, 18 Jun 2018 09:32:05 +0530 From: Jerin Jacob To: rkudurumalla Cc: dev@dpdk.org, ferruh.yigit@intel.com, Rakesh Kudurumalla Message-ID: <20180618040203.GA2326@jerin> References: <1528968979-25656-1-git-send-email-rakesh.kudurumalla@cavium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1528968979-25656-1-git-send-email-rakesh.kudurumalla@cavium.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [171.61.94.72] X-ClientProxiedBy: CO1PR15CA0080.namprd15.prod.outlook.com (2603:10b6:101:20::24) To CO2PR07MB2517.namprd07.prod.outlook.com (2603:10b6:102:12::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 63c6f270-e1ce-4fe7-f368-08d5d4d0472c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:CO2PR07MB2517; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2517; 3:UlsBDecf8rNHyYMBaEwSWRugFmQQu+O8G6VDbJWg+loQL2S7gfYrE5+uztX1iyDDT7mw4ASbcAWiE9cqW/gARN+nen0yfCDnXz7BLIEiEjYDTr0MQUZQ6RYKhlA64BAfRMEHUoiZqvcP4524DVxqnNiNLDTiFOIQrrfUakS1b/j8+NkgZU7v86g4rYfuAUXU4ay2ue0g8ErQy07+Qpp6L3JU1wMbCkJWj8/8W6p30AY4jvMfpjedTPzjQ56mK+Q6; 25:ovvawzDfvWITTpDFum5G1yYC44JwQwva0OIrdABo3AAqncImPThDtQv8gOmx/DZ6un4WgZ2bPSpgZ6rBbHBjCWfDazEU0AnZYCe1bBplAszu/shLJNf++sqb7+2EODlQFnFu+1lWN7Jw0V+XGarjbmHMq29Y8/SfKiNMhA5sqwIJYTlhVsMZgRVChCNZdeyRY8JCYa2YcBAU4xXqptW9w+2E3gw7MNhCX/Wgjo6EXo5supe9QZkBMVh8V/gOlynkAugwm8+2DrLCx66EiQ/+w+Gb8pFxfVc+mPuMlKkfAPL+EeNwX4twBjB0UumU1IcBqon4u5X0Y5t1UBt0zLgHpA==; 31:gXY3dtKUtarIYErCyB/gikOTefv/FrrXbBWQeVL/Y/ywbw+14DFGln7+fXc9UQj8608AFkjq7eCqChIQTkd7T9NrrH8D5uUFWz3EebNDboi39wkmMT7ha2c4u2kpGimLdGONzrInqkiaETF/0FXqWgnCRMg3OtDjX6AF1KoZ3FwG/+6+Sxbrzn3B4hH2/ioek512hUM1YGTvOA8frC5c8G2NsUZcrc/o3gSzSF9u89A= X-MS-TrafficTypeDiagnostic: CO2PR07MB2517: X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2517; 20:dDu1W6+2upXVDtNtZhvER//DR/HTze7eU1/UiUPVoCv94azFtglUrZZozhVmgDwEZqmHlUGv8wv32BsBzf7wRjce8vLMOssbrPx1YW1nKeBOIQqEz1Ucob4WapR8anpuy/4jl8JkIhdK8RFhBY3fz/8rP08L7Cu9THBpYqbQ4xIzT/6GwMUrcKutfCBcoII/swtqI9u7vmaQUmON9UJbW20R0a6UeZ8k+EZCasnjpEFavPmIspdATF0bQk+mSvamZpFIAEy337VWdH9fvCnxsDodNtZO8QmOh/Jyqczy7IaSI7khSI4AMZ1/xgAlPRAblrT+E0cUaIga+LbBp0vonMMwkYTH/8jKF02hf8gIvx9GOvK1xumaivv1fArTO+bgVCW9uh7Bt4+MRGtXJTP09VzdnHSiaafX8B002QntZh4QKCA0oWMeovkXymB7vy6rh6vZSJpam4cgdHfHL2KvQkWf0qqZmAFxJonVSSfm+FXQ3mtBb6tZgz0/Zb4WQ79Obdo92cw5g2ywAjT9dV/4H9scwPAZ4EvCsM3YJc7Qrfvn0jKOUL3mTY0c0euSfqjm+IHTQpI/GJzxyE41DOncRYK6s5bWrOF/JtnlzxrW4sA=; 4:3mr7W0DQE5FnDLDZosnQQobpGCFXtEbo1uC8h+LCHdq5LMgq2w6Rukzscey3+ciJqI9VcDJN4W1r0hzkLssFL084Pv6U04ffUhY9sxKe/5QaeGNCpinq6apEfcGNWu9HuE9DrXuxVqUn7iS5M8RfDhd+YR0BCloqVxLoPdmrUXDeKP7wXS24jvkl8xlxqmD+Tkx7LOgIuAvZfncIxyDfv12P5MJ+7JAMvGYXB3eA3aZxneTFQgyxkmrB5vxYTkIuf9E2b7zZ+MiLYBgl7AWcfchC1r2IaeRWEK7v52bGcxHuTwv6FrR7LeNHnFUTKMbW X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(10201501046)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:CO2PR07MB2517; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB2517; X-Forefront-PRVS: 0707248B64 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(396003)(39850400004)(366004)(376002)(346002)(13464003)(189003)(199004)(4326008)(2906002)(9686003)(107886003)(47776003)(55016002)(16526019)(6666003)(33896004)(59450400001)(446003)(2486003)(386003)(52116002)(229853002)(52146003)(316002)(53936002)(26005)(97736004)(6496006)(76176011)(44832011)(58126008)(11346002)(6862004)(2870700001)(5660300001)(5890100001)(476003)(6246003)(23676004)(42882007)(575784001)(486006)(66066001)(956004)(6306002)(33656002)(33716001)(25786009)(50466002)(8676002)(68736007)(1076002)(8936002)(81166006)(106356001)(3846002)(105586002)(81156014)(966005)(72206003)(478600001)(305945005)(7736002)(6116002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2517; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDTzJQUjA3TUIyNTE3OzIzOmsvNzlObFVQdEloSzRzRUV5dVRXUGU0b3BW?= =?utf-8?B?TStOeFh3VDYzYmtLclpaSmI3aUx5bGdESzBYYWtkaSs5NjB1TkNXbmh3KzZB?= =?utf-8?B?amc1SGhzTDF2YWpTQVFMOUhxbkxFRG5qdDFGRjlMckV1SENzZGlaQ0NlbDJ3?= =?utf-8?B?YUZCczR2Z0FKYnJJS0JZNXJWWjBoTDBmaUxET3BrU1hZN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nosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2517; 7:Hwuto46r8us4qZuJzhQyz5aLNXMFBDu5YICnF/3h53OClm5NpDdfAHsOTLwV6pTo3ux8g9OOcskDSUfgTisWvJgMRr8wQiaQh1NIZL7U6UeuFgnaBZ2h2pMMaERZpvVk9ombQuEhBZtZU2W08HdUOpWQOPhrntPnoLjzvWoPwfFH9Ct9qNjAVuOqhbTQcK4df9/vV3vQ8tfWZExNHgG4GfzL6yKaF1r8PIt3C66HUJhk+kU+rihzPfEqP1NIuirk X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2018 04:02:13.3439 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63c6f270-e1ce-4fe7-f368-08d5d4d0472c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2517 Subject: Re: [dpdk-dev] [PATCH V2] 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, 18 Jun 2018 04:02:18 -0000 -----Original Message----- > Date: Thu, 14 Jun 2018 15:06:19 +0530 > From: rkudurumalla > To: dev@dpdk.org > Cc: ferruh.yigit@intel.com, jerin.jacob@caviumnetworks.com, Rakesh > Kudurumalla > Subject: [PATCH V2] net/thunderx: add support for hardware first skip Add [dpdk-dev] in subject. [dpdk-dev] [PATCH v2] 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 > --- > V1: https://dpdk.org/ml/archives/dev/2018-May/103058.html > V2: Includes changes in thunder.rst to render outupt correctly in html > > doc/guides/nics/thunderx.rst | 18 +++++++++ > 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, 108 insertions(+), 1 deletion(-) > > diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst > index 2642374..7825b43 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,18 @@ 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 > +-------------- > + Create a sub section called skip_data_bytes. Since we are referecing this fearture as skip_data_bytes, please remove first skip instance. I have reformatted the documention. Here is the diff. Please consider using it. ➜ [master]laptop [dpdk.org] $ git diff diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst index 5b00dd5e8..e84eaafe5 100644 --- a/doc/guides/nics/thunderx.rst +++ b/doc/guides/nics/thunderx.rst @@ -30,7 +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 +- Skip data bytes Supported ThunderX SoCs ----------------------- @@ -317,13 +317,16 @@ The nicvf thunderx driver will make use of attached secondary VFs automatically 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("skip_data_bytes") to pmd. - This scheme is useful when application would like to insert vlan header without disturbing HEADROOM +skip_data_bytes +~~~~~~~~~~~~~~~ +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. +Example: + .. code-block:: console - use ``-w pci_id,skip_data_bytes="number of bytes to skip"`` - + -w 0002:01:00.2,skip_data_bytes=8 Limitations ----------- @@ -349,7 +352,7 @@ 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 -~~~~~~~~~~ +skip_data_bytes +~~~~~~~~~~~~~~~ -Maximum limit on first_skip is 128 bytes and number of bytes should be multiple of 8. +Maximum limit of skip_data_bytes is 128 bytes and number of bytes should be multiple of 8. > + 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"`` > + > + > Limitations > ----------- > > @@ -335,3 +348,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. > 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 > > #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*/ Please align the comment. Rest looks good to me.