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 C7335A00C3; Mon, 12 Sep 2022 13:24:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6AEF0400D4; Mon, 12 Sep 2022 13:24:49 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 2511840042 for ; Mon, 12 Sep 2022 13:24:48 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 5ABB669; Mon, 12 Sep 2022 14:24:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 5ABB669 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1662981887; bh=IP0WFcUKchBi+QXsFcpo3Cyt0CbpOBfgcoSEyy2XMeA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=k+CycBGiYvgr67vt2ttAadQchx/NmIAqX/ngQEmfuQSD+Lll2WylNYCyaY4cBeXWQ Sib96K8lwww90OwGsxPYcxbn4ujwQg5OPh3R+8ktkVA1R6gheqVD4FIfjG/WHMicl5 Bt8uJSzRTSFVkDlq083OliXeHP+MVhM+wnyJfA5c= Message-ID: Date: Mon, 12 Sep 2022 14:24:47 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v3 1/4] ethdev: introduce protocol header API Content-Language: en-US To: Yuan Wang , dev@dpdk.org, Thomas Monjalon , Ferruh Yigit , Ray Kinsella Cc: xiaoyun.li@intel.com, aman.deep.singh@intel.com, yuying.zhang@intel.com, qi.z.zhang@intel.com, qiming.yang@intel.com, jerinjacobk@gmail.com, viacheslavo@nvidia.com, stephen@networkplumber.org, xuan.ding@intel.com, hpothula@marvell.com, yaqi.tang@intel.com, Wenxuan Wu References: <20220812181552.2908067-1-yuanx.wang@intel.com> <20220902191027.666923-1-yuanx.wang@intel.com> <20220902191027.666923-2-yuanx.wang@intel.com> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20220902191027.666923-2-yuanx.wang@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 9/2/22 22:10, Yuan Wang wrote: > Add a new ethdev API to retrieve supported protocol headers > of a PMD, which helps to configure protocol header based buffer split. > > Signed-off-by: Yuan Wang > Signed-off-by: Xuan Ding > Signed-off-by: Wenxuan Wu Nit below. Other than that: Reviewed-by: Andrew Rybchenko > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 1979dc0850..093c577add 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -5917,6 +5917,39 @@ rte_eth_dev_priv_dump(uint16_t port_id, FILE *file) > return eth_err(port_id, (*dev->dev_ops->eth_dev_priv_dump)(dev, file)); > } > > +int > +rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t *ptypes, int num) > +{ > + int i, j; > + struct rte_eth_dev *dev; > + const uint32_t *all_types; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + dev = &rte_eth_devices[port_id]; > + > + if (ptypes == NULL && num > 0) { > + RTE_ETHDEV_LOG(ERR, > + "Cannot get ethdev port %u supported header protocol types to NULL " > + "when array size is non zero\n", Do not split log message across many lines. Too long line is a less evil which is accepted by checkpatches. > + port_id); > + return -EINVAL; > + } [snip]