All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cheng Xu <chengyou@linux.alibaba.com>
To: Bernard Metzler <BMT@zurich.ibm.com>,
	"jgg@ziepe.ca" <jgg@ziepe.ca>,
	"dledford@redhat.com" <dledford@redhat.com>
Cc: "leon@kernel.org" <leon@kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"KaiShen@linux.alibaba.com" <KaiShen@linux.alibaba.com>,
	"tonylu@linux.alibaba.com" <tonylu@linux.alibaba.com>
Subject: Re: [PATCH rdma-next v2 09/11] RDMA/erdma: Add the erdma module
Date: Wed, 19 Jan 2022 12:18:42 +0800	[thread overview]
Message-ID: <26c9b7fb-3a11-f247-f32e-185a68b64cdf@linux.alibaba.com> (raw)
In-Reply-To: <BYAPR15MB2631DDA080CDD41142AEB45399589@BYAPR15MB2631.namprd15.prod.outlook.com>



On 1/18/22 8:53 PM, Bernard Metzler wrote:

<...>

>> +static int erdma_res_cb_init(struct erdma_dev *dev)
>> +{
>> +	int i;
>> +
>> +	for (i = 0; i < ERDMA_RES_CNT; i++) {
>> +		dev->res_cb[i].next_alloc_idx = 1;
>> +		spin_lock_init(&dev->res_cb[i].lock);
>> +		dev->res_cb[i].bitmap = kcalloc(BITS_TO_LONGS(dev-
>>> res_cb[i].max_cap),
>> +						sizeof(unsigned long), GFP_KERNEL);
> 
> better stay with less than 80 chars per line
> throughout the patch series (I count currently 287 line wraps).
> 

The kernel now allows 100 chars per line, and the checkpath.pl also
checks using the new rule now. I will try to change this to 80 chars, 
but it actually makes some code not friendly for reading due to
indent.

<...>

>> +	switch (event) {
>> +	case NETDEV_UP:
>> +		dev->state = IB_PORT_ACTIVE;
>> +		erdma_port_event(dev, IB_EVENT_PORT_ACTIVE);
>> +		break;
>> +	case NETDEV_DOWN:
>> +		dev->state = IB_PORT_DOWN;
>> +		erdma_port_event(dev, IB_EVENT_PORT_ERR);
>> +		break;
>> +	case NETDEV_UNREGISTER:
>> +		ib_unregister_device_queued(ibdev);
>> +		break;
>> +	case NETDEV_REGISTER:
>> +	case NETDEV_CHANGEADDR:
> 
> No action needed here?
> 

Changing MAC address of ENIs in Alibaba Cloud makes no sense and is not
recommended, this will make the network unreachable and loss the 
connection. An ERDMA device is attached to an ENI, and no need to
process this event.

>> +	case NETDEV_CHANGEMTU:
>> +	case NETDEV_GOING_DOWN:
> 
> does erdma not have to take care about connected QPs
> if its associated link goes down? This event might be
> the right time to do cleanup, if needed (maybe also see siw
> driver)

The event of netdev down will be notified to the backend of virtio-net.
Virtio-net and ERDMA deivces are in the same MOC hardware (e,g, our DPU
chipset), and the event will be spread to ERDMA backend. After that,
ERDMA backend will process it, and notify to driver by AEQE or CQE with
error. No need to handle this in driver all together.

>> +	case NETDEV_CHANGE:
>> +	default:
>> +		break;
>> +	}
>> +
>> +	ib_device_put(ibdev);
>> +
>> +	return NOTIFY_DONE;
> 
> Better returning NOTIFY_OK here?
> 
> from <linux/notifier.h>:
>   #define NOTIFY_DONE     0x0000      /* Don't care */
>   #define NOTIFY_OK       0x0001      /* Suits me */
> 

I will check this.

Thanks,
Cheng Xu

  reply	other threads:[~2022-01-19  4:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18 12:53 [PATCH rdma-next v2 09/11] RDMA/erdma: Add the erdma module Bernard Metzler
2022-01-19  4:18 ` Cheng Xu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-01-19 10:15 Bernard Metzler
2022-01-19 11:31 ` Leon Romanovsky
2022-01-20  2:51   ` Cheng Xu
2022-01-17  8:48 [PATCH rdma-next v2 00/11] Elastic RDMA Adapter (ERDMA) driver Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 09/11] RDMA/erdma: Add the erdma module Cheng Xu
2022-01-17 15:22   ` Jason Gunthorpe
2022-01-18  3:29     ` Cheng Xu
2022-01-18  8:28       ` Leon Romanovsky
2022-01-18 11:47         ` Cheng Xu
2022-01-18 12:37         ` Jason Gunthorpe
2022-01-18 13:03     ` Cheng Xu
2022-01-18 14:13       ` Jason Gunthorpe
2022-01-19  1:57         ` Cheng Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26c9b7fb-3a11-f247-f32e-185a68b64cdf@linux.alibaba.com \
    --to=chengyou@linux.alibaba.com \
    --cc=BMT@zurich.ibm.com \
    --cc=KaiShen@linux.alibaba.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=tonylu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.