IB/mthca: Fix MAD extended header format for MAD_IFC firmware command

Several fields in an incoming MAD extended info header were passed
into the MAD_IFC firmware command at incorrect offsets (mostly off by
4 bytes). As the result, the HCA will fail to generate traps in which
this info is needed (e.g. traps which include the GRH of the incoming
packet), in violation of the IB spec.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by Michael S. Tsirkin and committed by Roland Dreier 68586b67 0b26c88f

+7 -7
+7 -7
drivers/infiniband/hw/mthca/mthca_cmd.c
··· 1820 1820 1821 1821 #define MAD_IFC_BOX_SIZE 0x400 1822 1822 #define MAD_IFC_MY_QPN_OFFSET 0x100 1823 - #define MAD_IFC_RQPN_OFFSET 0x104 1824 - #define MAD_IFC_SL_OFFSET 0x108 1825 - #define MAD_IFC_G_PATH_OFFSET 0x109 1826 - #define MAD_IFC_RLID_OFFSET 0x10a 1827 - #define MAD_IFC_PKEY_OFFSET 0x10e 1823 + #define MAD_IFC_RQPN_OFFSET 0x108 1824 + #define MAD_IFC_SL_OFFSET 0x10c 1825 + #define MAD_IFC_G_PATH_OFFSET 0x10d 1826 + #define MAD_IFC_RLID_OFFSET 0x10e 1827 + #define MAD_IFC_PKEY_OFFSET 0x112 1828 1828 #define MAD_IFC_GRH_OFFSET 0x140 1829 1829 1830 1830 inmailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); ··· 1862 1862 1863 1863 val = in_wc->dlid_path_bits | 1864 1864 (in_wc->wc_flags & IB_WC_GRH ? 0x80 : 0); 1865 - MTHCA_PUT(inbox, val, MAD_IFC_GRH_OFFSET); 1865 + MTHCA_PUT(inbox, val, MAD_IFC_G_PATH_OFFSET); 1866 1866 1867 1867 MTHCA_PUT(inbox, in_wc->slid, MAD_IFC_RLID_OFFSET); 1868 1868 MTHCA_PUT(inbox, in_wc->pkey_index, MAD_IFC_PKEY_OFFSET); ··· 1870 1870 if (in_grh) 1871 1871 memcpy(inbox + MAD_IFC_GRH_OFFSET, in_grh, 40); 1872 1872 1873 - op_modifier |= 0x10; 1873 + op_modifier |= 0x4; 1874 1874 1875 1875 in_modifier |= in_wc->slid << 16; 1876 1876 }