IB/hfi1: OPA_VNIC RDMA netdev support
Add support to create and free OPA_VNIC rdma netdev devices. Implement netstack interface functionality including xmit_skb, receive side NAPI etc. Also implement rdma netdev control functions. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:

committed by
Doug Ledford

parent
1bd671ab3f
commit
d4829ea603
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright(c) 2015, 2016 Intel Corporation.
|
||||
* Copyright(c) 2015-2017 Intel Corporation.
|
||||
*
|
||||
* This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
* redistributing this file, you may do so under either license.
|
||||
@@ -60,6 +60,7 @@
|
||||
#include "qp.h"
|
||||
#include "sdma.h"
|
||||
#include "debugfs.h"
|
||||
#include "vnic.h"
|
||||
|
||||
#undef pr_fmt
|
||||
#define pr_fmt(fmt) DRIVER_NAME ": " fmt
|
||||
@@ -1381,15 +1382,31 @@ int process_receive_ib(struct hfi1_packet *packet)
|
||||
return RHF_RCV_CONTINUE;
|
||||
}
|
||||
|
||||
static inline bool hfi1_is_vnic_packet(struct hfi1_packet *packet)
|
||||
{
|
||||
/* Packet received in VNIC context via RSM */
|
||||
if (packet->rcd->is_vnic)
|
||||
return true;
|
||||
|
||||
if ((HFI1_GET_L2_TYPE(packet->ebuf) == OPA_VNIC_L2_TYPE) &&
|
||||
(HFI1_GET_L4_TYPE(packet->ebuf) == OPA_VNIC_L4_ETHR))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int process_receive_bypass(struct hfi1_packet *packet)
|
||||
{
|
||||
struct hfi1_devdata *dd = packet->rcd->dd;
|
||||
|
||||
if (unlikely(rhf_err_flags(packet->rhf)))
|
||||
if (unlikely(rhf_err_flags(packet->rhf))) {
|
||||
handle_eflags(packet);
|
||||
} else if (hfi1_is_vnic_packet(packet)) {
|
||||
hfi1_vnic_bypass_rcv(packet);
|
||||
return RHF_RCV_CONTINUE;
|
||||
}
|
||||
|
||||
dd_dev_err(dd,
|
||||
"Bypass packets are not supported in normal operation. Dropping\n");
|
||||
dd_dev_err(dd, "Unsupported bypass packet. Dropping\n");
|
||||
incr_cntr64(&dd->sw_rcv_bypass_packet_errors);
|
||||
if (!(dd->err_info_rcvport.status_and_code & OPA_EI_STATUS_SMASK)) {
|
||||
u64 *flits = packet->ebuf;
|
||||
|
Reference in New Issue
Block a user