cxgbe: add CXGBE VF PMD and updates
cover cxgbe: add CXGBE VF PMD and updates
Patches 1 - 9 add support for cxgbe VF driver. Patches 10 - 12 fix bugs and convert license in cxgbe files to SPDX License Tag. Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
Patch 1 adds minimal cxgbe VF driver.
Patch 2 adds firmware mailbox support for VF.
Patch 3 adds base functions to enable VF ports in subsequent patches.
Patch 4 adds cxgbe VF probe to initialize VF devices.
Patch 5 initializes SGE and queues for VF.
Patch 6 enables RSS for VF.
Patch 7 updates TX and RX path for VF.
Patch 8 adds support for VF port statistics.
Patch 9 adds support to set mac address.
Patch 10 fixes bug where the other ports under same PF are not closed properly.
Patch 11 exports RSS hash functions in device info and adds check to prevent configuring unsupported hash functions.
Patch 12 converts all cxgbe files to use SPDX license tag.
Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
Thanks,
Rahul
Kumar Sanghvi (10):
cxgbe: add skeleton VF driver
cxgbe: add VF firmware mailbox support
cxgbe: add base for enabling VF ports
cxgbe: add probe to initialize VF devices
cxgbe: initialize SGE and queues for VF
cxgbe: enable RSS for VF
cxgbe: update TX and RX path for VF
cxgbe: add VF port statistics
cxgbe: add support to set mac address
cxgbe: add option to keep outer VLAN tag in Q-in-Q
Rahul Lakkireddy (3):
cxgbe: fix check to close other ports properly
cxgbe: export supported RSS hash functions
cxgbe: convert to SPDX license tags
config/common_base | 1 + doc/guides/nics/cxgbe.rst | 36 +- doc/guides/nics/features/cxgbevf.ini | 28 + doc/guides/rel_notes/release_18_05.rst | 5 + drivers/net/cxgbe/Makefile | 36 +- drivers/net/cxgbe/base/adapter.h | 42 +- drivers/net/cxgbe/base/common.h | 111 ++-- drivers/net/cxgbe/base/t4_chip_type.h | 34 +- drivers/net/cxgbe/base/t4_hw.c | 117 +++-- drivers/net/cxgbe/base/t4_hw.h | 34 +- drivers/net/cxgbe/base/t4_msg.h | 34 +- drivers/net/cxgbe/base/t4_pci_id_tbl.h | 34 +- drivers/net/cxgbe/base/t4_regs.h | 116 +++-- drivers/net/cxgbe/base/t4_regs_values.h | 34 +- drivers/net/cxgbe/base/t4fw_interface.h | 229 +++++++-- drivers/net/cxgbe/base/t4vf_hw.c | 874 ++++++++++++++++++++++++++++++++ drivers/net/cxgbe/base/t4vf_hw.h | 15 + drivers/net/cxgbe/cxgbe.h | 44 +- drivers/net/cxgbe/cxgbe_compat.h | 34 +- drivers/net/cxgbe/cxgbe_ethdev.c | 143 +++--- drivers/net/cxgbe/cxgbe_main.c | 118 +++-- drivers/net/cxgbe/cxgbe_pfvf.h | 43 ++ drivers/net/cxgbe/cxgbevf_ethdev.c | 197 +++++++ drivers/net/cxgbe/cxgbevf_main.c | 306 +++++++++++ drivers/net/cxgbe/sge.c | 415 ++++++++++++--- 25 files changed, 2417 insertions(+), 663 deletions(-) create mode 100644 doc/guides/nics/features/cxgbevf.ini create mode 100644 drivers/net/cxgbe/base/t4vf_hw.c create mode 100644 drivers/net/cxgbe/base/t4vf_hw.h create mode 100644 drivers/net/cxgbe/cxgbe_pfvf.h create mode 100644 drivers/net/cxgbe/cxgbevf_ethdev.c create mode 100644 drivers/net/cxgbe/cxgbevf_main.c
Signature · 1 line
2.14.1
PATCH 1/13 cxgbe: add skeleton VF driver
From: Kumar Sanghvi <[email protected]>
Add minimal VF driver. Declare functions common to both PF and VF functionality in separate header file and import the header file.
--- doc/guides/nics/features/cxgbevf.ini | 28 +++++++++++ doc/guides/rel_notes/release_18_05.rst | 5 ++ drivers/net/cxgbe/Makefile | 1 + drivers/net/cxgbe/cxgbe_ethdev.c | 70 +++++++++++--------------- drivers/net/cxgbe/cxgbe_pfvf.h | 38 ++++++++++++++ drivers/net/cxgbe/cxgbevf_ethdev.c | 91 ++++++++++++++++++++++++++++++++++ 6 files changed, 193 insertions(+), 40 deletions(-) create mode 100644 doc/guides/nics/features/cxgbevf.ini create mode 100644 drivers/net/cxgbe/cxgbe_pfvf.h create mode 100644 drivers/net/cxgbe/cxgbevf_ethdev.c
doc/guides/nics/features/cxgbevf.ini new file +28 -0
@@ -0,0 +1,28 @@ +; +; Supported features of the 'cxgbevf' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Speed capabilities = Y +Link status = Y +Queue start/stop = Y +MTU update = Y +Jumbo frame = Y +Scattered Rx = Y +TSO = Y +Promiscuous mode = Y +Allmulticast mode = Y +RSS hash = Y +CRC offload = Y +VLAN offload = Y +L3 checksum offload = Y +L4 checksum offload = Y +Packet type parsing = Y +Basic stats = Y +Stats per queue = Y +Multiprocess aware = Y +Linux UIO = Y +Linux VFIO = Y +x86-32 = Y +x86-64 = Y
doc/guides/rel_notes/release_18_05.rst +5 -0
@@ -45,6 +45,11 @@ New Features Support to update RSS hash and key has been added to CXGBE PMD. +* **Added CXGBE VF PMD.** + + CXGBE VF Poll Mode Driver has been added to run DPDK over Chelsio + T5/T6 NIC VF instances. + * **Updated Solarflare network PMD.** Updated the sfc_efx driver including the following changes:
drivers/net/cxgbe/Makefile +1 -0
@@ -80,6 +80,7 @@ VPATH += $(SRCDIR)/base # all source are stored in SRCS-y # SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbevf_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_main.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += sge.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t4_hw.c
drivers/net/cxgbe/cxgbe_ethdev.c +30 -40
199 lines not on this page · raw message
drivers/net/cxgbe/cxgbe_pfvf.h new file +38 -0
@@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2018 Chelsio Communications. +* All rights reserved. +*/ + +#ifndef _CXGBE_PFVF_H_ +#define _CXGBE_PFVF_H_ + +void cxgbe_dev_rx_queue_release (void *q); +void cxgbe_dev_tx_queue_release (void *q); +void cxgbe_dev_stop (struct rte_eth_dev *eth_dev); +void cxgbe_dev_close (struct rte_eth_dev *eth_dev); +void cxgbe_dev_info_get (struct rte_eth_dev *eth_dev, +struct rte_eth_dev_info *device_info); +void cxgbe_dev_promiscuous_enable (struct rte_eth_dev *eth_dev); +void cxgbe_dev_promiscuous_disable (struct rte_eth_dev *eth_dev); +void cxgbe_dev_allmulticast_enable (struct rte_eth_dev *eth_dev); +void cxgbe_dev_allmulticast_disable (struct rte_eth_dev *eth_dev); +int cxgbe_dev_configure (struct rte_eth_dev *eth_dev); +int cxgbe_dev_tx_queue_setup (struct rte_eth_dev *eth_dev,uint16_t queue_idx, +uint16_t nb_desc,unsigned int socket_id, +const struct rte_eth_txconf *tx_conf); +int cxgbe_dev_rx_queue_setup (struct rte_eth_dev *eth_dev,uint16_t queue_idx, +uint16_t nb_desc,unsigned int socket_id, +const struct rte_eth_rxconf *rx_conf, +struct rte_mempool *mp); +int cxgbe_dev_tx_queue_start (struct rte_eth_dev *eth_dev, +uint16_t tx_queue_id); +int cxgbe_dev_rx_queue_start (struct rte_eth_dev *eth_dev, +uint16_t tx_queue_id); +int cxgbe_dev_tx_queue_stop (struct rte_eth_dev *eth_dev,uint16_t tx_queue_id); +int cxgbe_dev_rx_queue_stop (struct rte_eth_dev *eth_dev,uint16_t rx_queue_id); +int cxgbe_dev_mtu_set (struct rte_eth_dev *eth_dev,uint16_t mtu); +int cxgbe_dev_start (struct rte_eth_dev *eth_dev); +int cxgbe_dev_link_update (struct rte_eth_dev *eth_dev, +int wait_to_complete); +const uint32_t *cxgbe_dev_supported_ptypes_get (struct rte_eth_dev *eth_dev); +#endif /* _CXGBE_PFVF_H_ */
drivers/net/cxgbe/cxgbevf_ethdev.c new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH 2/13 cxgbe: add VF firmware mailbox support
In reply to Rahul LakkireddyFrom: Kumar Sanghvi <[email protected]>
Add firmware mailbox communication support for VF. Add is_pf4() to check if driver is attached to PF4. Use is_pf4() to determine whether to use PF or VF mailbox communication.
--- drivers/net/cxgbe/Makefile | 1 + drivers/net/cxgbe/base/common.h | 21 ++++ drivers/net/cxgbe/base/t4_hw.c | 72 +++++++++---- drivers/net/cxgbe/base/t4_regs.h | 4 + drivers/net/cxgbe/base/t4vf_hw.c | 224 +++++++++++++++++++++++++++++++++++++++ drivers/net/cxgbe/base/t4vf_hw.h | 14 +++ 6 files changed, 318 insertions(+), 18 deletions(-) create mode 100644 drivers/net/cxgbe/base/t4vf_hw.c create mode 100644 drivers/net/cxgbe/base/t4vf_hw.h
drivers/net/cxgbe/Makefile +1 -0
@@ -84,5 +84,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbevf_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_main.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += sge.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t4_hw.c +SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t4vf_hw.c include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/cxgbe/base/common.h +21 -0
@@ -36,6 +36,7 @@#include "cxgbe_compat.h" #include "t4_hw.h" +#include "t4vf_hw.h" #include "t4_chip_type.h" #include "t4fw_interface.h"
@@ -290,6 +291,11 @@ static inline int t4_wait_op_done(struct adapter *adapter, int reg, u32 mask, delay, NULL); } +static inline int is_pf4 (struct adapter *adap) +{ +return adap->pf ==4 ; +} +#define for_each_port (adapter, iter) \ for (iter = 0; iter < (adapter)->params.nports; ++iter)
@@ -400,6 +406,21 @@ static inline int t4_wr_mbox_ns(struct adapter *adap, int mbox, const void *cmd,return t4_wr_mbox_meat (adap, mbox, cmd, size, rpl, false); } +int t4vf_wr_mbox_core (struct adapter *,const void *,int ,void *,bool ); + +static inline int t4vf_wr_mbox (struct adapter *adapter,const void *cmd, +int size,void *rpl) +{ +return t4vf_wr_mbox_core (adapter, cmd, size, rpl, true); +} + +static inline int t4vf_wr_mbox_ns (struct adapter *adapter,const void *cmd, +int size,void *rpl) +{ +return t4vf_wr_mbox_core (adapter, cmd, size, rpl, false); +} + +void t4_read_indirect (struct adapter *adap,unsigned int addr_reg,unsigned int data_reg,u32 *vals,unsigned int nregs,unsigned int start_idx);
drivers/net/cxgbe/base/t4_hw.c +54 -18
142 lines not on this page · raw message
drivers/net/cxgbe/base/t4_regs.h +4 -0
@@ -443,6 +443,8 @@/* registers for module CIM */ #define CIM_BASE_ADDR 0x7b00 +#define A_CIM_VF_EXT_MAILBOX_CTRL 0x0 +#define A_CIM_PF_MAILBOX_DATA 0x240#define A_CIM_PF_MAILBOX_CTRL 0x280
@@ -462,6 +464,8 @@#define V_UPCRST (x) ((x) << S_UPCRST)#define F_UPCRST V_UPCRST(1U) +#define NUM_CIM_PF_MAILBOX_DATA_INSTANCES 16 +/* registers for module TP */ #define A_TP_OUT_CONFIG 0x7d04
drivers/net/cxgbe/base/t4vf_hw.c new file +224 -0
224 lines not on this page · raw message
drivers/net/cxgbe/base/t4vf_hw.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2018 Chelsio Communications. +* All rights reserved. +*/ + +#ifndef __T4VF_HW_H +#define __T4VF_HW_H + +#define T4VF_CIM_BASE_ADDR 0x0300 +#define T4VF_MBDATA_BASE_ADDR 0x0240 +#define T6VF_MBDATA_BASE_ADDR 0x0280 + +#define NUM_CIM_VF_MAILBOX_DATA_INSTANCES NUM_CIM_PF_MAILBOX_DATA_INSTANCES +#endif /* __T4VF_HW_H */
Signature · 1 line
2.14.1
PATCH 3/13 cxgbe: add base for enabling VF ports
In reply to Rahul LakkireddyFrom: Kumar Sanghvi <[email protected]>
Add base to enable VF ports in subsequent patches.
--- drivers/net/cxgbe/base/common.h | 31 +++ drivers/net/cxgbe/base/t4_hw.c | 9 +- drivers/net/cxgbe/base/t4_regs.h | 2 + drivers/net/cxgbe/base/t4fw_interface.h | 73 ++++++ drivers/net/cxgbe/base/t4vf_hw.c | 434 ++++++++++++++++++++++++++++++++ drivers/net/cxgbe/base/t4vf_hw.h | 1 + 6 files changed, 544 insertions(+), 6 deletions(-)
drivers/net/cxgbe/base/common.h +31 -0
@@ -210,12 +210,29 @@ struct arch_specific_params {u16 mps_tcam_size; }; +/* +* Maximum resources provisioned for a PCI VF. +*/ +struct vf_resources { +unsigned int nvi;/* N virtual interfaces */ +unsigned int neq;/* N egress Qs */ +unsigned int nethctrl;/* N egress ETH or CTRL Qs */ +unsigned int niqflint;/* N ingress Qs/w free list(s) & intr */ +unsigned int niq;/* N ingress Qs */ +unsigned int tc;/* PCI-E traffic class */ +unsigned int pmask;/* port access rights mask */ +unsigned int nexactf;/* N exact MPS filters */ +unsigned int r_caps;/* read capabilities */ +unsigned int wx_caps;/* write/execute capabilities */ +}; +struct adapter_params {struct sge_params sge;struct tp_params tp;struct vpd_params vpd;struct pci_params pci;struct devlog_params devlog; +struct vf_resources vfres;enum pcie_memwin drv_memwin;unsigned int sf_size;/* serial flash size in bytes */
@@ -312,9 +329,11 @@ int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, enum dev_master master, enum dev_state *state);int t4_fw_bye (struct adapter *adap,unsigned int mbox);int t4_fw_reset (struct adapter *adap,unsigned int mbox,int reset); +int t4vf_fw_reset (struct adapter *adap);int t4_fw_halt (struct adapter *adap,unsigned int mbox,int reset);int t4_fw_restart (struct adapter *adap,unsigned int mbox,int reset);int t4_fl_pkt_align (struct adapter *adap); +int t4vf_get_vfres (struct adapter *adap);int t4_fixup_host_params_compat (struct adapter *adap,unsigned int page_size,unsigned int cache_line_size,enum chip_type chip_compat);
@@ -324,6 +343,12 @@ int t4_fw_initialize(struct adapter *adap, unsigned int mbox);int t4_query_params (struct adapter *adap,unsigned int mbox,unsigned int pf,unsigned int vf,unsigned int nparams,const u32 *params,u32 *val); +int t4vf_query_params (struct adapter *adap,unsigned int nparams, +const u32 *params,u32 *vals); +int t4vf_get_dev_params (struct adapter *adap); +int t4vf_get_vpd_params (struct adapter *adap); +int t4vf_set_params (struct adapter *adapter,unsigned int nparams, +const u32 *params,const u32 *vals); int t4_set_params_timeout(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params,
@@ -440,13 +465,17 @@ void t4_get_port_stats_offset(struct adapter *adap, int idx,struct port_stats *stats, struct port_stats *offset);void t4_clr_port_stats (struct adapter *adap,int idx); +void init_link_config (struct link_config *lc,fw_port_cap32_t pcaps, +fw_port_cap32_t acaps);void t4_reset_link_config (struct adapter *adap,int idx);int t4_get_version_info (struct adapter *adapter);void t4_dump_version_info (struct adapter *adapter);int t4_get_flash_params (struct adapter *adapter);int t4_get_chip_type (struct adapter *adap,int ver);int t4_prep_adapter (struct adapter *adapter); +int t4vf_prep_adapter (struct adapter *adapter);int t4_port_init (struct adapter *adap,int mbox,int pf,int vf); +int t4vf_port_init (struct adapter *adap);int t4_init_rss_mode (struct adapter *adap,int mbox);int t4_config_rss_range (struct adapter *adapter,int mbox,unsigned int viid,int start,int n,const u16 *rspq,unsigned int nrspq);
@@ -469,8 +498,10 @@ int t4_init_tp_params(struct adapter *adap);int t4_filter_field_shift (const struct adapter *adap,unsigned int filter_sel);int t4_handle_fw_rpl (struct adapter *adap,const __be64 *rpl);unsigned int t4_get_regs_len (struct adapter *adap); +unsigned int t4vf_get_pf_from_vf (struct adapter *adap);void t4_get_regs (struct adapter *adap,void *buf,size_t buf_size);int t4_seeprom_read (struct adapter *adapter,u32 addr,u32 *data);int t4_seeprom_write (struct adapter *adapter,u32 addr,u32 data);int t4_seeprom_wp (struct adapter *adapter,int enable); +fw_port_cap32_t fwcaps16_to_caps32 (fw_port_cap16_t caps16);#endif /* __CHELSIO_COMMON_H */
drivers/net/cxgbe/base/t4_hw.c +3 -6
@@ -55,9 +55,6 @@#include "t4_regs_values.h" #include "t4fw_interface.h" -static void init_link_config (struct link_config *lc,unsigned int pcaps, -unsigned int acaps); -/** * t4_read_mtu_tbl - returns the values in the HW path MTU table * @adap: the adapter
@@ -2804,7 +2801,7 @@ void t4_dump_version_info(struct adapter *adapter)* * Returns the equivalent 32-bit Port Capabilities value. */ -static fw_port_cap32_t fwcaps16_to_caps32 (fw_port_cap16_t caps16) +fw_port_cap32_t fwcaps16_to_caps32 (fw_port_cap16_t caps16) {fw_port_cap32_t caps32 =0 ;
@@ -4585,8 +4582,8 @@ void t4_reset_link_config(struct adapter *adap, int idx)* Initializes the SW state maintained for each link, including the link's * capabilities and default speed/flow-control/autonegotiation settings. */ -static void init_link_config (struct link_config *lc,fw_port_cap32_t pcaps, -fw_port_cap32_t acaps) +void init_link_config (struct link_config *lc,fw_port_cap32_t pcaps, +fw_port_cap32_t acaps) { lc->pcaps = pcaps; lc->requested_speed =0 ;
drivers/net/cxgbe/base/t4_regs.h +2 -0
@@ -852,6 +852,7 @@#define F_PFCIM V_PFCIM(1U)#define A_PL_WHOAMI 0x19400 +#define A_PL_VF_WHOAMI 0x0#define A_PL_RST 0x19428
@@ -866,6 +867,7 @@#define F_PIORSTMODE V_PIORSTMODE(1U)#define A_PL_REV 0x1943c +#define A_PL_VF_REV 0x4#define S_REV 0#define M_REV 0xfU
drivers/net/cxgbe/base/t4fw_interface.h +73 -0
103 lines not on this page · raw message
drivers/net/cxgbe/base/t4vf_hw.c +434 -0
443 lines not on this page · raw message
drivers/net/cxgbe/base/t4vf_hw.h +1 -0
@@ -6,6 +6,7 @@#ifndef __T4VF_HW_H#define __T4VF_HW_H +#define T4VF_PL_BASE_ADDR 0x0200#define T4VF_CIM_BASE_ADDR 0x0300#define T4VF_MBDATA_BASE_ADDR 0x0240#define T6VF_MBDATA_BASE_ADDR 0x0280
Signature · 1 line
2.14.1
PATCH 4/13 cxgbe: add probe to initialize VF devices
In reply to Rahul LakkireddyFrom: Kumar Sanghvi <[email protected]>
Add probe to initialize VF devices. Separate init/de-init paths for PF and VF. Do firmware state initialization wrt VF and retrieve various operational parameters by querying firmware. Finally configure and initialize ports.
--- drivers/net/cxgbe/Makefile | 1 + drivers/net/cxgbe/base/adapter.h | 1 + drivers/net/cxgbe/base/t4_hw.c | 2 +- drivers/net/cxgbe/cxgbe.h | 3 + drivers/net/cxgbe/cxgbe_main.c | 17 ++- drivers/net/cxgbe/cxgbevf_ethdev.c | 65 ++++++++- drivers/net/cxgbe/cxgbevf_main.c | 280 +++++++++++++++++++++++++++++++++++++ 7 files changed, 359 insertions(+), 10 deletions(-) create mode 100644 drivers/net/cxgbe/cxgbevf_main.c
drivers/net/cxgbe/Makefile +1 -0
@@ -82,6 +82,7 @@ VPATH += $(SRCDIR)/base SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbevf_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_main.c +SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbevf_main.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += sge.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t4_hw.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t4vf_hw.c
drivers/net/cxgbe/base/adapter.h +1 -0
@@ -68,6 +68,7 @@ struct port_info {u8 port_type;/* firmware port type */ u8 mod_type;/* firmware module type */ u8 port_id;/* physical port ID */ +u8 pidx;/* port index for this PF */ u8 tx_chan;/* associated channel */ u8 n_rx_qsets;/* # of rx qsets */
drivers/net/cxgbe/base/t4_hw.c +1 -1
@@ -4488,7 +4488,7 @@ static void t4_handle_get_port_info(struct port_info *pi, const __be64 *rpl) lc->auto_fec = fec; pi->port_type = port_type; pi->mod_type = mod_type; -t4_os_portmod_changed (adapter, pi->port_id); +t4_os_portmod_changed (adapter, pi->pidx); }if (link_ok != lc->link_ok || speed != lc->speed || fc != lc->fc || fec != lc->fec) {/* something changed */
drivers/net/cxgbe/cxgbe.h +3 -0
@@ -49,6 +49,7 @@#define CXGBE_DEFAULT_RSS_KEY_LEN 40/* 320-bits */ int cxgbe_probe (struct adapter *adapter); +int cxgbevf_probe (struct adapter *adapter);void cxgbe_get_speed_caps (struct port_info *pi,u32 *speed_caps);int cxgbe_up (struct adapter *adap);int cxgbe_down (struct port_info *pi);
@@ -63,5 +64,7 @@ void cfg_queues(struct rte_eth_dev *eth_dev);int cfg_queue_count (struct rte_eth_dev *eth_dev);int setup_rss (struct port_info *pi);void cxgbe_enable_rx_queues (struct port_info *pi); +void print_port_info (struct adapter *adap); +void print_adapter_info (struct adapter *adap);#endif /* _CXGBE_H_ */
drivers/net/cxgbe/cxgbe_main.c +10 -7
@@ -370,7 +370,7 @@ static int init_rss(struct adapter *adap)/** * Dump basic information about the adapter. */ -static void print_adapter_info (struct adapter *adap) +void print_adapter_info (struct adapter *adap) {/** * Hardware/Firmware/etc. Version/Revision IDs.
@@ -378,7 +378,7 @@ static void print_adapter_info(struct adapter *adap)t4_dump_version_info (adap); } -static void print_port_info (struct adapter *adap) +void print_port_info (struct adapter *adap) {int i;char buf[80 ];
@@ -917,7 +917,7 @@ int link_start(struct port_info *pi) ret =0 ; } } -if (ret ==0 ) +if (ret ==0 &&is_pf4 (adapter)) ret =t4_link_l1cfg (adapter, adapter->mbox, pi->tx_chan, &pi->link_cfg);if (ret ==0 ) {
@@ -1196,7 +1196,8 @@ int cxgbe_up(struct adapter *adap) {enable_rx (adap, &adap->sge.fw_evtq);t4_sge_tx_monitor_start (adap); -t4_intr_enable (adap); +if (is_pf4 (adap)) +t4_intr_enable (adap); adap->flags |=FULL_INIT_DONE ;/* TODO: deadman watchdog ?? */
@@ -1217,7 +1218,7 @@ int cxgbe_down(struct port_info *pi)return err; } -t4_reset_link_config (adapter, pi->port_id); +t4_reset_link_config (adapter, pi->pidx);return 0 ; }
@@ -1230,7 +1231,8 @@ void cxgbe_close(struct adapter *adapter)int i;if (adapter->flags &FULL_INIT_DONE ) { -t4_intr_disable (adapter); +if (is_pf4 (adapter)) +t4_intr_disable (adapter);t4_sge_tx_monitor_stop (adapter);t4_free_sge_resources (adapter);for_each_port (adapter, i) {
@@ -1248,7 +1250,7 @@ void cxgbe_close(struct adapter *adapter) adapter->flags &= ~FULL_INIT_DONE ; } -if (adapter->flags &FW_OK ) +if (is_pf4 (adapter) && (adapter->flags &FW_OK ))t4_fw_bye (adapter, adapter->mbox); }
@@ -1355,6 +1357,7 @@ int cxgbe_probe(struct adapter *adapter) pi->adapter = adapter; pi->xact_addr_filt =-1 ; pi->port_id = i; + pi->pidx = i; pi->eth_dev->device = &adapter->pdev->device; pi->eth_dev->dev_ops = adapter->eth_dev->dev_ops;
drivers/net/cxgbe/cxgbevf_ethdev.c +63 -2
75 lines not on this page · raw message
drivers/net/cxgbe/cxgbevf_main.c new file +280 -0
280 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH 5/13 cxgbe: initialize SGE and queues for VF
In reply to Rahul LakkireddyFrom: Kumar Sanghvi <[email protected]>
Query firmware and initialize SGE parameters and enable queue allocation for VF. Calculate pcie channel and queue congestion management for VF.
--- drivers/net/cxgbe/base/adapter.h | 2 + drivers/net/cxgbe/base/common.h | 1 + drivers/net/cxgbe/base/t4_regs.h | 12 ++ drivers/net/cxgbe/base/t4fw_interface.h | 6 + drivers/net/cxgbe/base/t4vf_hw.c | 40 ++++++ drivers/net/cxgbe/cxgbe_ethdev.c | 13 +- drivers/net/cxgbe/cxgbe_main.c | 3 +- drivers/net/cxgbe/cxgbevf_main.c | 5 + drivers/net/cxgbe/sge.c | 239 +++++++++++++++++++++++++++++--- 9 files changed, 296 insertions(+), 25 deletions(-)
drivers/net/cxgbe/base/adapter.h +2 -0
@@ -249,6 +249,7 @@ struct sge_txq {unsigned int equeidx;/* last sent credit request */ unsigned int last_pidx;/* last pidx recorded by tx monitor */ unsigned int last_coal_idx;/* last coal-idx recorded by tx monitor */ +unsigned int abs_id;int db_disabled;/* doorbell state */ unsigned short db_pidx;/* doorbell producer index */
@@ -719,6 +720,7 @@ int t4_eth_xmit(struct sge_eth_txq *txq, struct rte_mbuf *mbuf,int t4_ethrx_handler (struct sge_rspq *q,const __be64 *rsp,const struct pkt_gl *gl);int t4_sge_init (struct adapter *adap); +int t4vf_sge_init (struct adapter *adap);int t4_sge_alloc_eth_txq (struct adapter *adap,struct sge_eth_txq *txq,struct rte_eth_dev *eth_dev,uint16_t queue_id,unsigned int iqid,int socket_id);
drivers/net/cxgbe/base/common.h +1 -0
@@ -333,6 +333,7 @@ int t4vf_fw_reset(struct adapter *adap);int t4_fw_halt (struct adapter *adap,unsigned int mbox,int reset);int t4_fw_restart (struct adapter *adap,unsigned int mbox,int reset);int t4_fl_pkt_align (struct adapter *adap); +int t4vf_fl_pkt_align (struct adapter *adap,u32 sge_control,u32 sge_control2);int t4vf_get_vfres (struct adapter *adap); int t4_fixup_host_params_compat(struct adapter *adap, unsigned int page_size, unsigned int cache_line_size,
drivers/net/cxgbe/base/t4_regs.h +12 -0
@@ -77,6 +77,7 @@#define SGE_BASE_ADDR 0x1000#define A_SGE_PF_KDOORBELL 0x0 +#define A_SGE_VF_KDOORBELL 0x0#define S_QID 15#define M_QID 0x1ffffU
@@ -103,6 +104,9 @@#define A_SGE_PF_GTS 0x4 +#define T4VF_SGE_BASE_ADDR 0x0000 +#define A_SGE_VF_GTS 0x4 +#define S_INGRESSQID 16#define M_INGRESSQID 0xffffU#define V_INGRESSQID (x) ((x) << S_INGRESSQID)
@@ -191,6 +195,8 @@#define V_QUEUESPERPAGEPF0 (x) ((x) << S_QUEUESPERPAGEPF0)#define G_QUEUESPERPAGEPF0 (x) (((x) >> S_QUEUESPERPAGEPF0) & M_QUEUESPERPAGEPF0) +#define A_SGE_EGRESS_QUEUES_PER_PAGE_VF 0x1014 +#define S_ERR_CPL_EXCEED_IQE_SIZE 22#define V_ERR_CPL_EXCEED_IQE_SIZE (x) ((x) << S_ERR_CPL_EXCEED_IQE_SIZE)#define F_ERR_CPL_EXCEED_IQE_SIZE V_ERR_CPL_EXCEED_IQE_SIZE(1U)
@@ -280,6 +286,11 @@#define A_SGE_CONM_CTRL 0x1094 +#define S_T6_EGRTHRESHOLDPACKING 16 +#define M_T6_EGRTHRESHOLDPACKING 0xffU +#define G_T6_EGRTHRESHOLDPACKING (x) (((x) >> S_T6_EGRTHRESHOLDPACKING) & \ + M_T6_EGRTHRESHOLDPACKING) +#define S_EGRTHRESHOLD 8#define M_EGRTHRESHOLD 0x3fU#define V_EGRTHRESHOLD (x) ((x) << S_EGRTHRESHOLD)
@@ -370,6 +381,7 @@#define G_STATSOURCE_T5 (x) (((x) >> S_STATSOURCE_T5) & M_STATSOURCE_T5)#define A_SGE_INGRESS_QUEUES_PER_PAGE_PF 0x10f4 +#define A_SGE_INGRESS_QUEUES_PER_PAGE_VF 0x10f8#define A_SGE_CONTROL2 0x1124
drivers/net/cxgbe/base/t4fw_interface.h +6 -0
@@ -480,6 +480,7 @@ struct fw_caps_config_cmd {enum fw_params_mnem {FW_PARAMS_MNEM_DEV =1 ,/* device params */ FW_PARAMS_MNEM_PFVF =2 ,/* function params */ +FW_PARAMS_MNEM_REG =3 ,/* limited register access */ FW_PARAMS_MNEM_DMAQ =4 ,/* dma queue params */ };
@@ -887,6 +888,11 @@ struct fw_eq_eth_cmd {#define G_FW_EQ_ETH_CMD_EQID (x) \ (((x) >> S_FW_EQ_ETH_CMD_EQID) & M_FW_EQ_ETH_CMD_EQID) +#define S_FW_EQ_ETH_CMD_PHYSEQID 0 +#define M_FW_EQ_ETH_CMD_PHYSEQID 0xfffff +#define G_FW_EQ_ETH_CMD_PHYSEQID (x) \ + (((x) >> S_FW_EQ_ETH_CMD_PHYSEQID) & M_FW_EQ_ETH_CMD_PHYSEQID) +#define S_FW_EQ_ETH_CMD_FETCHRO 22#define M_FW_EQ_ETH_CMD_FETCHRO 0x1#define V_FW_EQ_ETH_CMD_FETCHRO (x) ((x) << S_FW_EQ_ETH_CMD_FETCHRO)
drivers/net/cxgbe/base/t4vf_hw.c +40 -0
@@ -460,6 +460,46 @@ int t4vf_set_params(struct adapter *adapter, unsigned int nparams,return t4vf_wr_mbox (adapter, &cmd,sizeof (cmd),NULL ); } +/** +* t4vf_fl_pkt_align - return the fl packet alignment +* @adapter: the adapter +* +* T4 has a single field to specify the packing and padding boundary. +* T5 onwards has separate fields for this and hence the alignment for +* next packet offset is maximum of these two. +*/ +int t4vf_fl_pkt_align (struct adapter *adapter,u32 sge_control, +u32 sge_control2) +{ +unsigned int ingpadboundary, ingpackboundary, fl_align, ingpad_shift; + +/* T4 uses a single control field to specify both the PCIe Padding and +* Packing Boundary. T5 introduced the ability to specify these +* separately. The actual Ingress Packet Data alignment boundary +* within Packed Buffer Mode is the maximum of these two +* specifications. +*/ +if (CHELSIO_CHIP_VERSION (adapter->params.chip) <=CHELSIO_T5 ) + ingpad_shift =X_INGPADBOUNDARY_SHIFT ; +else + ingpad_shift =X_T6_INGPADBOUNDARY_SHIFT ; + + ingpadboundary =1 << (G_INGPADBOUNDARY (sge_control) + ingpad_shift); + + fl_align = ingpadboundary; +if (!is_t4 (adapter->params.chip)) { + ingpackboundary =G_INGPACKBOUNDARY (sge_control2); +if (ingpackboundary ==X_INGPACKBOUNDARY_16B ) + ingpackboundary =16 ; +else + ingpackboundary =1 << (ingpackboundary + +X_INGPACKBOUNDARY_SHIFT ); + + fl_align =max (ingpadboundary, ingpackboundary); + } +return fl_align; +} +unsigned int t4vf_get_pf_from_vf (struct adapter *adapter) {u32 whoami;
drivers/net/cxgbe/cxgbe_ethdev.c +7 -6
@@ -481,9 +481,8 @@ int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, err =t4_sge_alloc_eth_txq (adapter, txq, eth_dev, queue_idx, s->fw_evtq.cntxt_id, socket_id); -dev_debug (adapter,"%s: txq->q.cntxt_id= %d err = %d\n" , - __func__, txq->q.cntxt_id, err); - +dev_debug (adapter,"%s: txq->q.cntxt_id= %u txq->q.abs_id= %u err = %d\n" , + __func__, txq->q.cntxt_id, txq->q.abs_id, err);return err; }
@@ -610,11 +609,13 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, err =t4_sge_alloc_rxq (adapter, &rxq->rspq, false, eth_dev, msi_idx, &rxq->fl, t4_ethrx_handler, -t4_get_tp_ch_map (adapter, pi->tx_chan), mp, +is_pf4 (adapter) ? +t4_get_tp_ch_map (adapter, pi->tx_chan) :0 , mp, queue_idx, socket_id); -dev_debug (adapter,"%s: err = %d; port_id = %d; cntxt_id = %u\n" , - __func__, err, pi->port_id, rxq->rspq.cntxt_id); +dev_debug (adapter,"%s: err = %d; port_id = %d; cntxt_id = %u; abs_id = %u\n" , + __func__, err, pi->port_id, rxq->rspq.cntxt_id, + rxq->rspq.abs_id);return err; }
drivers/net/cxgbe/cxgbe_main.c +2 -1
@@ -1064,7 +1064,8 @@ int setup_rss(struct port_info *pi)static void enable_rx (struct adapter *adap,struct sge_rspq *q) {/* 0-increment GTS to start the timer and enable interrupts */ -t4_write_reg (adap,MYPF_REG (A_SGE_PF_GTS ), +t4_write_reg (adap,is_pf4 (adap) ?MYPF_REG (A_SGE_PF_GTS ) : +T4VF_SGE_BASE_ADDR +A_SGE_VF_GTS ,V_SEINTARM (q->intr_params) |V_INGRESSQID (q->cntxt_id)); }
drivers/net/cxgbe/cxgbevf_main.c +5 -0
@@ -108,6 +108,11 @@ static int adap_init0vf(struct adapter *adapter) } adapter->pf =t4vf_get_pf_from_vf (adapter); + err =t4vf_sge_init (adapter); +if (err) { +dev_err (adapter->pdev_dev,"error in sge init\n" ); +return err; + }/* If we're running on newer firmware, let it know that we're * prepared to deal with encapsulated CPL messages. Older
drivers/net/cxgbe/sge.c +221 -18
327 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH 6/13 cxgbe: enable RSS for VF
In reply to Rahul LakkireddyFrom: Kumar Sanghvi <[email protected]>
Query firmware and configure RSS for VF.
--- drivers/net/cxgbe/base/common.h | 22 ++++++++++ drivers/net/cxgbe/base/t4fw_interface.h | 78 +++++++++++++++++++++++++++++++++ drivers/net/cxgbe/base/t4vf_hw.c | 71 ++++++++++++++++++++++++++++++ drivers/net/cxgbe/cxgbe.h | 1 + drivers/net/cxgbe/cxgbe_main.c | 13 +++--- drivers/net/cxgbe/cxgbevf_main.c | 16 +++++++ 6 files changed, 196 insertions(+), 5 deletions(-)
drivers/net/cxgbe/base/common.h +22 -0
@@ -210,6 +210,26 @@ struct arch_specific_params {u16 mps_tcam_size; }; +/* +* Global Receive Side Scaling (RSS) parameters in host-native format. +*/ +struct rss_params { +unsigned int mode;/* RSS mode */ +union { +struct { +uint synmapen:1 ;/* SYN Map Enable */ +uint syn4tupenipv6:1 ;/* en 4-tuple IPv6 SYNs hash */ +uint syn2tupenipv6:1 ;/* en 2-tuple IPv6 SYNs hash */ +uint syn4tupenipv4:1 ;/* en 4-tuple IPv4 SYNs hash */ +uint syn2tupenipv4:1 ;/* en 2-tuple IPv4 SYNs hash */ +uint ofdmapen:1 ;/* Offload Map Enable */ +uint tnlmapen:1 ;/* Tunnel Map Enable */ +uint tnlalllookup:1 ;/* Tunnel All Lookup */ +uint hashtoeplitz:1 ;/* use Toeplitz hash */ + } basicvirtual; + } u; +}; +/* * Maximum resources provisioned for a PCI VF. */
@@ -232,6 +252,7 @@ struct adapter_params {struct vpd_params vpd;struct pci_params pci;struct devlog_params devlog; +struct rss_params rss;struct vf_resources vfres;enum pcie_memwin drv_memwin;
@@ -348,6 +369,7 @@ int t4vf_query_params(struct adapter *adap, unsigned int nparams, const u32 *params, u32 *vals);int t4vf_get_dev_params (struct adapter *adap);int t4vf_get_vpd_params (struct adapter *adap); +int t4vf_get_rss_glb_config (struct adapter *adap);int t4vf_set_params (struct adapter *adapter,unsigned int nparams,const u32 *params,const u32 *vals); int t4_set_params_timeout(struct adapter *adap, unsigned int mbox,
drivers/net/cxgbe/base/t4fw_interface.h +78 -0
90 lines not on this page · raw message
drivers/net/cxgbe/base/t4vf_hw.c +71 -0
77 lines not on this page · raw message
drivers/net/cxgbe/cxgbe.h +1 -0
@@ -62,6 +62,7 @@ void init_rspq(struct adapter *adap, struct sge_rspq *q, unsigned int us,int setup_sge_fwevtq (struct adapter *adapter);void cfg_queues (struct rte_eth_dev *eth_dev);int cfg_queue_count (struct rte_eth_dev *eth_dev); +int init_rss (struct adapter *adap);int setup_rss (struct port_info *pi);void cxgbe_enable_rx_queues (struct port_info *pi);void print_port_info (struct adapter *adap);
drivers/net/cxgbe/cxgbe_main.c +8 -5
@@ -346,14 +346,17 @@ static void setup_memwin(struct adapter *adap) MEMWIN_NIC)); } -static int init_rss (struct adapter *adap) +int init_rss (struct adapter *adap) {unsigned int i; -int err; - err =t4_init_rss_mode (adap, adap->mbox); -if (err) -return err; +if (is_pf4 (adap)) { +int err; + + err =t4_init_rss_mode (adap, adap->mbox); +if (err) +return err; + }for_each_port (adap, i) {struct port_info *pi =adap2pinfo (adap, i);
drivers/net/cxgbe/cxgbevf_main.c +16 -0
@@ -114,6 +114,19 @@ static int adap_init0vf(struct adapter *adapter)return err; } + err =t4vf_get_rss_glb_config (adapter); +if (err) { +dev_err (adapter->pdev_dev,"unable to retrieve adapter" +" RSS parameters: err=%d\n" , err); +return err; + } +if (adapter->params.rss.mode != +FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL ) { +dev_err (adapter->pdev_dev,"unable to operate with global RSS" +" mode %d\n" , adapter->params.rss.mode); +return -EINVAL ; + } +/* If we're running on newer firmware, let it know that we're * prepared to deal with encapsulated CPL messages. Older * firmware won't understand this and we'll just get
@@ -264,6 +277,9 @@ int cxgbevf_probe(struct adapter *adapter)print_adapter_info (adapter);print_port_info (adapter); + err =init_rss (adapter); +if (err) + goto out_free;return 0 ; out_free:
Signature · 1 line
2.14.1
PATCH 7/13 cxgbe: update TX and RX path for VF
In reply to Rahul LakkireddyFrom: Kumar Sanghvi <[email protected]>
On TX path, add fw_eth_tx_pkt_vm_wr to transmit packets over VF. Use is_pf4() to correctly calculate the work request size and offsets within the work request. On RX path, use pktshift to adjust data offset within the mbuf.
--- drivers/net/cxgbe/base/adapter.h | 5 ++ drivers/net/cxgbe/base/t4fw_interface.h | 25 ++++++ drivers/net/cxgbe/cxgbe_ethdev.c | 8 +- drivers/net/cxgbe/cxgbe_pfvf.h | 4 + drivers/net/cxgbe/cxgbevf_ethdev.c | 4 +- drivers/net/cxgbe/sge.c | 139 +++++++++++++++++++++++++------- 6 files changed, 149 insertions(+), 36 deletions(-)
drivers/net/cxgbe/base/adapter.h +5 -0
@@ -198,6 +198,7 @@ struct sge_eth_rxq { /* a SW Ethernet Rx queue */* scenario where a packet needs 32 bytes. */ #define ETH_COALESCE_PKT_NUM 15 +#define ETH_COALESCE_VF_PKT_NUM 7#define ETH_COALESCE_PKT_PER_DESC 2struct tx_eth_coal_desc {
@@ -227,6 +228,10 @@ struct eth_coalesce {unsigned int len;unsigned int flits;unsigned int max; +__u8 ethmacdst[ETHER_ADDR_LEN ]; +__u8 ethmacsrc[ETHER_ADDR_LEN ]; +__be16 ethtype; +__be16 vlantci; };struct sge_txq {
drivers/net/cxgbe/base/t4fw_interface.h +25 -0
@@ -84,6 +84,8 @@ enum fw_memtype {enum fw_wr_opcodes {FW_ETH_TX_PKT_WR =0x08 ,FW_ETH_TX_PKTS_WR =0x09 , +FW_ETH_TX_PKT_VM_WR =0x11 , +FW_ETH_TX_PKTS_VM_WR =0x12 ,FW_ETH_TX_PKTS2_WR =0x78 , };
@@ -146,6 +148,29 @@ struct fw_eth_tx_pkts_wr {__u8 type; }; +struct fw_eth_tx_pkt_vm_wr { +__be32 op_immdlen; +__be32 equiq_to_len16; +__be32 r3[2 ]; +__u8 ethmacdst[6 ]; +__u8 ethmacsrc[6 ]; +__be16 ethtype; +__be16 vlantci; +}; + +struct fw_eth_tx_pkts_vm_wr { +__be32 op_pkd; +__be32 equiq_to_len16; +__be32 r3; +__be16 plen; +__u8 npkt; +__u8 r4; +__u8 ethmacdst[6 ]; +__u8 ethmacsrc[6 ]; +__be16 ethtype; +__be16 vlantci; +}; +/****************************************************************************** * C O M M A N D s *********************/
drivers/net/cxgbe/cxgbe_ethdev.c +4 -4
@@ -86,8 +86,8 @@*/ #include "t4_pci_id_tbl.h" -static uint16_t cxgbe_xmit_pkts (void *tx_queue,struct rte_mbuf **tx_pkts, -uint16_t nb_pkts) +uint16_t cxgbe_xmit_pkts (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts) {struct sge_eth_txq *txq = (struct sge_eth_txq *)tx_queue;uint16_t pkts_sent, pkts_remain;
@@ -120,8 +120,8 @@ static uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,return total_sent; } -static uint16_t cxgbe_recv_pkts (void *rx_queue,struct rte_mbuf **rx_pkts, -uint16_t nb_pkts) +uint16_t cxgbe_recv_pkts (void *rx_queue,struct rte_mbuf **rx_pkts, +uint16_t nb_pkts) {struct sge_eth_rxq *rxq = (struct sge_eth_rxq *)rx_queue;unsigned int work_done;
drivers/net/cxgbe/cxgbe_pfvf.h +4 -0
@@ -34,5 +34,9 @@ int cxgbe_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu);int cxgbe_dev_start (struct rte_eth_dev *eth_dev);int cxgbe_dev_link_update (struct rte_eth_dev *eth_dev,int wait_to_complete); +uint16_t cxgbe_xmit_pkts (void *tx_queue,struct rte_mbuf **tx_pkts, +uint16_t nb_pkts); +uint16_t cxgbe_recv_pkts (void *rx_queue,struct rte_mbuf **rx_pkts, +uint16_t nb_pkts);const uint32_t *cxgbe_dev_supported_ptypes_get (struct rte_eth_dev *eth_dev);#endif /* _CXGBE_PFVF_H_ */
drivers/net/cxgbe/cxgbevf_ethdev.c +2 -2
@@ -68,8 +68,8 @@ static int eth_cxgbevf_dev_init(struct rte_eth_dev *eth_dev)CXGBE_FUNC_TRACE (); eth_dev->dev_ops = &cxgbevf_eth_dev_ops; - eth_dev->rx_pkt_burst =NULL ; - eth_dev->tx_pkt_burst =NULL ; + eth_dev->rx_pkt_burst = &cxgbe_recv_pkts; + eth_dev->tx_pkt_burst = &cxgbe_xmit_pkts; pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev);/* for secondary processes, we attach to ethdevs allocated by primary
drivers/net/cxgbe/sge.c +109 -30
288 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH 8/13 cxgbe: add VF port statistics
In reply to Rahul LakkireddyFrom: Kumar Sanghvi <[email protected]>
--- drivers/net/cxgbe/base/common.h | 2 + drivers/net/cxgbe/base/t4_regs.h | 10 +++ drivers/net/cxgbe/base/t4fw_interface.h | 13 ++++ drivers/net/cxgbe/base/t4vf_hw.c | 105 ++++++++++++++++++++++++++++++++ drivers/net/cxgbe/cxgbe.h | 1 + drivers/net/cxgbe/cxgbevf_ethdev.c | 44 +++++++++++++ drivers/net/cxgbe/cxgbevf_main.c | 5 ++ 7 files changed, 180 insertions(+)
drivers/net/cxgbe/base/common.h +2 -0
@@ -484,6 +484,8 @@ unsigned int t4_get_mps_bg_map(struct adapter *adapter, unsigned int pidx);unsigned int t4_get_tp_ch_map (struct adapter *adapter,unsigned int pidx);const char *t4_get_port_type_description (enum fw_port_type port_type);void t4_get_port_stats (struct adapter *adap,int idx,struct port_stats *p); +void t4vf_get_port_stats (struct adapter *adapter,int pidx, +struct port_stats *p);void t4_get_port_stats_offset (struct adapter *adap,int idx,struct port_stats *stats,struct port_stats *offset);
drivers/net/cxgbe/base/t4_regs.h +10 -0
@@ -601,6 +601,7 @@/* registers for module MPS */ #define MPS_BASE_ADDR 0x9000 +#define T4VF_MPS_BASE_ADDR 0x0100#define S_REPLICATE 11#define V_REPLICATE (x) ((x) << S_REPLICATE)
@@ -807,6 +808,15 @@#define A_MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_L 0x96b8#define A_MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_H 0x96bc +#define A_MPS_VF_STAT_TX_VF_BCAST_FRAMES_L 0x88 +#define A_MPS_VF_STAT_TX_VF_MCAST_FRAMES_L 0x98 +#define A_MPS_VF_STAT_TX_VF_UCAST_FRAMES_L 0xa8 +#define A_MPS_VF_STAT_TX_VF_DROP_FRAMES_L 0xb0 +#define A_MPS_VF_STAT_RX_VF_BCAST_FRAMES_L 0xd0 +#define A_MPS_VF_STAT_RX_VF_MCAST_FRAMES_L 0xe0 +#define A_MPS_VF_STAT_RX_VF_UCAST_FRAMES_L 0xf0 +#define A_MPS_VF_STAT_RX_VF_ERR_FRAMES_L 0xf8 +/* registers for module ULP_RX */ #define ULP_RX_BASE_ADDR 0x19150
drivers/net/cxgbe/base/t4fw_interface.h +13 -0
@@ -210,6 +210,7 @@ enum fw_cmd_opcodes {FW_VI_MAC_CMD =0x15 ,FW_VI_RXMODE_CMD =0x16 ,FW_VI_ENABLE_CMD =0x17 , +FW_VI_STATS_CMD =0x1a ,FW_PORT_CMD =0x1b ,FW_RSS_IND_TBL_CMD =0x20 , FW_RSS_GLB_CONFIG_CMD = 0x22,
@@ -1183,6 +1184,9 @@ struct fw_vi_enable_cmd { (((x) >> S_FW_VI_ENABLE_CMD_DCB_INFO) & M_FW_VI_ENABLE_CMD_DCB_INFO)#define F_FW_VI_ENABLE_CMD_DCB_INFO V_FW_VI_ENABLE_CMD_DCB_INFO(1U) +/* VI VF stats offset definitions */ +#define VI_VF_NUM_STATS 16 +/* VI PF stats offset definitions */ #define VI_PF_NUM_STATS 17enum fw_vi_stats_pf_index {
@@ -1260,6 +1264,15 @@ struct fw_vi_stats_cmd { } u; }; +#define S_FW_VI_STATS_CMD_VIID 0 +#define V_FW_VI_STATS_CMD_VIID (x) ((x) << S_FW_VI_STATS_CMD_VIID) + +#define S_FW_VI_STATS_CMD_NSTATS 12 +#define V_FW_VI_STATS_CMD_NSTATS (x) ((x) << S_FW_VI_STATS_CMD_NSTATS) + +#define S_FW_VI_STATS_CMD_IX 0 +#define V_FW_VI_STATS_CMD_IX (x) ((x) << S_FW_VI_STATS_CMD_IX) +/* old 16-bit port capabilities bitmap */ enum fw_port_cap {FW_PORT_CAP_SPEED_100M =0x0001 ,
drivers/net/cxgbe/base/t4vf_hw.c +105 -0
111 lines not on this page · raw message
drivers/net/cxgbe/cxgbe.h +1 -0
@@ -55,6 +55,7 @@ int cxgbe_up(struct adapter *adap);int cxgbe_down (struct port_info *pi);void cxgbe_close (struct adapter *adapter);void cxgbe_stats_get (struct port_info *pi,struct port_stats *stats); +void cxgbevf_stats_get (struct port_info *pi,struct port_stats *stats);void cxgbe_stats_reset (struct port_info *pi);int link_start (struct port_info *pi); void init_rspq(struct adapter *adap, struct sge_rspq *q, unsigned int us,
drivers/net/cxgbe/cxgbevf_ethdev.c +44 -0
56 lines not on this page · raw message
drivers/net/cxgbe/cxgbevf_main.c +5 -0
@@ -74,6 +74,11 @@ static void size_nports_qsets(struct adapter *adapter) } } +void cxgbevf_stats_get (struct port_info *pi,struct port_stats *stats) +{ +t4vf_get_port_stats (pi->adapter, pi->pidx, stats); +} +static int adap_init0vf (struct adapter *adapter) {u32 param, val =0 ;
Signature · 1 line
2.14.1
PATCH 9/13 cxgbe: add support to set mac address
In reply to Rahul LakkireddyFrom: Kumar Sanghvi <[email protected]>
--- drivers/net/cxgbe/cxgbe_ethdev.c | 17 +++++++++++++++++ drivers/net/cxgbe/cxgbe_pfvf.h | 1 + drivers/net/cxgbe/cxgbevf_ethdev.c | 1 + 3 files changed, 19 insertions(+)
drivers/net/cxgbe/cxgbe_ethdev.c +17 -0
@@ -1030,6 +1030,22 @@ static int cxgbe_get_regs(struct rte_eth_dev *eth_dev,return 0 ; } +void cxgbe_mac_addr_set (struct rte_eth_dev *dev,struct ether_addr *addr) +{ +struct port_info *pi = (struct port_info *)(dev->data->dev_private); +struct adapter *adapter = pi->adapter; +int ret; + + ret =t4_change_mac (adapter, adapter->mbox, pi->viid, + pi->xact_addr_filt, (u8 *)addr, true, true); +if (ret <0 ) { +dev_err (adapter,"failed to set mac addr; err = %d\n" , + ret); +return ; + } + pi->xact_addr_filt = ret; +} +static const struct eth_dev_ops cxgbe_eth_dev_ops = { .dev_start = cxgbe_dev_start, .dev_stop = cxgbe_dev_stop,
@@ -1061,6 +1077,7 @@ static const struct eth_dev_ops cxgbe_eth_dev_ops = { .get_reg = cxgbe_get_regs, .rss_hash_update = cxgbe_dev_rss_hash_update, .rss_hash_conf_get = cxgbe_dev_rss_hash_conf_get, + .mac_addr_set = cxgbe_mac_addr_set, };/*
drivers/net/cxgbe/cxgbe_pfvf.h +1 -0
@@ -16,6 +16,7 @@ void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev);void cxgbe_dev_promiscuous_disable (struct rte_eth_dev *eth_dev);void cxgbe_dev_allmulticast_enable (struct rte_eth_dev *eth_dev);void cxgbe_dev_allmulticast_disable (struct rte_eth_dev *eth_dev); +void cxgbe_mac_addr_set (struct rte_eth_dev *dev,struct ether_addr *addr);int cxgbe_dev_configure (struct rte_eth_dev *eth_dev); int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id,
drivers/net/cxgbe/cxgbevf_ethdev.c +1 -0
@@ -95,6 +95,7 @@ static const struct eth_dev_ops cxgbevf_eth_dev_ops = { .rx_queue_stop = cxgbe_dev_rx_queue_stop, .rx_queue_release = cxgbe_dev_rx_queue_release, .stats_get = cxgbevf_dev_stats_get, + .mac_addr_set = cxgbe_mac_addr_set, };/*
Signature · 1 line
2.14.1
PATCH 10/13 cxgbe: fix check to close other ports properly
In reply to Rahul Lakkireddy--- drivers/net/cxgbe/cxgbe_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/cxgbe/cxgbe_main.c +1 -1
@@ -1246,7 +1246,7 @@ void cxgbe_close(struct adapter *adapter) adapter->pf, 0, pi->viid);rte_free (pi->eth_dev->data->mac_addrs);/* Skip first port since it'll be freed by DPDK stack */ -if (!i) { +if (i) {rte_free (pi->eth_dev->data->dev_private);rte_eth_dev_release_port (pi->eth_dev); }
Signature · 1 line
2.14.1
Re: [PATCH 10/13] cxgbe: fix check to close other ports properly
Quoted 3 lines · Rahul Lakkireddy
Fixes 084b35314ff2 ("net/cxgbe: rework ethdev device allocation")Signed-off-by Rahul Lakkireddy <[email protected]>Signed-off-by Kumar Sanghvi <[email protected]>
Squashed into relevant commit in next-net, thanks.
PATCH 11/13 cxgbe: export supported RSS hash functions
In reply to Rahul LakkireddyExport supported RSS hash functions in device info. Also add check to prevent configuring unsupported RSS hash functions.
--- drivers/net/cxgbe/cxgbe.h | 5 +++++ drivers/net/cxgbe/cxgbe_ethdev.c | 1 + drivers/net/cxgbe/cxgbe_main.c | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-)
drivers/net/cxgbe/cxgbe.h +5 -0
@@ -47,6 +47,11 @@#define CXGBE_MAX_RX_PKTLEN (9000 + ETHER_HDR_LEN + ETHER_CRC_LEN)/* max pkt */ #define CXGBE_DEFAULT_RSS_KEY_LEN 40/* 320-bits */ +#define CXGBE_RSS_HF_ALL (ETH_RSS_IPV4 | ETH_RSS_IPV6 | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_NONFRAG_IPV6_UDP)int cxgbe_probe (struct adapter *adapter);int cxgbevf_probe (struct adapter *adapter);
drivers/net/cxgbe/cxgbe_ethdev.c +1 -0
@@ -173,6 +173,7 @@ void cxgbe_dev_info_get(struct rte_eth_dev *eth_dev, device_info->reta_size = pi->rss_size; device_info->hash_key_size =CXGBE_DEFAULT_RSS_KEY_LEN ; + device_info->flow_type_rss_offloads =CXGBE_RSS_HF_ALL ; device_info->rx_desc_lim = cxgbe_desc_lim; device_info->tx_desc_lim = cxgbe_desc_lim;
drivers/net/cxgbe/cxgbe_main.c +5 -1
@@ -365,7 +365,7 @@ int init_rss(struct adapter *adap)if (!pi->rss)return -ENOMEM ; - pi->rss_hf =ETH_RSS_TCP |ETH_RSS_UDP ; + pi->rss_hf =CXGBE_RSS_HF_ALL ; }return 0 ; }
@@ -957,6 +957,10 @@ int cxgbe_write_rss_conf(const struct port_info *pi, uint64_t rss_hf)return -EINVAL ; } +/* Don't allow unsupported hash functions */ +if (rss_hf & ~CXGBE_RSS_HF_ALL ) +return -EINVAL ; +if (rss_hf Ð_RSS_IPV4 ) flags |=F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN ;
Signature · 1 line
2.14.1
Re: [PATCH 11/13] cxgbe: export supported RSS hash functions
Quoted 6 lines · Rahul Lakkireddy
Export supported RSS hash functions in device info. Also add check to prevent configuring unsupported RSS hash functions.
Fixes 58c5a23c1c4f ("net/cxgbe: support updating RSS hash configuration and key")Signed-off-by Rahul Lakkireddy <[email protected]>Signed-off-by Kumar Sanghvi <[email protected]>
Squashed into relevant commit in next-net, thanks.
PATCH 12/13 cxgbe: convert to SPDX license tags
In reply to Rahul Lakkireddy--- doc/guides/nics/cxgbe.rst | 32 +++---------------------------- drivers/net/cxgbe/Makefile | 33 +++----------------------------- drivers/net/cxgbe/base/adapter.h | 34 +++------------------------------ drivers/net/cxgbe/base/common.h | 34 +++------------------------------ drivers/net/cxgbe/base/t4_chip_type.h | 34 +++------------------------------ drivers/net/cxgbe/base/t4_hw.c | 34 +++------------------------------ drivers/net/cxgbe/base/t4_hw.h | 34 +++------------------------------ drivers/net/cxgbe/base/t4_msg.h | 34 +++------------------------------ drivers/net/cxgbe/base/t4_pci_id_tbl.h | 34 +++------------------------------ drivers/net/cxgbe/base/t4_regs.h | 34 +++------------------------------ drivers/net/cxgbe/base/t4_regs_values.h | 34 +++------------------------------ drivers/net/cxgbe/base/t4fw_interface.h | 34 +++------------------------------ drivers/net/cxgbe/cxgbe.h | 34 +++------------------------------ drivers/net/cxgbe/cxgbe_compat.h | 34 +++------------------------------ drivers/net/cxgbe/cxgbe_ethdev.c | 34 +++------------------------------ drivers/net/cxgbe/cxgbe_main.c | 34 +++------------------------------ drivers/net/cxgbe/sge.c | 34 +++------------------------------ 17 files changed, 51 insertions(+), 524 deletions(-)
doc/guides/nics/cxgbe.rst +3 -29
@@ -1,32 +1,6 @@ -.. BSD LICENSE - Copyright 2015-2017 Chelsio Communications. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of Chelsio Communications nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2014-2018 Chelsio Communications. + All rights reserved. CXGBE Poll Mode Driver ======================
drivers/net/cxgbe/Makefile +3 -30
@@ -1,33 +1,6 @@ -# BSD LICENSE -# -# Copyright(c) 2014-2015 Chelsio Communications. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Chelsio Communications nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2014-2018 Chelsio Communications. +# All rights reserved. include $(RTE_SDK)/mk/rte.vars.mk
drivers/net/cxgbe/base/adapter.h +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ /* This file should not be included directly. Include common.h instead. */
drivers/net/cxgbe/base/common.h +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #ifndef __CHELSIO_COMMON_H
drivers/net/cxgbe/base/t4_chip_type.h +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #ifndef __T4_CHIP_TYPE_H__
drivers/net/cxgbe/base/t4_hw.c +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #include <netinet/in.h>
drivers/net/cxgbe/base/t4_hw.h +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #ifndef __T4_HW_H
drivers/net/cxgbe/base/t4_msg.h +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #ifndef T4_MSG_H
drivers/net/cxgbe/base/t4_pci_id_tbl.h +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #ifndef __T4_PCI_ID_TBL_H__
drivers/net/cxgbe/base/t4_regs.h +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #define MYPF_BASE 0x1b000
drivers/net/cxgbe/base/t4_regs_values.h +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #ifndef __T4_REGS_VALUES_H__
drivers/net/cxgbe/base/t4fw_interface.h +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #ifndef _T4FW_INTERFACE_H_
drivers/net/cxgbe/cxgbe.h +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #ifndef _CXGBE_H_
drivers/net/cxgbe/cxgbe_compat.h +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #ifndef _CXGBE_COMPAT_H_
drivers/net/cxgbe/cxgbe_ethdev.c +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #include <sys/queue.h>
drivers/net/cxgbe/cxgbe_main.c +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2017 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #include <sys/queue.h>
drivers/net/cxgbe/sge.c +3 -31
@@ -1,34 +1,6 @@ -/*- -* BSD LICENSE -* -* Copyright(c) 2014-2015 Chelsio Communications. -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* * Neither the name of Chelsio Communications nor the names of its -* contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2018 Chelsio Communications. +* All rights reserved. */ #include <sys/queue.h>
Signature · 1 line
2.14.1
PATCH 13/13 cxgbe: add option to keep outer VLAN tag in Q-in-Q
In reply to Rahul LakkireddyFrom: Kumar Sanghvi <[email protected]>
Add compile time option to keep outer VLAN tag in Q-in-Q packets.
--- config/common_base | 1 + doc/guides/nics/cxgbe.rst | 4 +++ drivers/net/cxgbe/base/t4_regs.h | 54 ++++++++++++++++++++++++++++++++++++++++ drivers/net/cxgbe/cxgbe_main.c | 43 ++++++++++++++++++++++++++++++++ drivers/net/cxgbe/sge.c | 3 ++- 5 files changed, 104 insertions(+), 1 deletion(-)
config/common_base +1 -0
@@ -167,6 +167,7 @@ CONFIG_RTE_LIBRTE_CXGBE_DEBUG_MBOX=n CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX=n CONFIG_RTE_LIBRTE_CXGBE_TPUT=y +CONFIG_RTE_LIBRTE_CXGBE_KEEP_OVLAN=n # NXP DPAA Bus CONFIG_RTE_LIBRTE_DPAA_BUS=n
doc/guides/nics/cxgbe.rst +4 -0
@@ -110,6 +110,10 @@ enabling debugging options may affect system performance. Toggle behaviour to prefer Throughput or Latency. +- ``CONFIG_RTE_LIBRTE_CXGBE_KEEP_OVLAN`` (default **n**) + + Toggle behaviour to keep/remove Outer VLAN in Q-in-Q. + .. _driver-compilation: Driver compilation and testing
drivers/net/cxgbe/base/t4_regs.h +54 -0
66 lines not on this page · raw message
drivers/net/cxgbe/cxgbe_main.c +43 -0
55 lines not on this page · raw message
drivers/net/cxgbe/sge.c +2 -1
@@ -1596,7 +1596,8 @@ static int process_responses(struct sge_rspq *q, int budget, }if (cpl->vlan_ex) { - pkt->ol_flags |=PKT_RX_VLAN ; + pkt->ol_flags |=PKT_RX_VLAN | +PKT_RX_VLAN_STRIPPED ; pkt->vlan_tci =ntohs (cpl->vlan); }
Signature · 1 line
2.14.1
Quoted 5 lines · Rahul Lakkireddy
Patches 1 - 9 add support for cxgbe VF driver. Patches 10 - 12 fix bugs and convert license in cxgbe files to SPDX License Tag. Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
Patch 1 adds minimal cxgbe VF driver.
Can you please update driver documentation with new supported device?
Quoted 20 lines
Patch 2 adds firmware mailbox support for VF.
Patch 3 adds base functions to enable VF ports in subsequent patches.
Patch 4 adds cxgbe VF probe to initialize VF devices.
Patch 5 initializes SGE and queues for VF.
Patch 6 enables RSS for VF.
Patch 7 updates TX and RX path for VF.
Patch 8 adds support for VF port statistics.
Patch 9 adds support to set mac address.
Patch 10 fixes bug where the other ports under same PF are not closed properly.
Quoted 7 lines
Patch 11 exports RSS hash functions in device info and adds check to prevent configuring unsupported hash functions.
Patch 12 converts all cxgbe files to use SPDX license tag.
Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
We are trying to reduce the config options, is it possible to provide this functionality with a runtime option (devargs) ?
Or there is already an offload option DEV_RX_OFFLOAD_QINQ_STRIP, I guess this is different (is it?), if so does it make sense to have another offload option to cover your case?
Quoted 20 lines
Thanks,
RahulKumar Sanghvi (10):
cxgbe: add skeleton VF driver
cxgbe: add VF firmware mailbox support
cxgbe: add base for enabling VF ports
cxgbe: add probe to initialize VF devices
cxgbe: initialize SGE and queues for VF
cxgbe: enable RSS for VF
cxgbe: update TX and RX path for VF
cxgbe: add VF port statistics
cxgbe: add support to set mac address
cxgbe: add option to keep outer VLAN tag in Q-in-QRahul Lakkireddy (3):
cxgbe: fix check to close other ports properly
cxgbe: export supported RSS hash functions
cxgbe: convert to SPDX license tags
<...>
Quoted 9 lines · Ferruh Yigit
Quoted 5 lines · Rahul Lakkireddy
Patches 1 - 9 add support for cxgbe VF driver. Patches 10 - 12 fix bugs and convert license in cxgbe files to SPDX License Tag. Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
Patch 1 adds minimal cxgbe VF driver.
Can you please update driver documentation with new supported device?
There is no addition of new devices. The existing supported devices will be supported for VF PMD as well.
Quoted 23 lines
Quoted 23 lines
Patch 2 adds firmware mailbox support for VF.
Patch 3 adds base functions to enable VF ports in subsequent patches.
Patch 4 adds cxgbe VF probe to initialize VF devices.
Patch 5 initializes SGE and queues for VF.
Patch 6 enables RSS for VF.
Patch 7 updates TX and RX path for VF.
Patch 8 adds support for VF port statistics.
Patch 9 adds support to set mac address.
Patch 10 fixes bug where the other ports under same PF are not closed properly.
Patch 11 exports RSS hash functions in device info and adds check to prevent configuring unsupported hash functions.
Quoted 8 lines
Quoted 4 lines
Patch 12 converts all cxgbe files to use SPDX license tag.
Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
We are trying to reduce the config options, is it possible to provide this functionality with a runtime option (devargs) ?
Thank you for pointing to this. It seems like a good option.
Quoted 5 lines
Or there is already an offload option
DEV_RX_OFFLOAD_QINQ_STRIP, I guess this is different (is it?), if so does it make sense to have another offload option to cover your case?
Yes, this is different. Here, its about stripping or preserving Outer-VLAN tag from double-vlan in Rx. We have few customers who need this for their use-case. So, adding another offload option would also help. Let us know which is preferred - either one, devargs OR another offload, seems fine.
Thanks,
Rahul
Quoted 6 lines · Rahul Lakkireddy
Quoted 5 lines · Ferruh Yigit
Quoted 4 lines · Rahul Lakkireddy
Patches 1 - 9 add support for cxgbe VF driver. Patches 10 - 12 fix bugs and convert license in cxgbe files to SPDX License Tag. Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Patch 1 adds minimal cxgbe VF driver.
Can you please update driver documentation with new supported device?
There is no addition of new devices. The existing supported devices will be supported for VF PMD as well.
Sorry I didn't get this part, new PMD is introduced (VF driver) but no new device support added? If so why new driver is added?
Quoted 41 lines
Quoted 24 lines
Quoted 24 lines
Patch 2 adds firmware mailbox support for VF.
Patch 3 adds base functions to enable VF ports in subsequent patches.
Patch 4 adds cxgbe VF probe to initialize VF devices.
Patch 5 initializes SGE and queues for VF.
Patch 6 enables RSS for VF.
Patch 7 updates TX and RX path for VF.
Patch 8 adds support for VF port statistics.
Patch 9 adds support to set mac address.
Patch 10 fixes bug where the other ports under same PF are not closed properly.
Patch 11 exports RSS hash functions in device info and adds check to prevent configuring unsupported hash functions.
Quoted 8 lines
Quoted 4 lines
Patch 12 converts all cxgbe files to use SPDX license tag.
Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
We are trying to reduce the config options, is it possible to provide this functionality with a runtime option (devargs) ?
Thank you for pointing to this. It seems like a good option.
Quoted 5 lines
Or there is already an offload option
DEV_RX_OFFLOAD_QINQ_STRIP, I guess this is different (is it?), if so does it make sense to have another offload option to cover your case?
Quoted 5 lines
Yes, this is different. Here, its about stripping or preserving Outer-VLAN tag from double-vlan in Rx. We have few customers who need this for their use-case. So, adding another offload option would also help. Let us know which is preferred - either one, devargs OR another offload, seems fine.
As far as I can see this is done by hw configuration, so I would think this is a kind of offload and tend to add it as another offload flag. cc'ed Shahaf for comment.
Out of curiosity, if it is OK, what is the use case of keeping outer-VLAN tag but remove inner-VLAN?
Quoted 4 lines
Thanks,
Rahul
Quoted 9 lines · Ferruh Yigit
Quoted 8 lines · Rahul Lakkireddy
Quoted 7 lines · Ferruh Yigit
Quoted 5 lines · Rahul Lakkireddy
Patches 1 - 9 add support for cxgbe VF driver. Patches 10 - 12 fix bugs and convert license in cxgbe files to SPDX License Tag. Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
Patch 1 adds minimal cxgbe VF driver.
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
Can you please update driver documentation with new supported device?
There is no addition of new devices. The existing supported devices will be supported for VF PMD as well.
Sorry I didn't get this part, new PMD is introduced (VF driver) but no new device support added? If so why new driver is added?
Sorry for the confusion. By mistake, I replied in relation to existing cxgbe PMD. New device ids are already handled by Patch 1/13 for VF. Will get the docs updated.
Quoted 47 lines
Quoted 41 lines
Quoted 24 lines
Quoted 24 lines
Patch 2 adds firmware mailbox support for VF.
Patch 3 adds base functions to enable VF ports in subsequent patches.
Patch 4 adds cxgbe VF probe to initialize VF devices.
Patch 5 initializes SGE and queues for VF.
Patch 6 enables RSS for VF.
Patch 7 updates TX and RX path for VF.
Patch 8 adds support for VF port statistics.
Patch 9 adds support to set mac address.
Patch 10 fixes bug where the other ports under same PF are not closed properly.
Patch 11 exports RSS hash functions in device info and adds check to prevent configuring unsupported hash functions.
Quoted 8 lines
Quoted 4 lines
Patch 12 converts all cxgbe files to use SPDX license tag.
Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
We are trying to reduce the config options, is it possible to provide this functionality with a runtime option (devargs) ?
Thank you for pointing to this. It seems like a good option.
Quoted 5 lines
Or there is already an offload option
DEV_RX_OFFLOAD_QINQ_STRIP, I guess this is different (is it?), if so does it make sense to have another offload option to cover your case?Quoted 5 lines
Yes, this is different. Here, its about stripping or preserving Outer-VLAN tag from double-vlan in Rx. We have few customers who need this for their use-case. So, adding another offload option would also help. Let us know which is preferred - either one, devargs OR another offload, seems fine.
Quoted 4 lines
As far as I can see this is done by hw configuration, so I would think this is a kind of offload and tend to add it as another offload flag. cc'ed Shahaf for comment.
Replied to Shahaf in earlier mail with more details on how Chelsio HW handles double-vlans.
Quoted 8 lines
Out of curiosity, if it is OK, what is the use case of keeping outer-VLAN tag but remove inner-VLAN?
Quoted 4 lines
Thanks,
Rahul
Tuesday, March 27, 2018 10:02 AM, Rahul Lakkireddy:
[...]
Quoted 16 lines
Quoted 7 lines
Quoted 3 lines
Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
We are trying to reduce the config options, is it possible to provide this functionality with a runtime option (devargs) ?
Thank you for pointing to this. It seems like a good option.
Quoted 5 lines
Or there is already an offload option
DEV_RX_OFFLOAD_QINQ_STRIP, I guess this is different (is it?), if so does it make sense to have another offload option to cover your case?
Quoted 4 lines
Yes, this is different. Here, its about stripping or preserving Outer-VLAN tag from double-vlan in Rx. We have few customers who need this for their use- case. So, adding another offload option would also help. Let us know which is preferred - either one, devargs OR another offload, seems fine.
What exactly is the offload you try to expose? To strip the inner VLAN while keeping the outer one?
Quoted 3 lines
Thanks,
Rahul
Quoted 20 lines · Shahaf Shuler
Tuesday, March 27, 2018 10:02 AM, Rahul Lakkireddy:
[...]
Quoted 16 lines
Quoted 7 lines
Quoted 3 lines
Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
We are trying to reduce the config options, is it possible to provide this functionality with a runtime option (devargs) ?
Thank you for pointing to this. It seems like a good option.
Quoted 5 lines
Or there is already an offload option
DEV_RX_OFFLOAD_QINQ_STRIP, I guess this is different (is it?), if so does it make sense to have another offload option to cover your case?
Quoted 7 lines
Quoted 4 lines
Yes, this is different. Here, its about stripping or preserving Outer-VLAN tag from double-vlan in Rx. We have few customers who need this for their use- case. So, adding another offload option would also help. Let us know which is preferred - either one, devargs OR another offload, seems fine.
What exactly is the offload you try to expose? To strip the inner VLAN while keeping the outer one?
Sorry about that, I should have provided more details on this earlier. Chelsio hardware supports below for double-vlans:
1) Dropping Outer VLAN in hw; inner vlan is stripped and available as packet metadata.
2) Preserving Outer VLAN so, Outer VLAN is stripped and available as packet metadata. Inner VLAN is available as part of packet itself.
So, the configurability here is with respect to Outer VLAN and subsequently what is available as part of packet metadata (outer or inner vlan). Inner VLAN gets retained in both cases. However, based on how Outer VLAN is configured, Inner VLAN will be available either as packet metadata or as part of packet itself.
We are not very sure if DEV_RX_OFFLOAD_QINQ_STRIP could be used here. If it holds the same meaning then we will use the same.
Thanks,
Rahul
Wednesday, March 28, 2018 10:40 AM, Rahul Lakkireddy:
Quoted 10 lines
On Wednesday, March 03/28/18, 2018 at 10:19:17 +0530, Shahaf Shuler
Quoted 2 lines
What exactly is the offload you try to expose? To strip the inner VLAN while
keeping the outer one?
Quoted 1 line
Sorry about that, I should have provided more details on this earlier. Chelsio hardware supports below for double-vlans:
1) Dropping Outer VLAN in hw; inner vlan is stripped and available as packet metadata.
So this is basically the DEV_RX_OFFLOAD_QINQ_STRIP with limitation from your device you cannot return the outer vlan in the packet metadata
Quoted 2 lines
2) Preserving Outer VLAN so, Outer VLAN is stripped and available as packet metadata. Inner VLAN is available as part of packet itself.
And this one is the regular DEV_RX_OFFLOAD_VLAN_STRIP
Quoted 9 lines
So, the configurability here is with respect to Outer VLAN and subsequently what is available as part of packet metadata (outer or inner vlan). Inner VLAN gets retained in both cases. However, based on how Outer VLAN is configured, Inner VLAN will be available either as packet metadata or as part of packet itself.
We are not very sure if
DEV_RX_OFFLOAD_QINQ_STRIPcould be used here. If it holds the same meaning then we will use the same.
Yeah , we are missing good documentation of what each offload means.
Quoted 3 lines
Thanks,
Rahul
Quoted 7 lines · Shahaf Shuler
Wednesday, March 28, 2018 10:40 AM, Rahul Lakkireddy:
Quoted 6 lines
On Wednesday, March 03/28/18, 2018 at 10:19:17 +0530, Shahaf Shuler
Quoted 2 lines
What exactly is the offload you try to expose? To strip the inner VLAN while
keeping the outer one?
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Sorry about that, I should have provided more details on this earlier. Chelsio hardware supports below for double-vlans:
1) Dropping Outer VLAN in hw; inner vlan is stripped and available as packet metadata.So this is basically the
DEV_RX_OFFLOAD_QINQ_STRIPwith limitation from your device you cannot return the outer vlan in the packet metadata
Since this is specific to Chelsio devices, is it better handled by devargs approach instead? We will respin this particular patch separately.
Hi Ferruh,
Should we re-post the entire series minus this particular patch?
Quoted 19 lines
Quoted 2 lines
2) Preserving Outer VLAN so, Outer VLAN is stripped and available as packet metadata. Inner VLAN is available as part of packet itself.
And this one is the regular
DEV_RX_OFFLOAD_VLAN_STRIPQuoted 9 lines
So, the configurability here is with respect to Outer VLAN and subsequently what is available as part of packet metadata (outer or inner vlan). Inner VLAN gets retained in both cases. However, based on how Outer VLAN is configured, Inner VLAN will be available either as packet metadata or as part of packet itself.
We are not very sure if
DEV_RX_OFFLOAD_QINQ_STRIPcould be used here. If it holds the same meaning then we will use the same.Yeah , we are missing good documentation of what each offload means.
Quoted 3 lines
Thanks,
Rahul
Quoted 16 lines · Rahul Lakkireddy
Quoted 7 lines · Shahaf Shuler
Wednesday, March 28, 2018 10:40 AM, Rahul Lakkireddy:
Quoted 6 lines
On Wednesday, March 03/28/18, 2018 at 10:19:17 +0530, Shahaf Shuler
Quoted 2 lines
What exactly is the offload you try to expose? To strip the inner VLAN while
keeping the outer one?
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Sorry about that, I should have provided more details on this earlier. Chelsio hardware supports below for double-vlans:
1) Dropping Outer VLAN in hw; inner vlan is stripped and available as packet metadata.So this is basically the
DEV_RX_OFFLOAD_QINQ_STRIPwith limitation from your device you cannot return the outer vlan in the packet metadata
Quoted 6 lines
Since this is specific to Chelsio devices, is it better handled by devargs approach instead? We will respin this particular patch separately.
Hi Ferruh,
Should we re-post the entire series minus this particular patch?
No new version required.
I will not merge patch 13/13.
Also expecting an incremental documentation patch to update device information.
Quoted 20 lines
Quoted 20 lines
Quoted 3 lines
2) Preserving Outer VLAN so, Outer VLAN is stripped and available as packet metadata. Inner VLAN is available as part of packet itself.
And this one is the regular
DEV_RX_OFFLOAD_VLAN_STRIPQuoted 9 lines
So, the configurability here is with respect to Outer VLAN and subsequently what is available as part of packet metadata (outer or inner vlan). Inner VLAN gets retained in both cases. However, based on how Outer VLAN is configured, Inner VLAN will be available either as packet metadata or as part of packet itself.
We are not very sure if
DEV_RX_OFFLOAD_QINQ_STRIPcould be used here. If it holds the same meaning then we will use the same.Yeah , we are missing good documentation of what each offload means.
Quoted 3 lines
Thanks,
Rahul
Quoted 48 lines · Rahul Lakkireddy
Patches 1 - 9 add support for cxgbe VF driver. Patches 10 - 12 fix bugs and convert license in cxgbe files to SPDX License Tag. Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
Patch 1 adds minimal cxgbe VF driver.
Patch 2 adds firmware mailbox support for VF.
Patch 3 adds base functions to enable VF ports in subsequent patches.
Patch 4 adds cxgbe VF probe to initialize VF devices.
Patch 5 initializes SGE and queues for VF.
Patch 6 enables RSS for VF.
Patch 7 updates TX and RX path for VF.
Patch 8 adds support for VF port statistics.
Patch 9 adds support to set mac address.
Patch 10 fixes bug where the other ports under same PF are not closed properly.
Patch 11 exports RSS hash functions in device info and adds check to prevent configuring unsupported hash functions.
Patch 12 converts all cxgbe files to use SPDX license tag.
Patch 13 adds compile time option to keep outer vlan tag in Q-in-Q packet.
Thanks,
RahulKumar Sanghvi (10):
cxgbe: add skeleton VF driver
cxgbe: add VF firmware mailbox support
cxgbe: add base for enabling VF ports
cxgbe: add probe to initialize VF devices
cxgbe: initialize SGE and queues for VF
cxgbe: enable RSS for VF
cxgbe: update TX and RX path for VF
cxgbe: add VF port statistics
cxgbe: add support to set mac address
cxgbe: add option to keep outer VLAN tag in Q-in-Q
Quoted 4 lines
Rahul Lakkireddy (3):
cxgbe: fix check to close other ports properly
cxgbe: export supported RSS hash functions
cxgbe: convert to SPDX license tags
Series applied to dpdk-next-net/master with exceptions, thanks.
Exceptions:
Patch 10/13 squashed into next-net
Patch 11/13 squashed into next-net
Patch 13/13 dropped from set and not merged
Also expecting an incremental documentation patch to update device information.