[dpdk-dev] [PATCH v6 1/5] ethdev: Added ETH_SPEED_CAP bitmap for ports

2015-11-19 Thread Marc Sune
Hi Thomas,

2015-11-01 23:11 GMT+01:00 Thomas Monjalon :

> 2015-10-25 22:59, Marc Sune:
> > +#define ETH_SPEED_CAP_NOT_PHY(0)  /*< No phy media > */
> > +#define ETH_SPEED_CAP_10M_HD (1 << 0)  /*< 10 Mbps half-duplex> */
> > +#define ETH_SPEED_CAP_10M_FD (1 << 1)  /*< 10 Mbps full-duplex> */
> > +#define ETH_SPEED_CAP_100M_HD(1 << 2)  /*< 100 Mbps
> half-duplex> */
> > +#define ETH_SPEED_CAP_100M_FD(1 << 3)  /*< 100 Mbps
> full-duplex> */
> > +#define ETH_SPEED_CAP_1G (1 << 4)  /*< 1 Gbps > */
> > +#define ETH_SPEED_CAP_2_5G   (1 << 5)  /*< 2.5 Gbps > */
> > +#define ETH_SPEED_CAP_5G (1 << 6)  /*< 5 Gbps > */
> > +#define ETH_SPEED_CAP_10G(1 << 7)  /*< 10 Mbps > */
> > +#define ETH_SPEED_CAP_20G(1 << 8)  /*< 20 Gbps > */
> > +#define ETH_SPEED_CAP_25G(1 << 9)  /*< 25 Gbps > */
> > +#define ETH_SPEED_CAP_40G(1 << 10)  /*< 40 Gbps > */
> > +#define ETH_SPEED_CAP_50G(1 << 11)  /*< 50 Gbps > */
> > +#define ETH_SPEED_CAP_56G(1 << 12)  /*< 56 Gbps > */
> > +#define ETH_SPEED_CAP_100G   (1 << 13)  /*< 100 Gbps > */
>
> In the patch 3, you rename this flags. It would be easier to understand if
> the right names were used in the first patch.
>
> > @@ -837,6 +860,7 @@ struct rte_eth_dev_info {
> >   uint16_t vmdq_queue_base; /**< First queue ID for VMDQ pools. */
> >   uint16_t vmdq_queue_num;  /**< Queue number for VMDQ pools. */
> >   uint16_t vmdq_pool_base;  /**< First ID of VMDQ pools. */
> > + uint32_t speed_capa;  /**< Supported speeds bitmap
> (ETH_SPEED_CAP_). */
>
> When renaming ETH_SPEED_CAP, this line is not changed later.
>

This is made in purpose.

In patch 3/5 the bitmap speeds are renamed to ETH_LINK_SPEED_XXX and
numeric values are moved ETH_SPEED_NUM_XXX, to make clear the difference. I
cannot, in this commit, rename them directly to ETH_LINK_SPEED_XXX since
they would collide with the current numeric speeds.

Thanks
Marc


[dpdk-dev] [PATCH v6 1/5] ethdev: Added ETH_SPEED_CAP bitmap for ports

2015-11-01 Thread Thomas Monjalon
2015-10-25 22:59, Marc Sune:
> +#define ETH_SPEED_CAP_NOT_PHY(0)  /*< No phy media > */
> +#define ETH_SPEED_CAP_10M_HD (1 << 0)  /*< 10 Mbps half-duplex> */
> +#define ETH_SPEED_CAP_10M_FD (1 << 1)  /*< 10 Mbps full-duplex> */
> +#define ETH_SPEED_CAP_100M_HD(1 << 2)  /*< 100 Mbps half-duplex> */
> +#define ETH_SPEED_CAP_100M_FD(1 << 3)  /*< 100 Mbps full-duplex> */
> +#define ETH_SPEED_CAP_1G (1 << 4)  /*< 1 Gbps > */
> +#define ETH_SPEED_CAP_2_5G   (1 << 5)  /*< 2.5 Gbps > */
> +#define ETH_SPEED_CAP_5G (1 << 6)  /*< 5 Gbps > */
> +#define ETH_SPEED_CAP_10G(1 << 7)  /*< 10 Mbps > */
> +#define ETH_SPEED_CAP_20G(1 << 8)  /*< 20 Gbps > */
> +#define ETH_SPEED_CAP_25G(1 << 9)  /*< 25 Gbps > */
> +#define ETH_SPEED_CAP_40G(1 << 10)  /*< 40 Gbps > */
> +#define ETH_SPEED_CAP_50G(1 << 11)  /*< 50 Gbps > */
> +#define ETH_SPEED_CAP_56G(1 << 12)  /*< 56 Gbps > */
> +#define ETH_SPEED_CAP_100G   (1 << 13)  /*< 100 Gbps > */

In the patch 3, you rename this flags. It would be easier to understand if
the right names were used in the first patch.

> @@ -837,6 +860,7 @@ struct rte_eth_dev_info {
>   uint16_t vmdq_queue_base; /**< First queue ID for VMDQ pools. */
>   uint16_t vmdq_queue_num;  /**< Queue number for VMDQ pools. */
>   uint16_t vmdq_pool_base;  /**< First ID of VMDQ pools. */
> + uint32_t speed_capa;  /**< Supported speeds bitmap (ETH_SPEED_CAP_). */

When renaming ETH_SPEED_CAP, this line is not changed later.


[dpdk-dev] [PATCH v6 1/5] ethdev: Added ETH_SPEED_CAP bitmap for ports

2015-10-25 Thread Marc Sune
Added constants and bitmap to struct rte_eth_dev_info to be used by PMDs.

Signed-off-by: Marc Sune 
---
 lib/librte_ether/rte_ethdev.h | 24 
 1 file changed, 24 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 8a8c82b..951a423 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -811,6 +811,29 @@ struct rte_eth_conf {
 #define DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM 0x0080 /**< Used for tunneling 
packet. */
 #define DEV_TX_OFFLOAD_QINQ_INSERT 0x0100

+/**
+ * Device supported speeds
+ */
+#define ETH_SPEED_CAP_NOT_PHY  (0)  /*< No phy media > */
+#define ETH_SPEED_CAP_10M_HD   (1 << 0)  /*< 10 Mbps half-duplex> */
+#define ETH_SPEED_CAP_10M_FD   (1 << 1)  /*< 10 Mbps full-duplex> */
+#define ETH_SPEED_CAP_100M_HD  (1 << 2)  /*< 100 Mbps half-duplex> */
+#define ETH_SPEED_CAP_100M_FD  (1 << 3)  /*< 100 Mbps full-duplex> */
+#define ETH_SPEED_CAP_1G   (1 << 4)  /*< 1 Gbps > */
+#define ETH_SPEED_CAP_2_5G (1 << 5)  /*< 2.5 Gbps > */
+#define ETH_SPEED_CAP_5G   (1 << 6)  /*< 5 Gbps > */
+#define ETH_SPEED_CAP_10G  (1 << 7)  /*< 10 Mbps > */
+#define ETH_SPEED_CAP_20G  (1 << 8)  /*< 20 Gbps > */
+#define ETH_SPEED_CAP_25G  (1 << 9)  /*< 25 Gbps > */
+#define ETH_SPEED_CAP_40G  (1 << 10)  /*< 40 Gbps > */
+#define ETH_SPEED_CAP_50G  (1 << 11)  /*< 50 Gbps > */
+#define ETH_SPEED_CAP_56G  (1 << 12)  /*< 56 Gbps > */
+#define ETH_SPEED_CAP_100G (1 << 13)  /*< 100 Gbps > */
+
+
+/**
+ * Ethernet device information
+ */
 struct rte_eth_dev_info {
struct rte_pci_device *pci_dev; /**< Device PCI information. */
const char *driver_name; /**< Device Driver name. */
@@ -837,6 +860,7 @@ struct rte_eth_dev_info {
uint16_t vmdq_queue_base; /**< First queue ID for VMDQ pools. */
uint16_t vmdq_queue_num;  /**< Queue number for VMDQ pools. */
uint16_t vmdq_pool_base;  /**< First ID of VMDQ pools. */
+   uint32_t speed_capa;  /**< Supported speeds bitmap (ETH_SPEED_CAP_). */
 };

 /** Maximum name length for extended statistics counters */
-- 
2.1.4