[dpdk-dev] [PATCH v5 05/10] qede: Add core driver

2016-04-20 Thread Thomas Monjalon
2016-04-20 01:09, Rasesh Mody:
> Hi Thomas,
> 
> > From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> > Sent: Tuesday, April 19, 2016 5:59 AM
> > 
> > 2016-03-31 19:15, Rasesh Mody:
> > > +ifeq ($(OS_TYPE),Linux)
> > > +CFLAGS_ECORE_DRIVER += -Wno-shift-negative-value endif
> > 
> > I see an error with clang:
> > fatal error: unknown warning option '-Wno-shift-negative-value';
> > did you mean '-Wno-shift-sign-overflow'?
> 
> We had compiled all our v5 driver patches against clang v3.8 on  RH7.1 and 
> didn't see a similar error. 
>  "clang version 3.8.0 (trunk 249596) (llvm/trunk 249595)"
> 
> The '-Wno-shift-negative-value' option only got introduced after 3.6.0 clang 
> release.  Pls. let us know if we need to support a minimum version of clang. 
> We had asked this question earlier in the dpdk community, however we didn't 
> hear back from anyone so far.

I use clang-3.6.2.
You are right there is no official requirement in
doc/guides/linux_gsg/sys_reqs.rst.
Opinions about minimal version to support?


[dpdk-dev] [PATCH v5 05/10] qede: Add core driver

