Re: [PATCH v1 08/10] iser-target: Support the remote invalidation exception

2015-11-26 Thread Sagi Grimberg




yep, should be probably OK.

You didn't respond to my comment re adding bools vs bit-fields vs bit-flags


This is outside the scope of this patchset.
I'm willing to look into this incrementally to this.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1 08/10] iser-target: Support the remote invalidation exception

2015-11-25 Thread Or Gerlitz
On Wed, Nov 25, 2015 at 10:48 AM, Sagi Grimberg
 wrote:
> On 25/11/2015 10:41, Or Gerlitz wrote:
>> On Wed, Nov 25, 2015 at 9:55 AM, Sagi Grimberg 
>> wrote:

>> I see, so if this is case,  can you eliminate one the checks here

> +   if (isert_conn->snd_w_inv && isert_cmd->inv_rkey) {

> This are *exactly* the checks that enforce what I said above.
> If we remove that we'd step on the bug you mentioned.

> We do remote invalidate only if:
> - we are allowed to (send_w_inv)
> - initiator passed us rkey (inv_rkey).

yep, should be probably OK.

You didn't respond to my comment re adding bools vs bit-fields vs bit-flags

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1 08/10] iser-target: Support the remote invalidation exception

2015-11-25 Thread Sagi Grimberg



On 25/11/2015 10:41, Or Gerlitz wrote:

On Wed, Nov 25, 2015 at 9:55 AM, Sagi Grimberg  wrote:


For NO_DATA commands the iser specification explicitly states that
read_stag and write_stag should be 0 which means that inv_rkey is 0
too. We don't do remote invalidate in case inv_rkey is 0.


I see, so if this is case,  can you eliminate one the checks here


+   if (isert_conn->snd_w_inv && isert_cmd->inv_rkey) {


This are *exactly* the checks that enforce what I said above.
If we remove that we'd step on the bug you mentioned.

We do remote invalidate only if:
- we are allowed to (send_w_inv)
- initiator passed us rkey (inv_rkey).
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1 08/10] iser-target: Support the remote invalidation exception

2015-11-25 Thread Or Gerlitz
On Wed, Nov 25, 2015 at 9:55 AM, Sagi Grimberg  wrote:

> For NO_DATA commands the iser specification explicitly states that
> read_stag and write_stag should be 0 which means that inv_rkey is 0
> too. We don't do remote invalidate in case inv_rkey is 0.

I see, so if this is case,  can you eliminate one the checks here

>>> +   if (isert_conn->snd_w_inv && isert_cmd->inv_rkey) {
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1 08/10] iser-target: Support the remote invalidation exception

2015-11-24 Thread Sagi Grimberg



On 24/11/2015 19:42, Or Gerlitz wrote:

On Tue, Nov 24, 2015 at 6:23 PM, Sagi Grimberg  wrote:

@@ -1100,7 +1122,14 @@ isert_init_send_wr(struct isert_conn *isert_conn, struct 
isert_cmd *isert_cmd,

 isert_cmd->rdma_wr.iser_ib_op = ISER_IB_SEND;
 send_wr->wr_id = (uintptr_t)&isert_cmd->tx_desc;
-   send_wr->opcode = IB_WR_SEND;
+
+   if (isert_conn->snd_w_inv && isert_cmd->inv_rkey) {
+   send_wr->opcode  = IB_WR_SEND_WITH_INV;
+   send_wr->ex.invalidate_rkey = isert_cmd->inv_rkey;
+   } else {
+   send_wr->opcode = IB_WR_SEND;
+   }
+



@@ -1489,6 +1518,7 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct 
iser_rx_desc *rx_desc,
 isert_cmd->read_va = read_va;
 isert_cmd->write_stag = write_stag;
 isert_cmd->write_va = write_va;
+   isert_cmd->inv_rkey = read_stag ? read_stag : write_stag;


bug

what happens for commands for which we don't register any memory, TUR and such?


Hi Or,

For NO_DATA commands the iser specification explicitly states that
read_stag and write_stag should be 0 which means that inv_rkey is 0
too. We don't do remote invalidate in case inv_rkey is 0.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1 08/10] iser-target: Support the remote invalidation exception

2015-11-24 Thread Or Gerlitz
On Tue, Nov 24, 2015 at 6:23 PM, Sagi Grimberg  wrote:
> @@ -1100,7 +1122,14 @@ isert_init_send_wr(struct isert_conn *isert_conn, 
> struct isert_cmd *isert_cmd,
>
> isert_cmd->rdma_wr.iser_ib_op = ISER_IB_SEND;
> send_wr->wr_id = (uintptr_t)&isert_cmd->tx_desc;
> -   send_wr->opcode = IB_WR_SEND;
> +
> +   if (isert_conn->snd_w_inv && isert_cmd->inv_rkey) {
> +   send_wr->opcode  = IB_WR_SEND_WITH_INV;
> +   send_wr->ex.invalidate_rkey = isert_cmd->inv_rkey;
> +   } else {
> +   send_wr->opcode = IB_WR_SEND;
> +   }
> +

> @@ -1489,6 +1518,7 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct 
> iser_rx_desc *rx_desc,
> isert_cmd->read_va = read_va;
> isert_cmd->write_stag = write_stag;
> isert_cmd->write_va = write_va;
> +   isert_cmd->inv_rkey = read_stag ? read_stag : write_stag;

bug

what happens for commands for which we don't register any memory, TUR and such?

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html