Re: [PATCH] RDMA/ocrdma: Fixed CONFIG_VLAN_8021Q.
On Fri, Aug 10, 2012 at 9:28 AM, Parav Pandit wrote: > Fixed avoiding checking real vlan dev in scenario > when VLAN is disabled and ipv6 is enabled. It would be a nice touch to acknowledge Fengguang with a Reported-by: > Signed-off-by: Parav Pandit > --- > drivers/infiniband/hw/ocrdma/ocrdma_main.c | 16 > 1 files changed, 12 insertions(+), 4 deletions(-) > > diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c > b/drivers/infiniband/hw/ocrdma/ocrdma_main.c > index 5a04452..7146ffd 100644 > --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c > +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c > @@ -161,7 +161,7 @@ static void ocrdma_add_default_sgid(struct ocrdma_dev > *dev) > ocrdma_get_guid(dev, &sgid->raw[8]); > } > > -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) > +#if IS_ENABLED(CONFIG_VLAN_8021Q) || IS_ENABLED(CONFIG_VLAN_8021Q_MODULE) a single IS_ENABLED() tests both CONFIG_xxx and CONFIG_xxx_MODULE > static void ocrdma_add_vlan_sgids(struct ocrdma_dev *dev) > { > struct net_device *netdev, *tmp; > @@ -202,8 +202,16 @@ static int ocrdma_build_sgid_tbl(struct ocrdma_dev *dev) > return 0; > } > > -#if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_VLAN_8021Q) > +static struct net_device *ocrdma_get_real_netdev(struct net_device *netdev) > +{ > +#if IS_ENABLED(CONFIG_VLAN_8021Q) || IS_ENABLED(CONFIG_VLAN_8021Q_MODULE) > + return vlan_dev_real_dev(netdev); > +#else > + return netdev; > +#endif > +} This is kind of crazy: it's a big helper that you only use in one spot, and the whole point of IS_ENABLED() is that it is usable in C code too -- so you could at least write this without using the preprocessor. But I don't think it really helps to split out this wrapper. > +#if IS_ENABLED(CONFIG_IPV6) > static int ocrdma_inet6addr_event(struct notifier_block *notifier, > unsigned long event, void *ptr) > { > @@ -217,7 +225,7 @@ static int ocrdma_inet6addr_event(struct notifier_block > *notifier, > bool is_vlan = false; > u16 vid = 0; > > - netdev = vlan_dev_real_dev(event_netdev); > + netdev = ocrdma_get_real_netdev(event_netdev); > if (netdev != event_netdev) { > is_vlan = true; > vid = vlan_dev_vlan_id(event_netdev); > @@ -262,7 +270,7 @@ static struct notifier_block ocrdma_inet6addr_notifier = { > .notifier_call = ocrdma_inet6addr_event > }; > > -#endif /* IPV6 and VLAN */ > +#endif /* IPV6 */ > > static enum rdma_link_layer ocrdma_link_layer(struct ib_device *device, > u8 port_num) How about this simpler version: >From d549f55f2e132e3d1f1288ce4231f45f12988bbf Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Fri, 10 Aug 2012 16:52:13 -0700 Subject: [PATCH] RDMA/ocrdma: Don't call vlan_dev_real_dev() for non-VLAN netdevs If CONFIG_VLAN_8021Q is not set, then vlan_dev_real_dev() just goes BUG(), so we shouldn't call it unless we're actually dealing with a VLAN netdev. Reported-by: Fengguang Wu Signed-off-by: Roland Dreier --- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 5a04452..c4e0131 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c @@ -161,7 +161,7 @@ static void ocrdma_add_default_sgid(struct ocrdma_dev *dev) ocrdma_get_guid(dev, &sgid->raw[8]); } -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) +#if IS_ENABLED(CONFIG_VLAN_8021Q) static void ocrdma_add_vlan_sgids(struct ocrdma_dev *dev) { struct net_device *netdev, *tmp; @@ -202,14 +202,13 @@ static int ocrdma_build_sgid_tbl(struct ocrdma_dev *dev) return 0; } -#if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_VLAN_8021Q) +#if IS_ENABLED(CONFIG_IPV6) static int ocrdma_inet6addr_event(struct notifier_block *notifier, unsigned long event, void *ptr) { struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr; - struct net_device *event_netdev = ifa->idev->dev; - struct net_device *netdev = NULL; + struct net_device *netdev = ifa->idev->dev; struct ib_event gid_event; struct ocrdma_dev *dev; bool found = false; @@ -217,11 +216,12 @@ static int ocrdma_inet6addr_event(struct notifier_block *notifier, bool is_vlan = false; u16 vid = 0; - netdev = vlan_dev_real_dev(event_netdev); - if (netdev != event_netdev) { - is_vlan = true; - vid = vlan_dev_vlan_id(event_netdev); + is_vlan = netdev->priv_flags & IFF_802_1Q_VLAN; + if (is_vlan) { + vid = vlan_dev_vlan_id(netdev); + netdev = vlan_dev_real_dev(netdev); } + rcu_read_lock();
Re: IB softirq race
On Fri, Aug 10, 2012 at 6:03 AM, Sebastian Riemer wrote: > we've got a gateway machine which is connected to the internet via > ethernet and is connected with our KVM VMs-providing cloud > infrastructure via IB. > There must have been a race with softirqs. We've got a custom kernel > module ("xt_ETHOIP6_gw") which handles the Ethernet<>IB. Not sure why you are counting on a race. The dev_watchdog means that the netdev has been stuck with a full transmit queue for a long time (timescale of seconds). Usually this means completions aren't happening or aren't being reaped for some reason. Without really looking at your module code, it's hard to guess what the issue might be (and indeed you may just be triggering some existing bug). > The trace looks like that it caused the kernel trace together with the > tun driver. What does the "(O)" mean? "(O)" means the module with the flag is an out-of-tree module. - R. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] RDMA/ucma.c: Different fix for ucma context uid=0, causing iWarp RDMA applications to fail in connection establishment
> > Roland, there's a race here where ucma_set_event_context() copies ctx->uid > > to > the event structure outside of the mutex. Once the mutex is acquired, > ctx->uid > is checked. However, the uid could have changed between saving it off to the > event and checking it. > > OK. So then this patch, which moves the mutex acquire up to cover > ucma_set_event_context() seems like a sensible fix? yes -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] RDMA/ucma.c: Different fix for ucma context uid=0, causing iWarp RDMA applications to fail in connection establishment
On Sat, Aug 4, 2012 at 11:48 PM, Hefty, Sean wrote: > Roland, there's a race here where ucma_set_event_context() copies ctx->uid to > the event structure outside of the mutex. Once the mutex is acquired, > ctx->uid is checked. However, the uid could have changed between saving it > off to the event and checking it. OK. So then this patch, which moves the mutex acquire up to cover ucma_set_event_context() seems like a sensible fix? - R. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] IB/mlx4: check iboe netdev pointer before dereferencing it
Unlike other parts of the mlx4_ib code, the function build_mlx_header() doesn't check if the iboe netdev of the given port is valid before derefering it, which can cause a crash if the ethernet interface has already been taken down. This patch fixes the problem by checking for a valid netdev pointer before using it to get the port MAC address. Signed-off-by: Kleber Sacilotto de Souza --- drivers/infiniband/hw/mlx4/qp.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index a6d8ea0..f585edd 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -1407,6 +1407,7 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr, struct mlx4_wqe_mlx_seg *mlx = wqe; struct mlx4_wqe_inline_seg *inl = wqe + sizeof *mlx; struct mlx4_ib_ah *ah = to_mah(wr->wr.ud.ah); + struct net_device *ndev; union ib_gid sgid; u16 pkey; int send_size; @@ -1483,7 +1484,10 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr, memcpy(sqp->ud_header.eth.dmac_h, ah->av.eth.mac, 6); /* FIXME: cache smac value? */ - smac = to_mdev(sqp->qp.ibqp.device)->iboe.netdevs[sqp->qp.port - 1]->dev_addr; + ndev = to_mdev(sqp->qp.ibqp.device)->iboe.netdevs[sqp->qp.port - 1]; + if (!ndev) + return -ENODEV; + smac = ndev->dev_addr; memcpy(sqp->ud_header.eth.smac_h, smac, 6); if (!memcmp(sqp->ud_header.eth.smac_h, sqp->ud_header.eth.dmac_h, 6)) mlx->flags |= cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] ibsim/sim_mad.c: Add read/reset functions for optional performance attributes.
Add functions to read/reset optional performance counters detailed in IB Arch Release 1.2.1 16.1.4.[1-8]. Signed-off-by: Perry Huang --- ibsim/sim_mad.c | 502 ++- 1 files changed, 500 insertions(+), 2 deletions(-) diff --git a/ibsim/sim_mad.c b/ibsim/sim_mad.c index 61d4866..d1aaa65 100644 --- a/ibsim/sim_mad.c +++ b/ibsim/sim_mad.c @@ -58,8 +58,11 @@ typedef int (Smpfn) (Port * port, unsigned op, uint32_t mod, uint8_t * data); typedef int (EncodeTrapfn) (Port * port, char *data); static Smpfn do_nodeinfo, do_nodedesc, do_switchinfo, do_portinfo, -do_linearforwtbl, do_multicastforwtbl, do_portcounters, do_extcounters, -do_pkeytbl, do_sl2vl, do_vlarb, do_guidinfo, do_cpi; +do_linearforwtbl, do_multicastforwtbl, do_portcounters, do_extcounters, +do_rcv_error_details, do_xmit_discard_details, do_op_rcv_counters, +do_flow_ctl_counters, do_vl_op_packets, do_vl_op_data, +do_vl_xmit_flow_ctl_update_errors, do_vl_xmit_wait_counters, do_pkeytbl, +do_sl2vl, do_vlarb, do_guidinfo, do_cpi; static EncodeTrapfn encode_trap128; static EncodeTrapfn encode_trap144; @@ -85,6 +88,14 @@ static Smpfn *attrs[IB_PERFORMANCE_CLASS + 1][0xff] = { [IB_GSI_PORT_COUNTERS] = do_portcounters, [IB_GSI_PORT_COUNTERS_EXT] = do_extcounters, + [IB_GSI_PORT_RCV_ERROR_DETAILS] = do_rcv_error_details, + [IB_GSI_PORT_XMIT_DISCARD_DETAILS] = do_xmit_discard_details, + [IB_GSI_PORT_PORT_OP_RCV_COUNTERS] = do_op_rcv_counters, + [IB_GSI_PORT_PORT_FLOW_CTL_COUNTERS] = do_flow_ctl_counters, + [IB_GSI_PORT_PORT_VL_OP_PACKETS] = do_vl_op_packets, + [IB_GSI_PORT_PORT_VL_OP_DATA] = do_vl_op_data, + [IB_GSI_PORT_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS] = do_vl_xmit_flow_ctl_update_errors, + [IB_GSI_PORT_PORT_VL_XMIT_WAIT_COUNTERS] = do_vl_xmit_wait_counters, [IB_GSI_ATTR_LAST] 0, }, }; @@ -103,6 +114,10 @@ extern Port **lids; extern int netnodes, netports, netswitches; extern int maxlinearcap; +typedef void (*pc_reset_function)(Portcounters * pc, unsigned mask); +typedef void (*pc_get_function)(Portcounters * pc, uint8_t * data); +typedef void (*pc_sum_function)(Portcounters * totals, Portcounters * pc); + static uint64_t update_trid(uint8_t *mad, unsigned response, Client *cl) { uint64_t trid = mad_get_field64(mad, 0, IB_MAD_TRID_F); @@ -856,6 +871,489 @@ do_extcounters(Port * port, unsigned op, uint32_t unused, uint8_t * data) return 0; } +static int do_portcounters_common(Port * port, unsigned op, uint32_t unused, uint8_t * data, + pc_reset_function pc_reset_ptr, pc_get_function pc_get_ptr, pc_sum_function pc_sum_ptr) +{ + Node *node = port->node; + unsigned portnum; + Portcounters totals; + unsigned mask; + Port *p; + int i; + + portnum = mad_get_field(data, 0, IB_PC_PORT_SELECT_F); + if (node->type != SWITCH_NODE && portnum != port->portnum) + return ERR_BAD_PARAM; + + if (node->type == SWITCH_NODE && portnum > node->numports + && portnum != 0xff) + return ERR_BAD_PARAM; + + DEBUG("in node %" PRIx64 " port %" PRIx64 " portnum %u", + node->nodeguid, port->portguid, portnum); + + mask = mad_get_field(data, 0, IB_PC_COUNTER_SELECT_F); + + if (portnum != 0xff) { + if (!(p = node_get_port(node, portnum))) + return ERR_BAD_PARAM; + if (op == IB_MAD_METHOD_SET) + pc_reset_ptr(&p->portcounters, mask); + pc_get_ptr(&p->portcounters, data); + return 0; + } + + memset(&totals, 0, sizeof totals); + + for (i = 0; i <= node->numports; i++) { + if (!(p = node_get_port(node, i))) + return ERR_BAD_PARAM; + if (op == IB_MAD_METHOD_SET) + pc_reset_ptr(&p->portcounters, mask); + pc_sum_ptr(&totals, &p->portcounters); + } + + pc_get_ptr(&totals, data); + return 0; +} + +static void pc_rcv_error_details_get(Portcounters * pc, uint8_t * data) +{ + mad_set_field(data, 0, IB_PC_RCV_LOCAL_PHY_ERR_F, + pc->rcv_error_details.PortLocalPhysicalErrors); + mad_set_field(data, 0, IB_PC_RCV_MALFORMED_PKT_ERR_F, + pc->rcv_error_details.PortMalformedPacketErrors); + mad_set_field(data, 0, IB_PC_RCV_BUF_OVR_ERR_F, + pc->rcv_error_details.PortBufferOverrunErrors); + mad_set_field(data, 0, IB_PC_RCV_DLID_MAP_ERR_F, + pc->rcv_error_details.PortDLIDMappingErrors); + mad_set_fiel
[PATCH 1/2] ibsim/sim.h: Add support for optional performance attributes.
Add support for optional performance counters detailed in IB Arch Release 1.2.1 16.1.4.[1-8]. Does not include congestion attributes. Signed-off-by: Perry Huang --- ibsim/sim.h | 89 +++ 1 files changed, 89 insertions(+), 0 deletions(-) diff --git a/ibsim/sim.h b/ibsim/sim.h index 5a8a92f..a28e8b0 100644 --- a/ibsim/sim.h +++ b/ibsim/sim.h @@ -125,6 +125,35 @@ enum GS_PC_EXT_SELECT_MASK { GS_PC_EXT_MCAST_RECV = 1 << 7, }; +enum RCV_ERROR_DETAILS_COUNTER_SELECT_MASK { + GS_PERF_LOCAL_PHYSICAL_ERRORS_MASK = (1UL << 0), // PortLocalPhysicalErrors + GS_PERF_MALFORMED_PACKET_ERRORS_MASK = (1UL << 1), // PortMalformedPacketErrors + GS_PERF_BUFFER_OVERRUN_ERRORS_MASK = (1UL << 2), // PortBufferOverrunErrors + GS_PERF_DLID_MAPPING_ERRORS_MASK = (1UL << 3), // PortDLIDMappingErrors + GS_PERF_VL_MAPPING_ERRORS_MASK = (1UL << 4), // PortVLMappingErrors + GS_PERF_LOOPING_ERRORS_MASK = (1UL << 5), // PortLoopingErrors +}; + +enum XMIT_DISCARD_DETAILS_SELECT_MASK { + GS_PERF_INACTIVE_DISCARDS_MASK = (1UL << 0), // PortInactiveDiscards + GS_PERF_NEIGHBOR_MTU_DISCARDS_MASK = (1UL << 1), // PortNeighborMTUDiscards + GS_PERF_SW_LIFETIME_LIMIT_DISCARDS_MASK = (1UL << 2), // PortSwLifetimeLimitDiscards + GS_PERF_SW_HOQ_LIFETIME_LIMIT_DISCARDS_MASK = (1UL << 3), // PortSwHOQLifetimeLimitDiscards +}; + +enum OP_RCV_COUNTERS_SELECT_MASK { + GS_PERF_OP_RCV_PKTS_MASK = (1UL << 0), // PortOpRcvPkts + GS_PERF_OP_RCV_DATA_MASK = (1UL << 1), // PortOpRcvData +}; + +enum FLOW_CTL_COUNTERS_SELECT_MASK { + GS_PERF_XMIT_FLOW_PKTS_MASK = (1UL << 0), // PortXmitFlowPkts + GS_PERF_RCV_FLOW_PKTS_MASK = (1UL << 1), // PortRcvFlowPkts +}; + +/* Counter select bit masks for PortVLOpPackets[0-15], PortVLOpData[0-15], +and PortVLXmitWaitCounters[0-15] are ommitted due to redundency. */ + enum GS_PERF_COUNTER_SELECT_LIMIT { GS_PERF_ERR_SYM_LIMIT = 0x, GS_PERF_LINK_RECOVERS_LIMIT = 0xff, @@ -143,6 +172,24 @@ enum GS_PERF_COUNTER_SELECT_LIMIT { GS_PERF_XMT_PKTS_LIMIT = 0x, GS_PERF_RCV_PKTS_LIMIT = 0x, GS_PERF_XMT_WAIT_LIMIT = 0x, + GS_PERF_LOCAL_PHYSICAL_ERRORS_LIMIT = 0x, // PortLocalPhysicalErrors + GS_PERF_MALFORMED_PACKET_ERRORS_LIMIT = 0x, // PortMalformedPacketErrors + GS_PERF_BUFFER_OVERRUN_ERRORS_LIMIT = 0x, // PortBufferOverrunErrors + GS_PERF_DLID_MAPPING_ERRORS_LIMIT = 0x, // PortDLIDMappingErrors + GS_PERF_VL_MAPPING_ERRORS_LIMIT = 0x, // PortVLMappingErrors + GS_PERF_LOOPING_ERRORS_LIMIT = 0x, // PortLoopingErrors + GS_PERF_INACTIVE_DISCARDS_LIMIT = 0x, // PortInactiveDiscards + GS_PERF_NEIGHBOR_MTU_DISCARDS_LIMIT = 0x, // PortNeighborMTUDiscards + GS_PERF_SW_LIFETIME_LIMIT_DISCARDS_LIMIT = 0x, // PortSwLifetimeLimitDiscards + GS_PERF_SW_HOQ_LIFETIME_LIMIT_DISCARDS_LIMIT = 0x, // PortSwHOQLifetimeLimitDiscards + GS_PERF_OP_RCV_PKTS_LIMIT = 0x, // PortOpRcvPkts + GS_PERF_OP_RCV_DATA_LIMIT = 0x, // PortOpRcvData + GS_PERF_XMIT_FLOW_PKTS_LIMIT = 0x, // PortXmitFlowPkts + GS_PERF_RCV_FLOW_PKTS_LIMIT = 0x, // PortRcvFlowPkts + GS_PERF_VL_OP_PACKETS_LIMIT = 0x, // PortVLOpPackets[0-15] + GS_PERF_VL_OP_DATA_LIMIT = 0x, // PortVLOpData[0-15] + GS_PERF_VL_XMIT_FLOW_CTL_UPDATE_ERRORS = 0x3, // PortVLXmitFlowCtlUpdateErrors[0-15] + GS_PERF_VL_XMIT_WAIT_COUNTERS_LIMIT = 0x, // PortVLXmitWaitCounters[0-15] }; typedef struct Port Port; @@ -185,6 +232,48 @@ struct Portcounters { uint16_t errs_rcvswitchrelay; uint8_t errs_excessbufovrrun; uint32_t xmt_wait; + + struct PortRcvErrorDetails { + uint16_t PortLocalPhysicalErrors; + uint16_t PortMalformedPacketErrors; + uint16_t PortBufferOverrunErrors; + uint16_t PortDLIDMappingErrors; + uint16_t PortVLMappingErrors; + uint16_t PortLoopingErrors; + } rcv_error_details; + + struct PortXmitDiscardDetails { + uint16_t PortInactiveDiscards; + uint16_t PortNeighborMTUDiscards; + uint16_t PortSwLifetimeLimitDiscards; + uint16_t PortSwHOQLifetimeLimitDiscards; + } xmit_discard_details; + + struct PortOpRcvCounters { + uint32_t PortOpRcvPkts; + uint32_t PortOpRcvData; + } op_rcv_counters; + + struct PortFlowCtlCounters { + uint32_t PortXmitFlowPkts; + uint32_t PortRcvFlowPkts; + } flow_ctl_counters; + + struct PortVLOpPackets { + uint16_t PortVLOpPackets[16]; + } vl_op_packets; + + struct PortVLOpData { + uint32_t PortVLOpData[16]; + } vl_op_data; + + struct Port
IB softirq race
Hi Roland, we've got a gateway machine which is connected to the internet via ethernet and is connected with our KVM VMs-providing cloud infrastructure via IB. There must have been a race with softirqs. We've got a custom kernel module ("xt_ETHOIP6_gw") which handles the Ethernet<>IB. The trace looks like that it caused the kernel trace together with the tun driver. What does the "(O)" mean? Should we look at our kernel module for better locking? What are the common data structures with which races can occur? Something with the connection manager? Cheers, Sebastian WARNING: at net/sched/sch_generic.c:255 dev_watchdog+0x22c/0x240() Hardware name: H8DGU NETDEV WATCHDOG: ib0 (mlx4_core): transmit queue 0 timed out Modules linked in: ipt_LOG xt_ETHOIP6_gw(O) ip6table_mangle iptable_mangle ip6table_filter ip6_tables tun(O) bridge stp llc rdma_ucm rdma_cm iw_cm ib_addr ib_ipoib ib_cm ib_sa ib_uverbs ib_umad ib_qib mlx4_ib xt_multiport iptable_filter ip_tables x_tables ib_mthca ib_mad ib_core kvm_amd kvm psmouse tpm_tis tpm tpm_bios amd64_edac_mod i2c_piix4 edac_core serio_raw evdev edac_mce_amd button processor thermal_sys mlx4_en sg usb_storage mlx4_core ixgbe dca mdio [last unloaded: scsi_wait_scan] Pid: 3, comm: ksoftirqd/0 Tainted: G O 3.2.8-gw #1 Call Trace: [] ? warn_slowpath_common+0x7b/0xc0 [] ? warn_slowpath_fmt+0x45/0x50 [] ? mod_timer+0x153/0x2a0 [] ? dev_watchdog+0x22c/0x240 [] ? run_timer_softirq+0x158/0x360 [] ? __netdev_watchdog_up+0x70/0x70 [] ? __schedule+0x2ea/0x7e0 [] ? __do_softirq+0xb1/0x1e0 [] ? run_ksoftirqd+0xb1/0x160 [] ? __do_softirq+0x1e0/0x1e0 [] ? __do_softirq+0x1e0/0x1e0 [] ? kthread+0x96/0xa0 [] ? kernel_thread_helper+0x4/0x10 [] ? kthread_worker_fn+0x180/0x180 [] ? gs_change+0x13/0x13 ---[ end trace a4ac921bb1a9d647 ]--- ib0: transmit timeout: latency 1770 msecs ib0: queue stopped 1, tx_head 39614, tx_tail 39614 -- Sebastian Riemer Linux Kernel Developer ProfitBricks GmbH • Greifswalder Str. 207 • 10405 Berlin, Germany www.profitbricks.com • sebastian.rie...@profitbricks.com Tel.: +49 - 30 - 60 98 56 991 - 915 Sitz der Gesellschaft: Berlin Registergericht: Amtsgericht Charlottenburg, HRB 125506 B Geschäftsführer: Andreas Gauger, Achim Weiss -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] RDMA/ocrdma: Fixed CONFIG_VLAN_8021Q.
Fixed avoiding checking real vlan dev in scenario when VLAN is disabled and ipv6 is enabled. Signed-off-by: Parav Pandit --- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 16 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 5a04452..7146ffd 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c @@ -161,7 +161,7 @@ static void ocrdma_add_default_sgid(struct ocrdma_dev *dev) ocrdma_get_guid(dev, &sgid->raw[8]); } -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) +#if IS_ENABLED(CONFIG_VLAN_8021Q) || IS_ENABLED(CONFIG_VLAN_8021Q_MODULE) static void ocrdma_add_vlan_sgids(struct ocrdma_dev *dev) { struct net_device *netdev, *tmp; @@ -202,8 +202,16 @@ static int ocrdma_build_sgid_tbl(struct ocrdma_dev *dev) return 0; } -#if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_VLAN_8021Q) +static struct net_device *ocrdma_get_real_netdev(struct net_device *netdev) +{ +#if IS_ENABLED(CONFIG_VLAN_8021Q) || IS_ENABLED(CONFIG_VLAN_8021Q_MODULE) + return vlan_dev_real_dev(netdev); +#else + return netdev; +#endif +} +#if IS_ENABLED(CONFIG_IPV6) static int ocrdma_inet6addr_event(struct notifier_block *notifier, unsigned long event, void *ptr) { @@ -217,7 +225,7 @@ static int ocrdma_inet6addr_event(struct notifier_block *notifier, bool is_vlan = false; u16 vid = 0; - netdev = vlan_dev_real_dev(event_netdev); + netdev = ocrdma_get_real_netdev(event_netdev); if (netdev != event_netdev) { is_vlan = true; vid = vlan_dev_vlan_id(event_netdev); @@ -262,7 +270,7 @@ static struct notifier_block ocrdma_inet6addr_notifier = { .notifier_call = ocrdma_inet6addr_event }; -#endif /* IPV6 and VLAN */ +#endif /* IPV6 */ static enum rdma_link_layer ocrdma_link_layer(struct ib_device *device, u8 port_num) -- 1.6.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: BUG: RDMA/ocrdma calls invalid vlan_dev_real_dev()
I'll provide you fix in short while. Parav > -Original Message- > From: Fengguang Wu [mailto:fengguang...@intel.com] > Sent: Friday, August 10, 2012 5:39 AM > To: Roland Dreier > Cc: linux-rdma@vger.kernel.org; Pandit, Parav; Sean Hefty; linux- > ker...@vger.kernel.org > Subject: Re: BUG: RDMA/ocrdma calls invalid vlan_dev_real_dev() > > On Thu, Aug 09, 2012 at 04:54:37PM -0700, Roland Dreier wrote: > > thanks for the report. I assume the system doesn't actually have ocrdma > hw? > > Yeah, it's a test boot inside KVM. > > Thanks, > Fengguang > > > - R. > > On Aug 9, 2012 3:00 AM, "Fengguang Wu" > wrote: > > > > > Hi Parav, > > > > > > commit fe2caefcdf ("RDMA/ocrdma: Add driver for Emulex OneConnect > > > IBoE RDMA adapter") triggers the below kernel BUG for the attached > config. > > > > > > [ 280.861196] kernel BUG at > > > /c/kernel-tests/src/stable/include/linux/if_vlan.h:113! > > > [ 280.861196] invalid opcode: [#1] PREEMPT [ 280.861196] CPU > > > 0 [ 280.861196] Pid: 304, comm: ip Not tainted 3.6.0-rc1 #1 Bochs > > > Bochs [ 280.861196] RIP: 0010:[] > > > [] > > > ocrdma_inet6addr_event+0x4/0x6 > > > [ 280.861196] RSP: 0018:8800066a1548 EFLAGS: 0202 [ > > > 280.861196] RAX: 0001 RBX: RCX: > > > > > > [ 280.861196] RDX: 880006b6b400 RSI: 0001 RDI: > > > 8207ecc0 > > > [ 280.861196] RBP: 8800066a1548 R08: R09: > > > 8109b657 > > > [ 280.861196] R10: R11: 81e0f318 R12: > > > > > > [ 280.861196] R13: 8207ecc0 R14: R15: > > > > > > [ 280.861196] FS: 7f025c12f700() GS:81dfb000() > > > knlGS: > > > [ 280.861196] CS: 0010 DS: ES: CR0: 8005003b [ > > > 280.861196] CR2: 7fe4e1d3 CR3: 06b65000 CR4: > > > 06b0 > > > [ 280.861196] DR0: DR1: DR2: > > > > > > [ 280.861196] DR3: DR6: DR7: > > > > > > [ 280.861196] Process ip (pid: 304, threadinfo 8800066a, > > > task > > > 880006a7c2c0) > > > [ 280.861196] Stack: > > > [ 280.861196] 8800066a1598 8109b5a2 880006b6b400 > > > 0001 > > > [ 280.861196] 8800066a1598 0001 880006b6b400 > > > [ 280.861196] 820ad9b0 > > > 8800066a15f8 > > > 8109b6b7 > > > [ 280.861196] Call Trace: > > > [ 280.861196] [] notifier_call_chain+0x60/0x90 [ > > > 280.861196] [] > > > __atomic_notifier_call_chain+0x60/0x92 > > > [ 280.861196] [] ? > > > atomic_notifier_chain_unregister+0x46/0x46 > > > [ 280.861196] [] > > > atomic_notifier_call_chain+0xf/0x11 > > > [ 280.861196] [] ipv6_add_addr+0x333/0x388 [ > > > 280.861196] [] ? ipv6_add_addr+0x55/0x388 [ > > > 280.861196] [] add_addr+0x12/0x5c [ 280.861196] > > > [] init_loopback+0x7b/0x7f [ 280.861196] > > > [] addrconf_notify+0x178/0x2d4 [ 280.861196] > > > [] notifier_call_chain+0x60/0x90 [ 280.861196] > > > [] __raw_notifier_call_chain+0x9/0xb [ > > > 280.861196] [] raw_notifier_call_chain+0xf/0x11 [ > > > 280.861196] [] call_netdevice_notifiers+0x45/0x4a > > > [ 280.861196] [] __dev_notify_flags+0x32/0x56 [ > > > 280.861196] [] dev_change_flags+0x43/0x4e [ > > > 280.861196] [] do_setlink+0x2da/0x7f6 [ > > > 280.861196] [] ? native_sched_clock+0x38/0x68 [ > > > 280.861196] [] ? sched_clock+0x9/0xd [ > > > 280.861196] [] ? > > > sched_clock_local.constprop.2+0xd/0x78 > > > [ 280.861196] [] ? sched_clock_cpu+0x7b/0x89 [ > > > 280.861196] [] rtnl_newlink+0x264/0x438 [ > > > 280.861196] [] ? rtnl_newlink+0xba/0x438 [ > > > 280.861196] [] ? avc_has_perm_noaudit+0xd1/0xe3 [ > > > 280.861196] [] ? avc_has_perm_noaudit+0x22/0xe3 [ > > > 280.861196] [] rtnetlink_rcv_msg+0x22c/0x23b [ > > > 280.861196] [] ? rtnl_lock+0x12/0x14 [ > > > 280.861196] [] ? __rtnl_unlock+0x12/0x12 [ > > > 280.861196] [] netlink_rcv_skb+0x3d/0x8a [ > > > 280.861196] [] rtnetlink_rcv+0x21/0x28 [ > > > 280.861196] [] netlink_unicast+0x12c/0x1b8 [ > > > 280.861196] [] netlink_sendmsg+0x212/0x29a [ > > > 280.861196] [] sock_sendmsg+0x9e/0xbf [ > > > 280.861196] [] __sys_sendmsg+0x248/0x2d5 [ > > > 280.861196] [] ? _raw_spin_unlock_irq+0x34/0x50 [ > > > 280.861196] [] ? > > > finish_task_switch.constprop.48+0x72/0xd9 > > > [ 280.861196] [] ? > > > finish_task_switch.constprop.48+0x34/0xd9 > > > [ 280.861196] [] ? __schedule+0x501/0x607 [ > > > 280.861196] [] ? put_lock_stats.isra.17+0xe/0x28 > > > [ 280.861196] [] ? > > > lock_release_holdtime+0xcd/0xd5 [ 280.861196] [] > > > sys_sendmsg+0x3d/0x5e [ 280.861196] [] > > > system_call_fastpath+0x16/0x1b [ 280.861196] Code: 00 00 ad de 48 > > > 89 93 a8 0b 00 00 e8 c9 2f 2e 00 48 8d bb b0 0b 00 00 48 c7 c6 86 f0 > > > 6d 81 e8 b0 b2 9e ff 59 5b 5d c3 55 48