summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/eoib.c
diff options
context:
space:
mode:
authorMichael Brown2016-03-09 01:40:38 +0100
committerMichael Brown2016-03-09 09:43:40 +0100
commitecd93cfc116dd95864634b837e2b8dff09ae5dce (patch)
treeb2c56c9cc6903747b9de41ccfaceed51af72a4c5 /src/drivers/net/eoib.c
parent[eoib] Add Ethernet over Infiniband (EoIB) driver (diff)
downloadipxe-ecd93cfc116dd95864634b837e2b8dff09ae5dce.tar.gz
ipxe-ecd93cfc116dd95864634b837e2b8dff09ae5dce.tar.xz
ipxe-ecd93cfc116dd95864634b837e2b8dff09ae5dce.zip
[eoib] Silently ignore EoIB heartbeat packets
Some EoIB implementations transmit a vendor-proprietary heartbeat packet on the same multicast group used to provide the EoIB broadcast domain. Silently ignore these heartbeat packets, to avoid cluttering up the network interface error statistics. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/eoib.c')
-rw-r--r--src/drivers/net/eoib.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/drivers/net/eoib.c b/src/drivers/net/eoib.c
index c5b2f5c7..44eed4cc 100644
--- a/src/drivers/net/eoib.c
+++ b/src/drivers/net/eoib.c
@@ -752,3 +752,48 @@ struct ib_driver eoib_driver __ib_driver = {
.notify = eoib_notify,
.remove = eoib_remove,
};
+
+/****************************************************************************
+ *
+ * EoIB heartbeat packets
+ *
+ ****************************************************************************
+ */
+
+/**
+ * Silently ignore incoming EoIB heartbeat packets
+ *
+ * @v iobuf I/O buffer
+ * @v netdev Network device
+ * @v ll_source Link-layer source address
+ * @v flags Packet flags
+ * @ret rc Return status code
+ */
+static int eoib_heartbeat_rx ( struct io_buffer *iobuf,
+ struct net_device *netdev __unused,
+ const void *ll_dest __unused,
+ const void *ll_source __unused,
+ unsigned int flags __unused ) {
+ free_iob ( iobuf );
+ return 0;
+}
+
+/**
+ * Transcribe EoIB heartbeat address
+ *
+ * @v net_addr EoIB heartbeat address
+ * @ret string "<EoIB>"
+ *
+ * This operation is meaningless for the EoIB heartbeat protocol.
+ */
+static const char * eoib_heartbeat_ntoa ( const void *net_addr __unused ) {
+ return "<EoIB>";
+}
+
+/** EoIB heartbeat network protocol */
+struct net_protocol eoib_heartbeat_protocol __net_protocol = {
+ .name = "EoIB",
+ .net_proto = htons ( EOIB_MAGIC ),
+ .rx = eoib_heartbeat_rx,
+ .ntoa = eoib_heartbeat_ntoa,
+};