Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Initialize data field in struct buffer.



details:   https://anonhg.NetBSD.org/src/rev/ee0a7c0bc147
branches:  trunk
changeset: 1027193:ee0a7c0bc147
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Dec 10 11:14:18 2021 +0000

description:
Initialize data field in struct buffer.

  FreeBSD: b3ebe337ffa06b0f1f460bf8f1e42fb55db77d0b or ix-3.3.14
  DPDK:    40543be5376ca415b2a7e196315d0555725b8bdf

    While sending request using ixgbe_hic_unlocked() the data field in
    buffer struct is not used. It is set when the struct is overwritten by
    FW to deliver the response. To not pass random data to FW the whole
    structure should be zeroed before use.

diffstat:

 sys/dev/pci/ixgbe/ixgbe_x550.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r e930be7049f0 -r ee0a7c0bc147 sys/dev/pci/ixgbe/ixgbe_x550.c
--- a/sys/dev/pci/ixgbe/ixgbe_x550.c    Fri Dec 10 11:09:52 2021 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_x550.c    Fri Dec 10 11:14:18 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_x550.c,v 1.20 2021/05/19 08:19:20 msaitoh Exp $ */
+/* $NetBSD: ixgbe_x550.c,v 1.21 2021/12/10 11:14:18 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -35,7 +35,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x550.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_x550.c,v 1.20 2021/05/19 08:19:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_x550.c,v 1.21 2021/12/10 11:14:18 msaitoh Exp $");
 
 #include "ixgbe_x550.h"
 #include "ixgbe_x540.h"
@@ -3322,6 +3322,7 @@
        /* one word */
        buffer.length = IXGBE_CPU_TO_BE16(sizeof(u16));
        buffer.pad2 = 0;
+       buffer.data = 0;
        buffer.pad3 = 0;
 
        status = hw->mac.ops.acquire_swfw_sync(hw, mask);
@@ -3382,6 +3383,7 @@
                buffer.address = IXGBE_CPU_TO_BE32((offset + current_word) * 2);
                buffer.length = IXGBE_CPU_TO_BE16(words_to_read * 2);
                buffer.pad2 = 0;
+               buffer.data = 0;
                buffer.pad3 = 0;
 
                status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer),



Home | Main Index | Thread Index | Old Index