]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/ulp/ipoib/ipoib.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6-omap-h63xx.git] / drivers / infiniband / ulp / ipoib / ipoib.h
index f9b7caa541439666e4379b1c8b2cff00c60ed181..9044f8803532e035e264e2b166644b05d84563e4 100644 (file)
 /* constants */
 
 enum {
-       IPOIB_PACKET_SIZE         = 2048,
-       IPOIB_BUF_SIZE            = IPOIB_PACKET_SIZE + IB_GRH_BYTES,
-
        IPOIB_ENCAP_LEN           = 4,
 
+       IPOIB_UD_HEAD_SIZE        = IB_GRH_BYTES + IPOIB_ENCAP_LEN,
+       IPOIB_UD_RX_SG            = 2, /* max buffer needed for 4K mtu */
+
        IPOIB_CM_MTU              = 0x10000 - 0x10, /* padding to align header to 16 */
        IPOIB_CM_BUF_SIZE         = IPOIB_CM_MTU  + IPOIB_ENCAP_LEN,
        IPOIB_CM_HEAD_SIZE        = IPOIB_CM_BUF_SIZE % PAGE_SIZE,
@@ -87,6 +87,7 @@ enum {
        IPOIB_MCAST_STARTED       = 8,
        IPOIB_FLAG_ADMIN_CM       = 9,
        IPOIB_FLAG_UMCAST         = 10,
+       IPOIB_FLAG_CSUM           = 11,
 
        IPOIB_MAX_BACKOFF_SECONDS = 16,
 
@@ -94,6 +95,8 @@ enum {
        IPOIB_MCAST_FLAG_SENDONLY = 1,
        IPOIB_MCAST_FLAG_BUSY     = 2,  /* joining or already joined */
        IPOIB_MCAST_FLAG_ATTACHED = 3,
+
+       MAX_SEND_CQE              = 16,
 };
 
 #define        IPOIB_OP_RECV   (1ul << 31)
@@ -138,7 +141,7 @@ struct ipoib_mcast {
 
 struct ipoib_rx_buf {
        struct sk_buff *skb;
-       u64             mapping;
+       u64             mapping[IPOIB_UD_RX_SG];
 };
 
 struct ipoib_tx_buf {
@@ -209,7 +212,6 @@ struct ipoib_cm_tx {
        unsigned             tx_tail;
        unsigned long        flags;
        u32                  mtu;
-       struct ib_wc         ibwc[IPOIB_NUM_WC];
 };
 
 struct ipoib_cm_rx_buf {
@@ -242,6 +244,11 @@ struct ipoib_cm_dev_priv {
        int                     num_frags;
 };
 
+struct ipoib_ethtool_st {
+       u16     coalesce_usecs;
+       u16     max_coalesced_frames;
+};
+
 /*
  * Device private locking: tx_lock protects members used in TX fast
  * path (and we use LLTX so upper layers don't do extra locking).
@@ -280,7 +287,8 @@ struct ipoib_dev_priv {
        u16               pkey_index;
        struct ib_pd     *pd;
        struct ib_mr     *mr;
-       struct ib_cq     *cq;
+       struct ib_cq     *recv_cq;
+       struct ib_cq     *send_cq;
        struct ib_qp     *qp;
        u32               qkey;
 
@@ -289,6 +297,7 @@ struct ipoib_dev_priv {
 
        unsigned int admin_mtu;
        unsigned int mcast_mtu;
+       unsigned int max_ib_mtu;
 
        struct ipoib_rx_buf *rx_ring;
 
@@ -299,6 +308,10 @@ struct ipoib_dev_priv {
        struct ib_sge        tx_sge[MAX_SKB_FRAGS + 1];
        struct ib_send_wr    tx_wr;
        unsigned             tx_outstanding;
+       struct ib_wc         send_wc[MAX_SEND_CQE];
+
+       struct ib_recv_wr    rx_wr;
+       struct ib_sge        rx_sge[IPOIB_UD_RX_SG];
 
        struct ib_wc ibwc[IPOIB_NUM_WC];
 
@@ -319,6 +332,8 @@ struct ipoib_dev_priv {
        struct dentry *mcg_dentry;
        struct dentry *path_dentry;
 #endif
+       int     hca_caps;
+       struct ipoib_ethtool_st ethtool;
 };
 
 struct ipoib_ah {
@@ -359,6 +374,14 @@ struct ipoib_neigh {
        struct list_head    list;
 };
 
+#define IPOIB_UD_MTU(ib_mtu)           (ib_mtu - IPOIB_ENCAP_LEN)
+#define IPOIB_UD_BUF_SIZE(ib_mtu)      (ib_mtu + IB_GRH_BYTES)
+
+static inline int ipoib_ud_need_sg(unsigned int ib_mtu)
+{
+       return IPOIB_UD_BUF_SIZE(ib_mtu) > PAGE_SIZE;
+}
+
 /*
  * We stash a pointer to our private neighbour information after our
  * hardware address in neigh->ha.  The ALIGN() expression here makes
@@ -459,6 +482,8 @@ void ipoib_pkey_poll(struct work_struct *work);
 int ipoib_pkey_dev_delay_open(struct net_device *dev);
 void ipoib_drain_cq(struct net_device *dev);
 
+void ipoib_set_ethtool_ops(struct net_device *dev);
+
 #ifdef CONFIG_INFINIBAND_IPOIB_CM
 
 #define IPOIB_FLAGS_RC         0x80
@@ -641,7 +666,6 @@ static inline int ipoib_register_debugfs(void) { return 0; }
 static inline void ipoib_unregister_debugfs(void) { }
 #endif
 
-
 #define ipoib_printk(level, priv, format, arg...)      \
        printk(level "%s: " format, ((struct ipoib_dev_priv *) priv)->dev->name , ## arg)
 #define ipoib_warn(priv, format, arg...)               \