Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [net-intel-i40e] question about assignment overwrite
@ 2017-05-17 20:48 Gustavo A. R. Silva
  2017-05-18  5:49 ` Jeff Kirsher
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2017-05-17 20:48 UTC (permalink / raw)
  To: intel-wired-lan


Hello everybody,

While looking into Coverity ID 1408956 I ran into the following piece  
of code at drivers/net/ethernet/intel/i40e/i40e_main.c:8807:

8807        if (pf->hw.mac.type == I40E_MAC_X722) {
8808                pf->flags |= I40E_FLAG_RSS_AQ_CAPABLE
8809                             | I40E_FLAG_128_QP_RSS_CAPABLE
8810                             | I40E_FLAG_HW_ATR_EVICT_CAPABLE
8811                             | I40E_FLAG_OUTER_UDP_CSUM_CAPABLE
8812                             | I40E_FLAG_WB_ON_ITR_CAPABLE
8813                             | I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE
8814                             | I40E_FLAG_NO_PCI_LINK_CHECK
8815                             | I40E_FLAG_USE_SET_LLDP_MIB
8816                             | I40E_FLAG_GENEVE_OFFLOAD_CAPABLE
8817                             | I40E_FLAG_PTP_L4_CAPABLE
8818                             | I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE;
8819        } else if ((pf->hw.aq.api_maj_ver > 1) ||
8820                   ((pf->hw.aq.api_maj_ver == 1) &&
8821                    (pf->hw.aq.api_min_ver > 4))) {
8822                /* Supported in FW API version higher than 1.4 */
8823                pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
8824                pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
8825        } else {
8826                pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
8827        }

The issue here is that the assignment at line 8823 is overwritten by  
the code at line 8824.

I'm suspicious that line 8824 should be remove and a patch like the  
following can be applied:

index d5c9c9e..48ffa73 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8821,7 +8821,6 @@ static int i40e_sw_init(struct i40e_pf *pf)
                     (pf->hw.aq.api_min_ver > 4))) {
                 /* Supported in FW API version higher than 1.4 */
                 pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
-               pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
         } else {
                 pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
         }

What do you think?

Thanks!
--
Gustavo A. R. Silva





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Intel-wired-lan] [net-intel-i40e] question about assignment overwrite
  2017-05-17 20:48 [Intel-wired-lan] [net-intel-i40e] question about assignment overwrite Gustavo A. R. Silva
@ 2017-05-18  5:49 ` Jeff Kirsher
  2017-05-18 17:44   ` Gustavo A. R. Silva
  2017-06-07 19:55   ` Mauro Rodrigues
  0 siblings, 2 replies; 5+ messages in thread
From: Jeff Kirsher @ 2017-05-18  5:49 UTC (permalink / raw)
  To: intel-wired-lan

