net/txgbe: fix queue statistics mapping
[dpdk.git] / drivers / net / virtio / virtqueue.h
index 4f3dd31..99c68cf 100644 (file)
@@ -201,11 +201,33 @@ struct virtio_net_ctrl_mac {
 #define VIRTIO_NET_CTRL_VLAN_ADD 0
 #define VIRTIO_NET_CTRL_VLAN_DEL 1
 
+/**
+ * RSS control
+ *
+ * The RSS feature configuration message is sent by the driver when
+ * VIRTIO_NET_F_RSS has been negotiated. It provides the device with
+ * hash types to use, hash key and indirection table. In this
+ * implementation, the driver only supports fixed key length (40B)
+ * and indirection table size (128 entries).
+ */
+#define VIRTIO_NET_RSS_RETA_SIZE 128
+#define VIRTIO_NET_RSS_KEY_SIZE 40
+
+struct virtio_net_ctrl_rss {
+       uint32_t hash_types;
+       uint16_t indirection_table_mask;
+       uint16_t unclassified_queue;
+       uint16_t indirection_table[VIRTIO_NET_RSS_RETA_SIZE];
+       uint16_t max_tx_vq;
+       uint8_t hash_key_length;
+       uint8_t hash_key_data[VIRTIO_NET_RSS_KEY_SIZE];
+};
+
 /*
  * Control link announce acknowledgement
  *
  * The command VIRTIO_NET_CTRL_ANNOUNCE_ACK is used to indicate that
- * driver has recevied the notification; device would clear the
+ * driver has received the notification; device would clear the
  * VIRTIO_NET_S_ANNOUNCE bit in the status field after it receives
  * this command.
  */
@@ -290,9 +312,12 @@ struct virtqueue {
        struct vq_desc_extra vq_descx[0];
 };
 
-/* If multiqueue is provided by host, then we suppport it. */
+/* If multiqueue is provided by host, then we support it. */
 #define VIRTIO_NET_CTRL_MQ   4
+
 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET        0
+#define VIRTIO_NET_CTRL_MQ_RSS_CONFIG          1
+
 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN        1
 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX        0x8000
 
@@ -639,21 +664,21 @@ virtqueue_notify(struct virtqueue *vq)
 static inline void
 virtqueue_xmit_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *cookie)
 {
-       uint64_t csum_l4 = cookie->ol_flags & PKT_TX_L4_MASK;
-       uint16_t o_l23_len = (cookie->ol_flags & PKT_TX_TUNNEL_MASK) ?
+       uint64_t csum_l4 = cookie->ol_flags & RTE_MBUF_F_TX_L4_MASK;
+       uint16_t o_l23_len = (cookie->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) ?
                             cookie->outer_l2_len + cookie->outer_l3_len : 0;
 
-       if (cookie->ol_flags & PKT_TX_TCP_SEG)
-               csum_l4 |= PKT_TX_TCP_CKSUM;
+       if (cookie->ol_flags & RTE_MBUF_F_TX_TCP_SEG)
+               csum_l4 |= RTE_MBUF_F_TX_TCP_CKSUM;
 
        switch (csum_l4) {
-       case PKT_TX_UDP_CKSUM:
+       case RTE_MBUF_F_TX_UDP_CKSUM:
                hdr->csum_start = o_l23_len + cookie->l2_len + cookie->l3_len;
                hdr->csum_offset = offsetof(struct rte_udp_hdr, dgram_cksum);
                hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
                break;
 
-       case PKT_TX_TCP_CKSUM:
+       case RTE_MBUF_F_TX_TCP_CKSUM:
                hdr->csum_start = o_l23_len + cookie->l2_len + cookie->l3_len;
                hdr->csum_offset = offsetof(struct rte_tcp_hdr, cksum);
                hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
@@ -667,8 +692,8 @@ virtqueue_xmit_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *cookie)
        }
 
        /* TCP Segmentation Offload */
-       if (cookie->ol_flags & PKT_TX_TCP_SEG) {
-               hdr->gso_type = (cookie->ol_flags & PKT_TX_IPV6) ?
+       if (cookie->ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
+               hdr->gso_type = (cookie->ol_flags & RTE_MBUF_F_TX_IPV6) ?
                        VIRTIO_NET_HDR_GSO_TCPV6 :
                        VIRTIO_NET_HDR_GSO_TCPV4;
                hdr->gso_size = cookie->tso_segsz;