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

gatekeeper: more preparation for Ubuntu 24.04 LTS #693

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 2 additions & 6 deletions config/dynamic.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* For gettid(). */
#define _GNU_SOURCE

#include <unistd.h>
#include <arpa/inet.h>
#include <sys/un.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -621,8 +617,8 @@ dyn_cfg_proc(void *arg)
int ret = 0;
struct dynamic_config *dy_conf = arg;

G_LOG(NOTICE,
"The Dynamic Config block is running at tid = %u\n", gettid());
G_LOG(NOTICE, "The Dynamic Config block is running at tid = %u\n",
rte_gettid());

if (dy_conf->gt != NULL) {
/*
Expand Down
6 changes: 1 addition & 5 deletions cps/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* For gettid(). */
#define _GNU_SOURCE

#include <net/if.h>
#include <unistd.h>

#include "gatekeeper_cps.h"
#include "gatekeeper_l2.h"
Expand Down Expand Up @@ -688,7 +684,7 @@ cps_proc(void *arg)
*/
cap_value_t caps[] = {CAP_NET_ADMIN, CAP_SYS_MODULE};

G_LOG(NOTICE, "The CPS block is running at tid = %u\n", gettid());
G_LOG(NOTICE, "The CPS block is running at tid = %u\n", rte_gettid());

if (needed_caps(RTE_DIM(caps), caps) < 0) {
G_LOG(ERR, "Could not set needed capabilities\n");
Expand Down
6 changes: 1 addition & 5 deletions ggu/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* For gettid(). */
#define _GNU_SOURCE

#include <stdbool.h>
#include <unistd.h>

#include <rte_ip.h>
#include <rte_udp.h>
Expand Down Expand Up @@ -586,7 +582,7 @@ ggu_proc(void *arg)
uint16_t rx_queue = ggu_conf->rx_queue_back;
uint16_t max_pkt_burst = ggu_conf->max_pkt_burst;

G_LOG(NOTICE, "The GT-GK unit is running at tid = %u\n", gettid());
G_LOG(NOTICE, "The GT-GK unit is running at tid = %u\n", rte_gettid());

if (needed_caps(0, NULL) < 0) {
G_LOG(ERR, "Could not set needed capabilities\n");
Expand Down
6 changes: 1 addition & 5 deletions gk/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* For gettid(). */
#define _GNU_SOURCE

#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <linux/icmp.h>
#include <linux/icmpv6.h>
#include <unistd.h>
#include <time.h>

#include <rte_ip.h>
Expand Down Expand Up @@ -2350,7 +2346,7 @@ gk_proc(void *arg)
uint32_t scan_iter = gk_conf->flow_table_scan_iter;
uint32_t iter_count = 0;

G_LOG(NOTICE, "The GK block is running at tid = %u\n", gettid());
G_LOG(NOTICE, "The GK block is running at tid = %u\n", rte_gettid());

if (needed_caps(0, NULL) < 0) {
G_LOG(ERR, "Could not set needed capabilities\n");
Expand Down
6 changes: 1 addition & 5 deletions gt/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* For gettid(). */
#define _GNU_SOURCE

#include <stdbool.h>
#include <arpa/inet.h>
#include <lualib.h>
#include <lauxlib.h>
#include <netinet/ip.h>
#include <math.h>
#include <unistd.h>

#include <rte_log.h>
#include <rte_ether.h>
Expand Down Expand Up @@ -1617,7 +1613,7 @@ gt_proc(void *arg)
death_row.cnt = 0;
gt_max_pkt_burst = gt_conf->max_pkt_burst;

G_LOG(NOTICE, "The GT block is running at tid = %u\n", gettid());
G_LOG(NOTICE, "The GT block is running at tid = %u\n", rte_gettid());

if (needed_caps(RTE_DIM(caps), caps) < 0) {
G_LOG(ERR, "Could not set needed capabilities\n");
Expand Down
10 changes: 4 additions & 6 deletions lib/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,8 @@ check_if_rss(struct gatekeeper_if *iface,
* hash functions.
*/
iface->rss = true;
port_conf->rx_adv_conf.rss_conf.algorithm =
RTE_ETH_HASH_FUNCTION_DEFAULT;
port_conf->rx_adv_conf.rss_conf.rss_hf = 0;
if (ipv4_if_configured(iface)) {
port_conf->rx_adv_conf.rss_conf.rss_hf |=
Expand Down Expand Up @@ -1345,6 +1347,7 @@ check_if_rss(struct gatekeeper_if *iface,

disable_rss:
iface->rss = false;
port_conf->rxmode.mq_mode = RTE_ETH_MQ_RX_NONE;
port_conf->rx_adv_conf.rss_conf.rss_hf = 0;
iface->num_rx_queues = 1;
G_LOG(WARNING, "%s(%s): the interface does not have RSS capabilities; the GK or GT block will receive all packets and send them to the other blocks as needed. Gatekeeper or Grantor should only be run with one lcore dedicated to GK or GT in this mode; restart with only one GK or GT lcore if necessary\n",
Expand Down Expand Up @@ -1973,12 +1976,7 @@ monitor_links(struct gatekeeper_if *iface)
static int
init_iface(struct gatekeeper_if *iface)
{
struct rte_eth_conf port_conf = {
.rxmode = {
.mq_mode = RTE_ETH_MQ_RX_NONE,
},
/* Other offloads configured below. */
};
struct rte_eth_conf port_conf = {};
unsigned int i;
int ret;

Expand Down
3 changes: 2 additions & 1 deletion lib/rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ int
rib_create(struct rib_head *rib, const char *name, int socket_id,
uint8_t max_length, uint32_t max_rules)
{
rib_address_t dummy;
/* Initialize to avoid warning: ‘dummy’ may be used uninitialized. */
rib_address_t dummy = 0;
int ret;
unsigned int n;

Expand Down
6 changes: 1 addition & 5 deletions lls/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* For gettid(). */
#define _GNU_SOURCE

#include <stdbool.h>
#include <unistd.h>

#include <rte_cycles.h>
#include <rte_ethdev.h>
Expand Down Expand Up @@ -681,7 +677,7 @@ lls_proc(void *arg)
uint64_t timer_resolution_cycles =
net_conf->rotate_log_interval_sec * cycles_per_sec;

G_LOG(NOTICE, "The LLS block is running at tid = %u\n", gettid());
G_LOG(NOTICE, "The LLS block is running at tid = %u\n", rte_gettid());

if (needed_caps(0, NULL) < 0) {
G_LOG(ERR, "Could not set needed capabilities\n");
Expand Down
7 changes: 2 additions & 5 deletions sol/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* For gettid(). */
#define _GNU_SOURCE

#include <math.h>
#include <unistd.h>

#include <rte_approx.h>
#include <rte_sched.h>
Expand Down Expand Up @@ -517,7 +513,8 @@ sol_proc(void *arg)
struct sol_instance *instance = &sol_conf->instances[block_idx];
uint8_t tx_port_back = sol_conf->net->back.id;

G_LOG(NOTICE, "The Solicitor block is running at tid = %u\n", gettid());
G_LOG(NOTICE, "The Solicitor block is running at tid = %u\n",
rte_gettid());

if (needed_caps(0, NULL) < 0) {
G_LOG(ERR, "Could not set needed capabilities\n");
Expand Down