svn commit: r289598 - in head/sys/dev/ntb: if_ntb ntb_hw

Conrad E. Meyer cem at FreeBSD.org
Mon Oct 19 18:06:37 UTC 2015


Author: cem
Date: Mon Oct 19 18:06:35 2015
New Revision: 289598
URL: https://svnweb.freebsd.org/changeset/base/289598

Log:
  NTB: Add ntb_db_vector_mask() missed in r289546
  
  This is the last one.
  
  Obtained from:	Linux (Dual BSD/GPL driver)
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/dev/ntb/if_ntb/if_ntb.c
  head/sys/dev/ntb/ntb_hw/ntb_hw.c
  head/sys/dev/ntb/ntb_hw/ntb_hw.h

Modified: head/sys/dev/ntb/if_ntb/if_ntb.c
==============================================================================
--- head/sys/dev/ntb/if_ntb/if_ntb.c	Mon Oct 19 17:53:20 2015	(r289597)
+++ head/sys/dev/ntb/if_ntb/if_ntb.c	Mon Oct 19 18:06:35 2015	(r289598)
@@ -290,7 +290,7 @@ static int ntb_process_rxc(struct ntb_tr
 static void ntb_rx_copy_task(struct ntb_transport_qp *qp,
     struct ntb_queue_entry *entry, void *offset);
 static void ntb_complete_rxc(void *arg, int pending);
-static void ntb_transport_doorbell_callback(void *data, int vector);
+static void ntb_transport_doorbell_callback(void *data, uint32_t vector);
 static void ntb_transport_event_callback(void *data);
 static void ntb_transport_link_work(void *arg);
 static int ntb_set_mw(struct ntb_transport_ctx *, int num_mw, unsigned size);
@@ -1122,7 +1122,7 @@ ntb_complete_rxc(void *arg, int pending)
 }
 
 static void
-ntb_transport_doorbell_callback(void *data, int vector)
+ntb_transport_doorbell_callback(void *data, uint32_t vector)
 {
 	struct ntb_transport_ctx *nt = data;
 	struct ntb_transport_qp *qp;

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c
==============================================================================
--- head/sys/dev/ntb/ntb_hw/ntb_hw.c	Mon Oct 19 17:53:20 2015	(r289597)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw.c	Mon Oct 19 18:06:35 2015	(r289598)
@@ -2207,6 +2207,24 @@ ntb_db_valid_mask(struct ntb_softc *ntb)
 	return (ntb->db_valid_mask);
 }
 
+/*
+ * ntb_db_vector_mask() - get a mask of doorbell bits serviced by a vector
+ * @ntb:	NTB device context
+ * @vector:	Doorbell vector number
+ *
+ * Each interrupt vector may have a different number or arrangement of bits.
+ *
+ * Return: A mask of doorbell bits serviced by a vector.
+ */
+uint64_t
+ntb_db_vector_mask(struct ntb_softc *ntb, uint32_t vector)
+{
+
+	if (vector > ntb->db_vec_count)
+		return (0);
+	return (ntb->db_valid_mask & ntb_vec_mask(ntb, vector));
+}
+
 /**
  * ntb_link_is_up() - get the current ntb link state
  * @ntb:        NTB device context

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.h
==============================================================================
--- head/sys/dev/ntb/ntb_hw/ntb_hw.h	Mon Oct 19 17:53:20 2015	(r289597)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw.h	Mon Oct 19 18:06:35 2015	(r289598)
@@ -56,7 +56,7 @@ enum ntb_width {
 
 SYSCTL_DECL(_hw_ntb);
 
-typedef void (*ntb_db_callback)(void *data, int vector);
+typedef void (*ntb_db_callback)(void *data, uint32_t vector);
 typedef void (*ntb_event_callback)(void *data);
 
 struct ntb_ctx_ops {
@@ -90,13 +90,13 @@ int ntb_peer_spad_read(struct ntb_softc 
     uint32_t *val);
 
 uint64_t ntb_db_valid_mask(struct ntb_softc *);
+uint64_t ntb_db_vector_mask(struct ntb_softc *, uint32_t vector);
 bus_addr_t ntb_get_peer_db_addr(struct ntb_softc *, vm_size_t *sz_out);
 
 void ntb_db_clear(struct ntb_softc *, uint64_t bits);
 void ntb_db_clear_mask(struct ntb_softc *, uint64_t bits);
 uint64_t ntb_db_read(struct ntb_softc *);
 void ntb_db_set_mask(struct ntb_softc *, uint64_t bits);
-uint64_t ntb_db_vector_mask(struct ntb_softc *, int vector);
 void ntb_peer_db_set(struct ntb_softc *, uint64_t bits);
 
 /* Hardware owns the low 32 bits of features. */


More information about the svn-src-head mailing list