Message ID | 1433927612-20517-1-git-send-email-monis@mellanox.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Hi, Moni On 06/10/2015 11:13 AM, Moni Shoua wrote: > Registering an event handler is done for a device. This device may have > one RoCE port (no SA cap) and one InfiniBand port (has SA cap). > Therefore, warning from the event handler about a specific port that > doesn't have SA cap is correct but pollutes the kernel log without a > need. Maybe we should think about register event handler per port :-P Regards, Michael Wang > > Signed-off-by: Moni Shoua <monis@mellanox.com> > --- > drivers/infiniband/core/multicast.c | 2 +- > drivers/infiniband/core/sa_query.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/infiniband/core/multicast.c b/drivers/infiniband/core/multicast.c > index 605f20a..1244f02 100644 > --- a/drivers/infiniband/core/multicast.c > +++ b/drivers/infiniband/core/multicast.c > @@ -780,7 +780,7 @@ static void mcast_event_handler(struct ib_event_handler *handler, > int index; > > dev = container_of(handler, struct mcast_device, event_handler); > - if (WARN_ON(!rdma_cap_ib_mcast(dev->device, event->element.port_num))) > + if (!rdma_cap_ib_mcast(dev->device, event->element.port_num)) > return; > > index = event->element.port_num - dev->start_port; > diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c > index 7f7c8c9..3d0b7b2 100644 > --- a/drivers/infiniband/core/sa_query.c > +++ b/drivers/infiniband/core/sa_query.c > @@ -450,7 +450,7 @@ static void ib_sa_event(struct ib_event_handler *handler, struct ib_event *event > struct ib_sa_port *port = > &sa_dev->port[event->element.port_num - sa_dev->start_port]; > > - if (WARN_ON(!rdma_cap_ib_sa(handler->device, port->port_num))) > + if (!rdma_cap_ib_sa(handler->device, port->port_num)) > return; > > spin_lock_irqsave(&port->ah_lock, flags); > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Registering an event handler is done for a device. This device may have > > one RoCE port (no SA cap) and one InfiniBand port (has SA cap). > > Therefore, warning from the event handler about a specific port that > > doesn't have SA cap is correct but pollutes the kernel log without a > > need. > > Maybe we should think about register event handler per port :-P I agree, though I think that can be added separately from this change. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> > > Registering an event handler is done for a device. This device may > > > have one RoCE port (no SA cap) and one InfiniBand port (has SA cap). > > > Therefore, warning from the event handler about a specific port that > > > doesn't have SA cap is correct but pollutes the kernel log without a > > > need. > > > > Maybe we should think about register event handler per port :-P > > I agree, though I think that can be added separately from this change. Also agreed. We identified many places where we should split support to be per port while we did this work. We need to start working up to that. For the time being we should not break existing users (or in this case annoy them... ;-) Ira -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, 2015-06-10 at 12:13 +0300, Moni Shoua wrote: > Registering an event handler is done for a device. This device may have > one RoCE port (no SA cap) and one InfiniBand port (has SA cap). > Therefore, warning from the event handler about a specific port that > doesn't have SA cap is correct but pollutes the kernel log without a > need. > > Signed-off-by: Moni Shoua <monis@mellanox.com> Thanks, applied. > --- > drivers/infiniband/core/multicast.c | 2 +- > drivers/infiniband/core/sa_query.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/infiniband/core/multicast.c b/drivers/infiniband/core/multicast.c > index 605f20a..1244f02 100644 > --- a/drivers/infiniband/core/multicast.c > +++ b/drivers/infiniband/core/multicast.c > @@ -780,7 +780,7 @@ static void mcast_event_handler(struct ib_event_handler *handler, > int index; > > dev = container_of(handler, struct mcast_device, event_handler); > - if (WARN_ON(!rdma_cap_ib_mcast(dev->device, event->element.port_num))) > + if (!rdma_cap_ib_mcast(dev->device, event->element.port_num)) > return; > > index = event->element.port_num - dev->start_port; > diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c > index 7f7c8c9..3d0b7b2 100644 > --- a/drivers/infiniband/core/sa_query.c > +++ b/drivers/infiniband/core/sa_query.c > @@ -450,7 +450,7 @@ static void ib_sa_event(struct ib_event_handler *handler, struct ib_event *event > struct ib_sa_port *port = > &sa_dev->port[event->element.port_num - sa_dev->start_port]; > > - if (WARN_ON(!rdma_cap_ib_sa(handler->device, port->port_num))) > + if (!rdma_cap_ib_sa(handler->device, port->port_num)) > return; > > spin_lock_irqsave(&port->ah_lock, flags);
On 06/10/2015 06:15 PM, Weiny, Ira wrote: >>>> Registering an event handler is done for a device. This device may >>>> have one RoCE port (no SA cap) and one InfiniBand port (has SA cap). >>>> Therefore, warning from the event handler about a specific port that >>>> doesn't have SA cap is correct but pollutes the kernel log without a >>>> need. >>> >>> Maybe we should think about register event handler per port :-P >> >> I agree, though I think that can be added separately from this change. > > Also agreed. We identified many places where we should split support to be per port while we did this work. We need to start working up to that. For the time being we should not break existing users (or in this case annoy them... ;-) IMHO we can do some reform inside ib_dispatch_event(), where we already have the port number related to the event, if we could have an event_handler_list per port and classified the callback inside ib_register_event_handler(), then we can call the handler on the right port meanwhile won't annoy the user ;-) Regards, Michael Wang > > Ira > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/core/multicast.c b/drivers/infiniband/core/multicast.c index 605f20a..1244f02 100644 --- a/drivers/infiniband/core/multicast.c +++ b/drivers/infiniband/core/multicast.c @@ -780,7 +780,7 @@ static void mcast_event_handler(struct ib_event_handler *handler, int index; dev = container_of(handler, struct mcast_device, event_handler); - if (WARN_ON(!rdma_cap_ib_mcast(dev->device, event->element.port_num))) + if (!rdma_cap_ib_mcast(dev->device, event->element.port_num)) return; index = event->element.port_num - dev->start_port; diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index 7f7c8c9..3d0b7b2 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c @@ -450,7 +450,7 @@ static void ib_sa_event(struct ib_event_handler *handler, struct ib_event *event struct ib_sa_port *port = &sa_dev->port[event->element.port_num - sa_dev->start_port]; - if (WARN_ON(!rdma_cap_ib_sa(handler->device, port->port_num))) + if (!rdma_cap_ib_sa(handler->device, port->port_num)) return; spin_lock_irqsave(&port->ah_lock, flags);
Registering an event handler is done for a device. This device may have one RoCE port (no SA cap) and one InfiniBand port (has SA cap). Therefore, warning from the event handler about a specific port that doesn't have SA cap is correct but pollutes the kernel log without a need. Signed-off-by: Moni Shoua <monis@mellanox.com> --- drivers/infiniband/core/multicast.c | 2 +- drivers/infiniband/core/sa_query.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)