xdp-project / xdp-tutorial

XDP tutorial
2.33k stars 562 forks source link

Rework tutorials to use libxdp and libbpf 1.0 #355

Closed donaldh closed 1 year ago

netoptimizer commented 1 year ago

Tried out your branch on my machine.

I see that lib/xdp-tools automatically gets some changes

[xdp-tutorial-redhat-et]$ git diff
diff --git a/lib/xdp-tools b/lib/xdp-tools
--- a/lib/xdp-tools
+++ b/lib/xdp-tools
@@ -1 +1 @@
-Subproject commit cdd93184d18ceaf2200ec4bf63a30b7e11938177
+Subproject commit cdd93184d18ceaf2200ec4bf63a30b7e11938177-dirty

If I want to commit some changes I get this error:

[xdp-tutorial-redhat-et]$ git commit -s -a
On branch use-libxdp
Your branch is up to date with 'origin/use-libxdp'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
    modified:   lib/xdp-tools (modified content, untracked content)

no changes added to commit (use "git add" and/or "git commit -a")

This might be a xdp-tools issue (and we can blame @tohojo), but it affects the users of the XDP-tutorial.

netoptimizer commented 1 year ago

For completeness these are the changes I see on xdp-tools git submodule:

$ cd lib/xdp-tools
$ git diff
diff --git a/lib/libxdp/libxdp.3 b/lib/libxdp/libxdp.3
index 7300a53c8de1..030f35385f78 100644
--- a/lib/libxdp/libxdp.3
+++ b/lib/libxdp/libxdp.3
@@ -1,4 +1,4 @@
-.TH "libxdp" "3" "October  6, 2022" "v1.2.2" "libxdp - library for loading XDP programs" 
+.TH "libxdp" "3" "November 17, 2022" "v1.2.2" "libxdp - library for loading XDP programs" 

 .SH "NAME"
 libxdp \- library for attaching XDP programs and using AF_XDP sockets
diff --git a/xdp-loader/xdp-loader.8 b/xdp-loader/xdp-loader.8
index 4389ad6d3492..7b7d7fce200b 100644
--- a/xdp-loader/xdp-loader.8
+++ b/xdp-loader/xdp-loader.8
@@ -1,4 +1,4 @@
-.TH "xdp-loader" "8" "AUGUST  9, 2022" "V1.2.2" "XDP program loader"
+.TH "xdp-loader" "8" "AUGUST  9, 2022" "V1.2.2" "XDP program loader" 

I don't get where these strange changes to the dates happens to originate from...

donaldh commented 1 year ago

I don't get where these strange changes to the dates happens to originate from...

I don't know either, but they shouldn't be included so I'll revert this change.

tohojo commented 1 year ago

Donald Hunter @.***> writes:

I don't get where these strange changes to the dates happens to originate from...

I don't know either, but they shouldn't be included so I'll revert this change.

Just add 'ignore = dirty' to .gitmodules under the lib/xdp-tools entry (as is already done for the libbpf module).

netoptimizer commented 1 year ago

@tohojo writes: Just add 'ignore = dirty' to .gitmodules under the lib/xdp-tools entry (as is already done for the libbpf module).

I'm not sure this is a good idea. I've run into issues when we wanted to update the submodule version, and because my/users local git tree had 'dirty' submodule, these change was not automatically getting git pull'ed.

tohojo commented 1 year ago

Jesper Dangaard Brouer @.***> writes:

@tohojo writes: Just add 'ignore = dirty' to .gitmodules under the lib/xdp-tools entry (as is already done for the libbpf module).

I'm not sure this is a good idea. I've run into issues when we wanted to update the submodule version, and because my/users local git tree had 'dirty' submodule, these change was not automatically getting git pull'ed.

But that happens regardless, doesn't it? And 'git submodule update' will complain? Maybe we could have a make target that always resets submodules to the known checkout and state, and direct users to run that if they encounter problems. 'make clobber' or something?

donaldh commented 1 year ago

I have pushed a commit to set EMACS="" when running configure in xdp-tools.

netoptimizer commented 1 year ago

Going to merge this. I have not reviewed all the individual commits, but I trust Donald and Maryam. And I can poke them if things break ;-)