Subject: RE: [PATCH 07/22] RDMA/irdma: Register an auxiliary driver and implement private channel OPs

From: "Saleem, Shiraz" <[email-masked]>
Date: Sat, 30 Jan 2021 01:19:28 +0000

> Subject: Re: [PATCH 07/22] RDMA/irdma: Register an auxiliary driver and
> implement private channel OPs
> 
> On Fri, Jan 22, 2021 at 05:48:12PM -0600, Shiraz Saleem wrote:
> 
> > +static int irdma_probe(struct auxiliary_device *aux_dev,
> > +		       const struct auxiliary_device_id *id) {
> > +	struct irdma_drvdata *drvdata;
> > +	int ret;
> > +
> > +	drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
> > +	if (!drvdata)
> > +		return -ENOMEM;
> > +
> > +	switch (id->driver_data) {
> > +	case IRDMA_GEN_2:
> > +		drvdata->init_dev = irdma_init_dev;
> > +		drvdata->deinit_dev = irdma_deinit_dev;
> > +		break;
> > +	case IRDMA_GEN_1:
> > +		drvdata->init_dev = i40iw_init_dev;
> > +		drvdata->deinit_dev = i40iw_deinit_dev;
> > +		break;
> > +	default:
> > +		ret = -ENODEV;
> > +		goto ver_err;
> 
> Also don't do this, if the drivers are so different then give them different aux bus
> names and bind two drivers with the different flow.

I suppose we could have a gen1 aux driver and one for gen2 with the flows being a little orthogonal from each other.

The gen2 aux driver auxiliary_device_id table would have entries for iWARP and RoCE
aux dev's.

> 
> I suppose the old i40e can keep its weird registration thing, but ice should not
> duplicate that, new code must use aux devices properly, as in my other email.
> 
> Jason