On Wed, 2017-05-17 at 15:48 -0500, Gustavo A. R. Silva wrote:
> While looking into Coverity ID 1408956 I ran into the following
> piece??
> of code at drivers/net/ethernet/intel/i40e/i40e_main.c:8807:
> 
> 8807??????? if (pf->hw.mac.type == I40E_MAC_X722) {
> 8808??????????????? pf->flags |= I40E_FLAG_RSS_AQ_CAPABLE
> 8809???????????????????????????? | I40E_FLAG_128_QP_RSS_CAPABLE
> 8810???????????????????????????? | I40E_FLAG_HW_ATR_EVICT_CAPABLE
> 8811???????????????????????????? | I40E_FLAG_OUTER_UDP_CSUM_CAPABLE
> 8812???????????????????????????? | I40E_FLAG_WB_ON_ITR_CAPABLE
> 8813???????????????????????????? |
> I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE
> 8814???????????????????????????? | I40E_FLAG_NO_PCI_LINK_CHECK
> 8815???????????????????????????? | I40E_FLAG_USE_SET_LLDP_MIB
> 8816???????????????????????????? | I40E_FLAG_GENEVE_OFFLOAD_CAPABLE
> 8817???????????????????????????? | I40E_FLAG_PTP_L4_CAPABLE
> 8818???????????????????????????? | I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE;
> 8819??????? } else if ((pf->hw.aq.api_maj_ver > 1) ||
> 8820?????????????????? ((pf->hw.aq.api_maj_ver == 1) &&
> 8821??????????????????? (pf->hw.aq.api_min_ver > 4))) {
> 8822??????????????? /* Supported in FW API version higher than 1.4 */
> 8823??????????????? pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
> 8824??????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> 8825??????? } else {
> 8826??????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> 8827??????? }
> 
> The issue here is that the assignment at line 8823 is overwritten
> by??
> the code at line 8824.
> 
> I'm suspicious that line 8824 should be remove and a patch like the??
> following can be applied:
> 
> index d5c9c9e..48ffa73 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -8821,7 +8821,6 @@ static int i40e_sw_init(struct i40e_pf *pf)
> ???????????????????? (pf->hw.aq.api_min_ver > 4))) {
> ???????????????? /* Supported in FW API version higher than 1.4 */
> ???????????????? pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
> -?????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> ???????? } else {
> ???????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> ???????? }
> 
> What do you think?

