Git commit: 45036396e49ed6d7b5022e8dd6c436d67c3f74da
Author: Eelco Chaudron <[email protected]>
Subject: netdev-offload: Remove the global netdev-offload API.
This patch removes the global netdev_flow_api in favor of the new
dpif-offload infrastructure. All offload-related handling is now
performed via the dpif-offload layer, simplifying the code and
removing redundant global interfaces from netdev-offload.
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index df6c94912..484eefccb 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -2404,7 +2404,6 @@ do_del_port(struct dp_netdev *dp, struct dp_netdev_port
> *port)
> * offload modification or deletion. Managing those stray requests
> * is done in the offload threads. */
> dp_netdev_offload_flush(dp, port);
> - netdev_uninit_flow_api(port->netdev);
Does this removal risk leaving flow offload resources uninitialized on
the netdev when a port is deleted? The original call to
netdev_uninit_flow_api() appears to have cleaned up flow API state.
> @@ -2813,7 +2812,7 @@ dp_netdev_flow_offload_put(struct
> dp_offload_thread_item *item)
> odp_port_t in_port = flow->flow.in_port.odp_port;
> bool modification = offload->op == DP_NETDEV_FLOW_OFFLOAD_OP_MOD
> && flow->mark != INVALID_FLOW_MARK;
> - struct offload_info info;
> + struct dpif_netdev_offload_info info;
[ ... ]
> diff --git a/lib/dpif-netdev.h b/lib/dpif-netdev.h
> index 6db6ed2e2..5df344367 100644
> --- a/lib/dpif-netdev.h
> +++ b/lib/dpif-netdev.h
> @@ -38,6 +38,18 @@ bool dpif_is_netdev(const struct dpif *);
> #define NR_QUEUE 1
> #define NR_PMD_THREADS 1
>
> +/* Flow offloading info structure. XXX: This needs to be moved once the
> + * implementation is migrated to dpif-offload-dpdk. */
> +struct dpif_netdev_offload_info {
> + /*
> + * The flow mark id assigned to the flow. If any pkts hit the flow,
> + * it will be in the pkt meta data.
> + */
> + uint32_t flow_mark;
> +
> + odp_port_t orig_in_port; /* Originating in_port for tnl flows. */
> +};
[ ... ]
> diff --git a/lib/dpif.c b/lib/dpif.c
> index 323a2bf6c..006d9276e 100644
> --- a/lib/dpif.c
> +++ b/lib/dpif.c
> @@ -378,7 +378,6 @@ do_open(const char *name, const char *type, bool create,
> struct dpif **dpifp)
>
> if (!err) {
> netdev_set_dpif_type(netdev, dpif_type_str);
> - netdev_ports_insert(netdev, &dpif_port);
Does removing this netdev_ports_insert() call break the global port
tracking that other parts of the code might depend on? The function
appeared to maintain port-to-netdev mappings.
> @@ -443,19 +442,6 @@ dpif_create_and_open(const char *name, const char *type,
> struct dpif **dpifp)
> return error;
> }
>
> -static void
> -dpif_remove_netdev_ports(struct dpif *dpif) {
> - const char *dpif_type_str = dpif_normalize_type(dpif_type(dpif));
> - struct dpif_port_dump port_dump;
> - struct dpif_port dpif_port;
> -
> - DPIF_PORT_FOR_EACH (&dpif_port, &port_dump, dpif) {
> - if (!dpif_is_tap_port(dpif_port.type)) {
> - netdev_ports_remove(dpif_port.port_no, dpif_type_str);
> - }
> - }
> -}
[ ... ]
> @@ -626,17 +609,9 @@ dpif_port_add(struct dpif *dpif, struct netdev *netdev,
> odp_port_t *port_nop)
> dpif_name(dpif), netdev_name, port_no);
>
> if (!dpif_is_tap_port(netdev_get_type(netdev))) {
> -
> const char *dpif_type_str = dpif_normalize_type(dpif_type(dpif));
>
> netdev_set_dpif_type(netdev, dpif_type_str);
> -
> - dpif_port.type = CONST_CAST(char *, netdev_get_type(netdev));
> - dpif_port.name = CONST_CAST(char *, netdev_name);
> - dpif_port.port_no = port_no;
> - netdev_ports_insert(netdev, &dpif_port);
Does removing this netdev_ports_insert() call in dpif_port_add() leave
the newly added port untracked in global mappings? This could affect
functions that look up netdevs by port number.
> @@ -645,8 +645,6 @@ dpif_port_del(struct dpif *dpif, odp_port_t port_no, bool
> local_delete)
> }
>
> dpif_offload_port_del(dpif, port_no);
> -
> - netdev_ports_remove(port_no, dpif_normalize_type(dpif_type(dpif)));
[ ... ]
> diff --git a/lib/netdev-offload.c b/lib/netdev-offload.c
> index fff49240d..f24c415a2 100644
> --- a/lib/netdev-offload.c
> +++ b/lib/netdev-offload.c
> @@ -16,248 +16,13 @@
> */
>
> #include <config.h>
> -#include "netdev-offload.h"
[ ... ]
Does this massive removal of the port tracking infrastructure
(netdev_ports_insert, netdev_ports_remove, netdev_ports_get, etc.) break
any code that relied on the global port-to-netdev mappings maintained in
port_to_netdev and ifindex_to_port hashmaps? Functions like
netdev_ifindex_to_odp_port() appear to be completely removed.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev