Re: [RFC net-next 5/7] net/ism: Move ism_loopback to net/ism

Alexandra Winter
2025-01-20T09:32:12Z

On 20.01.25 04:55, Dust Li wrote:
>> +static int ism_lo_move_data(struct ism_dev *ism, u64 dmb_tok,
>> + unsigned int idx, bool sf, unsigned int offset,
>> + void *data, unsigned int size)
>> +{
>> + struct ism_lo_dmb_node *rmb_node = NULL, *tmp_node;
>> + struct ism_lo_dev *ldev;
>> + u16 s_mask;
>> + u8 client_id;
>> + u32 sba_idx;
>> +
>> + ldev = container_of(ism, struct ism_lo_dev, ism);
>> +
>> + if (!sf)
>> + /* since sndbuf is merged with peer DMB, there is
>> + * no need to copy data from sndbuf to peer DMB.
>> + */
>> + return 0;
>> +
>> + read_lock_bh(&ldev->dmb_ht_lock);
>> + hash_for_each_possible(ldev->dmb_ht, tmp_node, list, dmb_tok) {
>> + if (tmp_node->token == dmb_tok) {
>> + rmb_node = tmp_node;
>> + break;
>> + }
>> + }
>> + if (!rmb_node) {
>> + read_unlock_bh(&ldev->dmb_ht_lock);
>> + return -EINVAL;
>> + }
>> + // So why copy the data now?? SMC usecase? Data buffer is attached,
>> + // rw-pointer are not attached?
> I understand the confusion here. I have the same confusion the first time
> I saw this.
>
> This is actually the tricky part: it assumes the CDC will signal, while
> the data will not. We need to copy the CDC, so the copy here only to the
> CDC.
>
> I think we should refine the move_data() API to make this clearer.
>
> Best regards,
> Dust

I agree. Will be refined in next version.