2016-04-20 Thread Rasesh Mody
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Tuesday, April 19, 2016 6:18 AM
> 
> 2016-03-31 19:15, Rasesh Mody:
> > The Qlogic Everest Driver for Ethernet(QEDE) Poll Mode Driver(PMD) is
> > the DPDK specific module for QLogic FastLinQ QL4 25G/40G CNA
> > family of adapters as well as their virtual functions (VF) in SR-IOV 
> > context.
> >
> > This patch adds QEDE PMD, which interacts with base driver and
> > initialises the HW.
> 
> After removing the BIT_MACRO check (see http://dpdk.org/patch/12113)
> and other false positives, there is only one warning from checkpatches.sh:
> 
> CHECK:CONCATENATED_STRING: Concatenated strings should use spaces
> between elements
> #1933: FILE: drivers/net/qede/qede_main.c:152:
> +   DP_NOTICE(edev, false, "Invalid fw size: %" PRIu64"\n",

Will fix it.


[dpdk-dev] [PATCH v5 05/10] qede: Add core driver

2016-04-20 Thread Rasesh Mody
Hi Thomas,

> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Tuesday, April 19, 2016 5:59 AM
> 
> 2016-03-31 19:15, Rasesh Mody:
> > +ifeq ($(OS_TYPE),Linux)
> > +CFLAGS_ECORE_DRIVER += -Wno-shift-negative-value endif
> 
> I see an error with clang:
> fatal error: unknown warning option '-Wno-shift-negative-value';
>   did you mean '-Wno-shift-sign-overflow'?

We had compiled all our v5 driver patches against clang v3.8 on  RH7.1 and 
didn't see a similar error. 
 "clang version 3.8.0 (trunk 249596) (llvm/trunk 249595)"

The '-Wno-shift-negative-value' option only got introduced after 3.6.0 clang 
release.  Pls. let us know if we need to support a minimum version of clang. We 
had asked this question earlier in the dpdk community, however we didn't hear 
back from anyone so far.

Thanks!
Rasesh


[dpdk-dev] [PATCH v5 05/10] qede: Add core driver

2016-04-19 Thread Thomas Monjalon
2016-03-31 19:15, Rasesh Mody:
> The Qlogic Everest Driver for Ethernet(QEDE) Poll Mode Driver(PMD) is
> the DPDK specific module for QLogic FastLinQ QL4 25G/40G CNA family
> of adapters as well as their virtual functions (VF) in SR-IOV context.
> 
> This patch adds QEDE PMD, which interacts with base driver and
> initialises the HW.

After removing the BIT_MACRO check (see http://dpdk.org/patch/12113)
and other false positives, there is only one warning from checkpatches.sh:

CHECK:CONCATENATED_STRING: Concatenated strings should use spaces between 
elements
#1933: FILE: drivers/net/qede/qede_main.c:152:
+   DP_NOTICE(edev, false, "Invalid fw size: %" PRIu64"\n",



[dpdk-dev] [PATCH v5 05/10] qede: Add core driver

2016-04-19 Thread Thomas Monjalon
2016-03-31 19:15, Rasesh Mody:
> +ifeq ($(OS_TYPE),Linux)
> +CFLAGS_ECORE_DRIVER += -Wno-shift-negative-value
> +endif

I see an error with clang:
fatal error: unknown warning option '-Wno-shift-negative-value';
did you mean '-Wno-shift-sign-overflow'?


[dpdk-dev] [PATCH v5 05/10] qede: Add core driver

2016-04-19 Thread Thomas Monjalon
2016-03-31 19:15, Rasesh Mody:
> +#
> +# CFLAGS
> +#
> +CFLAGS_ECORE_DRIVER = -Wno-unused-parameter
> +CFLAGS_ECORE_DRIVER += -Wno-unused-value
> +CFLAGS_ECORE_DRIVER += -Wno-sign-compare
> +CFLAGS_ECORE_DRIVER += -Wno-missing-prototypes
> +CFLAGS_ECORE_DRIVER += -Wno-cast-qual
> +CFLAGS_ECORE_DRIVER += -Wno-unused-function
> +CFLAGS_ECORE_DRIVER += -Wno-unused-variable
> +CFLAGS_ECORE_DRIVER += -Wno-strict-aliasing
> +CFLAGS_ECORE_DRIVER += -Wno-missing-prototypes
> +CFLAGS_ECORE_DRIVER += -Wno-format-nonliteral
> +ifeq ($(OS_TYPE),Linux)
> +CFLAGS_ECORE_DRIVER += -Wno-shift-negative-value
> +endif
> +
> +ifneq (,$(filter gcc gcc48,$(CC)))
> +CFLAGS_ECORE_DRIVER += -Wno-unused-but-set-variable
> +CFLAGS_ECORE_DRIVER += -Wno-missing-declarations
> +CFLAGS_ECORE_DRIVER += -Wno-maybe-uninitialized
> +CFLAGS_ECORE_DRIVER += -Wno-strict-prototypes
> +else ifeq ($(CC), clang)
> +CFLAGS_ECORE_DRIVER += -Wno-format-extra-args
> +CFLAGS_ECORE_DRIVER += -Wno-visibility
> +CFLAGS_ECORE_DRIVER += -Wno-empty-body
> +CFLAGS_ECORE_DRIVER += -Wno-invalid-source-encoding
> +CFLAGS_ECORE_DRIVER += -Wno-sometimes-uninitialized
> +CFLAGS_ECORE_DRIVER += -Wno-pointer-bool-conversion
> +else
> +#icc flags
> +endif
> +
> +#
> +# Add extra flags for base ecore driver files
> +# to disable warnings in them
> +#
> +#
> +ECORE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard 
> $(SRCDIR)/base/*.c)))
> +$(foreach obj, $(ECORE_DRIVER_OBJS), $(eval CFLAGS+=$(CFLAGS_ECORE_DRIVER)))

CFLAGS_ECORE_DRIVER options apply only to base driver.
So why not name it CFLAGS_BASE_DRIVER?

This part of the Makefile should be in the patch importing the base driver.


[dpdk-dev] [PATCH v5 05/10] qede: Add core driver

2016-04-01 Thread Stephen Hemminger
On Thu, 31 Mar 2016 19:15:22 -0700
Rasesh Mody  wrote:

> +struct qed_filter_mcast_params {
> + enum qed_filter_xcast_params_type type;
> + uint8_t num;
> + unsigned char mac[64][ETHER_ADDR_LEN];
> +};

Would prefer a #define constant for the maximum number of multicast
addresses rather than magic number of 64.


[dpdk-dev] [PATCH v5 05/10] qede: Add core driver

2016-04-01 Thread Stephen Hemminger
On Thu, 31 Mar 2016 19:15:22 -0700
Rasesh Mody  wrote:

> +struct qed_filter_ucast_params {
> + enum qed_filter_xcast_params_type type;
> + uint8_t vlan_valid;
> + uint16_t vlan;
> + uint8_t mac_valid;
> + unsigned char mac[ETHER_ADDR_LEN];
> +} __attribute__ ((__packed__));

Why packed? Why not just rearrange elements to eliminate the padding holes?


[dpdk-dev] [PATCH v5 05/10] qede: Add core driver

2016-03-31 Thread Rasesh Mody
The Qlogic Everest Driver for Ethernet(QEDE) Poll Mode Driver(PMD) is
the DPDK specific module for QLogic FastLinQ QL4 25G/40G CNA family
of adapters as well as their virtual functions (VF) in SR-IOV context.

This patch adds QEDE PMD, which interacts with base driver and
initialises the HW.

This patch content also includes:
 - eth_dev_ops callbacks
 - Rx/Tx support for the driver
 - link default configuration
 - change link property
 - link up/down/update notifications
 - vlan offload and filtering capability
 - device/function/port statistics

Signed-off-by: Harish Patil 
Signed-off-by: Rasesh Mody 
Signed-off-by: Sony Chacko 
---
 drivers/net/qede/Makefile |   90 +++
 drivers/net/qede/qede_eth_if.h|  174 +
 drivers/net/qede/qede_ethdev.c|  979 
 drivers/net/qede/qede_ethdev.h|  158 
 drivers/net/qede/qede_if.h|  155 
 drivers/net/qede/qede_logs.h  |   93 +++
 drivers/net/qede/qede_main.c  |  548 ++
 drivers/net/qede/qede_rxtx.c  | 1167 +
 drivers/net/qede/qede_rxtx.h  |  187 +
 drivers/net/qede/rte_pmd_qede_version.map |4 +
 10 files changed, 3555 insertions(+)
 create mode 100644 drivers/net/qede/Makefile
 create mode 100644 drivers/net/qede/qede_eth_if.h
 create mode 100644 drivers/net/qede/qede_ethdev.c
 create mode 100644 drivers/net/qede/qede_ethdev.h
 create mode 100644 drivers/net/qede/qede_if.h
 create mode 100644 drivers/net/qede/qede_logs.h
 create mode 100644 drivers/net/qede/qede_main.c
 create mode 100644 drivers/net/qede/qede_rxtx.c
 create mode 100644 drivers/net/qede/qede_rxtx.h
 create mode 100644 drivers/net/qede/rte_pmd_qede_version.map

diff --git a/drivers/net/qede/Makefile b/drivers/net/qede/Makefile
new file mode 100644
index 000..efaefb2
--- /dev/null
+++ b/drivers/net/qede/Makefile
@@ -0,0 +1,90 @@
+#Copyright (c) 2016 QLogic Corporation.
+#All rights reserved.
+#www.qlogic.com
+#
+#See LICENSE.qede_pmd for copyright and licensing details.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+#
+# library name
+#
+LIB = librte_pmd_qede.a
+
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+
+EXPORT_MAP := rte_pmd_qede_version.map
+
+LIBABIVER := 1
+
+#
+#OS
+#
+OS_TYPE := $(shell uname -s)
+
+#
+# CFLAGS
+#
+CFLAGS_ECORE_DRIVER = -Wno-unused-parameter
+CFLAGS_ECORE_DRIVER += -Wno-unused-value
+CFLAGS_ECORE_DRIVER += -Wno-sign-compare
+CFLAGS_ECORE_DRIVER += -Wno-missing-prototypes
+CFLAGS_ECORE_DRIVER += -Wno-cast-qual
+CFLAGS_ECORE_DRIVER += -Wno-unused-function
+CFLAGS_ECORE_DRIVER += -Wno-unused-variable
+CFLAGS_ECORE_DRIVER += -Wno-strict-aliasing
+CFLAGS_ECORE_DRIVER += -Wno-missing-prototypes
+CFLAGS_ECORE_DRIVER += -Wno-format-nonliteral
+ifeq ($(OS_TYPE),Linux)
+CFLAGS_ECORE_DRIVER += -Wno-shift-negative-value
+endif
+
+ifneq (,$(filter gcc gcc48,$(CC)))
+CFLAGS_ECORE_DRIVER += -Wno-unused-but-set-variable
+CFLAGS_ECORE_DRIVER += -Wno-missing-declarations
+CFLAGS_ECORE_DRIVER += -Wno-maybe-uninitialized
+CFLAGS_ECORE_DRIVER += -Wno-strict-prototypes
+else ifeq ($(CC), clang)
+CFLAGS_ECORE_DRIVER += -Wno-format-extra-args
+CFLAGS_ECORE_DRIVER += -Wno-visibility
+CFLAGS_ECORE_DRIVER += -Wno-empty-body
+CFLAGS_ECORE_DRIVER += -Wno-invalid-source-encoding
+CFLAGS_ECORE_DRIVER += -Wno-sometimes-uninitialized
+CFLAGS_ECORE_DRIVER += -Wno-pointer-bool-conversion
+else
+#icc flags
+endif
+
+#
+# Add extra flags for base ecore driver files
+# to disable warnings in them
+#
+#
+ECORE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c)))
+$(foreach obj, $(ECORE_DRIVER_OBJS), $(eval CFLAGS+=$(CFLAGS_ECORE_DRIVER)))
+
+#
+# all source are stored in SRCS-y
+#
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_dev.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_hw.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_cxt.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_sp_commands.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_init_fw_funcs.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_spq.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_init_ops.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_mcp.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/ecore_int.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += base/bcm_osal.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_main.c
+SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_rxtx.c
+
+# dependent libs:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += lib/librte_eal lib/librte_ether
+DEPDIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += lib/librte_mempool lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += lib/librte_net lib/librte_malloc
+
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/qede/qede_eth_if.h b/drivers/net/qede/qede_eth_if.h
new file mode 100644
index 000..0662780
--- /dev/null
+++ b/drivers/net/qede/qede_eth_if.h
@@ -0,0 +1,174 @@
+/*
+ * Copyright