Thread (5 messages) 5 messages, 2 authors, 2021-10-04

Re: [PATCH] RDMA/cma: Split apart the multiple uses of the same list heads

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2021-10-04 19:39:52

On Thu, Sep 16, 2021 at 01:11:14PM +0800, Mark Zhang wrote:
quoted
@@ -4928,10 +4930,10 @@ static void cma_process_remove(struct cma_device *cma_dev)
         mutex_lock(&lock);
         while (!list_empty(&cma_dev->id_list)) {
                 struct rdma_id_private *id_priv = list_first_entry(
-                       &cma_dev->id_list, struct rdma_id_private, list);
+                       &cma_dev->id_list, struct rdma_id_private, device_item);

-               list_del(&id_priv->listen_list);
-               list_del_init(&id_priv->list);
+               list_del_init(&id_priv->listen_item);
Should it still be
    list_del(&id_priv->listen_list);
as it isn't dev_id_priv?
Actually I misunderstood your question

Yes, it should be listen_item - it makes no sense to delete a
list - that would just randomly remove the first item.

At this point we are iterating over a device list and the rules have
device id_privs using the list_item side of the union. Only IDs on
the listen_any_list use the listen_list side.

Jason 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help