Re: [PATCH] enic: add ethtool get_channel support

From: Jon Kohler
Date: Thu Jun 20 2024 - 15:53:49 EST




> On Jun 19, 2024, at 8:04 PM, Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> On Tue, 18 Jun 2024 16:39:40 +0000 Jon Kohler wrote:
>> Looking through how other drivers do this, I didn’t get a sense that
>> any other drivers were stacking rx_count + combined_count together.
>>
>> Also, enic and the underlying Cisco VIC hardware appears to be
>> fairly specific that the queues they provision at the hardware level are
>> either RX or TX and not a unified ring or something to that effect.
>>
>> I took that to mean that we would never call anything ‘combined’ in
>> the context of this driver.
>
> channel is a bit of an old term, think about interrupts more than
> queues. ethtool man page has the most informative description.

Thanks for the pointer on man ethtool - one question, Przemek had
brought up a good point that ethtool uapi says that combined queues
valid values start at 1; however, I don’t see anything that enforces that
point in the code or the man page.

Should I just omit that completely from the change, since the fields
are zero initialized anyhow?

>
> Looking at this driver, specifically enic_dev_init() I'd venture
> something along the lines of:
>
> switch (vnic_dev_get_intr_mode(enic->vdev)) {
> default:
> channels->combined = 1;
> break;
> case VNIC_DEV_INTR_MODE_MSIX:
> channels->rx_count = enic->rq_count;
> channels->tx_count = enic->wq_count;
> break;
> }
>
> Please not that you don't have to zero out unused fields, they come
> zero-initilized.

Ok thanks, I’ll see what I can cook up in a V2 patch.

> --
> pw-bot: cr