IB/ehca: Reject send WRs only for RESET, INIT and RTR state - Kernel

This is a discussion on IB/ehca: Reject send WRs only for RESET, INIT and RTR state - Kernel ; Signed-off-by: Joachim Fenkes --- drivers/infiniband/hw/ehca/ehca_reqs.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c index bbe0436..f093b00 100644 --- a/drivers/infiniband/hw/ehca/ehca_reqs.c +++ b/drivers/infiniband/hw/ehca/ehca_reqs.c @@ -421,8 +421,10 @@ int ehca_post_send(struct ib_qp *qp, int ret = 0; unsigned long ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: IB/ehca: Reject send WRs only for RESET, INIT and RTR state

  1. IB/ehca: Reject send WRs only for RESET, INIT and RTR state

    Signed-off-by: Joachim Fenkes
    ---
    drivers/infiniband/hw/ehca/ehca_reqs.c | 6 ++++--
    1 files changed, 4 insertions(+), 2 deletions(-)

    diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c
    index bbe0436..f093b00 100644
    --- a/drivers/infiniband/hw/ehca/ehca_reqs.c
    +++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
    @@ -421,8 +421,10 @@ int ehca_post_send(struct ib_qp *qp,
    int ret = 0;
    unsigned long flags;

    - if (unlikely(my_qp->state != IB_QPS_RTS)) {
    - ehca_err(qp->device, "QP not in RTS state qpn=%x", qp->qp_num);
    + /* Reject WR if QP is in RESET, INIT or RTR state */
    + if (unlikely(my_qp->state < IB_QPS_RTS)) {
    + ehca_err(qp->device, "Invalid QP state qp_state=%d qpn=%x",
    + my_qp->state, qp->qp_num);
    return -EINVAL;
    }

    --
    1.5.5


    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: IB/ehca: Reject send WRs only for RESET, INIT and RTR state

    thanks, applied.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: [ofa-general] IB/ehca: Reject send WRs only for RESET, INIT and RTR state

    Hi.

    I checked the code in the ehca driver and noticed that
    post RR to a QP is being accepted in any state (including the RESET state).

    thanks
    Dotan

    Joachim Fenkes wrote:
    > Signed-off-by: Joachim Fenkes
    > ---
    > drivers/infiniband/hw/ehca/ehca_reqs.c | 6 ++++--
    > 1 files changed, 4 insertions(+), 2 deletions(-)
    >
    > diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c
    > index bbe0436..f093b00 100644
    > --- a/drivers/infiniband/hw/ehca/ehca_reqs.c
    > +++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
    > @@ -421,8 +421,10 @@ int ehca_post_send(struct ib_qp *qp,
    > int ret = 0;
    > unsigned long flags;
    >
    > - if (unlikely(my_qp->state != IB_QPS_RTS)) {
    > - ehca_err(qp->device, "QP not in RTS state qpn=%x", qp->qp_num);
    > + /* Reject WR if QP is in RESET, INIT or RTR state */
    > + if (unlikely(my_qp->state < IB_QPS_RTS)) {
    > + ehca_err(qp->device, "Invalid QP state qp_state=%d qpn=%x",
    > + my_qp->state, qp->qp_num);
    > return -EINVAL;
    > }
    >
    >


    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. [PATCH] IB/ehca: Reject recv WRs if QP is in RESET state

    Signed-off-by: Joachim Fenkes
    ---
    On Friday 06 June 2008 22:20, Dotan Barak wrote:

    > I checked the code in the ehca driver and noticed that
    > post RR to a QP is being accepted in any state (including the RESET state).


    You're right, this is only consistent -- thanks for pointing it out!

    Regards,
    Joachim

    drivers/infiniband/hw/ehca/ehca_reqs.c | 12 ++++++++++--
    1 files changed, 10 insertions(+), 2 deletions(-)

    diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c
    index f093b00..ad197f4 100644
    --- a/drivers/infiniband/hw/ehca/ehca_reqs.c
    +++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
    @@ -544,8 +544,16 @@ int ehca_post_recv(struct ib_qp *qp,
    struct ib_recv_wr *recv_wr,
    struct ib_recv_wr **bad_recv_wr)
    {
    - return internal_post_recv(container_of(qp, struct ehca_qp, ib_qp),
    - qp->device, recv_wr, bad_recv_wr);
    + struct ehca_qp *my_qp = container_of(qp, struct ehca_qp, ib_qp);
    +
    + /* Reject WR if QP is in RESET state */
    + if (unlikely(my_qp->state == IB_QPS_RESET)) {
    + ehca_err(qp->device, "Invalid QP state qp_state=%d qpn=%x",
    + my_qp->state, qp->qp_num);
    + return -EINVAL;
    + }
    +
    + return internal_post_recv(my_qp, qp->device, recv_wr, bad_recv_wr);
    }

    int ehca_post_srq_recv(struct ib_srq *srq,
    --
    1.5.5

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. Re: [PATCH] IB/ehca: Reject recv WRs if QP is in RESET state

    thanks, applied.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  6. [PATCH] IB/ehca: Make device table externally visible

    This gives ehca an autogenerated modalias and therefore enables automatic loading.

    Signed-off-by: Joachim Fenkes
    ---
    drivers/infiniband/hw/ehca/ehca_main.c | 1 +
    1 files changed, 1 insertions(+), 0 deletions(-)

    diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
    index 482103e..598844d 100644
    --- a/drivers/infiniband/hw/ehca/ehca_main.c
    +++ b/drivers/infiniband/hw/ehca/ehca_main.c
    @@ -923,6 +923,7 @@ static struct of_device_id ehca_device_table[] =
    },
    {},
    };
    +MODULE_DEVICE_TABLE(of, ehca_device_table);

    static struct of_platform_driver ehca_driver = {
    .name = "ehca",
    --
    1.5.5


    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  7. Re: [PATCH] IB/ehca: Make device table externally visible

    thanks, applied
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  8. [PATCH] IB/ehca: Fix suppression of port activation events

    A previous fix introduced a regression where port activation events were
    dropped unconditionally if port autodetection was not enabled. Fixed.

    Signed-off-by: Joachim Fenkes
    ---

    Roland -- this patch is made against your for-linus branch. Please review
    and apply if you think it's okay. Hope it's not too late for the next kernel.

    Joachim

    drivers/infiniband/hw/ehca/ehca_irq.c | 45 +++++++++++++++++++-------------
    1 files changed, 27 insertions(+), 18 deletions(-)

    diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
    index 9e43459..757035e 100644
    --- a/drivers/infiniband/hw/ehca/ehca_irq.c
    +++ b/drivers/infiniband/hw/ehca/ehca_irq.c
    @@ -359,34 +359,43 @@ static void notify_port_conf_change(struct ehca_shca *shca, int port_num)
    *old_attr = new_attr;
    }

    +/* replay modify_qp for sqps -- return 0 if all is well, 1 if AQP1 destroyed */
    +static int replay_modify_qp(struct ehca_sport *sport)
    +{
    + int aqp1_destroyed;
    + unsigned long flags;
    +
    + spin_lock_irqsave(&sport->mod_sqp_lock, flags);
    +
    + aqp1_destroyed = !sport->ibqp_sqp[IB_QPT_GSI];
    +
    + if (sport->ibqp_sqp[IB_QPT_SMI])
    + ehca_recover_sqp(sport->ibqp_sqp[IB_QPT_SMI]);
    + if (!aqp1_destroyed)
    + ehca_recover_sqp(sport->ibqp_sqp[IB_QPT_GSI]);
    +
    + spin_unlock_irqrestore(&sport->mod_sqp_lock, flags);
    +
    + return aqp1_destroyed;
    +}
    +
    static void parse_ec(struct ehca_shca *shca, u64 eqe)
    {
    u8 ec = EHCA_BMASK_GET(NEQE_EVENT_CODE, eqe);
    u8 port = EHCA_BMASK_GET(NEQE_PORT_NUMBER, eqe);
    u8 spec_event;
    struct ehca_sport *sport = &shca->sport[port - 1];
    - unsigned long flags;

    switch (ec) {
    case 0x30: /* port availability change */
    if (EHCA_BMASK_GET(NEQE_PORT_AVAILABILITY, eqe)) {
    - /* only for autodetect mode important */
    - if (ehca_nr_ports >= 0)
    - break;
    -
    - int suppress_event;
    - /* replay modify_qp for sqps */
    - spin_lock_irqsave(&sport->mod_sqp_lock, flags);
    - suppress_event = !sport->ibqp_sqp[IB_QPT_GSI];
    - if (sport->ibqp_sqp[IB_QPT_SMI])
    - ehca_recover_sqp(sport->ibqp_sqp[IB_QPT_SMI]);
    - if (!suppress_event)
    - ehca_recover_sqp(sport->ibqp_sqp[IB_QPT_GSI]);
    - spin_unlock_irqrestore(&sport->mod_sqp_lock, flags);
    -
    - /* AQP1 was destroyed, ignore this event */
    - if (suppress_event)
    - break;
    + /* only replay modify_qp calls in autodetect mode;
    + * if AQP1 was destroyed, the port is already down
    + * again and we can drop the event.
    + */
    + if (ehca_nr_ports < 0)
    + if (replay_modify_qp(sport))
    + break;

    sport->port_state = IB_PORT_ACTIVE;
    dispatch_port_event(shca, port, IB_EVENT_PORT_ACTIVE,
    --
    1.5.5




    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  9. Re: [PATCH] IB/ehca: Fix suppression of port activation events

    > A previous fix introduced a regression where port activation events were
    > dropped unconditionally if port autodetection was not enabled. Fixed.


    Is this a fix to "IB/ehca: Remove reference to special QP in case of
    port activation failure"? Because if so I can roll it into that patch,
    since Linus hasn't pulled it yet.

    - R.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  10. Re: [PATCH] IB/ehca: Fix suppression of port activation events

    Roland Dreier wrote on 10.11.2008 21:36:23:

    > > A previous fix introduced a regression where port activation events

    were
    > > dropped unconditionally if port autodetection was not enabled. Fixed.

    >
    > Is this a fix to "IB/ehca: Remove reference to special QP in case of
    > port activation failure"? Because if so I can roll it into that patch,
    > since Linus hasn't pulled it yet.


    Yes, that would be splendid, thank you!

    Cheers,
    Joachim
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread