From 2f579fb96862defabf07983245d85b342476717a Mon Sep 17 00:00:00 2001 From: Pradeep Gopanapalli Date: Tue, 29 Aug 2017 11:59:54 -0700 Subject: [PATCH] xsigo: PCA 2.3.1 Compute Node panics in xve_create_arp+430 Orabug: 26474000 After some idle time on a RC connection xve driver cleans up the idle entry and by that time arp entry for that address would be flushed out. Further, traffic re-establishment for that address is taken care by arps generated by the system. But its not rare that arp entry for that address is still present with driver cleaned up the path and in that case xve driver generates arp/ndp packets to resolve the path. While generating an vlan based arp, xve driver uses "vlan_eth_hdr" API to fill vlan specific data. This API works as expected only if skb mac_header is initialized to proper value before using API. In xve_create_arp and xve_create_ndp newly allocated skb's will not have correct mac_header offset and as a result the pointer returned by vlan_eth_hdr function is not the correct address to use, some times this will result in a kernel panic. Call Trace: BUG: unable to handle kernel paging request at ffff88005a47060b IP: [] xve_create_arp+0x1ae/0x200 [xve] The fix here is to directly typecast skb->data instead of using "vlan_eth_hdr" API. This change in xve of using "vlan_eth_hdr" was mostly introduced during EDR/uVNIC development and is applicable only for UEK4. Signed-off-by: Pradeep Gopanapalli Reviewed-by: Chien Yen --- drivers/infiniband/ulp/xsigo/xscore/Makefile | 2 +- drivers/infiniband/ulp/xsigo/xsvhba/Makefile | 2 +- drivers/infiniband/ulp/xsigo/xsvnic/Makefile | 2 +- drivers/infiniband/ulp/xsigo/xve/Makefile | 2 +- drivers/infiniband/ulp/xsigo/xve/xve.h | 2 +- drivers/infiniband/ulp/xsigo/xve/xve_main.c | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/infiniband/ulp/xsigo/xscore/Makefile b/drivers/infiniband/ulp/xsigo/xscore/Makefile index 91c0ef4a6a4d..762cf2e6731d 100644 --- a/drivers/infiniband/ulp/xsigo/xscore/Makefile +++ b/drivers/infiniband/ulp/xsigo/xscore/Makefile @@ -2,7 +2,7 @@ obj-$(CONFIG_INFINIBAND_XSCORE) := xscore.o xscore-y := xscore_impl.o xs_ud.o xscore_api.o xsmp.o \ xscore_stats.o xscore_uadm.o -ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8043\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8044\" ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT diff --git a/drivers/infiniband/ulp/xsigo/xsvhba/Makefile b/drivers/infiniband/ulp/xsigo/xsvhba/Makefile index 20c710673132..d028912ddf7a 100644 --- a/drivers/infiniband/ulp/xsigo/xsvhba/Makefile +++ b/drivers/infiniband/ulp/xsigo/xsvhba/Makefile @@ -3,7 +3,7 @@ xsvhba-y := vhba_main.o vhba_xsmp.o vhba_create.o vhba_init.o vhba_delete.o \ vhba_attr.o vhba_wq.o vhba_proc.o vhba_stats.o vhba_ib.o \ vhba_scsi_intf.o vhba_align.o -ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8043\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8044\" ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT diff --git a/drivers/infiniband/ulp/xsigo/xsvnic/Makefile b/drivers/infiniband/ulp/xsigo/xsvnic/Makefile index 31aa91e34845..34f1224c6a82 100644 --- a/drivers/infiniband/ulp/xsigo/xsvnic/Makefile +++ b/drivers/infiniband/ulp/xsigo/xsvnic/Makefile @@ -1,7 +1,7 @@ obj-$(CONFIG_INFINIBAND_XSVNIC) := xsvnic.o xsvnic-y := xsvnic_main.o xsvnic_stats.o -ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8043\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8044\" ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT diff --git a/drivers/infiniband/ulp/xsigo/xve/Makefile b/drivers/infiniband/ulp/xsigo/xve/Makefile index e1fba082ed07..f8e959972137 100644 --- a/drivers/infiniband/ulp/xsigo/xve/Makefile +++ b/drivers/infiniband/ulp/xsigo/xve/Makefile @@ -2,7 +2,7 @@ obj-$(CONFIG_INFINIBAND_XVE) := xve.o xve-y := xve_main.o xve_verbs.o xve_multicast.o xve_ib.o xve_tables.o \ xve_ethtool.o xve_cm.o xve_stats.o -ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8043\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8044\" ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT diff --git a/drivers/infiniband/ulp/xsigo/xve/xve.h b/drivers/infiniband/ulp/xsigo/xve/xve.h index baab63794528..be577da4db87 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve.h +++ b/drivers/infiniband/ulp/xsigo/xve/xve.h @@ -1298,7 +1298,7 @@ static inline int xve_get_misc_info(void) static inline int xg_vlan_tx_tag_present(struct sk_buff *skb) { - struct vlan_ethhdr *veth = vlan_eth_hdr(skb); + struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data); return veth->h_vlan_proto == htons(ETH_P_8021Q); } diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_main.c b/drivers/infiniband/ulp/xsigo/xve/xve_main.c index 24b2e336537e..77481dd0664a 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_main.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_main.c @@ -1257,7 +1257,7 @@ void handle_carrier_state(struct xve_dev_priv *priv, char state) struct sk_buff *xve_generate_query(struct xve_dev_priv *priv, struct sk_buff *skb) { - struct vlan_ethhdr *veth = vlan_eth_hdr(skb); + struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data); if ((xg_vlan_tx_tag_present(skb) && veth->h_vlan_encapsulated_proto == htons(ETH_P_IP)) @@ -1302,7 +1302,7 @@ struct sk_buff *xve_create_arp(struct xve_dev_priv *priv, struct vlan_ethhdr *veth; vlan_get_tag(skb_pkt, &vlan_tci); - veth = vlan_eth_hdr(skb); + veth = (struct vlan_ethhdr *)(skb->data); veth->h_vlan_proto = htons(ETH_P_8021Q); /* now, the TCI */ veth->h_vlan_TCI = htons(vlan_tci); @@ -1432,7 +1432,7 @@ struct sk_buff *xve_create_ndp(struct xve_dev_priv *priv, struct vlan_ethhdr *veth; vlan_get_tag(skb_pkt, &vlan_tci); - veth = vlan_eth_hdr(skb); + veth = (struct vlan_ethhdr *)(skb->data); veth->h_vlan_proto = htons(ETH_P_8021Q); /* now, the TCI */ veth->h_vlan_TCI = htons(vlan_tci); -- 2.50.1