Giter Club home page Giter Club logo

Comments (9)

jhk098 avatar jhk098 commented on June 20, 2024

Are you sure the issue is not on the TX side? This would happen if you write to a buffer not in the range [head, tail[.

Also, you may try to use emulated netmap on the RX side (dev.netmap.admode=2), in such a way that you rule out (or confirm) that the issue depends on the i40 patched driver.

from netmap.

ghyls avatar ghyls commented on June 20, 2024

Hello,

Many thanks for the help.

I do not observe the issue when using the emulated adapter (dev.netmap.admode=2).

The TX side is just a for loop that uses pcap.h to send one packet per iteration. It is not using Netmap. Also, if on the RX side I set the ring size to e.g. 1024, the problematic packet would be the 1024th and not the 512th.

from netmap.

jhk098 avatar jhk098 commented on June 20, 2024

OK so that definitely points to some bug with i40e.

Does the following patch make any difference?

diff --git a/LINUX/i40e_netmap_linux.h b/LINUX/i40e_netmap_linux.h
index 55df4cd2..74a6e757 100644
--- a/LINUX/i40e_netmap_linux.h
+++ b/LINUX/i40e_netmap_linux.h
@@ -497,6 +497,7 @@ i40e_netmap_rxsync(struct netmap_kring *kring, int flags)
 	u_int nm_i;	/* index into the netmap ring */
 	u_int nic_i;	/* index into the NIC ring */
 	u_int ntail;	/* new tail for the user */
+	u_int stop_i;
 	u_int n;
 	u_int const lim = kring->nkr_num_slots - 1;
 	u_int const head = kring->rhead;
@@ -544,11 +545,13 @@ i40e_netmap_rxsync(struct netmap_kring *kring, int flags)
 
 		nic_i = rxr->next_to_clean; // or also k2n(kring->nr_hwtail)
 		nm_i = netmap_idx_n2k(kring, nic_i);
+		stop_i = nm_prev(kring->nr_hwcur, lim);
+		BUG_ON(nm_i != kring->nr_hwtail);
 		/* we advance tail only when we see a complete packet */
 		ntail = lim + 1;
 		complete = 0;
 
-		for (n = 0; ; n++) {
+		for (n = 0; nm_i != stop_i; n++) {
 			union i40e_rx_desc *curr = I40E_RX_DESC(rxr, nic_i);
 			uint64_t qword = le64toh(curr->wb.qword1.status_error_len);
 			uint32_t staterr = (qword & I40E_RXD_QW1_STATUS_MASK)

from netmap.

ghyls avatar ghyls commented on June 20, 2024

Hi,

Thanks for the help. Unfortunately, it doesn't seem to make any difference.
Just for clarification, I have applied it, and then run again:

make distclean
./configure --drivers=i40e --select-version=i40e:2.22.8
make
sudo make install

Please let me know if you need any further information.
I will let you know if I make any progress.

from netmap.

giuseppelettieri avatar giuseppelettieri commented on June 20, 2024

Is this any better?

diff --git a/LINUX/i40e_netmap_linux.h b/LINUX/i40e_netmap_linux.h
index 55df4cd25..9acdc106b 100644
--- a/LINUX/i40e_netmap_linux.h
+++ b/LINUX/i40e_netmap_linux.h
@@ -176,7 +176,7 @@ i40e_netmap_configure_rx_ring(struct i40e_ring *ring)
 	kring = na->rx_rings[ring_nr];
 	lim = na->num_rx_desc - 1 - nm_kr_rxspace(kring);
 
-	for (i = 0; i < lim; i++) {
+	for (i = 0; i <= lim; i++) {
 		int si = netmap_idx_n2k(kring, i);
 		uint64_t paddr;
 		union i40e_rx_desc *rx = I40E_RX_DESC(ring, i);

from netmap.

giuseppelettieri avatar giuseppelettieri commented on June 20, 2024

By the way, I assume that, after sudo make install, you have also run

rmmod i40e
modprobe i40e

from netmap.

ghyls avatar ghyls commented on June 20, 2024

Hi,

Yes, that fixes the problem.
(I ran rmmod i40e, rmmod netmap, insmod netmap.ko and insmod i40e/i40e.ko. Sorry for not writing it before.)

Thank you very much!

Mario

from netmap.

giuseppelettieri avatar giuseppelettieri commented on June 20, 2024

pushed to mater, thanks!

from netmap.

reinmark avatar reinmark commented on June 20, 2024

Thanks for describing and fixing this issue.
We observed the same behaviour on an igb based system which works now as expected.

from netmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.