From: Sunil Kumar Kori <sunil.kori@nxp.com>
To: <dev@dpdk.org>
Cc: <sunil.kori@nxp.com>, <hemant.agrawal@nxp.com>
Subject: [dpdk-dev] [PATCH v2 1/2] net/dpaa: Changes to support ethdev offload APIs
Date: Wed, 11 Apr 2018 16:35:39 +0530 [thread overview]
Message-ID: <20180411110540.30071-2-sunil.kori@nxp.com> (raw)
In-Reply-To: <20180411110540.30071-1-sunil.kori@nxp.com>
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
---
drivers/net/dpaa/dpaa_ethdev.c | 50 +++++++++++++++++++++++++++++++++++++-----
1 file changed, 44 insertions(+), 6 deletions(-)
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index db49364..1c632a2 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -95,6 +95,9 @@ static const struct rte_dpaa_xstats_name_off dpaa_xstats_strings[] = {
static struct rte_dpaa_driver rte_dpaa_pmd;
+static void
+dpaa_eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info);
+
static inline void
dpaa_poll_queue_default_config(struct qm_mcc_initfq *opts)
{
@@ -122,9 +125,11 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
if (mtu < ETHER_MIN_MTU || frame_size > DPAA_MAX_RX_PKT_LEN)
return -EINVAL;
if (frame_size > ETHER_MAX_LEN)
- dev->data->dev_conf.rxmode.jumbo_frame = 1;
+ dev->data->dev_conf.rxmode.offloads &=
+ DEV_RX_OFFLOAD_JUMBO_FRAME;
else
- dev->data->dev_conf.rxmode.jumbo_frame = 0;
+ dev->data->dev_conf.rxmode.offloads &=
+ ~DEV_RX_OFFLOAD_JUMBO_FRAME;
dev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size;
@@ -134,13 +139,42 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
}
static int
-dpaa_eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
+dpaa_eth_dev_configure(struct rte_eth_dev *dev)
{
struct dpaa_if *dpaa_intf = dev->data->dev_private;
+ struct rte_eth_conf *eth_conf = &dev->data->dev_conf;
+ struct rte_eth_dev_info dev_info;
+ uint64_t rx_offloads = eth_conf->rxmode.offloads;
+ uint64_t tx_offloads = eth_conf->txmode.offloads;
PMD_INIT_FUNC_TRACE();
- if (dev->data->dev_conf.rxmode.jumbo_frame == 1) {
+ dpaa_eth_dev_info(dev, &dev_info);
+ if (((~(dev_info.rx_offload_capa) & rx_offloads) != 0)) {
+ DPAA_PMD_ERR("Some Rx offloads are not supported "
+ "requested 0x%" PRIx64 " supported 0x%" PRIx64,
+ rx_offloads, dev_info.rx_offload_capa);
+ return -ENOTSUP;
+ }
+
+ if (((~(dev_info.tx_offload_capa) & tx_offloads) != 0)) {
+ DPAA_PMD_ERR("Some Tx offloads are not supported "
+ "requested 0x%" PRIx64 " supported 0x%" PRIx64,
+ tx_offloads, dev_info.tx_offload_capa);
+ return -ENOTSUP;
+ }
+
+ if (((rx_offloads & DEV_RX_OFFLOAD_IPV4_CKSUM) == 0) ||
+ ((rx_offloads & DEV_RX_OFFLOAD_UDP_CKSUM) == 0) ||
+ ((rx_offloads & DEV_RX_OFFLOAD_TCP_CKSUM) == 0) ||
+ ((tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) == 0) ||
+ ((tx_offloads & DEV_TX_OFFLOAD_UDP_CKSUM) == 0) ||
+ ((tx_offloads & DEV_TX_OFFLOAD_TCP_CKSUM) == 0)) {
+ DPAA_PMD_ERR(" Cksum offloading is enabled by default "
+ " Cannot be disabled. So ignoring this configuration ");
+ }
+
+ if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
if (dev->data->dev_conf.rxmode.max_rx_pkt_len <=
DPAA_MAX_RX_PKT_LEN) {
fman_if_set_maxfrm(dpaa_intf->fif,
@@ -259,11 +293,15 @@ static void dpaa_eth_dev_info(struct rte_eth_dev *dev,
dev_info->rx_offload_capa =
(DEV_RX_OFFLOAD_IPV4_CKSUM |
DEV_RX_OFFLOAD_UDP_CKSUM |
- DEV_RX_OFFLOAD_TCP_CKSUM);
+ DEV_RX_OFFLOAD_TCP_CKSUM) |
+ DEV_RX_OFFLOAD_JUMBO_FRAME |
+ DEV_RX_OFFLOAD_SCATTER;
dev_info->tx_offload_capa =
(DEV_TX_OFFLOAD_IPV4_CKSUM |
DEV_TX_OFFLOAD_UDP_CKSUM |
- DEV_TX_OFFLOAD_TCP_CKSUM);
+ DEV_TX_OFFLOAD_TCP_CKSUM) |
+ DEV_TX_OFFLOAD_MBUF_FAST_FREE |
+ DEV_TX_OFFLOAD_MULTI_SEGS;
}
static int dpaa_eth_link_update(struct rte_eth_dev *dev,
--
2.9.3
next prev parent reply other threads:[~2018-04-11 11:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-09 10:26 [dpdk-dev] [PATCH 0/2] Support for new Ethdev " Sunil Kumar Kori
2018-04-09 10:26 ` [dpdk-dev] [PATCH 1/2] net/dpaa: Changes to support ethdev " Sunil Kumar Kori
2018-04-09 13:19 ` Sunil Kumar Kori
2018-04-09 13:19 ` [dpdk-dev] [PATCH 2/2] net/dpaa2: " Sunil Kumar Kori
2018-04-10 16:47 ` Ferruh Yigit
2018-04-10 16:40 ` [dpdk-dev] [PATCH 1/2] net/dpaa: " Ferruh Yigit
2018-04-09 10:26 ` [dpdk-dev] [PATCH 2/2] net/dpaa2: " Sunil Kumar Kori
2018-04-11 11:05 ` [dpdk-dev] [PATCH v2 0/2] Support for new Ethdev " Sunil Kumar Kori
2018-04-11 11:05 ` Sunil Kumar Kori [this message]
2018-04-11 11:05 ` [dpdk-dev] [PATCH v2 2/2] net/dpaa2: Changes to support ethdev " Sunil Kumar Kori
2018-04-12 18:17 ` [dpdk-dev] [PATCH v2 0/2] Support for new Ethdev " Ferruh Yigit
2018-04-24 15:06 ` [dpdk-dev] [PATCH v3 1/2] net/dpaa: fix the ethdev offload checks Hemant Agrawal
2018-04-24 15:06 ` [dpdk-dev] [PATCH v3 2/2] net/dpaa2: " Hemant Agrawal
2018-04-24 16:43 ` [dpdk-dev] [PATCH v3 1/2] net/dpaa: " Ferruh Yigit
2018-04-24 17:23 ` Hemant Agrawal
2018-04-24 17:16 ` [dpdk-dev] [PATCH v4 " Hemant Agrawal
2018-04-24 17:16 ` [dpdk-dev] [PATCH v4 2/2] net/dpaa2: " Hemant Agrawal
2018-04-24 18:04 ` [dpdk-dev] [PATCH v4 1/2] net/dpaa: " Ferruh Yigit
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=20180411110540.30071-2-sunil.kori@nxp.com \
--to=sunil.kori@nxp.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.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).