This issue is already fixed in my dev-queue branch on my next-queue
tree.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20170517/9e80a5f1/attachment.asc>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Intel-wired-lan] [net-intel-i40e] question about assignment overwrite
  2017-05-18  5:49 ` Jeff Kirsher
@ 2017-05-18 17:44   ` Gustavo A. R. Silva
  2017-06-07 19:55   ` Mauro Rodrigues
  1 sibling, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2017-05-18 17:44 UTC (permalink / raw)
  To: intel-wired-lan

Hi Jeff,

Quoting Jeff Kirsher <jeffrey.t.kirsher@intel.com>:

> On Wed, 2017-05-17 at 15:48 -0500, Gustavo A. R. Silva wrote:
>> While looking into Coverity ID 1408956 I ran into the following
>> piece??
>> of code at drivers/net/ethernet/intel/i40e/i40e_main.c:8807:
>>
>> 8807??????? if (pf->hw.mac.type == I40E_MAC_X722) {
>> 8808??????????????? pf->flags |= I40E_FLAG_RSS_AQ_CAPABLE
>> 8809???????????????????????????? | I40E_FLAG_128_QP_RSS_CAPABLE
>> 8810???????????????????????????? | I40E_FLAG_HW_ATR_EVICT_CAPABLE
>> 8811???????????????????????????? | I40E_FLAG_OUTER_UDP_CSUM_CAPABLE
>> 8812???????????????????????????? | I40E_FLAG_WB_ON_ITR_CAPABLE
>> 8813???????????????????????????? |
>> I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE
>> 8814???????????????????????????? | I40E_FLAG_NO_PCI_LINK_CHECK
>> 8815???????????????????????????? | I40E_FLAG_USE_SET_LLDP_MIB
>> 8816???????????????????????????? | I40E_FLAG_GENEVE_OFFLOAD_CAPABLE
>> 8817???????????????????????????? | I40E_FLAG_PTP_L4_CAPABLE
>> 8818???????????????????????????? | I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE;
>> 8819??????? } else if ((pf->hw.aq.api_maj_ver > 1) ||
>> 8820?????????????????? ((pf->hw.aq.api_maj_ver == 1) &&
>> 8821??????????????????? (pf->hw.aq.api_min_ver > 4))) {
>> 8822??????????????? /* Supported in FW API version higher than 1.4 */
>> 8823??????????????? pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
>> 8824??????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
>> 8825??????? } else {
>> 8826??????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
>> 8827??????? }
>>
>> The issue here is that the assignment at line 8823 is overwritten
>> by??
>> the code at line 8824.
>>
>> I'm suspicious that line 8824 should be remove and a patch like the??
>> following can be applied:
>>
>> index d5c9c9e..48ffa73 100644
>> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
>> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
>> @@ -8821,7 +8821,6 @@ static int i40e_sw_init(struct i40e_pf *pf)
>> ???????????????????? (pf->hw.aq.api_min_ver > 4))) {
>> ???????????????? /* Supported in FW API version higher than 1.4 */
>> ???????????????? pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
>> -?????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
>> ???????? } else {
>> ???????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
>> ???????? }
>>
>> What do you think?
>
> This issue is already fixed in my dev-queue branch on my next-queue
> tree.

Great, it's good to know.

Thanks!
--
Gustavo A. R. Silva







^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Intel-wired-lan] [net-intel-i40e] question about assignment overwrite
  2017-05-18  5:49 ` Jeff Kirsher
  2017-05-18 17:44   ` Gustavo A. R. Silva
@ 2017-06-07 19:55   ` Mauro Rodrigues
  2017-06-07 20:34     ` Jeff Kirsher
  1 sibling, 1 reply; 5+ messages in thread
From: Mauro Rodrigues @ 2017-06-07 19:55 UTC (permalink / raw)
  To: intel-wired-lan

On Wed, May 17, 2017 at 10:49:11PM -0700, Jeff Kirsher wrote:
> On Wed, 2017-05-17 at 15:48 -0500, Gustavo A. R. Silva wrote:
> > While looking into Coverity ID 1408956 I ran into the following
> > piece??
> > of code at drivers/net/ethernet/intel/i40e/i40e_main.c:8807:
> > 
> > 8807??????? if (pf->hw.mac.type == I40E_MAC_X722) {
> > 8808??????????????? pf->flags |= I40E_FLAG_RSS_AQ_CAPABLE
> > 8809???????????????????????????? | I40E_FLAG_128_QP_RSS_CAPABLE
> > 8810???????????????????????????? | I40E_FLAG_HW_ATR_EVICT_CAPABLE
> > 8811???????????????????????????? | I40E_FLAG_OUTER_UDP_CSUM_CAPABLE
> > 8812???????????????????????????? | I40E_FLAG_WB_ON_ITR_CAPABLE
> > 8813???????????????????????????? |
> > I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE
> > 8814???????????????????????????? | I40E_FLAG_NO_PCI_LINK_CHECK
> > 8815???????????????????????????? | I40E_FLAG_USE_SET_LLDP_MIB
> > 8816???????????????????????????? | I40E_FLAG_GENEVE_OFFLOAD_CAPABLE
> > 8817???????????????????????????? | I40E_FLAG_PTP_L4_CAPABLE
> > 8818???????????????????????????? | I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE;
> > 8819??????? } else if ((pf->hw.aq.api_maj_ver > 1) ||
> > 8820?????????????????? ((pf->hw.aq.api_maj_ver == 1) &&
> > 8821??????????????????? (pf->hw.aq.api_min_ver > 4))) {
> > 8822??????????????? /* Supported in FW API version higher than 1.4 */
> > 8823??????????????? pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
> > 8824??????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> > 8825??????? } else {
> > 8826??????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> > 8827??????? }
> > 
> > The issue here is that the assignment at line 8823 is overwritten
> > by??
> > the code at line 8824.
> > 
> > I'm suspicious that line 8824 should be remove and a patch like the??
> > following can be applied:
> > 
> > index d5c9c9e..48ffa73 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> > @@ -8821,7 +8821,6 @@ static int i40e_sw_init(struct i40e_pf *pf)
> > ???????????????????? (pf->hw.aq.api_min_ver > 4))) {
> > ???????????????? /* Supported in FW API version higher than 1.4 */
> > ???????????????? pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
> > -?????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> > ???????? } else {
> > ???????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> > ???????? }
> > 
> > What do you think?
> 
> This issue is already fixed in my dev-queue branch on my next-queue
> tree.

Hi Jeff, are you planning to push this fix into net branch anytime soon?

Thanks,

Mauro


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Intel-wired-lan] [net-intel-i40e] question about assignment overwrite
  2017-06-07 19:55   ` Mauro Rodrigues
