[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ab2d5acc31f94ecc97e412d286c375cee9640722.camel@intel.com>
Date: Wed, 13 Nov 2019 10:47:38 -0800
From: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
To: Arkady Gilinsky <arkady.gilinsky@...monicinc.com>,
"Creeley, Brett" <brett.creeley@...el.com>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Cc: Arkady Gilinsky <arcadyg@...il.com>
Subject: Re: [EXTERNAL] RE: [PATCH net] i40e/iavf: Fix msg interface between
VF and PF
On Tue, 2019-11-12 at 07:33 +0000, Arkady Gilinsky wrote:
> Hi All,
>
> Jeffrey/Brett: I did re-submit the patch as "[v2,net] i40e/iavf: Fix msg
> interface between VF and PF"
> Please review.
Sorry, Brett is on vacation for a couple of weeks. Before he left, he
provided an alternative patch, which I will be submitting later today.
>
> On Fri, 2019-11-08 at 16:43 +0000, Creeley, Brett wrote:
> > > -----Original Message-----
> > > From: Kirsher, Jeffrey T <jeffrey.t.kirsher@...el.com>
> > > Sent: Thursday, November 7, 2019 11:39 AM
> > > To: Arkady Gilinsky <arkady.gilinsky@...monicinc.com>; Creeley, Brett
> > > <brett.creeley@...el.com>; intel-wired-lan@lis
> > > ts.osuosl.org;
> > > netdev@...r.kernel.org
> > > Cc: Arkady Gilinsky <arcadyg@...il.com>
> > > Subject: Re: [EXTERNAL] RE: [PATCH net] i40e/iavf: Fix msg interface
> > > between VF and PF
> > >
> > > On Wed, 2019-11-06 at 05:30 +0000, Arkady Gilinsky wrote:
> > > > On Tue, 2019-11-05 at 16:55 +0000, Creeley, Brett wrote:
> > > > > > -----Original Message-----
> > > > > > From: Arkady Gilinsky <arkady.gilinsky@...monicinc.com>
> > > > > > Sent: Monday, November 4, 2019 9:24 PM
> > > > > > To: Creeley, Brett <brett.creeley@...el.com>;
> > > > > > intel-wired-lan@...ts.osuosl.org; netdev@...r.kernel.org;
> > > > > > Kirsher,
> > > > > > Jeffrey T
> > > > > > <jeffrey.t.kirsher@...el.com>
> > > > > > Cc: Arkady Gilinsky <arcadyg@...il.com>
> > > > > > Subject: Re: [EXTERNAL] RE: [PATCH net] i40e/iavf: Fix msg
> > > > > > interface
> > > > > > between VF and PF
> > > > > > > static bool i40e_vc_verify_vqs_bitmaps(struct
> > > > > > > virtchnl_queue_select
> > > > > > > *vqs)
> > > > > > > {
> > > > > > > /* this will catch any changes made to the
> > > > > > > virtchnl_queue_select
> > > > > > > bitmap */
> > > > > > > if (sizeof(vqs->rx_queues) != sizeof(u32) ||
> > > > > > > sizeof(vqs->tx_queues) != sizeof(u32))
> > > > > > > return false;
> > > > > >
> > > > > > If so, then is it better to check the type of the fields in
> > > > > > compile-
> > > > > > time rather than in runtime ?
> > > > > > Something like this:
> > > > > > BUILD_BUG_ON(sizeof(vqs->rx_queues) != sizeof(u32));
> > > > > > BUILD_BUG_ON(sizeof(vqs->tx_queues) != sizeof(u32));
> > > > > > This is not required comparison each time when function is
> > > > > > called and
> > > > > > made code more optimized.
> > > > >
> > > > > I don't think this is required with the change you suggested
> > > > > below.
> > > >
> > > > Agree.
> > > > If other code in driver not need to be adjusted/verified, then this
> > > > check
> > > > is not needed.
> > > > > > > if ((vqs->rx_queues == 0 && vqs->tx_queues == 0) ||
> > > > > > > hweight32(vqs->rx_queues) > I40E_MAX_VF_QUEUES ||
> > > > > > > hweight32(vqs->tx_queues) > I40E_MAX_VF_QUEUES)
> > > > > > > return false;
> > > > > >
> > > > > > Again, from optimization POV it is better to have constant
> > > > > > changed
> > > > > > than variable,
> > > > > > since it is compile time and not run time action:
> > > > > > if ((vqs->rx_queues == 0 && vqs->tx_queues == 0) ||
> > > > > > vqs->rx_queues >= (BIT(I40E_MAX_VF_QUEUES)) ||
> > > > > >
> > > > > > vqs->tx_queues >= (BIT(I40E_MAX_VF_QUEUES)))
> > > > > > return false;
> > > > >
> > > > > This seems much better than my solution. It fixes the original
> > > > > issue,
> > > > > handles if the
> > > > > vqs->[r|t]x_queues variables have changed in size, and the queue
> > > > > bitmap
> > > > > comparison
> > > > > uses a constant. Thanks!
> > > >
> > > > Thanks to you for feedback.
> > > > I am trying to understand if this patch will enter into official
> > > > kernel
> > > > tree
> > > > and, not less important from my POV, to official Intel drivers.
> > > > Brett/Jeffrey, could you, please, assist to make sure that this
> > > > fix, or
> > > > fix suggested by Brett,
> > > > will be integrated into Intel i40e/iavf drivers ?
> > > > Or may be I should write mail straight to Intel support ?
> > >
> > > As Brett pointed out, there are issues with this patch. Please make
> > > the
> > > suggested changes and re-submit the patch to
> > > intel-wired-lan@...ts.osuosl.org
> >
> > Jeff/Arkady: I have already submitted patches for this internally for
> > official Intel drivers. Apologies for the delayed response.
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists