Git SHA: 32e77999a7c1bdc26d1d28237251348bc04c2646
Author: Eelco Chaudron <[email protected]>
Subject: netdev_dummy: Remove hardware offload override.
This commit removes hardware offload functionality from the dummy netdev
implementation, including flow offloading APIs and related data
structures. The change eliminates 181 lines of code that provided test
functionality for hardware offload operations.
> diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
> index 0e5239eeb..8ae1151ea 100644
> --- a/lib/netdev-dummy.c
> +++ b/lib/netdev-dummy.c
> @@ -141,8 +141,6 @@ struct netdev_dummy {
> struct ovs_list addrs OVS_GUARDED;
> struct ovs_list rxes OVS_GUARDED; /* List of child "netdev_rxq_dummy"s.
> */
>
> - struct hmap offloaded_flows OVS_GUARDED;
> -
[ ... ]
> @@ -768,7 +765,6 @@ static void
> netdev_dummy_destruct(struct netdev *netdev_)
> {
> struct netdev_dummy *netdev = netdev_dummy_cast(netdev_);
> - struct offloaded_flow *off_flow;
[ ... ]
> @@ -786,10 +782,6 @@ netdev_dummy_destruct(struct netdev *netdev_)
> dummy_packet_conn_close(&netdev->conn);
> netdev->conn.type = NONE;
>
> - HMAP_FOR_EACH_POP (off_flow, node, &netdev->offloaded_flows) {
> - free(off_flow);
> - }
> - hmap_destroy(&netdev->offloaded_flows);
Does this code introduce a memory leak? The struct offloaded_flow is no
longer defined anywhere in the codebase after these removals, but the
cleanup logic for any existing offloaded flows is also being removed.
[ ... ]
> @@ -1809,49 +1809,15 @@ netdev_dummy_queue_packet__(struct netdev_rxq_dummy
> *rx, struct dp_packet *packe
>
> static void
> netdev_dummy_queue_packet(struct netdev_dummy *dummy, struct dp_packet
> *packet,
> - struct flow *flow, int queue_id)
> + struct flow *flow OVS_UNUSED, int queue_id)
> OVS_REQUIRES(dummy->mutex)
> {
> struct netdev_rxq_dummy *rx, *prev;
> - struct offloaded_flow *data;
> - struct flow packet_flow;
>
> if (dummy->rxq_pcap) {
> ovs_pcap_write(dummy->rxq_pcap, packet);
> }
This function change looks correct - the flow parameter is marked as
unused appropriately when the offload matching logic is removed.
> @@ -2330,7 +2152,5 @@ netdev_dummy_register(enum dummy_level level)
> netdev_register_provider(&dummy_internal_class);
> netdev_register_provider(&dummy_pmd_class);
>
> - netdev_register_flow_api_provider(&netdev_offload_dummy);
> -
> netdev_vport_tunnel_register();
> }
The removal of netdev_register_flow_api_provider call ensures the dummy
flow API provider is no longer registered, which is consistent with the
removal of the netdev_offload_dummy structure.
Overall, the patch appears to cleanly remove the hardware offload test
functionality. The main concern is whether there might be any memory
leaks if offloaded_flows structures exist at destruction time, but since
the struct definitions are also being removed, this suggests a complete
removal rather than a partial one.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev