Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release-v1.9.8 #998

Merged
merged 83 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
79ca896
1. set query params 'snapshot' of API(/v2/vs) to dump the running ser…
you-looks-not-tasty Dec 26, 2023
7262f4b
build(deps): bump golang.org/x/net in /tools/dpvs-agent
dependabot[bot] Jan 2, 2024
351e95d
Merge pull request #932 from you-looks-not-tasty/devel-1.9.6-cybershot
ywc689 Jan 12, 2024
ef96bbf
Merge pull request #934 from iqiyi/dependabot/go_modules/tools/dpvs-a…
ywc689 Jan 12, 2024
9648beb
API: /${SVCID}/rs/health return the specified service detail when fet…
you-looks-not-tasty Jan 18, 2024
f9ab755
lock snapshot
you-looks-not-tasty Jan 22, 2024
e278598
format snapshot id
you-looks-not-tasty Jan 23, 2024
3bf1c3f
BUGFIX: do not release the lock of snapshot if not the snapshot have …
you-looks-not-tasty Jan 23, 2024
c2c4d8d
NEW API(/v2/vs/{VSID}/rs/health) for dpvs-healthcheck module
you-looks-not-tasty Oct 20, 2023
dfa9c96
tools/healthcheck: fix rs weight update problem when rs's weight chan…
ywc689 Oct 24, 2023
1806cd0
tools/healthcheck: further fix the problem discussed in previous commit
ywc689 Jan 19, 2024
cba78e9
update snapshot service info when snapshot exist
you-looks-not-tasty Jan 25, 2024
3bc93dd
more debug log
you-looks-not-tasty Jan 25, 2024
180e1fb
synproxy random number
Jan 31, 2024
c2d2863
clean healthcheck inhibited default
you-looks-not-tasty Jan 30, 2024
a392793
tools/healthcheck: fix serveral problems
ywc689 Feb 21, 2024
e18c333
tools/healthcheck: fix a deadlock problem caused by notification resync
ywc689 Feb 22, 2024
e5d71d1
dpvs-agent local cache builded depend on the user api invoke only. (e…
you-looks-not-tasty Feb 27, 2024
134a098
remove debug log
you-looks-not-tasty Feb 27, 2024
3528ef2
release service lock
you-looks-not-tasty Feb 27, 2024
6b153c0
update local cache real server inhibited
ywc689 Mar 4, 2024
30fb605
tools/healthcheck: fix problems in config update
ywc689 Mar 5, 2024
add443b
tools/dpvs-agent: fix crash problem in reconfiguring existing virtual…
ywc689 Mar 5, 2024
05eb6fa
tools/healthcheck: fix bad icmp checksum problem for udp and udpping …
ywc689 Mar 11, 2024
fad525d
release v1.9.7
ywc689 Mar 15, 2024
aa9f6fe
bugfix: keepalived new_vs quorum_state_up always be true and quorum_u…
Mar 25, 2024
ee8508c
ipvs: sctp implementation
Vladimare Mar 28, 2024
3ec1d59
Merge pull request #937 from ywc689/fix-hc-agent-racing
ywc689 Apr 10, 2024
cead683
Merge pull request #938 from donghaobo/random
ywc689 Apr 10, 2024
f7b0b50
ipvs: fix issue #946, a coredump problem when no enough memory on start
ywc689 Apr 19, 2024
efc101b
ipvs: fix issue #947, a compiling error caused by string overflow war…
ywc689 Apr 19, 2024
10ae133
ip_vs_conn: A small improvement
yifsun Apr 25, 2024
e19269d
ipvs: improve performance of local addr selection by replacing glibc …
ywc689 Apr 30, 2024
f30c588
Merge pull request #945 from happylixiao/devel
ywc689 Apr 30, 2024
a296c56
Merge pull request #954 from yifsun/fix-atomic
ywc689 Apr 30, 2024
acce1a7
test: add quic/http3 test programs
ywc689 May 6, 2024
e2f9533
test: quic server supports dpvs-compatible cid and uoa
ywc689 May 13, 2024
475a638
ipvs: support quic connection migration
ywc689 May 10, 2024
e1d2929
Merge pull request #949 from Vladimare/sctp
ywc689 May 29, 2024
41f762d
Merge pull request #950 from ywc689/bugfix
ywc689 May 29, 2024
ef1cb82
patch: nginx v1.26.0 patches for toa nat64, uoa, and quic connection …
ywc689 May 24, 2024
e5d466e
tools/ipvsadm: fix could not remove lip
Jun 5, 2024
d23db64
Merge pull request #962 from ywc689/ietf-quic
ywc689 Jun 19, 2024
db2176b
Merge pull request #969 from leogoing/fix-del-lip
ywc689 Jun 19, 2024
eff346a
fix compile error on RHEL 9.4
pubyun Jun 20, 2024
b9fd584
README: add ipvsadm RS port
Jul 10, 2024
8c49f43
ci: fix unsupported Node20 problem
ywc689 Jul 10, 2024
072fd44
Merge pull request #980 from ywc689/fix-ci
ywc689 Jul 10, 2024
5c79c4f
netif_addr: fix hw multicast address sync problems
ywc689 Jul 8, 2024
5b2fc59
dpip: add 'maddr' subcommand to show multicast addresses
ywc689 Jul 10, 2024
53ff10b
Merge pull request #972 from pubyun/master
ywc689 Jul 15, 2024
bdb9037
Merge pull request #977 from liningjie418/master
ywc689 Jul 15, 2024
c0b48af
Merge pull request #979 from ywc689/mcaddr
ywc689 Aug 5, 2024
922315b
lldp: add supports for lldp protocol
ywc689 Jul 24, 2024
9baec6d
patch: lldp bonding xmit patch for dpdk
ywc689 Jul 30, 2024
72bd6d2
lldp: fix strict-aliasing errors when compiling with O3
ywc689 Aug 5, 2024
ee736b3
Merge pull request #985 from ywc689/lldp
ywc689 Aug 5, 2024
dcd034a
ipvs: add ipset-type blklst to support deny list in network-cidr gran…
ywc689 Jun 17, 2024
dc1cec8
ipvs: add ipset-type whtlst to support allow list in network-cidr gra…
ywc689 Jun 18, 2024
19f401f
tools/dpip: fix ipset list-all problem and improve efficiency
ywc689 Jun 18, 2024
5d7a7a5
tools/dpvs-agent: adapted for ipset-type allow/deny list
ywc689 Jun 19, 2024
30f601b
define buffer size by INET6_ADDRSTRLEN
Aug 25, 2024
8286ef2
tools/dpip: fix delay when list empty ipset with sorting enabled
ywc689 Aug 26, 2024
e170318
dpvs: fix ipset default address family problem
ywc689 Aug 27, 2024
f33a98f
dpvs-agent: define ipset openapi
ywc689 Aug 9, 2024
53f16cf
dpvs-agent: update ipset openapi
ywc689 Aug 9, 2024
14d1f0c
dpvs-agent: add auto-generated codes for ipset openapi
ywc689 Aug 9, 2024
86a5ea5
dpvs-agent: implementation of ipset api
ywc689 Aug 15, 2024
140c152
dpvs-agent: add ipset test script
ywc689 Aug 27, 2024
b12ae54
Merge pull request #993 from pubyun/devel
ywc689 Sep 2, 2024
2c9b632
Merge pull request #971 from ywc689/ipvs-ipset-acl
ywc689 Sep 12, 2024
166b977
Fix segmentation fault problem when running on machines whose cpu num…
ywc689 Sep 2, 2024
257d89f
netif: refactor netif_rte_port_alloc with netif_alloc
ywc689 Sep 5, 2024
db72d09
inet: fix prolems in ipv6 all-nodes and all-routers address initializ…
ywc689 Sep 6, 2024
ed1a6e9
inetaddr: ipv6 link-local address auto configuration
ywc689 Sep 9, 2024
6765f6d
Merge pull request #995 from ywc689/bugfix-20240902
ywc689 Sep 13, 2024
5b4e47c
patch: add patches of dpdk-stable-20.11.10 and alter default dpdk ver…
ywc689 Aug 2, 2024
7b4124c
build: fix build warnings issued by high version gcc
ywc689 Aug 1, 2024
b21a018
doc: update README.md and version file
ywc689 Sep 13, 2024
4c306a4
Merge pull request #996 from ywc689/v1.9.8
ywc689 Sep 18, 2024
663466d
scripts: fix param setting problem in dpdk-build.sh
ywc689 Sep 19, 2024
69101a3
netif: fix memory corruption problem when retrieving nic's xstats
ywc689 Sep 19, 2024
fa780fb
Merge pull request #997 from ywc689/bugfix-20240919
ywc689 Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,22 @@ jobs:
runs-on: self-hosted
env:
PKG_CONFIG_PATH: /data/dpdk/dpdklib/lib64/pkgconfig
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- uses: actions/checkout@v2
- name: make
- name: Checkout Code
uses: actions/checkout@v3
- name: build
run: make -j

build-all:
runs-on: self-hosted
env:
PKG_CONFIG_PATH: /data/dpdk/dpdklib/lib64/pkgconfig
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- uses: actions/checkout@v2
- name: config
- name: Checkout Code
uses: actions/checkout@v3
- name: Config
run: sed -i 's/=n$/=y/' config.mk
- name: make
- name: build
run: make -j
10 changes: 6 additions & 4 deletions .github/workflows/run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ jobs:
runs-on: self-hosted
env:
PKG_CONFIG_PATH: /data/dpdk/dpdklib/lib64/pkgconfig
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- uses: actions/checkout@v2
- name: make
- name: Checkout Code
uses: actions/checkout@v3
- name: Build
run: make -j
- name: install
- name: Install
run: make install
- name: run-dpvs
- name: Run DPVS
run: sudo dpvsci $(pwd)/bin/dpvs
141 changes: 91 additions & 50 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions conf/dpvs.bond.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ global_defs {
! log_async_mode off
! kni on
! pdump off
lldp on
}

! netif config
Expand Down
4 changes: 4 additions & 0 deletions conf/dpvs.conf.items
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ global_defs {
<init> log_async_pool_size 16383 <16383, 1023-unlimited>
<init> pdump off <off, on|off>
<init> kni on <on, on|off>
lldp on <off, on|off>
}

! netif config
Expand Down Expand Up @@ -193,6 +194,9 @@ ipv4_defs {
ipv6_defs {
disable off <off, on/off>
forwarding off <off, on/off>
addr_gen_mode eui64 <eui64,none,stable-privacy,random>
stable_secret "" <128-bit hexadecimal string, used in stable-privacy mode >
<stable_secret can be produced by `uuidgen | sed 's/-//g'>
route6 {
<init> method "hlist" <"hlist"/"lpm">
recycle_time 10 <10, 1-36000>
Expand Down
1 change: 1 addition & 0 deletions conf/dpvs.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ global_defs {
! log_async_mode on
! kni on
! pdump off
lldp on
}

! netif config
Expand Down
1 change: 1 addition & 0 deletions conf/dpvs.conf.single-bond.sample
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ global_defs {
! log_file /var/log/dpvs.log
! log_async_mode on
! kni on
lldp on
}

! netif config
Expand Down
1 change: 1 addition & 0 deletions conf/dpvs.conf.single-nic.sample
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ global_defs {
! log_file /var/log/dpvs.log
! log_async_mode on
! kni on
lldp on
}

! netif config
Expand Down
2 changes: 1 addition & 1 deletion doc/IPset.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ bin/dpip: invalid parameter
The hash:ip,port,net set type uses a hash table to store IP address, port number and IP network address triples. Both IPv4 and IPv6 address are supported. The IP address of the IP and net should be of the same family. When adding/deleting entries, ranges are allowed but is transformed to specific host IP and port entries when stored into hash table for the "ip" and "port" segments. IPv4 supports both IP range and IP CIDR, while IPv6 supports IP CIDR only. Network address with zero prefix size is not supported, and is interpreted as host prefix size, i.e., 32 for IPv4 and 128 for IPv6. Option "nomatch" can be used to set exceptions to the set when add/deleting entries. If a test is matched against with a "nomatch" entry, then the result would end with false. The port number is interpreted together with a protocol. Supported protocols include TCP, UDP, ICMP, and ICMPv6, any other protocols are interpreted as unspec type with a protocol number of zero.

```bash
# ./bin/dpip ipset create bar hash:ip,port,net
# ./bin/dpip ipset -6 create bar hash:ip,port,net
# ./bin/dpip ipset add bar 2001::1,8080-8082,2002::/64
# ./bin/dpip ipset add bar 2001::1,8080-8082,2002::aaaa:bbbb:ccc0:0/108 nomatch
# ./bin/dpip ipset -v list bar
Expand Down
10 changes: 5 additions & 5 deletions include/conf/blklst.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@

#include "inet.h"
#include "conf/sockopts.h"
#include "conf/ipset.h"

struct dp_vs_blklst_entry {
union inet_addr addr;
};

typedef struct dp_vs_blklst_conf {
/* identify service */
union inet_addr blklst;
union inet_addr vaddr;
int af;
uint32_t fwmark;
uint16_t vport;
uint8_t proto;
uint8_t padding;
uint8_t af;

/* for set */
/* subject and ipset are mutual exclusive */
union inet_addr subject;
char ipset[IPSET_MAXNAMELEN];
} dpvs_blklst_t;

struct dp_vs_blklst_conf_array {
Expand Down
38 changes: 38 additions & 0 deletions include/conf/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <unistd.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/if_ether.h>

typedef uint32_t sockoptid_t;
Expand Down Expand Up @@ -142,6 +143,7 @@ int linux_get_link_status(const char *ifname, int *if_flags, char *if_flags_str,
int linux_set_if_mac(const char *ifname, const unsigned char mac[ETH_ALEN]);
int linux_hw_mc_add(const char *ifname, const uint8_t hwma[ETH_ALEN]);
int linux_hw_mc_del(const char *ifname, const uint8_t hwma[ETH_ALEN]);
int linux_ifname2index(const char *ifname);

/* read "n" bytes from a descriptor */
ssize_t readn(int fd, void *vptr, size_t n);
Expand All @@ -166,4 +168,40 @@ static inline char *strlwr(char *str) {
return str;
}

/* convert hexadecimal string to binary sequence, return the converted binary length
* note: buflen should be half in size of len at least */
int hexstr2binary(const char *hexstr, size_t len, uint8_t *buf, size_t buflen);

/* convert binary sequence to hexadecimal string, return the converted string length
* note: buflen should be twice in size of len at least */
int binary2hexstr(const uint8_t *hex, size_t len, char *buf, size_t buflen);

/* convert binary sequence to printable or hexadecimal string, return the converted string length
* note: buflen should be triple in size of len in the worst case */
int binary2print(const uint8_t *hex, size_t len, char *buf, size_t buflen);

/* get prefix from network mask */
int mask2prefix(const struct sockaddr *addr);

/* get host addresses and corresponding interfaces
*
* Loopback addresses, ipv6 link local addresses, and addresses on linked-down
* or not-running interface are ignored. If multiple addresses matched, return
* the address of the least prefix length.
*
* Params:
* @ifname: preferred interface where to get host address, can be NULL
* @result4: store ipv4 address found, can be NULL
* @result6: store ipv6 address found, can be NULL
* @ifname4: interface name of ipv4 address, can be NULL
* @ifname6: interface name of ipv6 address, can be NULL
* Return:
* 1: only ipv4 address found
* 2: only ipv6 address found
* 3: both ipv4 and ipv6 address found
* dpvs error code: error occurred
* */
int get_host_addr(const char *ifname, struct sockaddr_storage *result4,
struct sockaddr_storage *result6, char *ifname4, char *ifname6);

#endif /* __DPVS_COMMON_H__ */
1 change: 1 addition & 0 deletions include/conf/inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ static inline const char *inet_proto_name(uint8_t proto)
const static char *proto_names[256] = {
[IPPROTO_TCP] = "TCP",
[IPPROTO_UDP] = "UDP",
[IPPROTO_SCTP] = "SCTP",
[IPPROTO_ICMP] = "ICMP",
[IPPROTO_ICMPV6] = "ICMPV6",
};
Expand Down
14 changes: 14 additions & 0 deletions include/conf/inetaddr.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum {

/* leverage IFA_F_XXX in linux/if_addr.h*/
#define IFA_F_SAPOOL 0x10000 /* if address with sockaddr pool */
#define IFA_F_LINKLOCAL 0x20000 /* ipv6 link-local address */

/* ifa command flags */
#define IFA_F_OPS_VERBOSE 0x0001
Expand Down Expand Up @@ -100,4 +101,17 @@ struct inet_addr_front {
};
#endif /* CONFIG_DPVS_AGENT */

struct inet_maddr_entry {
char ifname[IFNAMSIZ];
union inet_addr maddr;
int af;
uint32_t flags;
uint32_t refcnt;
} __attribute__((__packed__));

struct inet_maddr_array {
int nmaddr;
struct inet_maddr_entry maddrs[0];
} __attribute__((__packed__));

#endif /* __DPVS_INETADDR_CONF_H__ */
57 changes: 32 additions & 25 deletions include/conf/ipset.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define IPSET_F_FORCE 0x0001

enum ipset_op {
IPSET_OP_ADD,
IPSET_OP_ADD = 1,
IPSET_OP_DEL,
IPSET_OP_TEST,
IPSET_OP_CREATE,
Expand All @@ -43,34 +43,36 @@ enum ipset_op {
};

struct ipset_option {
int family;
union {
struct {
bool comment;
int hashsize;
int maxelem;
} create;
int32_t hashsize;
uint32_t maxelem;
uint8_t comment;
} __attribute__((__packed__)) create;
struct {
bool nomatch;
} add;
char padding[8];
uint8_t nomatch;
} __attribute__((__packed__)) add;
};
};
uint8_t family;
} __attribute__((__packed__));

struct ipset_param {
char type[IPSET_MAXNAMELEN];
char name[IPSET_MAXNAMELEN];
char comment[IPSET_MAXCOMLEN];
int opcode;
struct ipset_option option;
uint16_t opcode;
uint16_t flag;
struct ipset_option option;

uint8_t proto;
uint8_t cidr;
struct inet_addr_range range; /* port in host byteorder */
uint8_t mac[6];
char iface[IFNAMSIZ];
uint8_t mac[6];

/* for type with 2 nets */
uint8_t padding;
uint8_t cidr2;
struct inet_addr_range range2;
//uint8_t mac[2];
Expand All @@ -83,43 +85,48 @@ struct ipset_member {
uint8_t cidr;
uint8_t proto;
uint16_t port;
uint8_t mac[6];
char iface[IFNAMSIZ];
bool nomatch;
uint8_t mac[6];
uint8_t nomatch;

/* second net */
union inet_addr addr2;
uint8_t cidr2;
uint16_t port2;
uint8_t padding[2];
union inet_addr addr2;
};

struct ipset_info {
char name[IPSET_MAXNAMELEN];
char type[IPSET_MAXNAMELEN];
bool comment;
uint8_t comment;

uint8_t af;
uint8_t padding[2];

union {
struct ipset_bitmap_header {
struct inet_addr_range range;
uint8_t cidr;
uint8_t padding[3];
struct inet_addr_range range;
} bitmap;
struct ipset_hash_header {
int hashsize;
int maxelem;
uint8_t padding[4]; // aligned for dpvs-agent
int32_t hashsize;
uint32_t maxelem;
} hash;
};

int af;
size_t size;
int entries;
int references;
uint32_t size;
uint32_t entries;
uint32_t references;

void *members;
};

struct ipset_info_array {
int nipset;
struct ipset_info infos[0];
uint32_t nipset;
struct ipset_info infos[0];
} __attribute__((__packed__));

#endif /* __DPVS_IPSET_CONF_H__ */
41 changes: 41 additions & 0 deletions include/conf/lldp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* DPVS is a software load balancer (Virtual Server) based on DPDK.
*
* Copyright (C) 2021 iQIYI (www.iqiyi.com).
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __DPVS_LLDP_CONF_H__
#define __DPVS_LLDP_CONF_H__

#include <net/if.h>
#include "conf/sockopts.h"

#define LLDP_MESSAGE_LEN 4096

#define DPVS_LLDP_NODE_LOCAL 0
#define DPVS_LLDP_NODE_NEIGH 1
#define DPVS_LLDP_NODE_MAX 2


struct lldp_param {
uint16_t node; /* DPVS_LLDP_NODE_xxx */
char ifname[IFNAMSIZ];
};

struct lldp_message {
struct lldp_param param;
char message[LLDP_MESSAGE_LEN];
};

#endif /* __DPVS_LLDP_CONF_H__ */
2 changes: 2 additions & 0 deletions include/conf/match.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ static inline int parse_match(const char *pattern, uint8_t *proto,
*proto = IPPROTO_TCP;
} else if (strcmp(tok, "udp") == 0) {
*proto = IPPROTO_UDP;
} else if (strcmp(tok, "sctp") == 0) {
*proto = IPPROTO_SCTP;
} else if (strcmp(tok, "icmp") == 0) {
*proto = IPPROTO_ICMP;
} else if (strcmp(tok, "icmp6") == 0) {
Expand Down
Loading
Loading