Re: [PATCH net] Revert "neighbour: force neigh_invalidate when NUD_FAILED update is from admin"
From: Roopa Prabhu Date: Sat, 20 Oct 2018 18:09:31 -0700 > From: Roopa Prabhu > > This reverts commit 8e326289e3069dfc9fa9c209924668dd031ab8ef. > > This patch results in unnecessary netlink notification when one > tries to delete a neigh entry already in NUD_FAILED state. Found > this with a buggy app that tries to delete a NUD_FAILED entry > repeatedly. While the notification issue can be fixed with more > checks, adding more complexity here seems unnecessary. Also, > recent tests with other changes in the neighbour code have > shown that the INCOMPLETE and PROBE checks are good enough for > the original issue. > > Signed-off-by: Roopa Prabhu Applied, thanks.
[PATCH net] Revert "neighbour: force neigh_invalidate when NUD_FAILED update is from admin"
From: Roopa Prabhu This reverts commit 8e326289e3069dfc9fa9c209924668dd031ab8ef. This patch results in unnecessary netlink notification when one tries to delete a neigh entry already in NUD_FAILED state. Found this with a buggy app that tries to delete a NUD_FAILED entry repeatedly. While the notification issue can be fixed with more checks, adding more complexity here seems unnecessary. Also, recent tests with other changes in the neighbour code have shown that the INCOMPLETE and PROBE checks are good enough for the original issue. Signed-off-by: Roopa Prabhu --- Dave, Sorry about the revert so late in the release. The issue is not serious, but i think its better to revert before it gets into a released kernel. I am happy to fix the notification issue but seems unnecessary at this point. Thanks. net/core/neighbour.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 91592fc..4e07824 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1148,8 +1148,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, neigh->nud_state = new; err = 0; notify = old & NUD_VALID; - if (((old & (NUD_INCOMPLETE | NUD_PROBE)) || -(flags & NEIGH_UPDATE_F_ADMIN)) && + if ((old & (NUD_INCOMPLETE | NUD_PROBE)) && (new & NUD_FAILED)) { neigh_invalidate(neigh); notify = 1; -- 2.1.4
[PATCH 07/16] octeontx2-af: NPA block admin queue init
From: Sunil Goutham Initialize NPA admin queue (AQ) i.e alloc memory for AQ instructions and for the results. All NPA LFs will submit instructions to AQ to init/write/read Aura/Pool contexts and in case of read, get context from result memory. Added some common APIs for allocating memory for a queue and get IOVA in return, these APIs will be used by NIX AQ and for other purposes. Signed-off-by: Sunil Goutham --- drivers/net/ethernet/marvell/octeontx2/af/Makefile | 2 +- drivers/net/ethernet/marvell/octeontx2/af/common.h | 99 ++ drivers/net/ethernet/marvell/octeontx2/af/rvu.c| 46 ++ drivers/net/ethernet/marvell/octeontx2/af/rvu.h| 13 ++- .../net/ethernet/marvell/octeontx2/af/rvu_npa.c| 86 +++ .../net/ethernet/marvell/octeontx2/af/rvu_struct.h | 65 ++ 6 files changed, 309 insertions(+), 2 deletions(-) create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/common.h create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_npa.c diff --git a/drivers/net/ethernet/marvell/octeontx2/af/Makefile b/drivers/net/ethernet/marvell/octeontx2/af/Makefile index eaac264..bdb4f98 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/Makefile +++ b/drivers/net/ethernet/marvell/octeontx2/af/Makefile @@ -7,4 +7,4 @@ obj-$(CONFIG_OCTEONTX2_MBOX) += octeontx2_mbox.o obj-$(CONFIG_OCTEONTX2_AF) += octeontx2_af.o octeontx2_mbox-y := mbox.o -octeontx2_af-y := cgx.o rvu.o rvu_cgx.o +octeontx2_af-y := cgx.o rvu.o rvu_cgx.o rvu_npa.o diff --git a/drivers/net/ethernet/marvell/octeontx2/af/common.h b/drivers/net/ethernet/marvell/octeontx2/af/common.h new file mode 100644 index 000..ec493ba --- /dev/null +++ b/drivers/net/ethernet/marvell/octeontx2/af/common.h @@ -0,0 +1,99 @@ +/* SPDX-License-Identifier: GPL-2.0 + * Marvell OcteonTx2 RVU Admin Function driver + * + * Copyright (C) 2018 Marvell International Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef COMMON_H +#define COMMON_H + +#include "rvu_struct.h" + +#define OTX2_ALIGN 128 /* Align to cacheline */ + +#define Q_SIZE_16 0ULL /* 16 entries */ +#define Q_SIZE_64 1ULL /* 64 entries */ +#define Q_SIZE_256 2ULL +#define Q_SIZE_1K 3ULL +#define Q_SIZE_4K 4ULL +#define Q_SIZE_16K 5ULL +#define Q_SIZE_64K 6ULL +#define Q_SIZE_256K7ULL +#define Q_SIZE_1M 8ULL /* Million entries */ +#define Q_SIZE_MIN Q_SIZE_16 +#define Q_SIZE_MAX Q_SIZE_1M + +#define Q_COUNT(x) (16ULL << (2 * x)) +#define Q_SIZE(x, n) ((ilog2(x) - (n)) / 2) + +/* Admin queue info */ + +/* Since we intend to add only one instruction at a time, + * keep queue size to it's minimum. + */ +#define AQ_SIZEQ_SIZE_16 +/* HW head & tail pointer mask */ +#define AQ_PTR_MASK0xF + +struct qmem { + void*base; + dma_addr_t iova; + int alloc_sz; + u8 entry_sz; + u8 align; + u32 qsize; +}; + +static inline int qmem_alloc(struct device *dev, struct qmem **q, +int qsize, int entry_sz) +{ + struct qmem *qmem; + int aligned_addr; + + if (!qsize) + return -EINVAL; + + *q = devm_kzalloc(dev, sizeof(*qmem), GFP_KERNEL); + if (!*q) + return -ENOMEM; + qmem = *q; + + qmem->entry_sz = entry_sz; + qmem->alloc_sz = (qsize * entry_sz) + OTX2_ALIGN; + qmem->base = dma_zalloc_coherent(dev, qmem->alloc_sz, +>iova, GFP_KERNEL); + if (!qmem->base) + return -ENOMEM; + + qmem->qsize = qsize; + + aligned_addr = ALIGN((u64)qmem->iova, OTX2_ALIGN); + qmem->align = (aligned_addr - qmem->iova); + qmem->base += qmem->align; + qmem->iova += qmem->align; + return 0; +} + +static inline void qmem_free(struct device *dev, struct qmem *qmem) +{ + if (!qmem) + return; + + if (qmem->base) + dma_free_coherent(dev, qmem->alloc_sz, + qmem->base - qmem->align, + qmem->iova - qmem->align); + devm_kfree(dev, qmem); +} + +struct admin_queue { + struct qmem *inst; + struct qmem *res; + spinlock_t lock; /* Serialize inst enqueue from PFs */ +}; + +#endif /* COMMON_H */ diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c index 85994ab..14255f2 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c +++ b
[PATCH 11/16] octeontx2-af: NIX block admin queue init
From: Sunil Goutham Initialize NIX admin queue (AQ) i.e alloc memory for AQ instructions and for the results. All NIX LFs will submit instructions to AQ to init/write/read RQ/SQ/CQ/RSS contexts and in case of read, get context from result memory. Also before configuring/using NIX block calibrate X2P bus and check if NIX interfaces like CGX and LBK are in active and working state. Signed-off-by: Sunil Goutham --- drivers/net/ethernet/marvell/octeontx2/af/Makefile | 2 +- drivers/net/ethernet/marvell/octeontx2/af/rvu.c| 5 + drivers/net/ethernet/marvell/octeontx2/af/rvu.h| 4 + .../net/ethernet/marvell/octeontx2/af/rvu_nix.c| 138 + .../net/ethernet/marvell/octeontx2/af/rvu_struct.h | 72 +++ 5 files changed, 220 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c diff --git a/drivers/net/ethernet/marvell/octeontx2/af/Makefile b/drivers/net/ethernet/marvell/octeontx2/af/Makefile index bdb4f98..45b108f 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/Makefile +++ b/drivers/net/ethernet/marvell/octeontx2/af/Makefile @@ -7,4 +7,4 @@ obj-$(CONFIG_OCTEONTX2_MBOX) += octeontx2_mbox.o obj-$(CONFIG_OCTEONTX2_AF) += octeontx2_af.o octeontx2_mbox-y := mbox.o -octeontx2_af-y := cgx.o rvu.o rvu_cgx.o rvu_npa.o +octeontx2_af-y := cgx.o rvu.o rvu_cgx.o rvu_npa.o rvu_nix.o diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c index 5d4917c..c06cca9 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c @@ -566,6 +566,7 @@ static void rvu_free_hw_resources(struct rvu *rvu) u64 cfg; rvu_npa_freemem(rvu); + rvu_nix_freemem(rvu); /* Free block LF bitmaps */ for (id = 0; id < BLK_COUNT; id++) { @@ -774,6 +775,10 @@ static int rvu_setup_hw_resources(struct rvu *rvu) if (err) return err; + err = rvu_nix_init(rvu); + if (err) + return err; + return 0; } diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h index bfc95c3..0d0fb1d 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h @@ -226,4 +226,8 @@ int rvu_mbox_handler_NPA_LF_ALLOC(struct rvu *rvu, struct npa_lf_alloc_rsp *rsp); int rvu_mbox_handler_NPA_LF_FREE(struct rvu *rvu, struct msg_req *req, struct msg_rsp *rsp); + +/* NIX APIs */ +int rvu_nix_init(struct rvu *rvu); +void rvu_nix_freemem(struct rvu *rvu); #endif /* RVU_H */ diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c new file mode 100644 index 000..5ff9e6b --- /dev/null +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Marvell OcteonTx2 RVU Admin Function driver + * + * Copyright (C) 2018 Marvell International Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include + +#include "rvu_struct.h" +#include "rvu_reg.h" +#include "rvu.h" +#include "cgx.h" + +static int nix_calibrate_x2p(struct rvu *rvu, int blkaddr) +{ + int idx, err; + u64 status; + + /* Start X2P bus calibration */ + rvu_write64(rvu, blkaddr, NIX_AF_CFG, + rvu_read64(rvu, blkaddr, NIX_AF_CFG) | BIT_ULL(9)); + /* Wait for calibration to complete */ + err = rvu_poll_reg(rvu, blkaddr, + NIX_AF_STATUS, BIT_ULL(10), false); + if (err) { + dev_err(rvu->dev, "NIX X2P bus calibration failed\n"); + return err; + } + + status = rvu_read64(rvu, blkaddr, NIX_AF_STATUS); + /* Check if CGX devices are ready */ + for (idx = 0; idx < cgx_get_cgx_cnt(); idx++) { + if (status & (BIT_ULL(16 + idx))) + continue; + dev_err(rvu->dev, + "CGX%d didn't respond to NIX X2P calibration\n", idx); + err = -EBUSY; + } + + /* Check if LBK is ready */ + if (!(status & BIT_ULL(19))) { + dev_err(rvu->dev, + "LBK didn't respond to NIX X2P calibration\n"); + err = -EBUSY; + } + + /* Clear 'calibrate_x2p' bit */ + rvu_write64(rvu, blkaddr, NIX_AF_CFG, + rvu_read64(rvu, blkaddr, NIX_AF_CFG) & ~BIT_ULL(9)); + if (err || (status & 0x3FFULL)) + dev_err(rvu->dev, + "NIX X2P calibration failed, status 0x
Re: [PATCH v9 00/15] octeontx2-af: Add RVU Admin Function driver
From: sunil.kovv...@gmail.com Date: Wed, 10 Oct 2018 18:14:20 +0530 > Resource virtualization unit (RVU) on Marvell's OcteonTX2 SOC maps HW > resources from the network, crypto and other functional blocks into > PCI-compatible physical and virtual functions. Each functional block > again has multiple local functions (LFs) for provisioning to PCI devices. > RVU supports multiple PCIe SRIOV physical functions (PFs) and virtual > functions (VFs). PF0 is called the administrative / admin function (AF) > and has privileges to provision RVU functional block's LFs to each of the > PF/VF. > > RVU managed networking functional blocks > - Network pool allocator (NPA) > - Network interface controller (NIX) > - Network parser CAM (NPC) > - Schedule/Synchronize/Order unit (SSO) > > RVU managed non-networking functional blocks > - Crypto accelerator (CPT) > - Scheduled timers unit (TIM) > - Schedule/Synchronize/Order unit (SSO) >Used for both networking and non networking usecases > - Compression (upcoming in future variants of the silicons) > > Resource provisioning examples > - A PF/VF with NIX-LF & NPA-LF resources works as a pure network device > - A PF/VF with CPT-LF resource works as a pure cyrpto offload device. > > This admin function driver neither receives any data nor processes it i.e > no I/O, a configuration only driver. > > PF/VFs communicates with AF via a shared memory region (mailbox). Upon > receiving requests from PF/VF, AF does resource provisioning and other > HW configuration. AF is always attached to host, but PF/VFs may be used > by host kernel itself, or attached to VMs or to userspace applications > like DPDK etc. So AF has to handle provisioning/configuration requests > sent by any device from any domain. > > This patch series adds logic for the following > - RVU AF driver with functional blocks provisioning support. > - Mailbox infrastructure for communication between AF and PFs. > - CGX (MAC controller) driver which communicates with firmware for >managing physical ethernet interfaces. AF collects info from this >driver and forwards the same to the PF/VFs uaing these interfaces. > > This is the first set of patches out of 80+ patches. Series applied. Please address Arnd's feedback about your usleep based timeout loops as a follow-on. Thank you.
Re: [PATCH v9 00/15] octeontx2-af: Add RVU Admin Function driver
On 10/10/18, sunil.kovv...@gmail.com wrote: > From: Sunil Goutham > This is the first set of patches out of 80+ patches. > > Changes from v8: > 1 Removed unnecessary typecasts in entire series >- Suggested by David Miller > 2 Added COMPILE_TEST to AF driver >- Suggested by Arnd Bergmann > 3 Changed udelay() to usleep_range() in rvu_poll_reg >- Suggested by Arnd Bergmann > 4 MSIX vector base IOMMU mapping is done using dma_map_resource() >API instead of dma_map_single() as it accepts physical address. >- Issue pointed by Arnd Bergmann With those changes, I have no more review comments (other than a single suggestion to improve the usleep_range() loop again). Reviewed-by: Arnd Bergmann Arnd
[PATCH v9 15/15] MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver
From: Sunil Goutham Added maintainers entry for Marvell OcteonTX2 SOC's RVU admin function driver. Signed-off-by: Sunil Goutham --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 54e719d..fe223e6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8847,6 +8847,15 @@ S: Supported F: drivers/mmc/host/sdhci-xenon* F: Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.txt +MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER +M: Sunil Goutham +M: Linu Cherian +M: Geetha sowjanya +M: Jerin Jacob +L: netdev@vger.kernel.org +S: Supported +F: drivers/net/ethernet/marvell/octeontx2/af/ + MATROX FRAMEBUFFER DRIVER L: linux-fb...@vger.kernel.org S: Orphan -- 2.7.4
[PATCH v9 00/15] octeontx2-af: Add RVU Admin Function driver
From: Sunil Goutham Resource virtualization unit (RVU) on Marvell's OcteonTX2 SOC maps HW resources from the network, crypto and other functional blocks into PCI-compatible physical and virtual functions. Each functional block again has multiple local functions (LFs) for provisioning to PCI devices. RVU supports multiple PCIe SRIOV physical functions (PFs) and virtual functions (VFs). PF0 is called the administrative / admin function (AF) and has privileges to provision RVU functional block's LFs to each of the PF/VF. RVU managed networking functional blocks - Network pool allocator (NPA) - Network interface controller (NIX) - Network parser CAM (NPC) - Schedule/Synchronize/Order unit (SSO) RVU managed non-networking functional blocks - Crypto accelerator (CPT) - Scheduled timers unit (TIM) - Schedule/Synchronize/Order unit (SSO) Used for both networking and non networking usecases - Compression (upcoming in future variants of the silicons) Resource provisioning examples - A PF/VF with NIX-LF & NPA-LF resources works as a pure network device - A PF/VF with CPT-LF resource works as a pure cyrpto offload device. This admin function driver neither receives any data nor processes it i.e no I/O, a configuration only driver. PF/VFs communicates with AF via a shared memory region (mailbox). Upon receiving requests from PF/VF, AF does resource provisioning and other HW configuration. AF is always attached to host, but PF/VFs may be used by host kernel itself, or attached to VMs or to userspace applications like DPDK etc. So AF has to handle provisioning/configuration requests sent by any device from any domain. This patch series adds logic for the following - RVU AF driver with functional blocks provisioning support. - Mailbox infrastructure for communication between AF and PFs. - CGX (MAC controller) driver which communicates with firmware for managing physical ethernet interfaces. AF collects info from this driver and forwards the same to the PF/VFs uaing these interfaces. This is the first set of patches out of 80+ patches. Changes from v8: 1 Removed unnecessary typecasts in entire series - Suggested by David Miller 2 Added COMPILE_TEST to AF driver - Suggested by Arnd Bergmann 3 Changed udelay() to usleep_range() in rvu_poll_reg - Suggested by Arnd Bergmann 4 MSIX vector base IOMMU mapping is done using dma_map_resource() API instead of dma_map_single() as it accepts physical address. - Issue pointed by Arnd Bergmann Changes from v7: 1 Removed unnecessary typecasts in mbox infra code. - Suggested by David Miller 2 Fixed MAINTAINERS patch - Suggested by Joe Perches Changes from v6: Fixed ordering of local variables from longest to shortest line. - Suggested by David Miller Changes from v5: Modified bitfield based command structures to bitmasks for communication with firmware, to address endianness issues. - Suggested by Arnd Bergmann Changes from v4: 1 Removed module author/version/description from CGX driver as it's now merged with AF driver module. - Suggested by Arnd Bergmann 2 Added big-endian bitfields for CGX's kernel <=> firmware communication command structures. - Suggested by Arnd Bergmann Changes from v3: Moved driver from drivers/soc to drivers/net/ethernet - Suggested by Arnd Bergmann https://patchwork.kernel.org/cover/10587635/ Changes from v2: No changes, submitted again with netdev mailing list in loop. - Suggested by Arnd Bergmann and Andrew Lunn Changes from v1: 1 Merged RVU admin function and CGX drivers into a single module - Suggested by Arnd Bergmann 2 Pulled mbox communication APIs into a separate module to remove admin function driver dependency in a VM where AF is not attached. - Suggested by Arnd Bergmann Aleksey Makarov (2): octeontx2-af: Add mailbox support infra octeontx2-af: Convert mbox msg id check to a macro Geetha sowjanya (1): octeontx2-af: Reconfig MSIX base with IOVA Linu Cherian (3): octeontx2-af: Set RVU PFs to CGX LMACs mapping octeontx2-af: Add support for CGX link management octeontx2-af: Register for CGX lmac events Sunil Goutham (9): octeontx2-af: Add Marvell OcteonTX2 RVU AF driver octeontx2-af: Reset all RVU blocks octeontx2-af: Gather RVU blocks HW info octeontx2-af: Add mailbox IRQ and msg handlers octeontx2-af: Scan blocks for LFs provisioned to PF/VF octeontx2-af: Add RVU block LF provisioning support octeontx2-af: Configure block LF's MSIX vector offset octeontx2-af: Add Marvell OcteonTX2 CGX driver MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver MAINTAINERS|9 + drivers/net/ethernet/marvell/Kconfig |3 + drivers/net/ethernet/marvell/Makefile |1 + drivers/net/ethernet/marvell/octeontx2/Kconfig | 17 + drivers/net/ethernet/marvell/octeontx2/Makefile|6 + drivers/net/ethernet/marvell/octeontx2/a
[PATCH v8 15/15] MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver
From: Sunil Goutham Added maintainers entry for Marvell OcteonTX2 SOC's RVU admin function driver. Signed-off-by: Sunil Goutham --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bb5f431..bc76b03 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8844,6 +8844,15 @@ S: Supported F: drivers/mmc/host/sdhci-xenon* F: Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.txt +MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER +M: Sunil Goutham +M: Linu Cherian +M: Geetha sowjanya +M: Jerin Jacob +L: netdev@vger.kernel.org +S: Supported +F: drivers/net/ethernet/marvell/octeontx2/af/ + MATROX FRAMEBUFFER DRIVER L: linux-fb...@vger.kernel.org S: Orphan -- 2.7.4
[PATCH v8 00/15] octeontx2-af: Add RVU Admin Function driver
From: Sunil Goutham Resource virtualization unit (RVU) on Marvell's OcteonTX2 SOC maps HW resources from the network, crypto and other functional blocks into PCI-compatible physical and virtual functions. Each functional block again has multiple local functions (LFs) for provisioning to PCI devices. RVU supports multiple PCIe SRIOV physical functions (PFs) and virtual functions (VFs). PF0 is called the administrative / admin function (AF) and has privileges to provision RVU functional block's LFs to each of the PF/VF. RVU managed networking functional blocks - Network pool allocator (NPA) - Network interface controller (NIX) - Network parser CAM (NPC) - Schedule/Synchronize/Order unit (SSO) RVU managed non-networking functional blocks - Crypto accelerator (CPT) - Scheduled timers unit (TIM) - Schedule/Synchronize/Order unit (SSO) Used for both networking and non networking usecases - Compression (upcoming in future variants of the silicons) Resource provisioning examples - A PF/VF with NIX-LF & NPA-LF resources works as a pure network device - A PF/VF with CPT-LF resource works as a pure cyrpto offload device. This admin function driver neither receives any data nor processes it i.e no I/O, a configuration only driver. PF/VFs communicates with AF via a shared memory region (mailbox). Upon receiving requests from PF/VF, AF does resource provisioning and other HW configuration. AF is always attached to host, but PF/VFs may be used by host kernel itself, or attached to VMs or to userspace applications like DPDK etc. So AF has to handle provisioning/configuration requests sent by any device from any domain. This patch series adds logic for the following - RVU AF driver with functional blocks provisioning support. - Mailbox infrastructure for communication between AF and PFs. - CGX (MAC controller) driver which communicates with firmware for managing physical ethernet interfaces. AF collects info from this driver and forwards the same to the PF/VFs uaing these interfaces. This is the first set of patches out of 80+ patches. Changes from v7: 1 Removed unecessary typecasts in mbox infra code. - Suggested by David Miller 2 Fixed MAINTAINERS patch - Suggested by Joe Perches Changes from v6: Fixed ordering of local variables from longest to shortest line. - Suggested by David Miller Changes from v5: Modified bitfield based command structures to bitmasks for communication with firmware, to address endianness issues. - Suggested by Arnd Bergmann Changes from v4: 1 Removed module author/version/description from CGX driver as it's now merged with AF driver module. - Suggested by Arnd Bergmann 2 Added big-endian bitfields for CGX's kernel <=> firmware communication command structures. - Suggested by Arnd Bergmann Changes from v3: Moved driver from drivers/soc to drivers/net/ethernet - Suggested by Arnd Bergmann https://patchwork.kernel.org/cover/10587635/ Changes from v2: No changes, submitted again with netdev mailing list in loop. - Suggested by Arnd Bergmann and Andrew Lunn Changes from v1: 1 Merged RVU admin function and CGX drivers into a single module - Suggested by Arnd Bergmann 2 Pulled mbox communication APIs into a separate module to remove admin function driver dependency in a VM where AF is not attached. - Suggested by Arnd Bergmann Aleksey Makarov (2): octeontx2-af: Add mailbox support infra octeontx2-af: Convert mbox msg id check to a macro Geetha sowjanya (1): octeontx2-af: Reconfig MSIX base with IOVA Linu Cherian (3): octeontx2-af: Set RVU PFs to CGX LMACs mapping octeontx2-af: Add support for CGX link management octeontx2-af: Register for CGX lmac events Sunil Goutham (9): octeontx2-af: Add Marvell OcteonTX2 RVU AF driver octeontx2-af: Reset all RVU blocks octeontx2-af: Gather RVU blocks HW info octeontx2-af: Add mailbox IRQ and msg handlers octeontx2-af: Scan blocks for LFs provisioned to PF/VF octeontx2-af: Add RVU block LF provisioning support octeontx2-af: Configure block LF's MSIX vector offset octeontx2-af: Add Marvell OcteonTX2 CGX driver MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver MAINTAINERS|9 + drivers/net/ethernet/marvell/Kconfig |3 + drivers/net/ethernet/marvell/Makefile |1 + drivers/net/ethernet/marvell/octeontx2/Kconfig | 16 + drivers/net/ethernet/marvell/octeontx2/Makefile|6 + drivers/net/ethernet/marvell/octeontx2/af/Makefile | 10 + drivers/net/ethernet/marvell/octeontx2/af/cgx.c| 505 ++ drivers/net/ethernet/marvell/octeontx2/af/cgx.h| 65 + .../net/ethernet/marvell/octeontx2/af/cgx_fw_if.h | 186 +++ drivers/net/ethernet/marvell/octeontx2/af/mbox.c | 303 drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 211 +++ drivers/net/ethernet/marvell/octeontx2/af/rvu.c| 1637 d
Re: [PATCH v7 15/15] MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver
On Sat, Oct 6, 2018 at 1:05 PM Joe Perches wrote: > > On Sat, 2018-10-06 at 11:36 +0530, sunil.kovv...@gmail.com wrote: > > Added maintainers entry for Marvell OcteonTX2 SOC's RVU > > admin function driver. > [] > > diff --git a/MAINTAINERS b/MAINTAINERS > [] > > @@ -8844,6 +8844,15 @@ S: Supported > > F: drivers/mmc/host/sdhci-xenon* > > F: Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.txt > > > > +MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER > > +M: Sunil Goutham > > +M: Linu Cherian > > +M: Geetha sowjanya > +M: Jerin Jacob > > +L: netdev@vger.kernel.org > > +S: Maintained > > Aren't you all being paid? > > So shouldn't this be > > S: Supported > > ? > > > +F: drivers/net/ethernet/marvell/octeontx2/af > > Please add a terminating / to show that this > is a directory and not a file. > > F: drivers/net/ethernet/marvell/octeontx2/af/ > Thanks for looking at this, will fix these. Sunil.
Re: [PATCH v7 15/15] MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver
On Sat, 2018-10-06 at 11:36 +0530, sunil.kovv...@gmail.com wrote: > Added maintainers entry for Marvell OcteonTX2 SOC's RVU > admin function driver. [] > diff --git a/MAINTAINERS b/MAINTAINERS [] > @@ -8844,6 +8844,15 @@ S: Supported > F: drivers/mmc/host/sdhci-xenon* > F: Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.txt > > +MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER > +M: Sunil Goutham > +M: Linu Cherian > +M: Geetha sowjanya +M: Jerin Jacob > +L: netdev@vger.kernel.org > +S: Maintained Aren't you all being paid? So shouldn't this be S: Supported ? > +F: drivers/net/ethernet/marvell/octeontx2/af Please add a terminating / to show that this is a directory and not a file. F: drivers/net/ethernet/marvell/octeontx2/af/
[PATCH v7 15/15] MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver
From: Sunil Goutham Added maintainers entry for Marvell OcteonTX2 SOC's RVU admin function driver. Signed-off-by: Sunil Goutham --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bb5f431..eee6151 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8844,6 +8844,15 @@ S: Supported F: drivers/mmc/host/sdhci-xenon* F: Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.txt +MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER +M: Sunil Goutham +M: Linu Cherian +M: Geetha sowjanya +M: Jerin Jacob +L: netdev@vger.kernel.org +S: Maintained +F: drivers/net/ethernet/marvell/octeontx2/af + MATROX FRAMEBUFFER DRIVER L: linux-fb...@vger.kernel.org S: Orphan -- 2.7.4
[PATCH v7 00/15] octeontx2-af: Add RVU Admin Function driver
From: Sunil Goutham Resource virtualization unit (RVU) on Marvell's OcteonTX2 SOC maps HW resources from the network, crypto and other functional blocks into PCI-compatible physical and virtual functions. Each functional block again has multiple local functions (LFs) for provisioning to PCI devices. RVU supports multiple PCIe SRIOV physical functions (PFs) and virtual functions (VFs). PF0 is called the administrative / admin function (AF) and has privileges to provision RVU functional block's LFs to each of the PF/VF. RVU managed networking functional blocks - Network pool allocator (NPA) - Network interface controller (NIX) - Network parser CAM (NPC) - Schedule/Synchronize/Order unit (SSO) RVU managed non-networking functional blocks - Crypto accelerator (CPT) - Scheduled timers unit (TIM) - Schedule/Synchronize/Order unit (SSO) Used for both networking and non networking usecases - Compression (upcoming in future variants of the silicons) Resource provisioning examples - A PF/VF with NIX-LF & NPA-LF resources works as a pure network device - A PF/VF with CPT-LF resource works as a pure cyrpto offload device. This admin function driver neither receives any data nor processes it i.e no I/O, a configuration only driver. PF/VFs communicates with AF via a shared memory region (mailbox). Upon receiving requests from PF/VF, AF does resource provisioning and other HW configuration. AF is always attached to host, but PF/VFs may be used by host kernel itself, or attached to VMs or to userspace applications like DPDK etc. So AF has to handle provisioning/configuration requests sent by any device from any domain. This patch series adds logic for the following - RVU AF driver with functional blocks provisioning support. - Mailbox infrastructure for communication between AF and PFs. - CGX (MAC controller) driver which communicates with firmware for managing physical ethernet interfaces. AF collects info from this driver and forwards the same to the PF/VFs uaing these interfaces. This is the first set of patches out of 80+ patches. Changes from v6: Fixed ordering of local variables from longest to shortest line. - Suggested by David Miller Changes from v5: Modified bitfield based command structures to bitmasks for communication with firmware, to address endianness issues. - Suggested by Arnd Bergmann Changes from v4: 1 Removed module author/version/description from CGX driver as it's now merged with AF driver module. - Suggested by Arnd Bergmann 2 Added big-endian bitfields for CGX's kernel <=> firmware communication command structures. - Suggested by Arnd Bergmann Changes from v3: Moved driver from drivers/soc to drivers/net/ethernet - Suggested by Arnd Bergmann https://patchwork.kernel.org/cover/10587635/ Changes from v2: No changes, submitted again with netdev mailing list in loop. - Suggested by Arnd Bergmann and Andrew Lunn Changes from v1: 1 Merged RVU admin function and CGX drivers into a single module - Suggested by Arnd Bergmann 2 Pulled mbox communication APIs into a separate module to remove admin function driver dependency in a VM where AF is not attached. - Suggested by Arnd Bergmann Aleksey Makarov (2): octeontx2-af: Add mailbox support infra octeontx2-af: Convert mbox msg id check to a macro Geetha sowjanya (1): octeontx2-af: Reconfig MSIX base with IOVA Linu Cherian (3): octeontx2-af: Set RVU PFs to CGX LMACs mapping octeontx2-af: Add support for CGX link management octeontx2-af: Register for CGX lmac events Sunil Goutham (9): octeontx2-af: Add Marvell OcteonTX2 RVU AF driver octeontx2-af: Reset all RVU blocks octeontx2-af: Gather RVU blocks HW info octeontx2-af: Add mailbox IRQ and msg handlers octeontx2-af: Scan blocks for LFs provisioned to PF/VF octeontx2-af: Add RVU block LF provisioning support octeontx2-af: Configure block LF's MSIX vector offset octeontx2-af: Add Marvell OcteonTX2 CGX driver MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver MAINTAINERS|9 + drivers/net/ethernet/marvell/Kconfig |3 + drivers/net/ethernet/marvell/Makefile |1 + drivers/net/ethernet/marvell/octeontx2/Kconfig | 16 + drivers/net/ethernet/marvell/octeontx2/Makefile|6 + drivers/net/ethernet/marvell/octeontx2/af/Makefile | 10 + drivers/net/ethernet/marvell/octeontx2/af/cgx.c| 505 ++ drivers/net/ethernet/marvell/octeontx2/af/cgx.h| 65 + .../net/ethernet/marvell/octeontx2/af/cgx_fw_if.h | 187 +++ drivers/net/ethernet/marvell/octeontx2/af/mbox.c | 303 drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 211 +++ drivers/net/ethernet/marvell/octeontx2/af/rvu.c| 1637 drivers/net/ethernet/marvell/octeontx2/af/rvu.h| 158 ++ .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c| 194 +++ .../net/ethernet/marvell/octeontx2/af
[PATCH v6 15/15] MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver
From: Sunil Goutham Added maintainers entry for Marvell OcteonTX2 SOC's RVU admin function driver. Signed-off-by: Sunil Goutham --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bb5f431..eee6151 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8844,6 +8844,15 @@ S: Supported F: drivers/mmc/host/sdhci-xenon* F: Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.txt +MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER +M: Sunil Goutham +M: Linu Cherian +M: Geetha sowjanya +M: Jerin Jacob +L: netdev@vger.kernel.org +S: Maintained +F: drivers/net/ethernet/marvell/octeontx2/af + MATROX FRAMEBUFFER DRIVER L: linux-fb...@vger.kernel.org S: Orphan -- 2.7.4
[PATCH v6 00/15] octeontx2-af: Add RVU Admin Function driver
From: Sunil Goutham Resource virtualization unit (RVU) on Marvell's OcteonTX2 SOC maps HW resources from the network, crypto and other functional blocks into PCI-compatible physical and virtual functions. Each functional block again has multiple local functions (LFs) for provisioning to PCI devices. RVU supports multiple PCIe SRIOV physical functions (PFs) and virtual functions (VFs). PF0 is called the administrative / admin function (AF) and has privileges to provision RVU functional block's LFs to each of the PF/VF. RVU managed networking functional blocks - Network pool allocator (NPA) - Network interface controller (NIX) - Network parser CAM (NPC) - Schedule/Synchronize/Order unit (SSO) RVU managed non-networking functional blocks - Crypto accelerator (CPT) - Scheduled timers unit (TIM) - Schedule/Synchronize/Order unit (SSO) Used for both networking and non networking usecases - Compression (upcoming in future variants of the silicons) Resource provisioning examples - A PF/VF with NIX-LF & NPA-LF resources works as a pure network device - A PF/VF with CPT-LF resource works as a pure cyrpto offload device. This admin function driver neither receives any data nor processes it i.e no I/O, a configuration only driver. PF/VFs communicates with AF via a shared memory region (mailbox). Upon receiving requests from PF/VF, AF does resource provisioning and other HW configuration. AF is always attached to host, but PF/VFs may be used by host kernel itself, or attached to VMs or to userspace applications like DPDK etc. So AF has to handle provisioning/configuration requests sent by any device from any domain. This patch series adds logic for the following - RVU AF driver with functional blocks provisioning support. - Mailbox infrastructure for communication between AF and PFs. - CGX (MAC controller) driver which communicates with firmware for managing physical ethernet interfaces. AF collects info from this driver and forwards the same to the PF/VFs uaing these interfaces. This is the first set of patches out of 80+ patches. Changes from v5: Modified bitfield based command structures to bitmasks for communication with firmware, to address endianness issues. - Suggested by Arnd Bergmann Changes from v4: 1 Removed module author/version/description from CGX driver as it's now merged with AF driver module. - Suggested by Arnd Bergmann 2 Added big-endian bitfields for CGX's kernel <=> firmware communication command structures. - Suggested by Arnd Bergmann Changes from v3: Moved driver from drivers/soc to drivers/net/ethernet - Suggested by Arnd Bergmann https://patchwork.kernel.org/cover/10587635/ Changes from v2: No changes, submitted again with netdev mailing list in loop. - Suggested by Arnd Bergmann and Andrew Lunn Changes from v1: 1 Merged RVU admin function and CGX drivers into a single module - Suggested by Arnd Bergmann 2 Pulled mbox communication APIs into a separate module to remove admin function driver dependency in a VM where AF is not attached. - Suggested by Arnd Bergmann Aleksey Makarov (1): octeontx2-af: Convert mbox msg id check to a macro Geetha sowjanya (1): octeontx2-af: Reconfig MSIX base with IOVA Linu Cherian (3): octeontx2-af: Set RVU PFs to CGX LMACs mapping octeontx2-af: Add support for CGX link management octeontx2-af: Register for CGX lmac events Sunil Goutham (10): octeontx2-af: Add Marvell OcteonTX2 RVU AF driver octeontx2-af: Reset all RVU blocks octeontx2-af: Gather RVU blocks HW info octeontx2-af: Add mailbox support infra octeontx2-af: Add mailbox IRQ and msg handlers octeontx2-af: Scan blocks for LFs provisioned to PF/VF octeontx2-af: Add RVU block LF provisioning support octeontx2-af: Configure block LF's MSIX vector offset octeontx2-af: Add Marvell OcteonTX2 CGX driver MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver MAINTAINERS|9 + drivers/net/ethernet/marvell/Kconfig |3 + drivers/net/ethernet/marvell/Makefile |1 + drivers/net/ethernet/marvell/octeontx2/Kconfig | 16 + drivers/net/ethernet/marvell/octeontx2/Makefile|6 + drivers/net/ethernet/marvell/octeontx2/af/Makefile | 10 + drivers/net/ethernet/marvell/octeontx2/af/cgx.c| 501 ++ drivers/net/ethernet/marvell/octeontx2/af/cgx.h| 65 + .../net/ethernet/marvell/octeontx2/af/cgx_fw_if.h | 187 +++ drivers/net/ethernet/marvell/octeontx2/af/mbox.c | 303 drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 211 +++ drivers/net/ethernet/marvell/octeontx2/af/rvu.c| 1637 drivers/net/ethernet/marvell/octeontx2/af/rvu.h| 158 ++ .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c| 194 +++ .../net/ethernet/marvell/octeontx2/af/rvu_reg.h| 441 ++ .../net/ethernet/marvell/octeontx2/af/rvu_struct.h | 74 + 16 files changed, 3816
[PATCH v5 15/15] MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver
From: Sunil Goutham Added maintainers entry for Marvell OcteonTX2 SOC's RVU admin function driver. Signed-off-by: Sunil Goutham --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 15565de..cf12fa3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8843,6 +8843,15 @@ S: Supported F: drivers/mmc/host/sdhci-xenon* F: Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.txt +MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER +M: Sunil Goutham +M: Linu Cherian +M: Geetha sowjanya +M: Jerin Jacob +L: netdev@vger.kernel.org +S: Maintained +F: drivers/net/ethernet/marvell/octeontx2/af + MATROX FRAMEBUFFER DRIVER L: linux-fb...@vger.kernel.org S: Orphan -- 2.7.4
[PATCH v5 00/15] octeontx2-af: Add RVU Admin Function driver
From: Sunil Goutham Resource virtualization unit (RVU) on Marvell's OcteonTX2 SOC maps HW resources from the network, crypto and other functional blocks into PCI-compatible physical and virtual functions. Each functional block again has multiple local functions (LFs) for provisioning to PCI devices. RVU supports multiple PCIe SRIOV physical functions (PFs) and virtual functions (VFs). PF0 is called the administrative / admin function (AF) and has privileges to provision RVU functional block's LFs to each of the PF/VF. RVU managed networking functional blocks - Network pool allocator (NPA) - Network interface controller (NIX) - Network parser CAM (NPC) - Schedule/Synchronize/Order unit (SSO) RVU managed non-networking functional blocks - Crypto accelerator (CPT) - Scheduled timers unit (TIM) - Schedule/Synchronize/Order unit (SSO) Used for both networking and non networking usecases - Compression (upcoming in future variants of the silicons) Resource provisioning examples - A PF/VF with NIX-LF & NPA-LF resources works as a pure network device - A PF/VF with CPT-LF resource works as a pure cyrpto offload device. This admin function driver neither receives any data nor processes it i.e no I/O, a configuration only driver. PF/VFs communicates with AF via a shared memory region (mailbox). Upon receiving requests from PF/VF, AF does resource provisioning and other HW configuration. AF is always attached to host, but PF/VFs may be used by host kernel itself, or attached to VMs or to userspace applications like DPDK etc. So AF has to handle provisioning/configuration requests sent by any device from any domain. This patch series adds logic for the following - RVU AF driver with functional blocks provisioning support. - Mailbox infrastructure for communication between AF and PFs. - CGX (MAC controller) driver which communicates with firmware for managing physical ethernet interfaces. AF collects info from this driver and forwards the same to the PF/VFs uaing these interfaces. This is the first set of patches out of 80+ patches. Changes from v4: 1 Removed module author/version/description from CGX driver as it's now merged with AF driver module. - Suggested by Arnd Bergmann 2 Added big-endian bitfields for CGX's kernel <=> firmware communication command structures. - Suggested by Arnd Bergmann Changes from v3: Moved driver from drivers/soc to drivers/net/ethernet - Suggested by Arnd Bergmann https://patchwork.kernel.org/cover/10587635/ Changes from v2: No changes, submitted again with netdev mailing list in loop. - Suggested by Arnd Bergmann and Andrew Lunn Changes from v1: 1 Merged RVU admin function and CGX drivers into a single module - Suggested by Arnd Bergmann 2 Pulled mbox communication APIs into a separate module to remove admin function driver dependency in a VM where AF is not attached. - Suggested by Arnd Bergmann Aleksey Makarov (1): octeontx2-af: Convert mbox msg id check to a macro Geetha sowjanya (1): octeontx2-af: Reconfig MSIX base with IOVA Linu Cherian (3): octeontx2-af: Set RVU PFs to CGX LMACs mapping octeontx2-af: Add support for CGX link management octeontx2-af: Register for CGX lmac events Sunil Goutham (10): octeontx2-af: Add Marvell OcteonTX2 RVU AF driver octeontx2-af: Reset all RVU blocks octeontx2-af: Gather RVU blocks HW info octeontx2-af: Add mailbox support infra octeontx2-af: Add mailbox IRQ and msg handlers octeontx2-af: Scan blocks for LFs provisioned to PF/VF octeontx2-af: Add RVU block LF provisioning support octeontx2-af: Configure block LF's MSIX vector offset octeontx2-af: Add Marvell OcteonTX2 CGX driver MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver MAINTAINERS|9 + drivers/net/ethernet/marvell/Kconfig |3 + drivers/net/ethernet/marvell/Makefile |1 + drivers/net/ethernet/marvell/octeontx2/Kconfig | 16 + drivers/net/ethernet/marvell/octeontx2/Makefile|6 + drivers/net/ethernet/marvell/octeontx2/af/Makefile | 10 + drivers/net/ethernet/marvell/octeontx2/af/cgx.c| 512 ++ drivers/net/ethernet/marvell/octeontx2/af/cgx.h| 65 + .../net/ethernet/marvell/octeontx2/af/cgx_fw_if.h | 292 drivers/net/ethernet/marvell/octeontx2/af/mbox.c | 303 drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 211 +++ drivers/net/ethernet/marvell/octeontx2/af/rvu.c| 1637 drivers/net/ethernet/marvell/octeontx2/af/rvu.h| 158 ++ .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c| 194 +++ .../net/ethernet/marvell/octeontx2/af/rvu_reg.h| 441 ++ .../net/ethernet/marvell/octeontx2/af/rvu_struct.h | 74 + 16 files changed, 3932 insertions(+) create mode 100644 drivers/net/ethernet/marvell/octeontx2/Kconfig create mode 100644 drivers/net/ethernet/marvell/octeontx2/Makefile create mode 100644 d
Re: [PATCH 00/15] octeontx2-af: Add RVU Admin Function driver
On Fri, Sep 28, 2018 at 1:57 PM Arnd Bergmann wrote: > > On Fri, Sep 28, 2018 at 8:08 AM wrote: > > > > From: Sunil Goutham > > > > Resource virtualization unit (RVU) on Marvell's OcteonTX2 SOC maps HW > > resources from the network, crypto and other functional blocks into > > PCI-compatible physical and virtual functions. Each functional block > > again has multiple local functions (LFs) for provisioning to PCI devices. > > RVU supports multiple PCIe SRIOV physical functions (PFs) and virtual > > functions (VFs). PF0 is called the administrative / admin function (AF) > > and has privileges to provision RVU functional block's LFs to each of the > > PF/VF. > > > > RVU managed networking functional blocks > > - Network pool allocator (NPA) > > - Network interface controller (NIX) > > - Network parser CAM (NPC) > > - Schedule/Synchronize/Order unit (SSO) > > > > RVU managed non-networking functional blocks > > - Crypto accelerator (CPT) > > - Scheduled timers unit (TIM) > > - Schedule/Synchronize/Order unit (SSO) > >Used for both networking and non networking usecases > > - Compression (upcoming in future variants of the silicons) > > > > Resource provisioning examples > > - A PF/VF with NIX-LF & NPA-LF resources works as a pure network device > > - A PF/VF with CPT-LF resource works as a pure cyrpto offload device. > > > > This admin function driver neither receives any data nor processes it i.e > > no I/O, a configuration only driver. > > > > PF/VFs communicates with AF via a shared memory region (mailbox). Upon > > receiving requests from PF/VF, AF does resource provisioning and other > > HW configuration. AF is always attached to host, but PF/VFs may be used > > by host kernel itself, or attached to VMs or to userspace applications > > like DPDK etc. So AF has to handle provisioning/configuration requests > > sent by any device from any domain. > > > > This patch series adds logic for the following > > - RVU AF driver with functional blocks provisioning support. > > - Mailbox infrastructure for communication between AF and PFs. > > - CGX (MAC controller) driver which communicates with firmware for > >managing physical ethernet interfaces. AF collects info from this > >driver and forwards the same to the PF/VFs uaing these interfaces. > > > > This is the first set of patches out of 80+ patches. > > Hi Sunil, > > This looks good overall, thanks for moving it to drivers/net > as I suggested. I found two more minor remaining issues here, > it should not be a problem to change the code accordingly. > > One thing I was missing here is a revision history for the patch > series, it would have been helpful to get a list of things you have > changed compared to the previous submission, what triggered > those changes, and which issues (if any) are still remaining. > Best add the full revision history in the next (hopefully final) > round for these patches, and use 'git format-patch --reroll-count' > to add the patchset revision number. Not much changes done to the patches since the v3 patchset i submitted on drivers/soc. But yes, i will add the old revision history while re-submitting patches after addressing your suggestions. > > I assume that the next set of patches will be more controversial > as you get to the point that adds the user interface. I have > not looked at those patches yet, so it may just be fine, assuming > all the configuration is done using devlink. Please keep me > on Cc for the future series, even if I don't participate in those > reviews as much. Sure I will keep you in CC. > > Thanks, > > Arnd
Re: [PATCH 00/15] octeontx2-af: Add RVU Admin Function driver
On Fri, Sep 28, 2018 at 8:08 AM wrote: > > From: Sunil Goutham > > Resource virtualization unit (RVU) on Marvell's OcteonTX2 SOC maps HW > resources from the network, crypto and other functional blocks into > PCI-compatible physical and virtual functions. Each functional block > again has multiple local functions (LFs) for provisioning to PCI devices. > RVU supports multiple PCIe SRIOV physical functions (PFs) and virtual > functions (VFs). PF0 is called the administrative / admin function (AF) > and has privileges to provision RVU functional block's LFs to each of the > PF/VF. > > RVU managed networking functional blocks > - Network pool allocator (NPA) > - Network interface controller (NIX) > - Network parser CAM (NPC) > - Schedule/Synchronize/Order unit (SSO) > > RVU managed non-networking functional blocks > - Crypto accelerator (CPT) > - Scheduled timers unit (TIM) > - Schedule/Synchronize/Order unit (SSO) >Used for both networking and non networking usecases > - Compression (upcoming in future variants of the silicons) > > Resource provisioning examples > - A PF/VF with NIX-LF & NPA-LF resources works as a pure network device > - A PF/VF with CPT-LF resource works as a pure cyrpto offload device. > > This admin function driver neither receives any data nor processes it i.e > no I/O, a configuration only driver. > > PF/VFs communicates with AF via a shared memory region (mailbox). Upon > receiving requests from PF/VF, AF does resource provisioning and other > HW configuration. AF is always attached to host, but PF/VFs may be used > by host kernel itself, or attached to VMs or to userspace applications > like DPDK etc. So AF has to handle provisioning/configuration requests > sent by any device from any domain. > > This patch series adds logic for the following > - RVU AF driver with functional blocks provisioning support. > - Mailbox infrastructure for communication between AF and PFs. > - CGX (MAC controller) driver which communicates with firmware for >managing physical ethernet interfaces. AF collects info from this >driver and forwards the same to the PF/VFs uaing these interfaces. > > This is the first set of patches out of 80+ patches. Hi Sunil, This looks good overall, thanks for moving it to drivers/net as I suggested. I found two more minor remaining issues here, it should not be a problem to change the code accordingly. One thing I was missing here is a revision history for the patch series, it would have been helpful to get a list of things you have changed compared to the previous submission, what triggered those changes, and which issues (if any) are still remaining. Best add the full revision history in the next (hopefully final) round for these patches, and use 'git format-patch --reroll-count' to add the patchset revision number. I assume that the next set of patches will be more controversial as you get to the point that adds the user interface. I have not looked at those patches yet, so it may just be fine, assuming all the configuration is done using devlink. Please keep me on Cc for the future series, even if I don't participate in those reviews as much. Thanks, Arnd
[PATCH 15/15] MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver
From: Sunil Goutham Added maintainers entry for Marvell OcteonTX2 SOC's RVU admin function driver. Signed-off-by: Sunil Goutham --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7233a9e..4f93114 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8843,6 +8843,15 @@ S: Supported F: drivers/mmc/host/sdhci-xenon* F: Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.txt +MARVELL OCTEONTX2 RVU ADMIN FUNCTION DRIVER +M: Sunil Goutham +M: Linu Cherian +M: Geetha sowjanya +M: Jerin Jacob +L: netdev@vger.kernel.org +S: Maintained +F: drivers/net/ethernet/marvell/octeontx2/af + MATROX FRAMEBUFFER DRIVER L: linux-fb...@vger.kernel.org S: Orphan -- 2.7.4
[PATCH 00/15] octeontx2-af: Add RVU Admin Function driver
From: Sunil Goutham Resource virtualization unit (RVU) on Marvell's OcteonTX2 SOC maps HW resources from the network, crypto and other functional blocks into PCI-compatible physical and virtual functions. Each functional block again has multiple local functions (LFs) for provisioning to PCI devices. RVU supports multiple PCIe SRIOV physical functions (PFs) and virtual functions (VFs). PF0 is called the administrative / admin function (AF) and has privileges to provision RVU functional block's LFs to each of the PF/VF. RVU managed networking functional blocks - Network pool allocator (NPA) - Network interface controller (NIX) - Network parser CAM (NPC) - Schedule/Synchronize/Order unit (SSO) RVU managed non-networking functional blocks - Crypto accelerator (CPT) - Scheduled timers unit (TIM) - Schedule/Synchronize/Order unit (SSO) Used for both networking and non networking usecases - Compression (upcoming in future variants of the silicons) Resource provisioning examples - A PF/VF with NIX-LF & NPA-LF resources works as a pure network device - A PF/VF with CPT-LF resource works as a pure cyrpto offload device. This admin function driver neither receives any data nor processes it i.e no I/O, a configuration only driver. PF/VFs communicates with AF via a shared memory region (mailbox). Upon receiving requests from PF/VF, AF does resource provisioning and other HW configuration. AF is always attached to host, but PF/VFs may be used by host kernel itself, or attached to VMs or to userspace applications like DPDK etc. So AF has to handle provisioning/configuration requests sent by any device from any domain. This patch series adds logic for the following - RVU AF driver with functional blocks provisioning support. - Mailbox infrastructure for communication between AF and PFs. - CGX (MAC controller) driver which communicates with firmware for managing physical ethernet interfaces. AF collects info from this driver and forwards the same to the PF/VFs uaing these interfaces. This is the first set of patches out of 80+ patches. Aleksey Makarov (1): octeontx2-af: Convert mbox msg id check to a macro Geetha sowjanya (1): octeontx2-af: Reconfig MSIX base with IOVA Linu Cherian (3): octeontx2-af: Set RVU PFs to CGX LMACs mapping octeontx2-af: Add support for CGX link management octeontx2-af: Register for CGX lmac events Sunil Goutham (10): octeontx2-af: Add Marvell OcteonTX2 RVU AF driver octeontx2-af: Reset all RVU blocks octeontx2-af: Gather RVU blocks HW info octeontx2-af: Add mailbox support infra octeontx2-af: Add mailbox IRQ and msg handlers octeontx2-af: Scan blocks for LFs provisioned to PF/VF octeontx2-af: Add RVU block LF provisioning support octeontx2-af: Configure block LF's MSIX vector offset octeontx2-af: Add Marvell OcteonTX2 CGX driver MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver MAINTAINERS|9 + drivers/net/ethernet/marvell/Kconfig |3 + drivers/net/ethernet/marvell/Makefile |1 + drivers/net/ethernet/marvell/octeontx2/Kconfig | 16 + drivers/net/ethernet/marvell/octeontx2/Makefile|6 + drivers/net/ethernet/marvell/octeontx2/af/Makefile | 10 + drivers/net/ethernet/marvell/octeontx2/af/cgx.c| 515 ++ drivers/net/ethernet/marvell/octeontx2/af/cgx.h| 65 + .../net/ethernet/marvell/octeontx2/af/cgx_fw_if.h | 225 +++ drivers/net/ethernet/marvell/octeontx2/af/mbox.c | 303 drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 211 +++ drivers/net/ethernet/marvell/octeontx2/af/rvu.c| 1637 drivers/net/ethernet/marvell/octeontx2/af/rvu.h| 158 ++ .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c| 194 +++ .../net/ethernet/marvell/octeontx2/af/rvu_reg.h| 441 ++ .../net/ethernet/marvell/octeontx2/af/rvu_struct.h | 74 + 16 files changed, 3868 insertions(+) create mode 100644 drivers/net/ethernet/marvell/octeontx2/Kconfig create mode 100644 drivers/net/ethernet/marvell/octeontx2/Makefile create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/Makefile create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/cgx.c create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/cgx.h create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/cgx_fw_if.h create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/mbox.c create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/mbox.h create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu.c create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu.h create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_reg.h create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_struct.h -- 2.7.4
[net-next 7/8] ice: Update to capabilities admin queue command
From: Anirudh Venkataramanan This patch makes a couple of changes in the way the driver uses the "get capabilities" command. 1. Get device capabilities in addition to function capabilities 2. Align to latest spec by using cap_count to determine size of the buffer in case of length error. Signed-off-by: Anirudh Venkataramanan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/ice/ice_common.c | 50 ++--- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 0847dbf9d42f..decfdb065a20 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -1451,7 +1451,7 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count, * @hw: pointer to the hw struct * @buf: a virtual buffer to hold the capabilities * @buf_size: Size of the virtual buffer - * @data_size: Size of the returned data, or buf size needed if AQ err==ENOMEM + * @cap_count: cap count needed if AQ err==ENOMEM * @opc: capabilities type to discover - pass in the command opcode * @cd: pointer to command details structure or NULL * @@ -1459,7 +1459,7 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count, * the firmware. */ static enum ice_status -ice_aq_discover_caps(struct ice_hw *hw, void *buf, u16 buf_size, u16 *data_size, +ice_aq_discover_caps(struct ice_hw *hw, void *buf, u16 buf_size, u32 *cap_count, enum ice_adminq_opc opc, struct ice_sq_cd *cd) { struct ice_aqc_list_caps *cmd; @@ -1477,58 +1477,76 @@ ice_aq_discover_caps(struct ice_hw *hw, void *buf, u16 buf_size, u16 *data_size, status = ice_aq_send_cmd(hw, , buf, buf_size, cd); if (!status) ice_parse_caps(hw, buf, le32_to_cpu(cmd->count), opc); - *data_size = le16_to_cpu(desc.datalen); - + else if (hw->adminq.sq_last_status == ICE_AQ_RC_ENOMEM) + *cap_count = + DIV_ROUND_UP(le16_to_cpu(desc.datalen), +sizeof(struct ice_aqc_list_caps_elem)); return status; } /** - * ice_get_caps - get info about the HW + * ice_discover_caps - get info about the HW * @hw: pointer to the hardware structure + * @opc: capabilities type to discover - pass in the command opcode */ -enum ice_status ice_get_caps(struct ice_hw *hw) +static enum ice_status ice_discover_caps(struct ice_hw *hw, +enum ice_adminq_opc opc) { enum ice_status status; - u16 data_size = 0; + u32 cap_count; u16 cbuf_len; u8 retries; /* The driver doesn't know how many capabilities the device will return * so the buffer size required isn't known ahead of time. The driver * starts with cbuf_len and if this turns out to be insufficient, the -* device returns ICE_AQ_RC_ENOMEM and also the buffer size it needs. -* The driver then allocates the buffer of this size and retries the -* operation. So it follows that the retry count is 2. +* device returns ICE_AQ_RC_ENOMEM and also the cap_count it needs. +* The driver then allocates the buffer based on the count and retries +* the operation. So it follows that the retry count is 2. */ #define ICE_GET_CAP_BUF_COUNT 40 #define ICE_GET_CAP_RETRY_COUNT2 - cbuf_len = ICE_GET_CAP_BUF_COUNT * - sizeof(struct ice_aqc_list_caps_elem); - + cap_count = ICE_GET_CAP_BUF_COUNT; retries = ICE_GET_CAP_RETRY_COUNT; do { void *cbuf; + cbuf_len = (u16)(cap_count * +sizeof(struct ice_aqc_list_caps_elem)); cbuf = devm_kzalloc(ice_hw_to_dev(hw), cbuf_len, GFP_KERNEL); if (!cbuf) return ICE_ERR_NO_MEMORY; - status = ice_aq_discover_caps(hw, cbuf, cbuf_len, _size, - ice_aqc_opc_list_func_caps, NULL); + status = ice_aq_discover_caps(hw, cbuf, cbuf_len, _count, + opc, NULL); devm_kfree(ice_hw_to_dev(hw), cbuf); if (!status || hw->adminq.sq_last_status != ICE_AQ_RC_ENOMEM) break; /* If ENOMEM is returned, try again with bigger buffer */ - cbuf_len = data_size; } while (--retries); return status; } +/** + * ice_get_caps - get info about the HW + * @hw: pointer to the hardware structure + */ +enum ice_status ice_get_caps(struct ice_hw *hw) +{ + enum ice_status status; + + status = ice_discover_caps(hw, ice_aqc_opc_list_dev_caps); + if (!status) + status = ice_discover_caps(hw, ice_aqc_opc_list_func_caps); + + return status; +} + /** *
[PATCH net-next 1/2] neighbour: allow admin to set NTF_ROUTER
From: Roopa Prabhu This patch allows admin setting of NTF_ROUTER flag on a neighbour entry. This enables external control plane (like bgp evpn) to manage neigh entries with NTF_ROUTER flag. Signed-off-by: Roopa Prabhu --- net/core/neighbour.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index aa19d86..ca99456 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1709,7 +1709,8 @@ static int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, struct netlink_ext_ack *extack) { - int flags = NEIGH_UPDATE_F_ADMIN | NEIGH_UPDATE_F_OVERRIDE; + int flags = NEIGH_UPDATE_F_ADMIN | NEIGH_UPDATE_F_OVERRIDE | + NEIGH_UPDATE_F_OVERRIDE_ISROUTER; struct net *net = sock_net(skb->sk); struct ndmsg *ndm; struct nlattr *tb[NDA_MAX+1]; @@ -1784,12 +1785,16 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, } if (!(nlh->nlmsg_flags & NLM_F_REPLACE)) - flags &= ~NEIGH_UPDATE_F_OVERRIDE; + flags &= ~(NEIGH_UPDATE_F_OVERRIDE | + NEIGH_UPDATE_F_OVERRIDE_ISROUTER); } if (ndm->ndm_flags & NTF_EXT_LEARNED) flags |= NEIGH_UPDATE_F_EXT_LEARNED; + if (ndm->ndm_flags & NTF_ROUTER) + flags |= NEIGH_UPDATE_F_ISROUTER; + if (ndm->ndm_flags & NTF_USE) { neigh_event_send(neigh, NULL); err = 0; -- 2.1.4
Re: [PATCH 00/15] soc: octeontx2: Add RVU admin function driver
> > > My feeling overall is that we need a review from the network driver > > > folks more than the arm-soc team etc, and that maybe the driver > > > as a whole should go into drivers/net/ethernet. > > > > This driver doesn't handle any network IO and moreever this driver has to > > handle > > configuration requests from crypto driver as well. There will be > > separate network and > > crypto drivers which will be upstreamed into drivers/net/ethernet and > > drivers/crypto. > > And in future silicons there will be different types of functional > > blocks which will be > > added into this resource virtualization unit (RVU). Hence i thought > > this driver is not a > > right fit in drivers/net/ethernet. Hi Sunil Do you have a git branch for everything? I would like to look at the actual Ethernet driver, and the full API this driver exports to other drivers. I think there real question here is, do you have split between this driver and the actual device drivers in the right place? For me, link up/down detection should be in the Ethernet driver, since it is not shared with the crypto driver. Thanks Andrew
Re: [PATCH net-next] neighbour: force neigh_invalidate when NUD_FAILED update is from admin
From: Roopa Prabhu Date: Mon, 25 Jun 2018 20:32:53 -0700 > From: Roopa Prabhu > > In systems where neigh gc thresh holds are set to high values, > admin deleted neigh entries (eg ip neigh flush or ip neigh del) can > linger around in NUD_FAILED state for a long time until periodic gc kicks > in. This patch forces neigh_invalidate when NUD_FAILED neigh_update is > from an admin. > > Signed-off-by: Roopa Prabhu Applied.
[PATCH net-next] neighbour: force neigh_invalidate when NUD_FAILED update is from admin
From: Roopa Prabhu In systems where neigh gc thresh holds are set to high values, admin deleted neigh entries (eg ip neigh flush or ip neigh del) can linger around in NUD_FAILED state for a long time until periodic gc kicks in. This patch forces neigh_invalidate when NUD_FAILED neigh_update is from an admin. Signed-off-by: Roopa Prabhu --- My testing has not shown any problems with this patch. But i am not sure why historically neigh admin was not considered here: I am assuming that it is because the problem is not very obvious in default low gc threshold deployments. net/core/neighbour.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 8e3fda9..cbe85d8 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1148,7 +1148,8 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, neigh->nud_state = new; err = 0; notify = old & NUD_VALID; - if ((old & (NUD_INCOMPLETE | NUD_PROBE)) && + if (((old & (NUD_INCOMPLETE | NUD_PROBE)) || +(flags & NEIGH_UPDATE_F_ADMIN)) && (new & NUD_FAILED)) { neigh_invalidate(neigh); notify = 1; -- 2.1.4
[net V2 1/8] net/mlx5e: Don't override vport admin link state in switchdev mode
From: Jianbo Liu <jian...@mellanox.com> The vport admin original link state will be re-applied after returning back to legacy mode, it is not right to change the admin link state value when in switchdev mode. Use direct vport commands to alter logical vport state in netdev representor open/close flows rather than the administrative eswitch API. Fixes: 20a1ea674783 ('net/mlx5e: Support VF vport link state control for SRIOV switchdev mode') Signed-off-by: Jianbo Liu <jian...@mellanox.com> Reviewed-by: Roi Dayan <r...@mellanox.com> Reviewed-by: Or Gerlitz <ogerl...@mellanox.com> Signed-off-by: Saeed Mahameed <sae...@mellanox.com> --- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index 363d8dcb7f17..0273c233bc85 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -668,7 +668,6 @@ static int mlx5e_rep_open(struct net_device *dev) struct mlx5e_priv *priv = netdev_priv(dev); struct mlx5e_rep_priv *rpriv = priv->ppriv; struct mlx5_eswitch_rep *rep = rpriv->rep; - struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; int err; mutex_lock(>state_lock); @@ -676,8 +675,9 @@ static int mlx5e_rep_open(struct net_device *dev) if (err) goto unlock; - if (!mlx5_eswitch_set_vport_state(esw, rep->vport, - MLX5_ESW_VPORT_ADMIN_STATE_UP)) + if (!mlx5_modify_vport_admin_state(priv->mdev, + MLX5_QUERY_VPORT_STATE_IN_OP_MOD_ESW_VPORT, + rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_UP)) netif_carrier_on(dev); unlock: @@ -690,11 +690,12 @@ static int mlx5e_rep_close(struct net_device *dev) struct mlx5e_priv *priv = netdev_priv(dev); struct mlx5e_rep_priv *rpriv = priv->ppriv; struct mlx5_eswitch_rep *rep = rpriv->rep; - struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; int ret; mutex_lock(>state_lock); - (void)mlx5_eswitch_set_vport_state(esw, rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_DOWN); + mlx5_modify_vport_admin_state(priv->mdev, + MLX5_QUERY_VPORT_STATE_IN_OP_MOD_ESW_VPORT, + rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_DOWN); ret = mlx5e_close_locked(dev); mutex_unlock(>state_lock); return ret; -- 2.14.3
[net 1/8] net/mlx5e: Don't override vport admin link state in switchdev mode
From: Jianbo Liu <jian...@mellanox.com> The vport admin original link state will be re-applied after returning back to legacy mode, it is not right to change the admin link state value when in switchdev mode. Use direct vport commands to alter logical vport state in netdev representor open/close flows rather than the administrative eswitch API. Fixes: 20a1ea674783 ('net/mlx5e: Support VF vport link state control for SRIOV switchdev mode') Signed-off-by: Jianbo Liu <jian...@mellanox.com> Reviewed-by: Roi Dayan <r...@mellanox.com> Reviewed-by: Or Gerlitz <ogerl...@mellanox.com> Signed-off-by: Saeed Mahameed <sae...@mellanox.com> --- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index 363d8dcb7f17..0273c233bc85 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -668,7 +668,6 @@ static int mlx5e_rep_open(struct net_device *dev) struct mlx5e_priv *priv = netdev_priv(dev); struct mlx5e_rep_priv *rpriv = priv->ppriv; struct mlx5_eswitch_rep *rep = rpriv->rep; - struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; int err; mutex_lock(>state_lock); @@ -676,8 +675,9 @@ static int mlx5e_rep_open(struct net_device *dev) if (err) goto unlock; - if (!mlx5_eswitch_set_vport_state(esw, rep->vport, - MLX5_ESW_VPORT_ADMIN_STATE_UP)) + if (!mlx5_modify_vport_admin_state(priv->mdev, + MLX5_QUERY_VPORT_STATE_IN_OP_MOD_ESW_VPORT, + rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_UP)) netif_carrier_on(dev); unlock: @@ -690,11 +690,12 @@ static int mlx5e_rep_close(struct net_device *dev) struct mlx5e_priv *priv = netdev_priv(dev); struct mlx5e_rep_priv *rpriv = priv->ppriv; struct mlx5_eswitch_rep *rep = rpriv->rep; - struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; int ret; mutex_lock(>state_lock); - (void)mlx5_eswitch_set_vport_state(esw, rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_DOWN); + mlx5_modify_vport_admin_state(priv->mdev, + MLX5_QUERY_VPORT_STATE_IN_OP_MOD_ESW_VPORT, + rep->vport, MLX5_ESW_VPORT_ADMIN_STATE_DOWN); ret = mlx5e_close_locked(dev); mutex_unlock(>state_lock); return ret; -- 2.14.3
[PATCH net-next 3/4] selftests: fib_tests: Move admin of dummy0 to helpers
Move setup and teardown of testns and dummy0 to helpers. Signed-off-by: David Ahern <dsah...@gmail.com> --- tools/testing/selftests/net/fib_tests.sh | 100 +++ 1 file changed, 34 insertions(+), 66 deletions(-) diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh index d4e0b5cb4355..e113cfd659fc 100755 --- a/tools/testing/selftests/net/fib_tests.sh +++ b/tools/testing/selftests/net/fib_tests.sh @@ -28,12 +28,24 @@ log_test() fi } -netns_create() +setup() { - local testns=$1 + set -e + ip netns add testns + ip -netns testns link set dev lo up + + ip -netns testns link add dummy0 type dummy + ip -netns testns link set dev dummy0 up + ip -netns testns address add 198.51.100.1/24 dev dummy0 + ip -netns testns -6 address add 2001:db8:1::1/64 dev dummy0 + set +e + +} - ip netns add $testns - ip netns exec $testns ip link set dev lo up +cleanup() +{ + ip -netns testns link del dev dummy0 &> /dev/null + ip netns del testns } fib_unreg_unicast_test() @@ -41,14 +53,7 @@ fib_unreg_unicast_test() echo echo "Single path route test" - set -e - netns_create "testns" - - ip -netns testns link add dummy0 type dummy - ip -netns testns link set dev dummy0 up - ip -netns testns address add 198.51.100.1/24 dev dummy0 - ip -netns testns -6 address add 2001:db8:1::1/64 dev dummy0 - set +e + setup echo "Start point" ip -netns testns route get fibmatch 198.51.100.2 &> /dev/null @@ -66,7 +71,7 @@ fib_unreg_unicast_test() ip -netns testns -6 route get fibmatch 2001:db8:1::2 &> /dev/null log_test $? 2 "IPv6 fibmatch - no route" - ip netns del testns + cleanup } fib_unreg_multipath_test() @@ -75,18 +80,11 @@ fib_unreg_multipath_test() echo echo "Multipath route test" - set -e - netns_create "testns" - - ip -netns testns link add dummy0 type dummy - ip -netns testns link set dev dummy0 up + setup + set -e ip -netns testns link add dummy1 type dummy ip -netns testns link set dev dummy1 up - - ip -netns testns address add 198.51.100.1/24 dev dummy0 - ip -netns testns -6 address add 2001:db8:1::1/64 dev dummy0 - ip -netns testns address add 192.0.2.1/24 dev dummy1 ip -netns testns -6 address add 2001:db8:2::1/64 dev dummy1 @@ -124,7 +122,7 @@ fib_unreg_multipath_test() ip -netns testns -6 route get fibmatch 2001:db8:3::1 &> /dev/null log_test $? 2 "IPv6 - no route" - ip netns del testns + cleanup } fib_unreg_test() @@ -138,15 +136,7 @@ fib_down_unicast_test() echo echo "Single path, admin down" - set -e - netns_create "testns" - - ip -netns testns link add dummy0 type dummy - ip -netns testns link set dev dummy0 up - - ip -netns testns address add 198.51.100.1/24 dev dummy0 - ip -netns testns -6 address add 2001:db8:1::1/64 dev dummy0 - set +e + setup echo "Start point" ip -netns testns route get fibmatch 198.51.100.2 &> /dev/null @@ -164,9 +154,7 @@ fib_down_unicast_test() ip -netns testns -6 route get fibmatch 2001:db8:1::2 &> /dev/null log_test $? 2 "IPv6 fibmatch" - ip -netns testns link del dev dummy0 - - ip netns del testns + cleanup } fib_down_multipath_test_do() @@ -208,18 +196,12 @@ fib_down_multipath_test() echo echo "Admin down multipath" - set -e - netns_create "testns" - - ip -netns testns link add dummy0 type dummy - ip -netns testns link set dev dummy0 up + setup + set -e ip -netns testns link add dummy1 type dummy ip -netns testns link set dev dummy1 up - ip -netns testns address add 198.51.100.1/24 dev dummy0 - ip -netns testns -6 address add 2001:db8:1::1/64 dev dummy0 - ip -netns testns address add 192.0.2.1/24 dev dummy1 ip -netns testns -6 address add 2001:db8:2::1/64 dev dummy1 @@ -264,8 +246,7 @@ fib_down_multipath_test() log_test $? 2 "IPv6 fibmatch" ip -netns testns link del dev dummy1 - ip -netns testns link del dev dummy0 - ip netns del testns + cleanup } fib_down_test() @@ -280,16 +261,10 @@ fib_carrier_local_test() echo echo "Local carrier tests - single path" - set -e - netns_create "testns" - - ip -netns testns link add dummy0 type dummy - ip -netns testns link set dev dummy0 up + setup + set -e ip -netns testns link set dev dummy0 c
[net-next 7/9] i40e: Admin queue definitions for cloud filters
From: Amritha Nambiar <amritha.namb...@intel.com> Add new admin queue definitions and extended fields for cloud filter support. Define big buffer for extended general fields in Add/Remove Cloud filters command. Signed-off-by: Amritha Nambiar <amritha.namb...@intel.com> Signed-off-by: Kiran Patil <kiran.pa...@intel.com> Signed-off-by: Jingjing Wu <jingjing...@intel.com> Acked-by: Shannon Nelson <shannon.nel...@oracle.com> Tested-by: Andrew Bowers <andrewx.bow...@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirs...@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 107 - .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h| 107 - 2 files changed, 210 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index 47d1a93f..9f1f5786dcc2 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h @@ -1371,14 +1371,16 @@ struct i40e_aqc_add_remove_cloud_filters { #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0 #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \ I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT) - u8 reserved2[4]; + u8 big_buffer_flag; +#define I40E_AQC_ADD_CLOUD_CMD_BB 1 + u8 reserved2[3]; __le32 addr_high; __le32 addr_low; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters); -struct i40e_aqc_add_remove_cloud_filters_element_data { +struct i40e_aqc_cloud_filters_element_data { u8 outer_mac[6]; u8 inner_mac[6]; __le16 inner_vlan; @@ -1408,6 +1410,10 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +/* 0x0010 to 0x0017 is for custom filters */ +#define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010 /* Dest IP + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 /* Dest MAC + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT0x0012 /* Dest MAC + VLAN + L4 Port */ #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080 #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6 @@ -1442,6 +1448,49 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { u8 response_reserved[7]; }; +I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_cloud_filters_element_data); + +/* i40e_aqc_cloud_filters_element_bb is used when + * I40E_AQC_CLOUD_CMD_BB flag is set. + */ +struct i40e_aqc_cloud_filters_element_bb { + struct i40e_aqc_cloud_filters_element_data element; + u16 general_fields[32]; +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0 0 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1 1 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2 2 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0 3 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1 4 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2 5 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0 6 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1 7 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2 8 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0 9 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1 10 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2 11 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0 12 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1 13 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2 14 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0 15 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1 16 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2 17 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3 18 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4 19 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5 20 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6 21 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7 22 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0 23 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1 24 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2 25 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3 26 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4 27 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5 28 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6 29 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7 30 +}; + +I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_cloud_filters_element_bb); + struct i40e_aqc_remove_cloud_filters_completion { __le16 perfect_ovlan_used; __le16 perfect_ovlan_free; @@ -1453,6 +1502,60 @@ struct i40e_aqc_remove_cloud_filters_completion { I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion); +/* Replace filter Command 0x025F + * uses the i40e_aqc_replace_cloud_filters, + * and the generic indirect completion structure + */ +struct i40e_filter_d
[jkirsher/next-queue PATCH v5 4/6] i40e: Admin queue definitions for cloud filters
Add new admin queue definitions and extended fields for cloud filter support. Define big buffer for extended general fields in Add/Remove Cloud filters command. v5: Addressed Shannon's comment to move couple of description comments to the right. v3: Shortened some lengthy struct names. v2: Added I40E_CHECK_STRUCT_LEN check to AQ command structs and added AQ definitions to i40evf for consistency based on Shannon's feedback. Signed-off-by: Amritha Nambiar <amritha.namb...@intel.com> Signed-off-by: Kiran Patil <kiran.pa...@intel.com> Signed-off-by: Jingjing Wu <jingjing...@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 107 .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h| 107 2 files changed, 210 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index 47d..9f1f578 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h @@ -1371,14 +1371,16 @@ struct i40e_aqc_add_remove_cloud_filters { #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0 #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \ I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT) - u8 reserved2[4]; + u8 big_buffer_flag; +#define I40E_AQC_ADD_CLOUD_CMD_BB 1 + u8 reserved2[3]; __le32 addr_high; __le32 addr_low; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters); -struct i40e_aqc_add_remove_cloud_filters_element_data { +struct i40e_aqc_cloud_filters_element_data { u8 outer_mac[6]; u8 inner_mac[6]; __le16 inner_vlan; @@ -1408,6 +1410,10 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +/* 0x0010 to 0x0017 is for custom filters */ +#define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010 /* Dest IP + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 /* Dest MAC + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT0x0012 /* Dest MAC + VLAN + L4 Port */ #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080 #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6 @@ -1442,6 +1448,49 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { u8 response_reserved[7]; }; +I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_cloud_filters_element_data); + +/* i40e_aqc_cloud_filters_element_bb is used when + * I40E_AQC_CLOUD_CMD_BB flag is set. + */ +struct i40e_aqc_cloud_filters_element_bb { + struct i40e_aqc_cloud_filters_element_data element; + u16 general_fields[32]; +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0 0 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1 1 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2 2 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0 3 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1 4 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2 5 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0 6 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1 7 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2 8 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0 9 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1 10 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2 11 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0 12 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1 13 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2 14 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0 15 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1 16 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2 17 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3 18 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4 19 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5 20 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6 21 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7 22 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0 23 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1 24 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2 25 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3 26 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4 27 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5 28 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6 29 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7 30 +}; + +I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_cloud_filters_element_bb); + struct i40e_aqc_remove_cloud_filters_completion { __le16 perfect_ovlan_used; __le16 perfect_ovlan_free; @@ -1453,6 +1502,60 @@ struct i40e_aqc_remove_cloud_filters_completion { I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion); +/* Replace filter Command 0x025F + * uses the i40e_aqc_replace_cloud_filters, + * and the generic indirect completion structure + */ +struct i40e_
[PATCH net-next 5/6] net: ena: add new admin define for future support of IPv6 RSS
From: Netanel BelgazalSigned-off-by: Netanel Belgazal --- drivers/net/ethernet/amazon/ena/ena_admin_defs.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/amazon/ena/ena_admin_defs.h b/drivers/net/ethernet/amazon/ena/ena_admin_defs.h index 305dc1996b4e..4532e574ebcd 100644 --- a/drivers/net/ethernet/amazon/ena/ena_admin_defs.h +++ b/drivers/net/ethernet/amazon/ena/ena_admin_defs.h @@ -627,6 +627,12 @@ enum ena_admin_flow_hash_proto { ENA_ADMIN_RSS_NOT_IP= 7, + /* TCPv6 with extension header */ + ENA_ADMIN_RSS_TCP6_EX = 8, + + /* IPv6 with extension header */ + ENA_ADMIN_RSS_IP6_EX= 9, + ENA_ADMIN_RSS_PROTO_NUM = 16, }; -- 1.8.3.1
Re: [Intel-wired-lan] [jkirsher/next-queue PATCH v4 4/6] i40e: Admin queue definitions for cloud filters
On 10/10/2017 5:24 PM, Amritha Nambiar wrote: Add new admin queue definitions and extended fields for cloud filter support. Define big buffer for extended general fields in Add/Remove Cloud filters command. v3: Shortened some lengthy struct names. v2: Added I40E_CHECK_STRUCT_LEN check to AQ command structs and added AQ definitions to i40evf for consistency based on Shannon's feedback. Signed-off-by: Amritha Nambiar <amritha.namb...@intel.com> Signed-off-by: Kiran Patil <kiran.pa...@intel.com> Signed-off-by: Jingjing Wu <jingjing...@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 110 .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h| 110 2 files changed, 216 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index 729976b..bcc7986 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h @@ -1371,14 +1371,16 @@ struct i40e_aqc_add_remove_cloud_filters { #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0 #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \ I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT) - u8 reserved2[4]; + u8 big_buffer_flag; +#define I40E_AQC_ADD_CLOUD_CMD_BB 1 + u8 reserved2[3]; __le32 addr_high; __le32 addr_low; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters); -struct i40e_aqc_add_remove_cloud_filters_element_data { +struct i40e_aqc_cloud_filters_element_data { u8 outer_mac[6]; u8 inner_mac[6]; __le16 inner_vlan; @@ -1408,6 +1410,13 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +/* 0x0010 to 0x0017 is for custom filters */ +/* flag to be used when adding cloud filter: IP + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010 +/* flag to be used when adding cloud filter: Dest MAC + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 +/* flag to be used when adding cloud filter: Dest MAC + VLAN + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT0x0012 Short description comments to the side of each line would be more readable, and maybe don't mind too much the 80 column thing here #define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010/* Dest IP + L4 Port */ #define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 /* Dest MAC + L4 Port */ #define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT 0x0012 /* Dest MAC + VLAN + L4 Port */ #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080 #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6 @@ -1442,6 +1451,49 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { u8 response_reserved[7]; }; +I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_cloud_filters_element_data); + +/* i40e_aqc_cloud_filters_element_bb is used when + * I40E_AQC_CLOUD_CMD_BB flag is set. + */ +struct i40e_aqc_cloud_filters_element_bb { + struct i40e_aqc_cloud_filters_element_data element; + u16 general_fields[32]; +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0 0 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1 1 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2 2 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0 3 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1 4 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2 5 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0 6 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1 7 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2 8 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0 9 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1 10 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2 11 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0 12 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1 13 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2 14 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0 15 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1 16 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2 17 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3 18 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4 19 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5 20 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6 21 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7 22 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0 23 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1 24 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2 25 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3 26 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4 27 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5 28 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6 29 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7 30 +}; + +I4
[jkirsher/next-queue PATCH v4 4/6] i40e: Admin queue definitions for cloud filters
Add new admin queue definitions and extended fields for cloud filter support. Define big buffer for extended general fields in Add/Remove Cloud filters command. v3: Shortened some lengthy struct names. v2: Added I40E_CHECK_STRUCT_LEN check to AQ command structs and added AQ definitions to i40evf for consistency based on Shannon's feedback. Signed-off-by: Amritha Nambiar <amritha.namb...@intel.com> Signed-off-by: Kiran Patil <kiran.pa...@intel.com> Signed-off-by: Jingjing Wu <jingjing...@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 110 .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h| 110 2 files changed, 216 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index 729976b..bcc7986 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h @@ -1371,14 +1371,16 @@ struct i40e_aqc_add_remove_cloud_filters { #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0 #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \ I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT) - u8 reserved2[4]; + u8 big_buffer_flag; +#define I40E_AQC_ADD_CLOUD_CMD_BB 1 + u8 reserved2[3]; __le32 addr_high; __le32 addr_low; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters); -struct i40e_aqc_add_remove_cloud_filters_element_data { +struct i40e_aqc_cloud_filters_element_data { u8 outer_mac[6]; u8 inner_mac[6]; __le16 inner_vlan; @@ -1408,6 +1410,13 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +/* 0x0010 to 0x0017 is for custom filters */ +/* flag to be used when adding cloud filter: IP + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010 +/* flag to be used when adding cloud filter: Dest MAC + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 +/* flag to be used when adding cloud filter: Dest MAC + VLAN + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT0x0012 #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080 #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6 @@ -1442,6 +1451,49 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { u8 response_reserved[7]; }; +I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_cloud_filters_element_data); + +/* i40e_aqc_cloud_filters_element_bb is used when + * I40E_AQC_CLOUD_CMD_BB flag is set. + */ +struct i40e_aqc_cloud_filters_element_bb { + struct i40e_aqc_cloud_filters_element_data element; + u16 general_fields[32]; +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0 0 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1 1 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2 2 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0 3 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1 4 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2 5 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0 6 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1 7 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2 8 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0 9 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1 10 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2 11 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0 12 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1 13 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2 14 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0 15 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1 16 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2 17 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3 18 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4 19 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5 20 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6 21 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7 22 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0 23 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1 24 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2 25 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3 26 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4 27 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5 28 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6 29 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7 30 +}; + +I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_cloud_filters_element_bb); + struct i40e_aqc_remove_cloud_filters_completion { __le16 perfect_ovlan_used; __le16 perfect_ovlan_free; @@ -1453,6 +1505,60 @@ struct i40e_aqc_remove_cloud_filters_completion { I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion); +/* Replace filter Command 0x025F + * uses the i40e_aqc_replace_cloud_filters, + * and the generic indirect completio
[net-next 06/15] i40e: use admin queue for setting LEDs behavior
From: Mariusz StachuraInstead of accessing register directly, use newly added AQC in order to blink LEDs. Introduce and utilize a new flag to prevent excessive API version checking. Signed-off-by: Mariusz Stachura Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/i40e/i40e_adminq.c | 6 ++ drivers/net/ethernet/intel/i40e/i40e_common.c | 115 -- drivers/net/ethernet/intel/i40evf/i40e_type.h | 2 + 3 files changed, 99 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c index ba04988e0598..08f63226105a 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c @@ -607,6 +607,12 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw) _lo); hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo; + if (hw->mac.type == I40E_MAC_XL710 && + hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR && + hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) { + hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; + } + if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) { ret_code = I40E_ERR_FIRMWARE_API_VERSION; goto init_adminq_free_arq; diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index fada03799850..a4838779de5d 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c @@ -4836,6 +4836,74 @@ i40e_status i40e_blink_phy_link_led(struct i40e_hw *hw, return status; } +/** + * i40e_led_get_reg - read LED register + * @hw: pointer to the HW structure + * @led_addr: LED register address + * @reg_val: read register value + **/ +static enum i40e_status_code i40e_led_get_reg(struct i40e_hw *hw, u16 led_addr, + u32 *reg_val) +{ + enum i40e_status_code status; + u8 phy_addr = 0; + u8 port_num; + u32 i; + + *reg_val = 0; + if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) { + status = + i40e_aq_get_phy_register(hw, + I40E_AQ_PHY_REG_ACCESS_EXTERNAL, + I40E_PHY_COM_REG_PAGE, + I40E_PHY_LED_PROV_REG_1, + reg_val, NULL); + } else { + i = rd32(hw, I40E_PFGEN_PORTNUM); + port_num = (u8)(i & I40E_PFGEN_PORTNUM_PORT_NUM_MASK); + phy_addr = i40e_get_phy_address(hw, port_num); + status = i40e_read_phy_register_clause45(hw, +I40E_PHY_COM_REG_PAGE, +led_addr, phy_addr, +(u16 *)reg_val); + } + return status; +} + +/** + * i40e_led_set_reg - write LED register + * @hw: pointer to the HW structure + * @led_addr: LED register address + * @reg_val: register value to write + **/ +static enum i40e_status_code i40e_led_set_reg(struct i40e_hw *hw, u16 led_addr, + u32 reg_val) +{ + enum i40e_status_code status; + u8 phy_addr = 0; + u8 port_num; + u32 i; + + if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) { + status = + i40e_aq_set_phy_register(hw, + I40E_AQ_PHY_REG_ACCESS_EXTERNAL, + I40E_PHY_COM_REG_PAGE, + I40E_PHY_LED_PROV_REG_1, + reg_val, NULL); + } else { + i = rd32(hw, I40E_PFGEN_PORTNUM); + port_num = (u8)(i & I40E_PFGEN_PORTNUM_PORT_NUM_MASK); + phy_addr = i40e_get_phy_address(hw, port_num); + status = i40e_write_phy_register_clause45(hw, + I40E_PHY_COM_REG_PAGE, + led_addr, phy_addr, + (u16)reg_val); + } + + return status; +} + /** * i40e_led_get_phy - return current on/off mode * @hw: pointer to the hw struct @@ -4853,7 +4921,19 @@ i40e_status i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr, u16 temp_addr; u8 port_num; u32 i; - + u32 reg_val_aq; + + if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) { + status = + i40e_aq_get_phy_register(hw, +
[RFC PATCH v3 5/7] i40e: Admin queue definitions for cloud filters
Add new admin queue definitions and extended fields for cloud filter support. Define big buffer for extended general fields in Add/Remove Cloud filters command. v3: Shortened some lengthy struct names. v2: Added I40E_CHECK_STRUCT_LEN check to AQ command structs and added AQ definitions to i40evf for consistency based on Shannon's feedback. Signed-off-by: Amritha Nambiar <amritha.namb...@intel.com> Signed-off-by: Kiran Patil <kiran.pa...@intel.com> Signed-off-by: Jingjing Wu <jingjing...@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 110 .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h| 110 2 files changed, 216 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index e41050a..2e567c2 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h @@ -1371,14 +1371,16 @@ struct i40e_aqc_add_remove_cloud_filters { #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0 #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \ I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT) - u8 reserved2[4]; + u8 big_buffer_flag; +#define I40E_AQC_ADD_CLOUD_CMD_BB 1 + u8 reserved2[3]; __le32 addr_high; __le32 addr_low; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters); -struct i40e_aqc_add_remove_cloud_filters_element_data { +struct i40e_aqc_cloud_filters_element_data { u8 outer_mac[6]; u8 inner_mac[6]; __le16 inner_vlan; @@ -1408,6 +1410,13 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +/* 0x0010 to 0x0017 is for custom filters */ +/* flag to be used when adding cloud filter: IP + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010 +/* flag to be used when adding cloud filter: Dest MAC + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 +/* flag to be used when adding cloud filter: Dest MAC + VLAN + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT0x0012 #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080 #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6 @@ -1442,6 +1451,49 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { u8 response_reserved[7]; }; +I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_cloud_filters_element_data); + +/* i40e_aqc_cloud_filters_element_bb is used when + * I40E_AQC_CLOUD_CMD_BB flag is set. + */ +struct i40e_aqc_cloud_filters_element_bb { + struct i40e_aqc_cloud_filters_element_data element; + u16 general_fields[32]; +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0 0 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1 1 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2 2 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0 3 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1 4 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2 5 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0 6 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1 7 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2 8 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0 9 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1 10 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2 11 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0 12 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1 13 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2 14 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0 15 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1 16 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2 17 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3 18 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4 19 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5 20 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6 21 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7 22 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0 23 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1 24 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2 25 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3 26 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4 27 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5 28 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6 29 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7 30 +}; + +I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_cloud_filters_element_bb); + struct i40e_aqc_remove_cloud_filters_completion { __le16 perfect_ovlan_used; __le16 perfect_ovlan_free; @@ -1453,6 +1505,60 @@ struct i40e_aqc_remove_cloud_filters_completion { I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion); +/* Replace filter Command 0x025F + * uses the i40e_aqc_replace_cloud_filters, + * and the generic indirect completio
[RFC PATCH v2 4/6] [net-next]net: i40e: Admin queue definitions for cloud filters
Add new admin queue definitions and extended fields for cloud filter support. Define big buffer for extended general fields in Add/Remove Cloud filters command. v2: Added I40E_CHECK_STRUCT_LEN check to AQ command structs and added AQ definitions to i40evf for consistency based on Shannon's feedback. Signed-off-by: Amritha Nambiar <amritha.namb...@intel.com> Signed-off-by: Kiran Patil <kiran.pa...@intel.com> Signed-off-by: Jingjing Wu <jingjing...@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 108 .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h| 108 2 files changed, 214 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index eac5ff5..1f5 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h @@ -1355,7 +1355,9 @@ struct i40e_aqc_add_remove_cloud_filters { #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0 #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \ I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT) - u8 reserved2[4]; + u8 big_buffer_flag; +#defineI40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER 1 + u8 reserved2[3]; __le32 addr_high; __le32 addr_low; }; @@ -1392,6 +1394,13 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +/* 0x0010 to 0x0017 is for custom filters */ +/* flag to be used when adding cloud filter: IP + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010 +/* flag to be used when adding cloud filter: Dest MAC + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 +/* flag to be used when adding cloud filter: Dest MAC + VLAN + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT0x0012 #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080 #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6 @@ -1426,6 +1435,49 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { u8 response_reserved[7]; }; +I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_add_remove_cloud_filters_element_data); + +/* i40e_aqc_add_remove_cloud_filters_element_big_data is used when + * I40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER flag is set. + */ +struct i40e_aqc_add_remove_cloud_filters_element_big_data { + struct i40e_aqc_add_remove_cloud_filters_element_data element; + u16 general_fields[32]; +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0 0 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1 1 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2 2 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0 3 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1 4 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2 5 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0 6 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1 7 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2 8 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0 9 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1 10 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2 11 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0 12 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1 13 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2 14 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0 15 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1 16 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2 17 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3 18 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4 19 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5 20 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6 21 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7 22 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0 23 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1 24 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2 25 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3 26 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4 27 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5 28 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6 29 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7 30 +}; + +I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_add_remove_cloud_filters_element_big_data); + struct i40e_aqc_remove_cloud_filters_completion { __le16 perfect_ovlan_used; __le16 perfect_ovlan_free; @@ -1437,6 +1489,60 @@ struct i40e_aqc_remove_cloud_filters_completion { I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion); +/* Replace filter Command 0x025F + * uses the i40e_aqc_replace_cloud_filters, + * and the generic indirect completion structure + */ +struct i40e_filter_data { + u8 filter_type; + u8 input[3]; +}; + +I40E_CHECK_STRUCT_LEN(4, i40e_filter_data); + +struct i40e_aqc_replace_cloud_filters_cmd { +
Re: [Intel-wired-lan] [PATCH 4/6] [net-next]net: i40e: Admin queue definitions for cloud filters
On 8/1/2017 12:16 PM, Shannon Nelson wrote: > On 7/31/2017 5:37 PM, Amritha Nambiar wrote: >> Add new admin queue definitions and extended fields for cloud >> filter support. Define big buffer for extended general fields >> in Add/Remove Cloud filters command. >> >> Signed-off-by: Amritha Nambiar <amritha.namb...@intel.com> >> Signed-off-by: Kiran Patil <kiran.pa...@intel.com> >> Signed-off-by: Store Laura <laura.st...@intel.com> >> Signed-off-by: Iremonger Bernard <bernard.iremon...@intel.com> >> Signed-off-by: Jingjing Wu <jingjing...@intel.com> >> --- >> drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 98 >> + >> 1 file changed, 97 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h >> b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h >> index 8bba04c..9f14305 100644 >> --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h >> +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h > > I see that you're changing the i40e version of this, but not the i40evf > version. I understand that these changes are not useful for the VF, but > are you no longer trying to keep the AdminQ definitions consistent > between the two? I will add these definitions to the VF as well for consistency in the next version. > >> @@ -1358,7 +1358,9 @@ struct i40e_aqc_add_remove_cloud_filters { >> #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0 >> #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \ >> I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT) >> -u8 reserved2[4]; >> +u8 big_buffer_flag; >> +#define I40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER 1 >> +u8 reserved2[3]; >> __le32 addr_high; >> __le32 addr_low; >> }; >> @@ -1395,6 +1397,13 @@ struct i40e_aqc_add_remove_cloud_filters_element_data >> { >> #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A >> #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B >> #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C >> +/* 0x0010 to 0x0017 is for custom filters */ >> +/* flag to be used when adding cloud filter: IP + L4 Port */ >> +#define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010 >> +/* flag to be used when adding cloud filter: Dest MAC + L4 Port */ >> +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 >> +/* flag to be used when adding cloud filter: Dest MAC + VLAN + L4 Port */ >> +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT 0x0012 >> >> #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080 >> #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6 >> @@ -1429,6 +1438,45 @@ struct i40e_aqc_add_remove_cloud_filters_element_data >> { >> u8 response_reserved[7]; >> }; > > I know you didn't add this struct, but where's the I40E_CHECK_STRUCT_LEN > check? Will add all the needed I40E_CHECK_STRUCT_LEN check in the next version of the series. > >> >> +/* i40e_aqc_add_remove_cloud_filters_element_big_data is used when >> + * I40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER flag is set. >> + */ >> +struct i40e_aqc_add_remove_cloud_filters_element_big_data { >> +struct i40e_aqc_add_remove_cloud_filters_element_data element; >> +u16 general_fields[32]; >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD00 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD11 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD22 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD03 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD14 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD25 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD06 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD17 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD28 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD09 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD110 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD211 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD012 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD113 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD214 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD015 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD116 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD217 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD318 >> +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4
admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar su buzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono: Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación: es: 006524 Correo Soporte Técnico © 2017 ¡gracias Sistemas administrador
Re: [Intel-wired-lan] [PATCH 4/6] [net-next]net: i40e: Admin queue definitions for cloud filters
On 7/31/2017 5:37 PM, Amritha Nambiar wrote: Add new admin queue definitions and extended fields for cloud filter support. Define big buffer for extended general fields in Add/Remove Cloud filters command. Signed-off-by: Amritha Nambiar <amritha.namb...@intel.com> Signed-off-by: Kiran Patil <kiran.pa...@intel.com> Signed-off-by: Store Laura <laura.st...@intel.com> Signed-off-by: Iremonger Bernard <bernard.iremon...@intel.com> Signed-off-by: Jingjing Wu <jingjing...@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 98 + 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index 8bba04c..9f14305 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h I see that you're changing the i40e version of this, but not the i40evf version. I understand that these changes are not useful for the VF, but are you no longer trying to keep the AdminQ definitions consistent between the two? @@ -1358,7 +1358,9 @@ struct i40e_aqc_add_remove_cloud_filters { #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0 #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \ I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT) - u8 reserved2[4]; + u8 big_buffer_flag; +#defineI40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER 1 + u8 reserved2[3]; __le32 addr_high; __le32 addr_low; }; @@ -1395,6 +1397,13 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +/* 0x0010 to 0x0017 is for custom filters */ +/* flag to be used when adding cloud filter: IP + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010 +/* flag to be used when adding cloud filter: Dest MAC + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 +/* flag to be used when adding cloud filter: Dest MAC + VLAN + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT0x0012 #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080 #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6 @@ -1429,6 +1438,45 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { u8 response_reserved[7]; }; I know you didn't add this struct, but where's the I40E_CHECK_STRUCT_LEN check? +/* i40e_aqc_add_remove_cloud_filters_element_big_data is used when + * I40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER flag is set. + */ +struct i40e_aqc_add_remove_cloud_filters_element_big_data { + struct i40e_aqc_add_remove_cloud_filters_element_data element; + u16 general_fields[32]; +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0 0 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1 1 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2 2 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0 3 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1 4 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2 5 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0 6 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1 7 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2 8 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0 9 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1 10 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2 11 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0 12 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1 13 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2 14 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0 15 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1 16 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2 17 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3 18 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4 19 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5 20 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6 21 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7 22 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0 23 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1 24 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2 25 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3 26 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4 27 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5 28 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6 29 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7 30 +}; Needs the I40E_CHECK_STRUCT_LEN to be consistent with the data checking in the rest of this file. + struct i40e_aqc_remove_cloud_filters_completion { __le16 perfect_ovlan_used; __le16 perfect_ovlan_free; @@ -1440,6 +1488,54 @@ struct i40e_aqc_remove_cloud_filters_completion { I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion); +/* Replace filter Command 0x025F + * uses the i40e_aqc_replace_cloud_filters, + *
[PATCH 4/6] [net-next]net: i40e: Admin queue definitions for cloud filters
Add new admin queue definitions and extended fields for cloud filter support. Define big buffer for extended general fields in Add/Remove Cloud filters command. Signed-off-by: Amritha Nambiar <amritha.namb...@intel.com> Signed-off-by: Kiran Patil <kiran.pa...@intel.com> Signed-off-by: Store Laura <laura.st...@intel.com> Signed-off-by: Iremonger Bernard <bernard.iremon...@intel.com> Signed-off-by: Jingjing Wu <jingjing...@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 98 + 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index 8bba04c..9f14305 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h @@ -1358,7 +1358,9 @@ struct i40e_aqc_add_remove_cloud_filters { #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0 #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \ I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT) - u8 reserved2[4]; + u8 big_buffer_flag; +#defineI40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER 1 + u8 reserved2[3]; __le32 addr_high; __le32 addr_low; }; @@ -1395,6 +1397,13 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +/* 0x0010 to 0x0017 is for custom filters */ +/* flag to be used when adding cloud filter: IP + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010 +/* flag to be used when adding cloud filter: Dest MAC + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 +/* flag to be used when adding cloud filter: Dest MAC + VLAN + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT0x0012 #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080 #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6 @@ -1429,6 +1438,45 @@ struct i40e_aqc_add_remove_cloud_filters_element_data { u8 response_reserved[7]; }; +/* i40e_aqc_add_remove_cloud_filters_element_big_data is used when + * I40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER flag is set. + */ +struct i40e_aqc_add_remove_cloud_filters_element_big_data { + struct i40e_aqc_add_remove_cloud_filters_element_data element; + u16 general_fields[32]; +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0 0 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1 1 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2 2 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0 3 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1 4 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2 5 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0 6 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1 7 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2 8 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0 9 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1 10 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2 11 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0 12 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1 13 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2 14 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0 15 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1 16 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2 17 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3 18 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4 19 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5 20 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6 21 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7 22 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0 23 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1 24 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2 25 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3 26 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4 27 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5 28 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6 29 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7 30 +}; + struct i40e_aqc_remove_cloud_filters_completion { __le16 perfect_ovlan_used; __le16 perfect_ovlan_free; @@ -1440,6 +1488,54 @@ struct i40e_aqc_remove_cloud_filters_completion { I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion); +/* Replace filter Command 0x025F + * uses the i40e_aqc_replace_cloud_filters, + * and the generic indirect completion structure + */ +struct i40e_filter_data { + u8 filter_type; + u8 input[3]; +}; + +struct i40e_aqc_replace_cloud_filters_cmd { + u8 valid_flags; +#define I40E_AQC_REPLACE_L1_FILTER 0x0 +#define I40E_AQC_REPLACE_CLOUD_FILTER 0x1 +#define I40E_AQC_GET_CLOUD_FILTERS 0x2 +#define I40E_AQC_MIRROR_CLOUD_FILTER 0x4 +#define I40E_AQC_HIGH_PRIORITY_CLOUD_FILTER0x8 +
[net-next 04/14] i40e: Handle admin Q timeout when releasing NVM
From: Paul M Stillwell Jr <paul.m.stillwell...@intel.com> There are some rare cases where the release resource call will return an admin Q timeout. In these cases the code needs to try to release the resource again until it succeeds or it times out. Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell...@intel.com> Tested-by: Andrew Bowers <andrewx.bow...@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirs...@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c index 800bd55d0159..17607a2c0a65 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c +++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c @@ -134,8 +134,25 @@ i40e_status i40e_acquire_nvm(struct i40e_hw *hw, **/ void i40e_release_nvm(struct i40e_hw *hw) { - if (!hw->nvm.blank_nvm_mode) - i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL); + i40e_status ret_code = I40E_SUCCESS; + u32 total_delay = 0; + + if (hw->nvm.blank_nvm_mode) + return; + + ret_code = i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL); + + /* there are some rare cases when trying to release the resource +* results in an admin Q timeout, so handle them correctly +*/ + while ((ret_code == I40E_ERR_ADMIN_QUEUE_TIMEOUT) && + (total_delay < hw->aq.asq_cmd_timeout)) { + usleep_range(1000, 2000); + ret_code = i40e_aq_release_resource(hw, + I40E_NVM_RESOURCE_ID, + 0, NULL); + total_delay++; + } } /** -- 2.13.3
admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar su buzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación:Ar Correo.AR...AR005615273849598 Correo Soporte Técnico © 2017 ¡gracias Sistemas administrador
[PATCH net 7/9] net: ena: disable admin msix while working in polling mode
From: Netanel BelgazalFixes: 1738cd3ed342 ("Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Netanel Belgazal --- drivers/net/ethernet/amazon/ena/ena_com.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index ea60b9e67acb..f5b237e0bd60 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -61,6 +61,8 @@ #define ENA_MMIO_READ_TIMEOUT 0x +#define ENA_REGS_ADMIN_INTR_MASK 1 + /*/ /*/ /*/ @@ -1454,6 +1456,12 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev) void ena_com_set_admin_polling_mode(struct ena_com_dev *ena_dev, bool polling) { + u32 mask_value = 0; + + if (polling) + mask_value = ENA_REGS_ADMIN_INTR_MASK; + + writel(mask_value, ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF); ena_dev->admin_queue.polling = polling; } -- 2.7.4
[PATCH net 4/9] net: ena: fix race condition between submit and completion admin command
From: Netanel Belgazal <neta...@amazon.com> Bug: "Completion context is occupied" error printout will be noticed in dmesg. This error will cause the admin command to fail, which will lead to an ena_probe() failure or a watchdog reset (depends on which admin command failed). Root cause: __ena_com_submit_admin_cmd() is the function that submits new entries to the admin queue. The function have a check that makes sure the queue is not full and the function does not override any outstanding command. It uses head and tail indexes for this check. The head is increased by ena_com_handle_admin_completion() which runs from interrupt context, and the tail index is increased by the submit function (the function is running under ->q_lock, so there is no risk of multithread increment). Each command is associated with a completion context. This context allocated before call to __ena_com_submit_admin_cmd() and freed by ena_com_wait_and_process_admin_cq_interrupts(), right after the command was completed. This can lead to a state where the head was increased, the check passed, but the completion context is still in use. Solution: Use the atomic variable ->outstanding_cmds instead of using the head and the tail indexes. This variable is safe for use since it is bumped in get_comp_ctx() in __ena_com_submit_admin_cmd() and is freed by comp_ctxt_release() Fixes: 1738cd3ed342 ("Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Netanel Belgazal <neta...@amazon.com> --- drivers/net/ethernet/amazon/ena/ena_com.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index e1c2fab6292f..ea60b9e67acb 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -232,11 +232,9 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd(struct ena_com_admin_queu tail_masked = admin_queue->sq.tail & queue_size_mask; /* In case of queue FULL */ - cnt = admin_queue->sq.tail - admin_queue->sq.head; + cnt = atomic_read(_queue->outstanding_cmds); if (cnt >= admin_queue->q_depth) { - pr_debug("admin queue is FULL (tail %d head %d depth: %d)\n", -admin_queue->sq.tail, admin_queue->sq.head, - admin_queue->q_depth); + pr_debug("admin queue is full.\n"); admin_queue->stats.out_of_space++; return ERR_PTR(-ENOSPC); } -- 2.7.4
[PATCH net 1/9] net: ena: fix rare uncompleted admin command false alarm
From: Netanel Belgazal <neta...@amazon.com> The current flow to detect admin completion is: while (command_not_completed) { if (timeout) error check_for_completion() sleep() } So in case the sleep took more than the timeout (in case the thread/workqueue was not scheduled due to higher priority task or prolonged VMexit), the driver can detect a stall even if the completion is present. The fix changes the order of this function to first check for completion and only after that check if the timeout expired. Fixes: 1738cd3ed342 ("Add a driver for Amazon Elastic Network Adapters (ENA)") Signed-off-by: Netanel Belgazal <neta...@amazon.com> --- drivers/net/ethernet/amazon/ena/ena_com.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index 08d11cede9c9..e1c2fab6292f 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -508,15 +508,20 @@ static int ena_com_comp_status_to_errno(u8 comp_status) static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { - unsigned long flags; - u32 start_time; + unsigned long flags, timeout; int ret; - start_time = ((u32)jiffies_to_usecs(jiffies)); + timeout = jiffies + ADMIN_CMD_TIMEOUT_US; + + while (1) { + spin_lock_irqsave(_queue->q_lock, flags); + ena_com_handle_admin_completion(admin_queue); + spin_unlock_irqrestore(_queue->q_lock, flags); - while (comp_ctx->status == ENA_CMD_SUBMITTED) { - if u32)jiffies_to_usecs(jiffies)) - start_time) > - ADMIN_CMD_TIMEOUT_US) { + if (comp_ctx->status != ENA_CMD_SUBMITTED) + break; + + if (time_is_before_jiffies(timeout)) { pr_err("Wait for completion (polling) timeout\n"); /* ENA didn't have any completion */ spin_lock_irqsave(_queue->q_lock, flags); @@ -528,10 +533,6 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c goto err; } - spin_lock_irqsave(_queue->q_lock, flags); - ena_com_handle_admin_completion(admin_queue); - spin_unlock_irqrestore(_queue->q_lock, flags); - msleep(100); } -- 2.7.4
[PATCH net-next 4/8] net: ena: fix race condition between submit and completion admin command
From: Netanel Belgazal <neta...@amazon.com> Bug: "Completion context is occupied" error printout will be noticed in dmesg. This error will cause the admin command to fail, which will lead to an ena_probe() failure or a watchdog reset (depends on which admin command failed). Root cause: __ena_com_submit_admin_cmd() is the function that submits new entries to the admin queue. The function have a check that makes sure the queue is not full and the function does not override any outstanding command. It uses head and tail indexes for this check. The head is increased by ena_com_handle_admin_completion() which runs from interrupt context, and the tail index is increased by the submit function (the function is running under ->q_lock, so there is no risk of multithread increment). Each command is associated with a completion context. This context allocated before call to __ena_com_submit_admin_cmd() and freed by ena_com_wait_and_process_admin_cq_interrupts(), right after the command was completed. This can lead to a state where the head was increased, the check passed, but the completion context is still in use. Solution: Use the atomic variable ->outstanding_cmds instead of using the head and the tail indexes. This variable is safe for use since it is bumped in get_comp_ctx() in __ena_com_submit_admin_cmd() and is freed by comp_ctxt_release() Signed-off-by: Netanel Belgazal <neta...@amazon.com> --- drivers/net/ethernet/amazon/ena/ena_com.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index e1c2fab..ea60b9e 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -232,11 +232,9 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd(struct ena_com_admin_queu tail_masked = admin_queue->sq.tail & queue_size_mask; /* In case of queue FULL */ - cnt = admin_queue->sq.tail - admin_queue->sq.head; + cnt = atomic_read(_queue->outstanding_cmds); if (cnt >= admin_queue->q_depth) { - pr_debug("admin queue is FULL (tail %d head %d depth: %d)\n", -admin_queue->sq.tail, admin_queue->sq.head, - admin_queue->q_depth); + pr_debug("admin queue is full.\n"); admin_queue->stats.out_of_space++; return ERR_PTR(-ENOSPC); } -- 2.7.4
[PATCH net-next 7/8] net: ena: disable admin msix while working in polling mode
From: Netanel BelgazalSigned-off-by: Netanel Belgazal --- drivers/net/ethernet/amazon/ena/ena_com.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index ea60b9e..f5b237e 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -61,6 +61,8 @@ #define ENA_MMIO_READ_TIMEOUT 0x +#define ENA_REGS_ADMIN_INTR_MASK 1 + /*/ /*/ /*/ @@ -1454,6 +1456,12 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev) void ena_com_set_admin_polling_mode(struct ena_com_dev *ena_dev, bool polling) { + u32 mask_value = 0; + + if (polling) + mask_value = ENA_REGS_ADMIN_INTR_MASK; + + writel(mask_value, ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF); ena_dev->admin_queue.polling = polling; } -- 2.7.4
[PATCH net-next 1/8] net: ena: fix rare uncompleted admin command false alarm
From: Netanel Belgazal <neta...@amazon.com> The current flow to detect admin completion is: while (command_not_completed) { if (timeout) error check_for_completion() sleep() } So in case the sleep took more than the timeout (in case the thread/workqueue was not scheduled due to higher priority task or prolonged VMexit), the driver can detect a stall even if the completion is present. The fix changes the order of this function to first check for completion and only after that check if the timeout expired. Signed-off-by: Netanel Belgazal <neta...@amazon.com> --- drivers/net/ethernet/amazon/ena/ena_com.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index 08d11ce..e1c2fab 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -508,15 +508,20 @@ static int ena_com_comp_status_to_errno(u8 comp_status) static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { - unsigned long flags; - u32 start_time; + unsigned long flags, timeout; int ret; - start_time = ((u32)jiffies_to_usecs(jiffies)); + timeout = jiffies + ADMIN_CMD_TIMEOUT_US; + + while (1) { + spin_lock_irqsave(_queue->q_lock, flags); + ena_com_handle_admin_completion(admin_queue); + spin_unlock_irqrestore(_queue->q_lock, flags); - while (comp_ctx->status == ENA_CMD_SUBMITTED) { - if u32)jiffies_to_usecs(jiffies)) - start_time) > - ADMIN_CMD_TIMEOUT_US) { + if (comp_ctx->status != ENA_CMD_SUBMITTED) + break; + + if (time_is_before_jiffies(timeout)) { pr_err("Wait for completion (polling) timeout\n"); /* ENA didn't have any completion */ spin_lock_irqsave(_queue->q_lock, flags); @@ -528,10 +533,6 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c goto err; } - spin_lock_irqsave(_queue->q_lock, flags); - ena_com_handle_admin_completion(admin_queue); - spin_unlock_irqrestore(_queue->q_lock, flags); - msleep(100); } -- 2.7.4
[PATCH net-next 7/8] net: ena: disable admin msix while working in polling mode
From: Netanel BelgazalSigned-off-by: Netanel Belgazal --- drivers/net/ethernet/amazon/ena/ena_com.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index ea60b9e..f5b237e 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -61,6 +61,8 @@ #define ENA_MMIO_READ_TIMEOUT 0x +#define ENA_REGS_ADMIN_INTR_MASK 1 + /*/ /*/ /*/ @@ -1454,6 +1456,12 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev) void ena_com_set_admin_polling_mode(struct ena_com_dev *ena_dev, bool polling) { + u32 mask_value = 0; + + if (polling) + mask_value = ENA_REGS_ADMIN_INTR_MASK; + + writel(mask_value, ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF); ena_dev->admin_queue.polling = polling; } -- 2.7.4
[PATCH net-next 1/8] net: ena: fix rare uncompleted admin command false alarm
From: Netanel Belgazal <neta...@amazon.com> The current flow to detect admin completion is: while (command_not_completed) { if (timeout) error check_for_completion() sleep() } So in case the sleep took more than the timeout (in case the thread/workqueue was not scheduled due to higher priority task or prolonged VMexit), the driver can detect a stall even if the completion is present. The fix changes the order of this function to first check for completion and only after that check if the timeout expired. Signed-off-by: Netanel Belgazal <neta...@amazon.com> --- drivers/net/ethernet/amazon/ena/ena_com.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index 08d11ce..e1c2fab 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -508,15 +508,20 @@ static int ena_com_comp_status_to_errno(u8 comp_status) static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { - unsigned long flags; - u32 start_time; + unsigned long flags, timeout; int ret; - start_time = ((u32)jiffies_to_usecs(jiffies)); + timeout = jiffies + ADMIN_CMD_TIMEOUT_US; + + while (1) { + spin_lock_irqsave(_queue->q_lock, flags); + ena_com_handle_admin_completion(admin_queue); + spin_unlock_irqrestore(_queue->q_lock, flags); - while (comp_ctx->status == ENA_CMD_SUBMITTED) { - if u32)jiffies_to_usecs(jiffies)) - start_time) > - ADMIN_CMD_TIMEOUT_US) { + if (comp_ctx->status != ENA_CMD_SUBMITTED) + break; + + if (time_is_before_jiffies(timeout)) { pr_err("Wait for completion (polling) timeout\n"); /* ENA didn't have any completion */ spin_lock_irqsave(_queue->q_lock, flags); @@ -528,10 +533,6 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c goto err; } - spin_lock_irqsave(_queue->q_lock, flags); - ena_com_handle_admin_completion(admin_queue); - spin_unlock_irqrestore(_queue->q_lock, flags); - msleep(100); } -- 2.7.4
[PATCH net-next 4/8] net: ena: fix race condition between submit and completion admin command
From: Netanel Belgazal <neta...@amazon.com> Bug: "Completion context is occupied" error printout will be noticed in dmesg. This error will cause the admin command to fail, which will lead to an ena_probe() failure or a watchdog reset (depends on which admin command failed). Root cause: __ena_com_submit_admin_cmd() is the function that submits new entries to the admin queue. The function have a check that makes sure the queue is not full and the function does not override any outstanding command. It uses head and tail indexes for this check. The head is increased by ena_com_handle_admin_completion() which runs from interrupt context, and the tail index is increased by the submit function (the function is running under ->q_lock, so there is no risk of multithread increment). Each command is associated with a completion context. This context allocated before call to __ena_com_submit_admin_cmd() and freed by ena_com_wait_and_process_admin_cq_interrupts(), right after the command was completed. This can lead to a state where the head was increased, the check passed, but the completion context is still in use. Solution: Use the atomic variable ->outstanding_cmds instead of using the head and the tail indexes. This variable is safe for use since it is bumped in get_comp_ctx() in __ena_com_submit_admin_cmd() and is freed by comp_ctxt_release() Signed-off-by: Netanel Belgazal <neta...@amazon.com> --- drivers/net/ethernet/amazon/ena/ena_com.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index e1c2fab..ea60b9e 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -232,11 +232,9 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd(struct ena_com_admin_queu tail_masked = admin_queue->sq.tail & queue_size_mask; /* In case of queue FULL */ - cnt = admin_queue->sq.tail - admin_queue->sq.head; + cnt = atomic_read(_queue->outstanding_cmds); if (cnt >= admin_queue->q_depth) { - pr_debug("admin queue is FULL (tail %d head %d depth: %d)\n", -admin_queue->sq.tail, admin_queue->sq.head, - admin_queue->q_depth); + pr_debug("admin queue is full.\n"); admin_queue->stats.out_of_space++; return ERR_PTR(-ENOSPC); } -- 2.7.4
[PATCH net-next 7/8] net: ena: disable admin msix while working in polling mode
From: Netanel BelgazalSigned-off-by: Netanel Belgazal --- drivers/net/ethernet/amazon/ena/ena_com.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index ea60b9e..f5b237e 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -61,6 +61,8 @@ #define ENA_MMIO_READ_TIMEOUT 0x +#define ENA_REGS_ADMIN_INTR_MASK 1 + /*/ /*/ /*/ @@ -1454,6 +1456,12 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev) void ena_com_set_admin_polling_mode(struct ena_com_dev *ena_dev, bool polling) { + u32 mask_value = 0; + + if (polling) + mask_value = ENA_REGS_ADMIN_INTR_MASK; + + writel(mask_value, ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF); ena_dev->admin_queue.polling = polling; } -- 2.7.4
[PATCH net-next 4/8] net: ena: fix race condition between submit and completion admin command
From: Netanel Belgazal <neta...@amazon.com> Bug: "Completion context is occupied" error printout will be noticed in dmesg. This error will cause the admin command to fail, which will lead to an ena_probe() failure or a watchdog reset (depends on which admin command failed). Root cause: __ena_com_submit_admin_cmd() is the function that submits new entries to the admin queue. The function have a check that makes sure the queue is not full and the function does not override any outstanding command. It uses head and tail indexes for this check. The head is increased by ena_com_handle_admin_completion() which runs from interrupt context, and the tail index is increased by the submit function (the function is running under ->q_lock, so there is no risk of multithread increment). Each command is associated with a completion context. This context allocated before call to __ena_com_submit_admin_cmd() and freed by ena_com_wait_and_process_admin_cq_interrupts(), right after the command was completed. This can lead to a state where the head was increased, the check passed, but the completion context is still in use. Solution: Use the atomic variable ->outstanding_cmds instead of using the head and the tail indexes. This variable is safe for use since it is bumped in get_comp_ctx() in __ena_com_submit_admin_cmd() and is freed by comp_ctxt_release() Signed-off-by: Netanel Belgazal <neta...@amazon.com> --- drivers/net/ethernet/amazon/ena/ena_com.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index e1c2fab..ea60b9e 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -232,11 +232,9 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd(struct ena_com_admin_queu tail_masked = admin_queue->sq.tail & queue_size_mask; /* In case of queue FULL */ - cnt = admin_queue->sq.tail - admin_queue->sq.head; + cnt = atomic_read(_queue->outstanding_cmds); if (cnt >= admin_queue->q_depth) { - pr_debug("admin queue is FULL (tail %d head %d depth: %d)\n", -admin_queue->sq.tail, admin_queue->sq.head, - admin_queue->q_depth); + pr_debug("admin queue is full.\n"); admin_queue->stats.out_of_space++; return ERR_PTR(-ENOSPC); } -- 2.7.4
[PATCH net-next 1/8] net: ena: fix rare uncompleted admin command false alarm
From: Netanel Belgazal <neta...@amazon.com> The current flow to detect admin completion is: while (command_not_completed) { if (timeout) error check_for_completion() sleep() } So in case the sleep took more than the timeout (in case the thread/workqueue was not scheduled due to higher priority task or prolonged VMexit), the driver can detect a stall even if the completion is present. The fix changes the order of this function to first check for completion and only after that check if the timeout expired. Signed-off-by: Netanel Belgazal <neta...@amazon.com> --- drivers/net/ethernet/amazon/ena/ena_com.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index 08d11ce..e1c2fab 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -508,15 +508,20 @@ static int ena_com_comp_status_to_errno(u8 comp_status) static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { - unsigned long flags; - u32 start_time; + unsigned long flags, timeout; int ret; - start_time = ((u32)jiffies_to_usecs(jiffies)); + timeout = jiffies + ADMIN_CMD_TIMEOUT_US; + + while (1) { + spin_lock_irqsave(_queue->q_lock, flags); + ena_com_handle_admin_completion(admin_queue); + spin_unlock_irqrestore(_queue->q_lock, flags); - while (comp_ctx->status == ENA_CMD_SUBMITTED) { - if u32)jiffies_to_usecs(jiffies)) - start_time) > - ADMIN_CMD_TIMEOUT_US) { + if (comp_ctx->status != ENA_CMD_SUBMITTED) + break; + + if (time_is_before_jiffies(timeout)) { pr_err("Wait for completion (polling) timeout\n"); /* ENA didn't have any completion */ spin_lock_irqsave(_queue->q_lock, flags); @@ -528,10 +533,6 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c goto err; } - spin_lock_irqsave(_queue->q_lock, flags); - ena_com_handle_admin_completion(admin_queue); - spin_unlock_irqrestore(_queue->q_lock, flags); - msleep(100); } -- 2.7.4
admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar su buzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono: Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación: es: 006524 Correo Soporte Técnico © 2017 ¡gracias Sistemas administrador
Admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar subuzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono: 0 Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación: es:00916gbd51.17 Correo Soporte Técnico © 2017 ¡gracias Sistemas Administrador
admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar subuzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono: 0 Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación: es:00916gbd51.17 Correo Soporte Técnico © 2017 ¡gracias Sistemas administrador
admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar subuzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono: 0 Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación: es:00916gbd51.17 Correo Soporte Técnico © 2017 ¡gracias Sistemas administrador
admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar su buzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono: Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación: es: Ar..No,hat2rq7hs;z.Ar Correo Soporte Técnico © 2017 ¡gracias Sistemas administrador
Re: [PATCH net-next] net: ipv6: send unsolicited NA on admin up
From: David AhernDate: Wed, 12 Apr 2017 11:49:04 -0700 > ndisc_notify is the ipv6 equivalent to arp_notify. When arp_notify is > set to 1, gratuitous arp requests are sent when the device is brought up. > The same is expected when ndisc_notify is set to 1 (per ndisc_notify in > Documentation/networking/ip-sysctl.txt). The NA is not sent on NETDEV_UP > event; add it. > > Fixes: 5cb04436eef6 ("ipv6: add knob to send unsolicited ND on link-layer > address change") > Signed-off-by: David Ahern Applied, thanks.
Re: [PATCH net-next] net: ipv6: send unsolicited NA on admin up
On 4/13/17 5:45 AM, Hannes Frederic Sowa wrote: > > > On Wed, Apr 12, 2017, at 20:49, David Ahern wrote: >> ndisc_notify is the ipv6 equivalent to arp_notify. When arp_notify is >> set to 1, gratuitous arp requests are sent when the device is brought up. >> The same is expected when ndisc_notify is set to 1 (per ndisc_notify in >> Documentation/networking/ip-sysctl.txt). The NA is not sent on NETDEV_UP >> event; add it. >> >> Fixes: 5cb04436eef6 ("ipv6: add knob to send unsolicited ND on link-layer >> address change") >> Signed-off-by: David Ahern> > Acked-by: Hannes Frederic Sowa > > In future we might be able to make this a bit more robust when DAD is > happening at the same time. agreed.
Re: [PATCH net-next] net: ipv6: send unsolicited NA on admin up
On Wed, Apr 12, 2017, at 20:49, David Ahern wrote: > ndisc_notify is the ipv6 equivalent to arp_notify. When arp_notify is > set to 1, gratuitous arp requests are sent when the device is brought up. > The same is expected when ndisc_notify is set to 1 (per ndisc_notify in > Documentation/networking/ip-sysctl.txt). The NA is not sent on NETDEV_UP > event; add it. > > Fixes: 5cb04436eef6 ("ipv6: add knob to send unsolicited ND on link-layer > address change") > Signed-off-by: David AhernAcked-by: Hannes Frederic Sowa In future we might be able to make this a bit more robust when DAD is happening at the same time. Thanks, Hannes
[PATCH net-next] net: ipv6: send unsolicited NA on admin up
ndisc_notify is the ipv6 equivalent to arp_notify. When arp_notify is set to 1, gratuitous arp requests are sent when the device is brought up. The same is expected when ndisc_notify is set to 1 (per ndisc_notify in Documentation/networking/ip-sysctl.txt). The NA is not sent on NETDEV_UP event; add it. Fixes: 5cb04436eef6 ("ipv6: add knob to send unsolicited ND on link-layer address change") Signed-off-by: David Ahern--- net/ipv6/ndisc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index b5812b3f7539..b23822e64228 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1748,6 +1748,8 @@ static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, case NETDEV_CHANGEADDR: neigh_changeaddr(_tbl, dev); fib6_run_gc(0, net, false); + /* fallthrough */ + case NETDEV_UP: idev = in6_dev_get(dev); if (!idev) break; -- 2.1.4
admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar su buzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono: Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación: es: 006524 Correo Soporte Técnico © 2017 ¡gracias Sistemas administrador
Admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar su buzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono: Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación: es: 006524 Correo Soporte Técnico © 2017 ¡gracias Sistemas administrador
Admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar su buzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono: Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación: es: 006524 Correo Soporte Técnico © 2017 ¡gracias Sistemas administrador
[PATCH net-next v2 1/2] vxlan: don't flush static fdb entries on admin down
From: Roopa PrabhuThis patch skips flushing static fdb entries in ndo_stop, but flushes all fdb entries during vxlan device delete. This is consistent with the bridge driver fdb Signed-off-by: Roopa Prabhu --- drivers/net/vxlan.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 19b1653..b34822f 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -2354,7 +2354,7 @@ static int vxlan_open(struct net_device *dev) } /* Purge the forwarding table */ -static void vxlan_flush(struct vxlan_dev *vxlan) +static void vxlan_flush(struct vxlan_dev *vxlan, bool do_all) { unsigned int h; @@ -2364,6 +2364,8 @@ static void vxlan_flush(struct vxlan_dev *vxlan) hlist_for_each_safe(p, n, >fdb_head[h]) { struct vxlan_fdb *f = container_of(p, struct vxlan_fdb, hlist); + if (!do_all && (f->state & (NUD_PERMANENT | NUD_NOARP))) + continue; /* the all_zeros_mac entry is deleted at vxlan_uninit */ if (!is_zero_ether_addr(f->eth_addr)) vxlan_fdb_destroy(vxlan, f); @@ -2385,7 +2387,7 @@ static int vxlan_stop(struct net_device *dev) del_timer_sync(>age_timer); - vxlan_flush(vxlan); + vxlan_flush(vxlan, false); vxlan_sock_release(vxlan); return ret; @@ -3058,6 +3060,8 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head) struct vxlan_dev *vxlan = netdev_priv(dev); struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id); + vxlan_flush(vxlan, true); + spin_lock(>sock_lock); if (!hlist_unhashed(>hlist)) hlist_del_rcu(>hlist); -- 1.9.1
Re: [PATCH net-next 1/2] vxlan: don't flush static fdb entries on admin down
On 1/23/17, 1:07 PM, David Miller wrote: > From: Roopa Prabhu> Date: Fri, 20 Jan 2017 23:43:18 -0800 > >> /* Purge the forwarding table */ >> -static void vxlan_flush(struct vxlan_dev *vxlan) >> +static void vxlan_flush(struct vxlan_dev *vxlan, int do_all) > Please use 'bool' and true/false for this new argument. > > FWIW, I am fine with changing the default behavior in this way. ack, will fix and post a v2, thanks.
Re: [PATCH net-next 1/2] vxlan: don't flush static fdb entries on admin down
From: Roopa PrabhuDate: Fri, 20 Jan 2017 23:43:18 -0800 > /* Purge the forwarding table */ > -static void vxlan_flush(struct vxlan_dev *vxlan) > +static void vxlan_flush(struct vxlan_dev *vxlan, int do_all) Please use 'bool' and true/false for this new argument. FWIW, I am fine with changing the default behavior in this way.
Re: [PATCH net-next 1/2] vxlan: don't flush static fdb entries on admin down
On 1/23/17, 12:55 AM, Jiri Benc wrote: > On Fri, 20 Jan 2017 23:43:18 -0800, Roopa Prabhu wrote: >> This patch skips flushing static fdb entries in >> ndo_stop, but flushes all fdb entries during vxlan >> device delete. This is consistent with the bridge >> driver fdb > This makes sense but isn't this a uAPI change? Do you know whether > there are users relying on the current behavior? > yeah, i have debated about this also. I am sitting on a stash of such patches which are borderline bug fixes but been out there long enough that people might care. I leaned towards making it the default because, - I am assuming not many people use static entries - and people will not be very unhappy with this changebecause it does not delete something they had...just retains them. - Per device flag seems like an overkill here Also, i think some such changes were done to the bridge driver too after it was out.
Re: [PATCH net-next 1/2] vxlan: don't flush static fdb entries on admin down
On Fri, 20 Jan 2017 23:43:18 -0800, Roopa Prabhu wrote: > This patch skips flushing static fdb entries in > ndo_stop, but flushes all fdb entries during vxlan > device delete. This is consistent with the bridge > driver fdb This makes sense but isn't this a uAPI change? Do you know whether there are users relying on the current behavior? Jiri
Re: [PATCH cumulus-4.1.y 4/5] vxlan: don't flush static fdb entries on admin down
Hi Roopa, [auto build test ERROR on net-next/master] [also build test ERROR on v4.10-rc4 next-20170120] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Roopa-Prabhu/vxlan-flush-fdb-entries-on-oper-down/20170121-163042 config: x86_64-randconfig-x017-201703 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): drivers/net/vxlan.c: In function 'vxlan_netdevice_event': drivers/net/vxlan.c:3295:27: error: 'vxlan_netdev_ops' undeclared (first use in this function) if (dev->netdev_ops == _netdev_ops) { ^~~~ drivers/net/vxlan.c:3295:27: note: each undeclared identifier is reported only once for each function it appears in >> drivers/net/vxlan.c:3297:5: error: too few arguments to function >> 'vxlan_flush' vxlan_flush(netdev_priv(dev)); ^~~ drivers/net/vxlan.c:2368:13: note: declared here static void vxlan_flush(struct vxlan_dev *vxlan, int do_all) ^~~ vim +/vxlan_flush +3297 drivers/net/vxlan.c acaf4e7099 Daniel Borkmann 2014-01-13 3289 783c146335 Daniel Borkmann 2014-01-22 3290if (event == NETDEV_UNREGISTER) acaf4e7099 Daniel Borkmann 2014-01-13 3291 vxlan_handle_lowerdev_unregister(vn, dev); 7c46a640de Alexander Duyck 2016-06-16 3292else if (event == NETDEV_UDP_TUNNEL_PUSH_INFO) b7aade1548 Hannes Frederic Sowa 2016-04-18 3293 vxlan_push_rx_ports(dev); d8ef10fd7d Balakrishnan Raman 2017-01-20 3294else if (event == NETDEV_CHANGE) { d8ef10fd7d Balakrishnan Raman 2017-01-20 @3295if (dev->netdev_ops == _netdev_ops) { d8ef10fd7d Balakrishnan Raman 2017-01-20 3296if (netif_running(dev) && !netif_oper_up(dev)) d8ef10fd7d Balakrishnan Raman 2017-01-20 @3297 vxlan_flush(netdev_priv(dev)); d8ef10fd7d Balakrishnan Raman 2017-01-20 3298} d8ef10fd7d Balakrishnan Raman 2017-01-20 3299} acaf4e7099 Daniel Borkmann 2014-01-13 3300 :: The code at line 3297 was first introduced by commit :: d8ef10fd7d083cc5551d83db6317a692fee076ba vxlan: flush fdb entries on oper down :: TO: Balakrishnan Raman:: CC: 0day robot --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
[PATCH net-next 1/2] vxlan: don't flush static fdb entries on admin down
From: Roopa PrabhuThis patch skips flushing static fdb entries in ndo_stop, but flushes all fdb entries during vxlan device delete. This is consistent with the bridge driver fdb Signed-off-by: Roopa Prabhu --- drivers/net/vxlan.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 19b1653..269e515 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -2354,7 +2354,7 @@ static int vxlan_open(struct net_device *dev) } /* Purge the forwarding table */ -static void vxlan_flush(struct vxlan_dev *vxlan) +static void vxlan_flush(struct vxlan_dev *vxlan, int do_all) { unsigned int h; @@ -2364,6 +2364,8 @@ static void vxlan_flush(struct vxlan_dev *vxlan) hlist_for_each_safe(p, n, >fdb_head[h]) { struct vxlan_fdb *f = container_of(p, struct vxlan_fdb, hlist); + if (!do_all && (f->state & (NUD_PERMANENT | NUD_NOARP))) + continue; /* the all_zeros_mac entry is deleted at vxlan_uninit */ if (!is_zero_ether_addr(f->eth_addr)) vxlan_fdb_destroy(vxlan, f); @@ -2385,7 +2387,7 @@ static int vxlan_stop(struct net_device *dev) del_timer_sync(>age_timer); - vxlan_flush(vxlan); + vxlan_flush(vxlan, 0); vxlan_sock_release(vxlan); return ret; @@ -3058,6 +3060,8 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head) struct vxlan_dev *vxlan = netdev_priv(dev); struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id); + vxlan_flush(vxlan, 1); + spin_lock(>sock_lock); if (!hlist_unhashed(>hlist)) hlist_del_rcu(>hlist); -- 1.9.1
[PATCH cumulus-4.1.y 4/5] vxlan: don't flush static fdb entries on admin down
From: Roopa PrabhuThis patch skips flushing static fdb entries in ndo_stop, but flushes all fdb entries during vxlan device delete. This is consistent with the bridge driver fdb Signed-off-by: Roopa Prabhu --- drivers/net/vxlan.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 7300586..3314090 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -2365,7 +2365,7 @@ static int vxlan_open(struct net_device *dev) } /* Purge the forwarding table */ -static void vxlan_flush(struct vxlan_dev *vxlan) +static void vxlan_flush(struct vxlan_dev *vxlan, int do_all) { unsigned int h; @@ -2375,6 +2375,8 @@ static void vxlan_flush(struct vxlan_dev *vxlan) hlist_for_each_safe(p, n, >fdb_head[h]) { struct vxlan_fdb *f = container_of(p, struct vxlan_fdb, hlist); + if (!do_all && (f->state & (NUD_PERMANENT | NUD_NOARP))) + continue; /* the all_zeros_mac entry is deleted at vxlan_uninit */ if (!is_zero_ether_addr(f->eth_addr)) vxlan_fdb_destroy(vxlan, f); @@ -2396,7 +2398,7 @@ static int vxlan_stop(struct net_device *dev) del_timer_sync(>age_timer); - vxlan_flush(vxlan); + vxlan_flush(vxlan, 0); vxlan_sock_release(vxlan); return ret; @@ -3069,6 +3071,8 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head) struct vxlan_dev *vxlan = netdev_priv(dev); struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id); + vxlan_flush(vxlan, 1); + spin_lock(>sock_lock); if (!hlist_unhashed(>hlist)) hlist_del_rcu(>hlist); -- 1.9.1
Re: [PATCH net-next] net: ipv6: Keep nexthop of multipath route on admin down
From: David Ahern <d...@cumulusnetworks.com> Date: Wed, 18 Jan 2017 07:40:36 -0800 > IPv6 deletes route entries associated with multipath routes on an > admin down where IPv4 does not. For example: ... > Signed-off-by: David Ahern <d...@cumulusnetworks.com> Seems reasonable, applied, thanks David.
[PATCH net-next] net: ipv6: Keep nexthop of multipath route on admin down
IPv6 deletes route entries associated with multipath routes on an admin down where IPv4 does not. For example: $ ip ro ls vrf red unreachable default metric 8192 1.1.1.0/24 metric 64 nexthop via 10.100.1.254 dev eth1 weight 1 nexthop via 10.100.2.254 dev eth2 weight 1 10.100.1.0/24 dev eth1 proto kernel scope link src 10.100.1.4 10.100.2.0/24 dev eth2 proto kernel scope link src 10.100.2.4 $ ip -6 ro ls vrf red 2001:db8:1::/120 dev eth1 proto kernel metric 256 pref medium 2001:db8:2:: dev red proto none metric 0 pref medium 2001:db8:2::/120 dev eth2 proto kernel metric 256 pref medium 2001:db8:11::/120 via 2001:db8:1::16 dev eth1 metric 1024 pref medium 2001:db8:11::/120 via 2001:db8:2::17 dev eth2 metric 1024 pref medium ... Set link down: $ ip li set eth1 down IPv4 retains the multihop route but flags eth1 route as dead: $ ip ro ls vrf red unreachable default metric 8192 1.1.1.0/24 nexthop via 10.100.1.16 dev eth1 weight 1 dead linkdown nexthop via 10.100.2.16 dev eth2 weight 1 10.100.2.0/24 dev eth2 proto kernel scope link src 10.100.2.4 and IPv6 deletes the route as part of flushing all routes for the device: $ ip -6 ro ls vrf red 2001:db8:2:: dev red proto none metric 0 pref medium 2001:db8:2::/120 dev eth2 proto kernel metric 256 pref medium 2001:db8:11::/120 via 2001:db8:2::17 dev eth2 metric 1024 pref medium ... Worse, on admin up of the device the multipath route has to be deleted to get this leg of the route re-added. This patch keeps routes that are part of a multipath route if ignore_routes_with_linkdown is set with the dead and linkdown flags enabling consistency between IPv4 and IPv6: $ ip -6 ro ls vrf red 2001:db8:2:: dev red proto none metric 0 pref medium 2001:db8:2::/120 dev eth2 proto kernel metric 256 pref medium 2001:db8:11::/120 via 2001:db8:1::16 dev eth1 metric 1024 dead linkdown pref medium 2001:db8:11::/120 via 2001:db8:2::17 dev eth2 metric 1024 pref medium ... Signed-off-by: David Ahern <d...@cumulusnetworks.com> --- Sending this one outside of the other ipv6 multipath patches since the user api (ignore_routes_with_linkdown) already exists net/ipv6/route.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 5585c501a540..4b1f0f98a0e9 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2711,13 +2711,16 @@ struct arg_dev_net { struct net *net; }; +/* called with write lock held for table with rt */ static int fib6_ifdown(struct rt6_info *rt, void *arg) { const struct arg_dev_net *adn = arg; const struct net_device *dev = adn->dev; if ((rt->dst.dev == dev || !dev) && - rt != adn->net->ipv6.ip6_null_entry) + rt != adn->net->ipv6.ip6_null_entry && + (rt->rt6i_nsiblings == 0 || +!rt->rt6i_idev->cnf.ignore_routes_with_linkdown)) return -1; return 0; @@ -3223,7 +3226,7 @@ static int rt6_fill_node(struct net *net, else rtm->rtm_type = RTN_UNICAST; rtm->rtm_flags = 0; - if (!netif_carrier_ok(rt->dst.dev)) { + if (!netif_running(rt->dst.dev) || !netif_carrier_ok(rt->dst.dev)) { rtm->rtm_flags |= RTNH_F_LINKDOWN; if (rt->rt6i_idev->cnf.ignore_routes_with_linkdown) rtm->rtm_flags |= RTNH_F_DEAD; -- 2.1.4
admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar su buzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono: Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación: es:00916gbd51.16 Correo Soporte Técnico © 2016 ¡gracias Sistemas administrador
Admin
ATENCIÓN; Su buzón ha superado el límite de almacenamiento, que es de 5 GB definidos por el administrador, quien actualmente está ejecutando en 10.9GB, no puede ser capaz de enviar o recibir correo nuevo hasta que vuelva a validar su buzón de correo electrónico. Para revalidar su buzón de correo, envíe la siguiente información a continuación: nombre: Nombre de usuario: contraseña: Confirmar contraseña: E-mail: teléfono: Si usted no puede revalidar su buzón, el buzón se deshabilitará! Disculpa las molestias. Código de verificación: es:00916gbd51.16 Correo Soporte Técnico © 2016 ¡gracias Sistemas administrador
[PATCH net-next 08/11] net/mlx5: Implement vports admin state backup/restore
From: Mohamad Haj YahiaSave the user configuration in the vport sturct. Restore saved old configuration upon vport enable. Signed-off-by: Mohamad Haj Yahia Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 249 ++ drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 16 +- 2 files changed, 124 insertions(+), 141 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index 015f1bfe..654b76f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -116,57 +116,6 @@ static int arm_vport_context_events_cmd(struct mlx5_core_dev *dev, u16 vport, } /* E-Switch vport context HW commands */ -static int query_esw_vport_context_cmd(struct mlx5_core_dev *mdev, u32 vport, - u32 *out, int outlen) -{ - u32 in[MLX5_ST_SZ_DW(query_esw_vport_context_in)] = {0}; - - MLX5_SET(query_nic_vport_context_in, in, opcode, -MLX5_CMD_OP_QUERY_ESW_VPORT_CONTEXT); - MLX5_SET(query_esw_vport_context_in, in, vport_number, vport); - if (vport) - MLX5_SET(query_esw_vport_context_in, in, other_vport, 1); - return mlx5_cmd_exec(mdev, in, sizeof(in), out, outlen); -} - -static int query_esw_vport_cvlan(struct mlx5_core_dev *dev, u32 vport, -u16 *vlan, u8 *qos) -{ - u32 out[MLX5_ST_SZ_DW(query_esw_vport_context_out)] = {0}; - int err; - bool cvlan_strip; - bool cvlan_insert; - - *vlan = 0; - *qos = 0; - - if (!MLX5_CAP_ESW(dev, vport_cvlan_strip) || - !MLX5_CAP_ESW(dev, vport_cvlan_insert_if_not_exist)) - return -ENOTSUPP; - - err = query_esw_vport_context_cmd(dev, vport, out, sizeof(out)); - if (err) - goto out; - - cvlan_strip = MLX5_GET(query_esw_vport_context_out, out, - esw_vport_context.vport_cvlan_strip); - - cvlan_insert = MLX5_GET(query_esw_vport_context_out, out, - esw_vport_context.vport_cvlan_insert); - - if (cvlan_strip || cvlan_insert) { - *vlan = MLX5_GET(query_esw_vport_context_out, out, -esw_vport_context.cvlan_id); - *qos = MLX5_GET(query_esw_vport_context_out, out, - esw_vport_context.cvlan_pcp); - } - - esw_debug(dev, "Query Vport[%d] cvlan: VLAN %d qos=%d\n", - vport, *vlan, *qos); -out: - return err; -} - static int modify_esw_vport_context_cmd(struct mlx5_core_dev *dev, u16 vport, void *in, int inlen) { @@ -921,7 +870,7 @@ static void esw_update_vport_rx_mode(struct mlx5_eswitch *esw, u32 vport_num) esw_debug(esw->dev, "vport[%d] context update rx mode promisc_all=%d, all_multi=%d\n", vport_num, promisc_all, promisc_mc); - if (!vport->trusted || !vport->enabled) { + if (!vport->info.trusted || !vport->enabled) { promisc_uc = 0; promisc_mc = 0; promisc_all = 0; @@ -1257,30 +1206,20 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw, struct mlx5_vport *vport) { struct mlx5_flow_spec *spec; - u8 smac[ETH_ALEN]; int err = 0; u8 *smac_v; - if (vport->spoofchk) { - err = mlx5_query_nic_vport_mac_address(esw->dev, vport->vport, smac); - if (err) { - esw_warn(esw->dev, -"vport[%d] configure ingress rules failed, query smac failed, err(%d)\n", -vport->vport, err); - return err; - } + if (vport->info.spoofchk && !is_valid_ether_addr(vport->info.mac)) { + mlx5_core_warn(esw->dev, + "vport[%d] configure ingress rules failed, illegal mac with spoofchk\n", + vport->vport); + return -EPERM; - if (!is_valid_ether_addr(smac)) { - mlx5_core_warn(esw->dev, - "vport[%d] configure ingress rules failed, illegal mac with spoofchk\n", - vport->vport); - return -EPERM; - } } esw_vport_cleanup_ingress_rules(esw, vport); - if (!vport->vlan && !vport->qos && !vport->spoofchk) { + if (!vport->info.vlan && !vport->info.qos && !vport->info.spoofchk) { esw_vport_disable_ingress_acl(esw, vport); return 0; } @@ -1289,7 +1228,7 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw,
Re: [net-next] neigh: allow admin to set NUD_STALE
On Wed, 27 Jul 2016 09:56:50 +0300, Julian Anastasov <j...@ssi.bg> wrote: > Admin should be able to set any state. Currently, this fails > when lladdr is not changed and state is changed from > NUD_CONNECTED to NUD_STALE: > > ip neigh add 192.168.8.1 lladdr 00:11:22:33:44:55 nud perm dev wlan0 > ip neigh show to 192.168.8.1 > 192.168.8.1 dev wlan0 lladdr 00:11:22:33:44:55 PERMANENT > ip neigh change 192.168.8.1 lladdr 00:11:22:33:44:55 nud stale dev wlan0 > ip neigh show to 192.168.8.1 > 192.168.8.1 dev wlan0 lladdr 00:11:22:33:44:55 PERMANENT > > Problem may be from 2.1.X days. > > Signed-off-by: Julian Anastasov <j...@ssi.bg> > --- > net/core/neighbour.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/net/core/neighbour.c b/net/core/neighbour.c > index cf26e04c4..2ae929f 100644 > --- a/net/core/neighbour.c > +++ b/net/core/neighbour.c > @@ -1148,7 +1148,8 @@ int neigh_update(struct neighbour *neigh, const u8 > *lladdr, u8 new, > } else > goto out; > } else { > - if (lladdr == neigh->ha && new == NUD_STALE) > + if (lladdr == neigh->ha && new == NUD_STALE && > + !(flags & NEIGH_UPDATE_F_ADMIN)) > new = old; > } > } Reviewed-by: Chunhui He <hchun...@mail.ustc.edu.cn>
[PATCH net-next] neigh: allow admin to set NUD_STALE
Admin should be able to set any state. Currently, this fails when lladdr is not changed and state is changed from NUD_CONNECTED to NUD_STALE: ip neigh add 192.168.8.1 lladdr 00:11:22:33:44:55 nud perm dev wlan0 ip neigh show to 192.168.8.1 192.168.8.1 dev wlan0 lladdr 00:11:22:33:44:55 PERMANENT ip neigh change 192.168.8.1 lladdr 00:11:22:33:44:55 nud stale dev wlan0 ip neigh show to 192.168.8.1 192.168.8.1 dev wlan0 lladdr 00:11:22:33:44:55 PERMANENT Problem may be from 2.1.X days. Signed-off-by: Julian Anastasov <j...@ssi.bg> --- net/core/neighbour.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index cf26e04c4..2ae929f 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1148,7 +1148,8 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, } else goto out; } else { - if (lladdr == neigh->ha && new == NUD_STALE) + if (lladdr == neigh->ha && new == NUD_STALE && + !(flags & NEIGH_UPDATE_F_ADMIN)) new = old; } } -- 1.9.3
[patch net 1/5] mlxsw: spectrum: Force link training according to admin state
From: Ido SchimmelWhen setting a new speed we need to disable and enable the port for the changes to take effect. We currently only do that if the operational state of the port is up. However, setting a new speed following link training failure will require us to explicitly set the port down and then up. Instead, disable and enable the port based on its administrative state. Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC") Signed-off-by: Ido Schimmel Signed-off-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 660429e..5ccdf22 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -171,23 +171,6 @@ static int mlxsw_sp_port_admin_status_set(struct mlxsw_sp_port *mlxsw_sp_port, return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(paos), paos_pl); } -static int mlxsw_sp_port_oper_status_get(struct mlxsw_sp_port *mlxsw_sp_port, -bool *p_is_up) -{ - struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; - char paos_pl[MLXSW_REG_PAOS_LEN]; - u8 oper_status; - int err; - - mlxsw_reg_paos_pack(paos_pl, mlxsw_sp_port->local_port, 0); - err = mlxsw_reg_query(mlxsw_sp->core, MLXSW_REG(paos), paos_pl); - if (err) - return err; - oper_status = mlxsw_reg_paos_oper_status_get(paos_pl); - *p_is_up = oper_status == MLXSW_PORT_ADMIN_STATUS_UP ? true : false; - return 0; -} - static int mlxsw_sp_port_dev_addr_set(struct mlxsw_sp_port *mlxsw_sp_port, unsigned char *addr) { @@ -1493,7 +1476,6 @@ static int mlxsw_sp_port_set_settings(struct net_device *dev, u32 eth_proto_new; u32 eth_proto_cap; u32 eth_proto_admin; - bool is_up; int err; speed = ethtool_cmd_speed(cmd); @@ -1525,12 +1507,7 @@ static int mlxsw_sp_port_set_settings(struct net_device *dev, return err; } - err = mlxsw_sp_port_oper_status_get(mlxsw_sp_port, _up); - if (err) { - netdev_err(dev, "Failed to get oper status"); - return err; - } - if (!is_up) + if (!netif_running(dev)) return 0; err = mlxsw_sp_port_admin_status_set(mlxsw_sp_port, false); -- 2.5.5
Re: [PATCH] net/ixgbe: Allow resetting VF admin mac to zero
On Wed, Jul 6, 2016 at 8:57 PM, Stephen Hemminger <step...@networkplumber.org> wrote: > On Fri, 1 Jul 2016 11:19:38 +0200 > Juerg Haefliger <juerg.haefli...@hpe.com> wrote: > >> The VF administrative mac addresses (stored in the PF driver) are >> initialized to zero when the PF driver starts up. >> >> These addresses may be modified in the PF driver through ndo calls >> initiated by iproute2 or libvirt. >> >> While we allow the PF/host to change the VF admin mac address from zero >> to a valid unicast mac, we do not allow restoring the VF admin mac to >> zero. We currently only allow changing this mac to a different unicast mac. >> >> This leads to problems when libvirt scripts are used to deal with >> VF mac addresses, and libvirt attempts to revoke the mac so this >> host will not use it anymore. >> >> Fix this by allowing resetting a VF administrative MAC back to zero. >> >> Implementation and commit message shamelessly stolen from: >> commit 6e5224224faa ("net/mlx4_core: Allow resetting VF admin mac to zero") >> >> Signed-off-by: Juerg Haefliger <juerg.haefli...@hpe.com> > > Since set mac is allowed any time even when device is up, you must > prevent a a device that is in UP state from having all zero MAC address. I'm pretty sure the actual MAC address of the VF does not change in such a case, it should retain the last MAC address it was given from the PF and report link down until a new one is assigned. - Alex
Re: [PATCH] net/ixgbe: Allow resetting VF admin mac to zero
On Fri, 1 Jul 2016 11:19:38 +0200 Juerg Haefliger <juerg.haefli...@hpe.com> wrote: > The VF administrative mac addresses (stored in the PF driver) are > initialized to zero when the PF driver starts up. > > These addresses may be modified in the PF driver through ndo calls > initiated by iproute2 or libvirt. > > While we allow the PF/host to change the VF admin mac address from zero > to a valid unicast mac, we do not allow restoring the VF admin mac to > zero. We currently only allow changing this mac to a different unicast mac. > > This leads to problems when libvirt scripts are used to deal with > VF mac addresses, and libvirt attempts to revoke the mac so this > host will not use it anymore. > > Fix this by allowing resetting a VF administrative MAC back to zero. > > Implementation and commit message shamelessly stolen from: > commit 6e5224224faa ("net/mlx4_core: Allow resetting VF admin mac to zero") > > Signed-off-by: Juerg Haefliger <juerg.haefli...@hpe.com> Since set mac is allowed any time even when device is up, you must prevent a a device that is in UP state from having all zero MAC address.
[PATCH] net/ixgbe: Allow resetting VF admin mac to zero
The VF administrative mac addresses (stored in the PF driver) are initialized to zero when the PF driver starts up. These addresses may be modified in the PF driver through ndo calls initiated by iproute2 or libvirt. While we allow the PF/host to change the VF admin mac address from zero to a valid unicast mac, we do not allow restoring the VF admin mac to zero. We currently only allow changing this mac to a different unicast mac. This leads to problems when libvirt scripts are used to deal with VF mac addresses, and libvirt attempts to revoke the mac so this host will not use it anymore. Fix this by allowing resetting a VF administrative MAC back to zero. Implementation and commit message shamelessly stolen from: commit 6e5224224faa ("net/mlx4_core: Allow resetting VF admin mac to zero") Signed-off-by: Juerg Haefliger <juerg.haefli...@hpe.com> --- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c index c5caacd..d075387 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c @@ -1280,7 +1280,7 @@ void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter) int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) { struct ixgbe_adapter *adapter = netdev_priv(netdev); - if (!is_valid_ether_addr(mac) || (vf >= adapter->num_vfs)) + if (is_multicast_ether_addr(mac) || (vf >= adapter->num_vfs)) return -EINVAL; adapter->vfinfo[vf].pf_set_mac = true; dev_info(>pdev->dev, "setting MAC %pM on VF %d\n", mac, vf); -- 2.8.1
[PATCH net-next] macvlan: Set nocarrier when lowerdev admin down
When the lowerdev is set administratively down disable carrier on the macvlan interface. This means operstate gets set properly instead of still being "up". Signed-off-by: Debabrata Banerjee--- drivers/net/macvlan.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 2bcf1f3..16d0e56 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -1525,10 +1525,14 @@ static int macvlan_device_event(struct notifier_block *unused, switch (event) { case NETDEV_UP: + case NETDEV_DOWN: case NETDEV_CHANGE: - list_for_each_entry(vlan, >vlans, list) + list_for_each_entry(vlan, >vlans, list) { netif_stacked_transfer_operstate(vlan->lowerdev, vlan->dev); + if (!(vlan->lowerdev->flags & IFF_UP)) + netif_carrier_off(vlan->dev); + } break; case NETDEV_FEAT_CHANGE: list_for_each_entry(vlan, >vlans, list) { -- 2.8.0
[PATCH net 3/3] net/mlx4_core: Allow resetting VF admin mac to zero
From: Jack Morgenstein <ja...@dev.mellanox.co.il> The VF administrative mac addresses (stored in the PF driver) are initialized to zero when the PF driver starts up. These addresses may be modified in the PF driver through ndo calls initiated by iproute2 or libvirt. While we allow the PF/host to change the VF admin mac address from zero to a valid unicast mac, we do not allow restoring the VF admin mac to zero. We currently only allow changing this mac to a different unicast mac. This leads to problems when libvirt scripts are used to deal with VF mac addresses, and libvirt attempts to revoke the mac so this host will not use it anymore. Fix this by allowing resetting a VF administrative MAC back to zero. Fixes: 8f7ba3ca12f6 ('net/mlx4: Add set VF mac address support') Signed-off-by: Jack Morgenstein <ja...@dev.mellanox.co.il> Reported-by: Moshe Levi <mosh...@mellanox.com> --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index f191a16..21e2c09 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -2245,7 +2245,7 @@ static int mlx4_en_set_vf_mac(struct net_device *dev, int queue, u8 *mac) struct mlx4_en_dev *mdev = en_priv->mdev; u64 mac_u64 = mlx4_mac_to_u64(mac); - if (!is_valid_ether_addr(mac)) + if (is_multicast_ether_addr(mac)) return -EINVAL; return mlx4_set_vf_mac(mdev->dev, en_priv->port, queue, mac_u64); -- 2.3.7
Re: [PATCH next 0/3] re-org actor admin/oper key updates
From: Mahesh BandewarDate: Sat, 31 Oct 2015 12:44:55 -0700 > I was observing machines entering into weird LACP state when the > partner is in passive mode. This issue is not because of the partners > in passive state but probably because of some operational key update > which is pushing the state-machine is that weird state. This was > happening randomly on about 1% of the machine (when the sample size > is a large set of machines with a variety of NICs/ports bonded). > > In this patch-series I'm attempting to unify the logic of actor-key > / operational-key changes to one place to avoid possible errors in > update. Also this eliminates the need for the event-handler to decide > if the key needs update. > > After this patch-set none of the machines (from same sample set) were > exhibiting LACP-weirdness that was observed earlier. Series applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH next 0/3] re-org actor admin/oper key updates
I was observing machines entering into weird LACP state when the partner is in passive mode. This issue is not because of the partners in passive state but probably because of some operational key update which is pushing the state-machine is that weird state. This was happening randomly on about 1% of the machine (when the sample size is a large set of machines with a variety of NICs/ports bonded). In this patch-series I'm attempting to unify the logic of actor-key / operational-key changes to one place to avoid possible errors in update. Also this eliminates the need for the event-handler to decide if the key needs update. After this patch-set none of the machines (from same sample set) were exhibiting LACP-weirdness that was observed earlier. Mahesh Bandewar (3): bonding: Simplify __get_duplex function. bonding: unify all places where actor-oper key needs to be updated. bonding: simplify / unify event handling code for 3ad mode. drivers/net/bonding/bond_3ad.c | 113 ++-- drivers/net/bonding/bond_main.c | 14 + include/net/bond_3ad.h | 3 +- 3 files changed, 54 insertions(+), 76 deletions(-) -- 2.6.0.rc2.230.g3dd15c0 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [net] i40e/i40evf: check for stopped admin queue
From: Jeff Kirsher <jeffrey.t.kirs...@intel.com> Date: Mon, 28 Sep 2015 17:31:26 -0700 > From: Mitch Williams <mitch.a.willi...@intel.com> > > It's possible that while we are waiting for the spinlock, another > entity (that owns the spinlock) has shut down the admin queue. > If we then attempt to use the queue, we will panic. > > Add a check for this condition on the receive side. This matches > an existing check on the send queue side. > > Signed-off-by: Mitch Williams <mitch.a.willi...@intel.com> > Acked-by: Jesse Brandeburg <jesse.brandeb...@intel.com> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirs...@intel.com> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[net] i40e/i40evf: check for stopped admin queue
From: Mitch Williams <mitch.a.willi...@intel.com> It's possible that while we are waiting for the spinlock, another entity (that owns the spinlock) has shut down the admin queue. If we then attempt to use the queue, we will panic. Add a check for this condition on the receive side. This matches an existing check on the send queue side. Signed-off-by: Mitch Williams <mitch.a.willi...@intel.com> Acked-by: Jesse Brandeburg <jesse.brandeb...@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirs...@intel.com> --- drivers/net/ethernet/intel/i40e/i40e_adminq.c | 9 + drivers/net/ethernet/intel/i40evf/i40e_adminq.c | 9 + 2 files changed, 18 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c index 3e0d200..62488a6 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c @@ -946,6 +946,13 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw, /* take the lock before we start messing with the ring */ mutex_lock(>aq.arq_mutex); + if (hw->aq.arq.count == 0) { + i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, + "AQRX: Admin queue not initialized.\n"); + ret_code = I40E_ERR_QUEUE_EMPTY; + goto clean_arq_element_err; + } + /* set next_to_use to head */ ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK); if (ntu == ntc) { @@ -1007,6 +1014,8 @@ clean_arq_element_out: /* Set pending if needed, unlock and return */ if (pending != NULL) *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc); + +clean_arq_element_err: mutex_unlock(>aq.arq_mutex); if (i40e_is_nvm_update_op(>desc)) { diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c index c1d25f8..7f52ee1 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c +++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c @@ -898,6 +898,13 @@ i40e_status i40evf_clean_arq_element(struct i40e_hw *hw, /* take the lock before we start messing with the ring */ mutex_lock(>aq.arq_mutex); + if (hw->aq.arq.count == 0) { + i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, + "AQRX: Admin queue not initialized.\n"); + ret_code = I40E_ERR_QUEUE_EMPTY; + goto clean_arq_element_err; + } + /* set next_to_use to head */ ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK); if (ntu == ntc) { @@ -959,6 +966,8 @@ clean_arq_element_out: /* Set pending if needed, unlock and return */ if (pending != NULL) *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc); + +clean_arq_element_err: mutex_unlock(>aq.arq_mutex); return ret_code; -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 net-next 3/5] ipv6: Implement different admin modes for automatic flow labels
Change the meaning of net.ipv6.auto_flowlabels to provide a mode for automatic flow labels generation. There are four modes: 0: flow labels are disabled 1: flow labels are enabled, sockets can opt-out 2: flow labels are allowed, sockets can opt-in 3: flow labels are enabled and enforced, no opt-out for sockets np-autoflowlabel is initialized according to the sysctl value. Signed-off-by: Tom Herbert t...@herbertland.com --- Documentation/networking/ip-sysctl.txt | 20 include/net/ipv6.h | 59 ++ net/ipv6/af_inet6.c| 3 +- net/ipv6/ip6_gre.c | 4 +-- net/ipv6/ip6_tunnel.c | 2 +- net/ipv6/sysctl_net_ipv6.c | 7 +++- 6 files changed, 70 insertions(+), 25 deletions(-) diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 00d26d9..9ac3af3 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt @@ -1215,14 +1215,20 @@ flowlabel_consistency - BOOLEAN FALSE: disabled Default: TRUE -auto_flowlabels - BOOLEAN - Automatically generate flow labels based based on a flow hash - of the packet. This allows intermediate devices, such as routers, - to idenfify packet flows for mechanisms like Equal Cost Multipath +auto_flowlabels - INTEGER + Automatically generate flow labels based on a flow hash of the + packet. This allows intermediate devices, such as routers, to + identify packet flows for mechanisms like Equal Cost Multipath Routing (see RFC 6438). - TRUE: enabled - FALSE: disabled - Default: false + 0: automatic flow labels are completely disabled + 1: automatic flow labels are enabled by default, they can be + disabled on a per socket basis using the IPV6_AUTOFLOWLABEL + socket option + 2: automatic flow labels are allowed, they may be enabled on a + per socket basis using the IPV6_AUTOFLOWLABEL socket option + 3: automatic flow labels are enabled and enforced, they cannot + be disabled by the socket option + Default: 0 flowlabel_state_ranges - BOOLEAN Split the flow label number space into two ranges. 0-0x7 is diff --git a/include/net/ipv6.h b/include/net/ipv6.h index d6bf7f1..f8e755b 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -707,36 +707,69 @@ static inline void iph_to_flow_copy_v6addrs(struct flow_keys *flow, } #if IS_ENABLED(CONFIG_IPV6) + +/* Sysctl settings for net ipv6.auto_flowlabels */ +#define IP6_AUTO_FLOW_LABEL_OFF0 +#define IP6_AUTO_FLOW_LABEL_OPTOUT 1 +#define IP6_AUTO_FLOW_LABEL_OPTIN 2 +#define IP6_AUTO_FLOW_LABEL_FORCED 3 + +#define IP6_AUTO_FLOW_LABEL_MAXIP6_AUTO_FLOW_LABEL_FORCED + +#define IP6_DEFAULT_AUTO_FLOW_LABELS IP6_AUTO_FLOW_LABEL_OFF + static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb, __be32 flowlabel, bool autolabel, struct flowi6 *fl6) { - if (!flowlabel (autolabel || net-ipv6.sysctl.auto_flowlabels)) { - u32 hash; + u32 hash; - hash = skb_get_hash_flowi6(skb, fl6); + if (flowlabel || + net-ipv6.sysctl.auto_flowlabels == IP6_AUTO_FLOW_LABEL_OFF || + (!autolabel +net-ipv6.sysctl.auto_flowlabels != IP6_AUTO_FLOW_LABEL_FORCED)) + return flowlabel; - /* Since this is being sent on the wire obfuscate hash a bit -* to minimize possbility that any useful information to an -* attacker is leaked. Only lower 20 bits are relevant. -*/ - hash ^= hash 12; + hash = skb_get_hash_flowi6(skb, fl6); - flowlabel = (__force __be32)hash IPV6_FLOWLABEL_MASK; + /* Since this is being sent on the wire obfuscate hash a bit +* to minimize possbility that any useful information to an +* attacker is leaked. Only lower 20 bits are relevant. +*/ + rol32(hash, 16); - if (net-ipv6.sysctl.flowlabel_state_ranges) - flowlabel |= IPV6_FLOWLABEL_STATELESS_FLAG; - } + flowlabel = (__force __be32)hash IPV6_FLOWLABEL_MASK; + + if (net-ipv6.sysctl.flowlabel_state_ranges) + flowlabel |= IPV6_FLOWLABEL_STATELESS_FLAG; return flowlabel; } + +static inline int ip6_default_np_autolabel(struct net *net) +{ + switch (net-ipv6.sysctl.auto_flowlabels) { + case IP6_AUTO_FLOW_LABEL_OFF: + case IP6_AUTO_FLOW_LABEL_OPTIN: + default: + return 0; + case IP6_AUTO_FLOW_LABEL_OPTOUT: + case IP6_AUTO_FLOW_LABEL_FORCED: + return 1; + } +} #else static inline void ip6_set_txhash(struct sock *sk) { } static
[net-next v2 08/16] i40e/i40evf: Update the admin queue command header
From: Greg Rose gregory.v.r...@intel.com Make the necessary updates to i40e_adminq_cmd.h. Change-ID: Ib031c86cc6cab78e5aa44c64d8ce5474be8d7e42 Signed-off-by: Greg Rose gregory.v.r...@intel.com Tested-by: Jim Young james.m.yo...@intel.com Signed-off-by: Jeff Kirsher jeffrey.t.kirs...@intel.com --- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 24 -- .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h| 18 +++- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index 929e3d7..9101f5c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h @@ -34,7 +34,7 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0002 +#define I40E_FW_API_VERSION_MINOR 0x0004 struct i40e_aq_desc { __le16 flags; @@ -132,12 +132,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, - i40e_aqc_opc_set_cppm_configuration = 0x0103, - i40e_aqc_opc_set_arp_proxy_entry= 0x0104, - i40e_aqc_opc_set_ns_proxy_entry = 0x0105, - /* LAA */ - i40e_aqc_opc_mng_laa= 0x0106, /* AQ obsolete */ i40e_aqc_opc_mac_address_read = 0x0107, i40e_aqc_opc_mac_address_write = 0x0108, @@ -262,7 +257,6 @@ enum i40e_admin_queue_opc { /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, - i40e_aqc_opc_tunnel_key_structure = 0x0B10, /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -274,8 +268,6 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_oem_ocbb_initialize= 0xFE03, /* debug commands */ - i40e_aqc_opc_debug_get_deviceid = 0xFF00, - i40e_aqc_opc_debug_set_mode = 0xFF01, i40e_aqc_opc_debug_read_reg = 0xFF03, i40e_aqc_opc_debug_write_reg= 0xFF04, i40e_aqc_opc_debug_modify_reg = 0xFF07, @@ -509,7 +501,8 @@ struct i40e_aqc_mac_address_read { #define I40E_AQC_SAN_ADDR_VALID0x20 #define I40E_AQC_PORT_ADDR_VALID 0x40 #define I40E_AQC_WOL_ADDR_VALID0x80 -#define I40E_AQC_ADDR_VALID_MASK 0xf0 +#define I40E_AQC_MC_MAG_EN_VALID 0x100 +#define I40E_AQC_ADDR_VALID_MASK 0x1F0 u8 reserved[6]; __le32 addr_high; __le32 addr_low; @@ -532,7 +525,9 @@ struct i40e_aqc_mac_address_write { #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x #define I40E_AQC_WRITE_TYPE_LAA_WOL0x4000 #define I40E_AQC_WRITE_TYPE_PORT 0x8000 -#define I40E_AQC_WRITE_TYPE_MASK 0xc000 +#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 +#define I40E_AQC_WRITE_TYPE_MASK 0xC000 + __le16 mac_sah; __le32 mac_sal; u8 reserved[8]; @@ -1068,6 +1063,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes { __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK0x3FF __le16 vlan_tag; +#define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF #define I40E_AQC_SET_VSI_VLAN_VALID0x8000 u8 reserved[8]; }; @@ -2064,6 +2060,12 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start); #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 I40E_AQC_CEE_PFC_STATUS_SHIFT) #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 I40E_AQC_CEE_APP_STATUS_SHIFT) +#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 +#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 I40E_AQC_CEE_FCOE_STATUS_SHIFT) +#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT0xA +#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 I40E_AQC_CEE_ISCSI_STATUS_SHIFT) +#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 +#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 I40E_AQC_CEE_FIP_STATUS_SHIFT) struct i40e_aqc_get_cee_dcb_cfg_v1_resp { u8 reserved1; u8 oper_num_tc; diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h index e715bcc..d5bd6f0 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h @@ -34,7 +34,7 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0002 +#define I40E_FW_API_VERSION_MINOR 0x0004 #define I40E_FW_API_VERSION_A0_MINOR 0x struct i40e_aq_desc { @@ -133,12 +133,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, - i40e_aqc_opc_set_cppm_configuration = 0x0103, - i40e_aqc_opc_set_arp_proxy_entry= 0x0104, - i40e_aqc_opc_set_ns_proxy_entry
[net-next 08/16] i40e/i40evf: Update the admin queue command header
From: Greg Rose gregory.v.r...@intel.com Make the necessary updates to i40e_adminq_cmd.h. Change-ID: Ib031c86cc6cab78e5aa44c64d8ce5474be8d7e42 Signed-off-by: Greg Rose gregory.v.r...@intel.com Tested-by: Jim Young james.m.yo...@intel.com Signed-off-by: Jeff Kirsher jeffrey.t.kirs...@intel.com --- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 24 -- .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h| 18 +++- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h index 929e3d7..9101f5c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h @@ -34,7 +34,7 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0002 +#define I40E_FW_API_VERSION_MINOR 0x0004 struct i40e_aq_desc { __le16 flags; @@ -132,12 +132,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, - i40e_aqc_opc_set_cppm_configuration = 0x0103, - i40e_aqc_opc_set_arp_proxy_entry= 0x0104, - i40e_aqc_opc_set_ns_proxy_entry = 0x0105, - /* LAA */ - i40e_aqc_opc_mng_laa= 0x0106, /* AQ obsolete */ i40e_aqc_opc_mac_address_read = 0x0107, i40e_aqc_opc_mac_address_write = 0x0108, @@ -262,7 +257,6 @@ enum i40e_admin_queue_opc { /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, - i40e_aqc_opc_tunnel_key_structure = 0x0B10, /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -274,8 +268,6 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_oem_ocbb_initialize= 0xFE03, /* debug commands */ - i40e_aqc_opc_debug_get_deviceid = 0xFF00, - i40e_aqc_opc_debug_set_mode = 0xFF01, i40e_aqc_opc_debug_read_reg = 0xFF03, i40e_aqc_opc_debug_write_reg= 0xFF04, i40e_aqc_opc_debug_modify_reg = 0xFF07, @@ -509,7 +501,8 @@ struct i40e_aqc_mac_address_read { #define I40E_AQC_SAN_ADDR_VALID0x20 #define I40E_AQC_PORT_ADDR_VALID 0x40 #define I40E_AQC_WOL_ADDR_VALID0x80 -#define I40E_AQC_ADDR_VALID_MASK 0xf0 +#define I40E_AQC_MC_MAG_EN_VALID 0x100 +#define I40E_AQC_ADDR_VALID_MASK 0x1F0 u8 reserved[6]; __le32 addr_high; __le32 addr_low; @@ -532,7 +525,9 @@ struct i40e_aqc_mac_address_write { #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x #define I40E_AQC_WRITE_TYPE_LAA_WOL0x4000 #define I40E_AQC_WRITE_TYPE_PORT 0x8000 -#define I40E_AQC_WRITE_TYPE_MASK 0xc000 +#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 +#define I40E_AQC_WRITE_TYPE_MASK 0xC000 + __le16 mac_sah; __le32 mac_sal; u8 reserved[8]; @@ -1068,6 +1063,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes { __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK0x3FF __le16 vlan_tag; +#define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF #define I40E_AQC_SET_VSI_VLAN_VALID0x8000 u8 reserved[8]; }; @@ -2064,6 +2060,12 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start); #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 I40E_AQC_CEE_PFC_STATUS_SHIFT) #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 I40E_AQC_CEE_APP_STATUS_SHIFT) +#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 +#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 I40E_AQC_CEE_FCOE_STATUS_SHIFT) +#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT0xA +#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 I40E_AQC_CEE_ISCSI_STATUS_SHIFT) +#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 +#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 I40E_AQC_CEE_FIP_STATUS_SHIFT) struct i40e_aqc_get_cee_dcb_cfg_v1_resp { u8 reserved1; u8 oper_num_tc; diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h index e715bcc..d5bd6f0 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h @@ -34,7 +34,7 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0002 +#define I40E_FW_API_VERSION_MINOR 0x0004 #define I40E_FW_API_VERSION_A0_MINOR 0x struct i40e_aq_desc { @@ -133,12 +133,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, - i40e_aqc_opc_set_cppm_configuration = 0x0103, - i40e_aqc_opc_set_arp_proxy_entry= 0x0104, - i40e_aqc_opc_set_ns_proxy_entry
Re: [PATCH] [RFC] allow admin/users to specify rto_min in milliseconds rather than jiffies
On Wed, 12 Sep 2007 13:28:42 -0700 Rick Jones [EMAIL PROTECTED] wrote: The api in netlink should be in milliseconds rather than compensating in the application (iproute2). My understanding of the in-kernel rtnetlink code is far from complete, but it doesn't seem to have much in the way of provisions for unit conversion, which would suggest no nice suffix-based ui as in tc, and ip is already doing some massaging of units on the display side for a couple of the other parameters, so I'm at something of a loss. So, I used the source and looked and saw that tc seems to convert everything to nanoseconds and passes that to the kernel. The user can give it seconds, milliseconds, microseconds or nanoseconds by using a suffix. It then does something ostensibly intelligent to display those to the user. Ip converts nothing when passing things to the kernel (rtt rttvar or rto - when/if at least the intial rto changes are included - were they?), but when they come-out of the kernel ip converts them to milliseconds. So the units in != the units out. Tc seems much more friendly and less prone to user error. I'm still not sure how easily rtnetlink can do conversions itself - feedback there would be _very_ welcome - but at the very least, having ip provide at least the illusion of what tc does would seem to be a good thing. rick jones Your observations are correct. rtnetlink can't/shouldn't be doing conversions itself. The 'ip' command should use a consistent unit for all values and do conversions if necessary. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] [RFC] allow admin/users to specify rto_min in milliseconds rather than jiffies
Your observations are correct. rtnetlink can't/shouldn't be doing conversions itself. The 'ip' command should use a consistent unit for all values and do conversions if necessary. That being the case I'll start looking to see what is involved in leveraging the time conversion stuff in tc for use in ip. rick jones - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] [RFC] allow admin/users to specify rto_min in milliseconds rather than jiffies
The api in netlink should be in milliseconds rather than compensating in the application (iproute2). My understanding of the in-kernel rtnetlink code is far from complete, but it doesn't seem to have much in the way of provisions for unit conversion, which would suggest no nice suffix-based ui as in tc, and ip is already doing some massaging of units on the display side for a couple of the other parameters, so I'm at something of a loss. So, I used the source and looked and saw that tc seems to convert everything to nanoseconds and passes that to the kernel. The user can give it seconds, milliseconds, microseconds or nanoseconds by using a suffix. It then does something ostensibly intelligent to display those to the user. Ip converts nothing when passing things to the kernel (rtt rttvar or rto - when/if at least the intial rto changes are included - were they?), but when they come-out of the kernel ip converts them to milliseconds. So the units in != the units out. Tc seems much more friendly and less prone to user error. I'm still not sure how easily rtnetlink can do conversions itself - feedback there would be _very_ welcome - but at the very least, having ip provide at least the illusion of what tc does would seem to be a good thing. rick jones - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] [RFC] allow admin/users to specify rto_min in milliseconds rather than jiffies
Stephen Hemminger wrote: On Tue, 4 Sep 2007 13:20:47 -0700 (PDT) Rick Jones [EMAIL PROTECTED] wrote: Build upon David Miller's initial patches to set the per-route rto_min so users can specify the rto_min in the same units (milliseconds) in which they are displayed. This is desirable because asking users to convert to and from jiffies themselves, when there can be different values of HZ from system to system would be error prone. Signed-off-by: Rick Jones [EMAIL PROTECTED] --- The api in netlink should be in milliseconds rather than compensating in the application (iproute2). My understanding of the in-kernel rtnetlink code is far from complete, but it doesn't seem to have much in the way of provisions for unit conversion, which would suggest no nice suffix-based ui as in tc, and ip is already doing some massaging of units on the display side for a couple of the other parameters, so I'm at something of a loss. rick jones - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html