From: Jerin Jacob <jerinjacobk@gmail.com>
To: Sunil Kumar Kori <skori@marvell.com>
Cc: Jerin Jacob <jerinj@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
John McNamara <john.mcnamara@intel.com>,
Marko Kovacevic <marko.kovacevic@intel.com>,
dpdk-dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3 1/1] net/octeontx2: add Rx/Tx burst mode get callbacks
Date: Fri, 8 Nov 2019 22:58:51 +0530 [thread overview]
Message-ID: <CALBAE1MK+vNZBcOd52fN_71pqK8F8moABBxcAH0qc80Af8kBXQ@mail.gmail.com> (raw)
In-Reply-To: <20191106112649.24484-1-skori@marvell.com>
On Wed, Nov 6, 2019 at 4:57 PM Sunil Kumar Kori <skori@marvell.com> wrote:
>
> Retrieve burst mode information according to the selected Rx/Tx mode and
> offloads.
>
> Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
> ---
> v3:
> - Rebased the patch over patches.dpdk.org/patch/62368/
> v2:
> - Rebased the patch on latest commit.
> - Update feature matrix for the support.
>
> doc/guides/nics/features/octeontx2.ini | 1 +
> drivers/net/octeontx2/otx2_ethdev.c | 2 +
> drivers/net/octeontx2/otx2_ethdev.h | 4 ++
> drivers/net/octeontx2/otx2_ethdev_ops.c | 87 +++++++++++++++++++++++++
> 4 files changed, 94 insertions(+)
>
>
> +int
> +otx2_rx_burst_mode_get(struct rte_eth_dev *eth_dev,
> + __rte_unused uint16_t queue_id,
> + struct rte_eth_burst_mode *mode)
> +{
> +#define STRING_SIZE 1024
Use RTE_ETH_BURST_MODE_INFO_SIZE instead of hardcoded 1024
> + struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);
> + char info[STRING_SIZE] = {'\0'};
No need for intermediate "info", use rte_eth_burst_mode::info
> + ssize_t bytes = 0;
> +
> + if (dev->scalar_ena)
> + bytes += rte_strscpy(info, "Scalar", 7);
Please avoid hardcoding of '7'.
ssize_t sz = 0, rc;
rc = rte_strscpy(mode->info + sz, "Scalar", STRING_SIZE - sz);
if (rc < 0)
goto done;
sz += rc;
rc = rte_strscpy(mode->info + sz, "Vector Neon", STRING_SIZE - sz);
if (rc < 0)
goto done;
sz += rc;
> + else
> + bytes += rte_strscpy(info, "Vector Neon", 12);
> +
> + bytes += rte_strscpy(info + bytes, ", Rx Offloads:", 15);
> +
> + if (dev->rx_offload_flags & NIX_RX_OFFLOAD_RSS_F)
> + bytes += rte_strscpy(info + bytes, " RSS,", 6);
> +
> + if (dev->rx_offload_flags & NIX_RX_OFFLOAD_PTYPE_F)
> + bytes += rte_strscpy(info + bytes, " Ptype,", 8);
next prev parent reply other threads:[~2019-11-08 17:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 11:26 Sunil Kumar Kori
2019-11-08 17:28 ` Jerin Jacob [this message]
2019-11-11 8:16 ` [dpdk-dev] [PATCH v4 " Sunil Kumar Kori
2019-11-11 12:05 ` [dpdk-dev] [PATCH v5 " Sunil Kumar Kori
2019-11-11 12:16 ` Sunil Kumar Kori
2019-11-12 9:02 ` [dpdk-dev] [PATCH v6 " Sunil Kumar Kori
2019-11-15 7:00 ` Jerin Jacob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALBAE1MK+vNZBcOd52fN_71pqK8F8moABBxcAH0qc80Af8kBXQ@mail.gmail.com \
--to=jerinjacobk@gmail.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=john.mcnamara@intel.com \
--cc=kirankumark@marvell.com \
--cc=marko.kovacevic@intel.com \
--cc=ndabilpuram@marvell.com \
--cc=skori@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).