DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/l3fwd: force CRC stripping for i40evf
@ 2016-11-09  8:23 Björn Töpel
  2016-11-09  8:37 ` Yao, Lei A
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Björn Töpel @ 2016-11-09  8:23 UTC (permalink / raw)
  To: dev
  Cc: qian.q.xu, lei.a.yao, jingjing.wu, thomas.monjalon,
	Björn Töpel

Commit 1bbcc5d21129 ("i40evf: report error for unsupported CRC
stripping config") broke l3fwd, since it was forcing that CRC was
kept. Now, if i40evf is running, CRC stripping will be enabled.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
---
 examples/l3fwd/main.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 7223e773107e..b60278794135 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -906,6 +906,14 @@ main(int argc, char **argv)
 			n_tx_queue = MAX_TX_QUEUE_PER_PORT;
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue );
+		rte_eth_dev_info_get(portid, &dev_info);
+		if (dev_info.driver_name &&
+		    strcmp(dev_info.driver_name, "net_i40e_vf") == 0) {
+			/* i40evf require that CRC stripping is enabled. */
+			port_conf.rxmode.hw_strip_crc = 1;
+		} else {
+			port_conf.rxmode.hw_strip_crc = 0;
+		}
 		ret = rte_eth_dev_configure(portid, nb_rx_queue,
 					(uint16_t)n_tx_queue, &port_conf);
 		if (ret < 0)
@@ -946,7 +954,6 @@ main(int argc, char **argv)
 			printf("txq=%u,%d,%d ", lcore_id, queueid, socketid);
 			fflush(stdout);
 
-			rte_eth_dev_info_get(portid, &dev_info);
 			txconf = &dev_info.default_txconf;
 			if (port_conf.rxmode.jumbo_frame)
 				txconf->txq_flags = 0;
-- 
2.9.3

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/l3fwd: force CRC stripping for i40evf
@ 2016-11-10 13:50 Mori, Naoyuki
  2016-11-10 14:32 ` Thomas Monjalon
  0 siblings, 1 reply; 19+ messages in thread
From: Mori, Naoyuki @ 2016-11-10 13:50 UTC (permalink / raw)
  To: dev, bjorn.topel, Yao, Lei A, Topel, Bjorn, Zhang, Helin,
	Ananyev, Konstantin
  Cc: Xu, Qian Q, Wu, Jingjing, thomas.monjalon

Hi,

Re:
>    Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: force CRC stripping
>    	for	i40evf
>    Message-ID: <cce4d31c-8a84-07aa-3361-327dba1ec77a@intel.com>
>    Thomas wrote:
>     > Just to make it sure, you mean returning an error in the driver when
>     > a configuration cannot be applied, right?
>    
>    Yes, as in 1bbcc5d21129 ("i40evf: report error for unsupported CRC
>    stripping config"), where -EINVAL is returned.
>    
>    Bj?rn

On my experience, OvS+DPDK has same issue.
You cannot run OvS on i40evf due to this CRC config mismatch, while OvS on ixgbevf works fine.
So, changing on i40evf PMD side would have more benefit, I believe.


[Details below]
ovs-vswitchd.log:
2016-11-10T08:53:31.290Z|00054|netdev_dpdk|WARN|Interface dpdk0 eth_dev setup error Invalid argument

because of
i40evf_dev_configure() returns –EINVAL.
At here
---
i40evf_dev_configure(struct rte_eth_dev *dev)
{
<snip>
        /* For non-DPDK PF drivers, VF has no ability to disable HW
         * CRC strip, and is implicitly enabled by the PF.
         */
        if (!conf->rxmode.hw_strip_crc) {
                vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
                if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR) &&
                    (vf->version_minor <= I40E_VIRTCHNL_VERSION_MINOR)) {
                        /* Peer is running non-DPDK PF driver. */
                        PMD_INIT_LOG(ERR, "VF can't disable HW CRC Strip");
                        return -EINVAL;
                }
        }
<snip>
}
---

ixgbevf is same Intel NIC but implementation is different. It won’t return error.

ixgbevf_dev_configure(struct rte_eth_dev *dev)
{
<snip>
        /*
         * VF has no ability to enable/disable HW CRC
         * Keep the persistent behavior the same as Host PF
         */
#ifndef RTE_LIBRTE_IXGBE_PF_DISABLE_STRIP_CRC
        if (!conf->rxmode.hw_strip_crc) {
                PMD_INIT_LOG(NOTICE, "VF can't disable HW CRC Strip");
                conf->rxmode.hw_strip_crc = 1;
        }
#else
        if (conf->rxmode.hw_strip_crc) {
                PMD_INIT_LOG(NOTICE, "VF can't enable HW CRC Strip");
                conf->rxmode.hw_strip_crc = 0;
        }
#endif
<snip>
}

Regards and Thanks,
Mori


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-11-10 14:43 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-09  8:23 [dpdk-dev] [PATCH] examples/l3fwd: force CRC stripping for i40evf Björn Töpel
2016-11-09  8:37 ` Yao, Lei A
2016-11-09  9:28 ` Thomas Monjalon
2016-11-09  9:39   ` Björn Töpel
2016-11-09  9:46 ` Ananyev, Konstantin
2016-11-09 10:05   ` Björn Töpel
2016-11-09 10:22     ` Thomas Monjalon
2016-11-09 11:08     ` Ananyev, Konstantin
2016-11-09 11:27       ` Björn Töpel
2016-11-09 12:13         ` Ananyev, Konstantin
2016-11-09 13:01         ` Zhang, Helin
2016-11-09 13:09           ` Björn Töpel
2016-11-10  5:49             ` Yao, Lei A
2016-11-10  6:17               ` Björn Töpel
2016-11-10  7:55                 ` Thomas Monjalon
2016-11-10  7:59                   ` Björn Töpel
2016-11-10 13:50 Mori, Naoyuki
2016-11-10 14:32 ` Thomas Monjalon
2016-11-10 14:43   ` Mori, Naoyuki

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).