From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 11CB645BFE; Mon, 28 Oct 2024 17:33:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32EF3427A1; Mon, 28 Oct 2024 17:33:43 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 57A4641060 for ; Mon, 28 Oct 2024 17:33:37 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-20cdbe608b3so34715005ad.1 for ; Mon, 28 Oct 2024 09:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1730133216; x=1730738016; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eERcSAsAIEsLOZELjeKcS1nvsOxPOD0jLU9DUuE9RgY=; b=c76UT2VAInanRhYLFu+cY9+6h0MHB5kuK9Jm1qGV1A76MMxdmRsQZsrJ1vKnp7yaW1 7Uq0y+Hnjd5VGlmEBO28bMjJPSd9hJYdPlAf629P8UupvRBhteA+tKrcKnW2+OW50oMH Xt1mxTEtg8Rpef4wC6qFl9lUMJmnj6590dmBdTLTEnK1EpWlSZ8b0Pp39RfnDbmmXyv5 wFLB3Tl8O7Z8oiZj99hQkmtpmZCovfiExh11kc6TUTjljkUPHkQjUmHvD/PZiKKCgk8K TeSCro1FjOwbhtYsFioVZOVJ48Lf2RtjkVgNa7JiQzcfReBcrTfOmLUDhbugbSrXGFr2 M6LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730133216; x=1730738016; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eERcSAsAIEsLOZELjeKcS1nvsOxPOD0jLU9DUuE9RgY=; b=OOoAMUOwKnLJ/nl5QimNxvX/OX3pfA/tZh6KQ8/hsDm2GmickzLFDrgIdP6QQko6uM PrwW38DqhWAkj5ChGpm+bwTS391Unziv5WFUNPkDEUhtYW5upBY78rzr1u3ht4cMxHMe wSfKv36z2qaSby7po0pRZ3Pq3LpO2gFNHiqr54cavzX5IBip0Z/ux3esqQEhjyZbZh86 wLjl1/O4lThOTfKcQw3EcCtvC6jhdEbUli2CFiitwVrSLiJ9gf94GgQSpvuMrW23H29I jAiu54zrbElzjABqBW6gSd5uJHK1ur1zxErt+CunqcOjXD/kBvmef5i+oQzNllObAdtV orZw== X-Gm-Message-State: AOJu0Yxo2io0YhQeKJL91iLpJuGUtSqzPQm5Ut+EehpWQsOEDPQoud+i Q6t/9J7ckw9RmHnQWZEiCxZm/oATZ+vq448fg2heUsYeyi+GCuhwx1BOcuLtRnzvmdgXeg5umlo v X-Google-Smtp-Source: AGHT+IFLm0FY3iaFBBm5DVZii0FdHdmKq3U43jfZLky4Iahu1k3aEJXe7coa2YvzKYIP8NNGY9ietA== X-Received: by 2002:a17:902:e746:b0:20b:4f95:932d with SMTP id d9443c01a7336-210c686a10fmr112282955ad.3.1730133216526; Mon, 28 Oct 2024 09:33:36 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-210bbf43460sm52709895ad.23.2024.10.28.09.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 09:33:36 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 2/4] net/tap: rename struct nlmsg to tap_nlmsg Date: Mon, 28 Oct 2024 09:32:10 -0700 Message-ID: <20241028163324.193338-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241028163324.193338-1-stephen@networkplumber.org> References: <20241028163324.193338-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The struct netlink message structure is part of the internal TAP device API, not the netlink API itself. Use tap_ prefix to avoid any confusion with nlmsghdr from netlink.h Signed-off-by: Stephen Hemminger --- drivers/net/tap/tap_flow.c | 22 +++++++++++----------- drivers/net/tap/tap_netlink.c | 4 ++-- drivers/net/tap/tap_netlink.h | 6 +++--- drivers/net/tap/tap_tcmsgs.c | 10 +++++----- drivers/net/tap/tap_tcmsgs.h | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c index 51ec07eb5a..6564583174 100644 --- a/drivers/net/tap/tap_flow.c +++ b/drivers/net/tap/tap_flow.c @@ -35,7 +35,7 @@ struct rte_flow { LIST_ENTRY(rte_flow) next; /* Pointer to the next rte_flow structure */ struct rte_flow *remote_flow; /* associated remote flow */ - struct nlmsg msg; + struct tap_nlmsg msg; }; struct convert_data { @@ -423,7 +423,7 @@ tap_flow_create_eth(const struct rte_flow_item *item, void *data) const struct rte_flow_item_eth *spec = item->spec; const struct rte_flow_item_eth *mask = item->mask; struct rte_flow *flow = info->flow; - struct nlmsg *msg; + struct tap_nlmsg *msg; /* use default mask if none provided */ if (!mask) @@ -477,7 +477,7 @@ tap_flow_create_vlan(const struct rte_flow_item *item, void *data) const struct rte_flow_item_vlan *spec = item->spec; const struct rte_flow_item_vlan *mask = item->mask; struct rte_flow *flow = info->flow; - struct nlmsg *msg; + struct tap_nlmsg *msg; /* use default mask if none provided */ if (!mask) @@ -537,7 +537,7 @@ tap_flow_create_ipv4(const struct rte_flow_item *item, void *data) const struct rte_flow_item_ipv4 *spec = item->spec; const struct rte_flow_item_ipv4 *mask = item->mask; struct rte_flow *flow = info->flow; - struct nlmsg *msg; + struct tap_nlmsg *msg; /* use default mask if none provided */ if (!mask) @@ -593,7 +593,7 @@ tap_flow_create_ipv6(const struct rte_flow_item *item, void *data) const struct rte_flow_item_ipv6 *mask = item->mask; struct rte_flow *flow = info->flow; uint8_t empty_addr[16] = { 0 }; - struct nlmsg *msg; + struct tap_nlmsg *msg; /* use default mask if none provided */ if (!mask) @@ -648,7 +648,7 @@ tap_flow_create_udp(const struct rte_flow_item *item, void *data) const struct rte_flow_item_udp *spec = item->spec; const struct rte_flow_item_udp *mask = item->mask; struct rte_flow *flow = info->flow; - struct nlmsg *msg; + struct tap_nlmsg *msg; /* use default mask if none provided */ if (!mask) @@ -694,7 +694,7 @@ tap_flow_create_tcp(const struct rte_flow_item *item, void *data) const struct rte_flow_item_tcp *spec = item->spec; const struct rte_flow_item_tcp *mask = item->mask; struct rte_flow *flow = info->flow; - struct nlmsg *msg; + struct tap_nlmsg *msg; /* use default mask if none provided */ if (!mask) @@ -820,7 +820,7 @@ tap_flow_item_validate(const struct rte_flow_item *item, static int add_action(struct rte_flow *flow, size_t *act_index, struct action_data *adata) { - struct nlmsg *msg = &flow->msg; + struct tap_nlmsg *msg = &flow->msg; if (tap_nlattr_nested_start(msg, (*act_index)++) < 0) return -1; @@ -891,7 +891,7 @@ static int add_actions(struct rte_flow *flow, int nb_actions, struct action_data *data, int classifier_action) { - struct nlmsg *msg = &flow->msg; + struct tap_nlmsg *msg = &flow->msg; size_t act_index = 1; int i; @@ -1274,7 +1274,7 @@ tap_flow_create(struct rte_eth_dev *dev, struct pmd_internals *pmd = dev->data->dev_private; struct rte_flow *remote_flow = NULL; struct rte_flow *flow = NULL; - struct nlmsg *msg = NULL; + struct tap_nlmsg *msg = NULL; int err; if (!pmd->if_index) { @@ -1593,7 +1593,7 @@ int tap_flow_implicit_create(struct pmd_internals *pmd, struct rte_flow_item_eth eth_local = { .hdr.ether_type = 0 }; unsigned int if_index = pmd->remote_if_index; struct rte_flow *remote_flow = NULL; - struct nlmsg *msg = NULL; + struct tap_nlmsg *msg = NULL; int err = 0; struct rte_flow_item items_local[2] = { [0] = { diff --git a/drivers/net/tap/tap_netlink.c b/drivers/net/tap/tap_netlink.c index 35c491ac37..8a57c9242c 100644 --- a/drivers/net/tap/tap_netlink.c +++ b/drivers/net/tap/tap_netlink.c @@ -368,7 +368,7 @@ tap_nlattr_add32(struct nlmsghdr *nh, unsigned short type, uint32_t data) * -1 if adding a nested netlink attribute failed, 0 otherwise. */ int -tap_nlattr_nested_start(struct nlmsg *msg, uint16_t type) +tap_nlattr_nested_start(struct tap_nlmsg *msg, uint16_t type) { struct nested_tail *tail; @@ -400,7 +400,7 @@ tap_nlattr_nested_start(struct nlmsg *msg, uint16_t type) * The netlink message where to edit the nested_tails metadata. */ void -tap_nlattr_nested_finish(struct nlmsg *msg) +tap_nlattr_nested_finish(struct tap_nlmsg *msg) { struct nested_tail *tail = msg->nested_tails; diff --git a/drivers/net/tap/tap_netlink.h b/drivers/net/tap/tap_netlink.h index faa73ba163..466c47a6d7 100644 --- a/drivers/net/tap/tap_netlink.h +++ b/drivers/net/tap/tap_netlink.h @@ -16,7 +16,7 @@ #define NLMSG_BUF 512 -struct nlmsg { +struct tap_nlmsg { struct nlmsghdr nh; struct tcmsg t; char buf[NLMSG_BUF]; @@ -36,7 +36,7 @@ void tap_nlattr_add(struct nlmsghdr *nh, unsigned short type, void tap_nlattr_add8(struct nlmsghdr *nh, unsigned short type, uint8_t data); void tap_nlattr_add16(struct nlmsghdr *nh, unsigned short type, uint16_t data); void tap_nlattr_add32(struct nlmsghdr *nh, unsigned short type, uint32_t data); -int tap_nlattr_nested_start(struct nlmsg *msg, uint16_t type); -void tap_nlattr_nested_finish(struct nlmsg *msg); +int tap_nlattr_nested_start(struct tap_nlmsg *msg, uint16_t type); +void tap_nlattr_nested_finish(struct tap_nlmsg *msg); #endif /* _TAP_NETLINK_H_ */ diff --git a/drivers/net/tap/tap_tcmsgs.c b/drivers/net/tap/tap_tcmsgs.c index a3aae3c814..1755b57519 100644 --- a/drivers/net/tap/tap_tcmsgs.c +++ b/drivers/net/tap/tap_tcmsgs.c @@ -42,7 +42,7 @@ struct qdisc_custom_arg { * Overrides the default netlink flags for this msg with those specified. */ void -tc_init_msg(struct nlmsg *msg, unsigned int ifindex, uint16_t type, uint16_t flags) +tc_init_msg(struct tap_nlmsg *msg, unsigned int ifindex, uint16_t type, uint16_t flags) { struct nlmsghdr *n = &msg->nh; @@ -72,7 +72,7 @@ tc_init_msg(struct nlmsg *msg, unsigned int ifindex, uint16_t type, uint16_t fla static int qdisc_del(int nlsk_fd, unsigned int ifindex, struct qdisc *qinfo) { - struct nlmsg msg; + struct tap_nlmsg msg; int fd = 0; tc_init_msg(&msg, ifindex, RTM_DELQDISC, 0); @@ -117,7 +117,7 @@ int qdisc_add_multiq(int nlsk_fd, unsigned int ifindex) { struct tc_multiq_qopt opt = {0}; - struct nlmsg msg; + struct tap_nlmsg msg; tc_init_msg(&msg, ifindex, RTM_NEWQDISC, NLM_F_REQUEST | NLM_F_ACK | NLM_F_EXCL | NLM_F_CREATE); @@ -146,7 +146,7 @@ qdisc_add_multiq(int nlsk_fd, unsigned int ifindex) int qdisc_add_ingress(int nlsk_fd, unsigned int ifindex) { - struct nlmsg msg; + struct tap_nlmsg msg; tc_init_msg(&msg, ifindex, RTM_NEWQDISC, NLM_F_REQUEST | NLM_F_ACK | NLM_F_EXCL | NLM_F_CREATE); @@ -211,7 +211,7 @@ static int qdisc_iterate(int nlsk_fd, unsigned int ifindex, int (*callback)(struct nlmsghdr *, void *), void *arg) { - struct nlmsg msg; + struct tap_nlmsg msg; struct list_args args = { .nlsk_fd = nlsk_fd, .ifindex = ifindex, diff --git a/drivers/net/tap/tap_tcmsgs.h b/drivers/net/tap/tap_tcmsgs.h index 9411626661..70e97e2b62 100644 --- a/drivers/net/tap/tap_tcmsgs.h +++ b/drivers/net/tap/tap_tcmsgs.h @@ -24,7 +24,7 @@ #define MULTIQ_MAJOR_HANDLE (1 << 16) -void tc_init_msg(struct nlmsg *msg, unsigned int ifindex, uint16_t type, +void tc_init_msg(struct tap_nlmsg *msg, unsigned int ifindex, uint16_t type, uint16_t flags); int qdisc_list(int nlsk_fd, unsigned int ifindex); int qdisc_flush(int nlsk_fd, unsigned int ifindex); -- 2.45.2