@ 2017-06-07 20:34     ` Jeff Kirsher
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Kirsher @ 2017-06-07 20:34 UTC (permalink / raw)
  To: intel-wired-lan

On Wed, 2017-06-07 at 16:55 -0300, Mauro Rodrigues wrote:
> On Wed, May 17, 2017 at 10:49:11PM -0700, Jeff Kirsher wrote:
> > On Wed, 2017-05-17 at 15:48 -0500, Gustavo A. R. Silva wrote:
> > > While looking into Coverity ID 1408956 I ran into the following
> > > piece??
> > > of code at drivers/net/ethernet/intel/i40e/i40e_main.c:8807:
> > > 
> > > 8807??????? if (pf->hw.mac.type == I40E_MAC_X722) {
> > > 8808??????????????? pf->flags |= I40E_FLAG_RSS_AQ_CAPABLE
> > > 8809???????????????????????????? | I40E_FLAG_128_QP_RSS_CAPABLE
> > > 8810???????????????????????????? | I40E_FLAG_HW_ATR_EVICT_CAPABLE
> > > 8811???????????????????????????? | I40E_FLAG_OUTER_UDP_CSUM_CAPABLE
> > > 8812???????????????????????????? | I40E_FLAG_WB_ON_ITR_CAPABLE
> > > 8813???????????????????????????? |
> > > I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE
> > > 8814???????????????????????????? | I40E_FLAG_NO_PCI_LINK_CHECK
> > > 8815???????????????????????????? | I40E_FLAG_USE_SET_LLDP_MIB
> > > 8816???????????????????????????? | I40E_FLAG_GENEVE_OFFLOAD_CAPABLE
> > > 8817???????????????????????????? | I40E_FLAG_PTP_L4_CAPABLE
> > > 8818???????????????????????????? | I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE;
> > > 8819??????? } else if ((pf->hw.aq.api_maj_ver > 1) ||
> > > 8820?????????????????? ((pf->hw.aq.api_maj_ver == 1) &&
> > > 8821??????????????????? (pf->hw.aq.api_min_ver > 4))) {
> > > 8822??????????????? /* Supported in FW API version higher than 1.4 */
> > > 8823??????????????? pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
> > > 8824??????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> > > 8825??????? } else {
> > > 8826??????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> > > 8827??????? }
> > > 
> > > The issue here is that the assignment at line 8823 is overwritten
> > > by??
> > > the code at line 8824.
> > > 
> > > I'm suspicious that line 8824 should be remove and a patch like the??
> > > following can be applied:
> > > 
> > > index d5c9c9e..48ffa73 100644
> > > --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> > > +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> > > @@ -8821,7 +8821,6 @@ static int i40e_sw_init(struct i40e_pf *pf)
> > > ???????????????????? (pf->hw.aq.api_min_ver > 4))) {
> > > ???????????????? /* Supported in FW API version higher than 1.4 */
> > > ???????????????? pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
> > > -?????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> > > ???????? } else {
> > > ???????????????? pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
> > > ???????? }
> > > 
> > > What do you think?
> > 
> > This issue is already fixed in my dev-queue branch on my next-queue
> > tree.
> 
> Hi Jeff, are you planning to push this fix into net branch anytime soon?
> 
> Thanks,
> 
> Mauro

The patch that fixed this issue is already in David Miller's net-next tree.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20170607/9080abaf/attachment.asc>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-07 20:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-17 20:48 [Intel-wired-lan] [net-intel-i40e] question about assignment overwrite Gustavo A. R. Silva
2017-05-18  5:49 ` Jeff Kirsher
2017-05-18 17:44   ` Gustavo A. R. Silva
2017-06-07 19:55   ` Mauro Rodrigues
2017-06-07 20:34     ` Jeff Kirsher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox