Skip to content

Commit 7df4ae9

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Implement DCBNL to support host-based DCBX.
Support only IEEE DCBX initially. Add IEEE DCBNL ops and functions to get and set the hardware DCBX parameters. The DCB code is conditional on Kconfig CONFIG_BNXT_DCB. Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 87c374d commit 7df4ae9

File tree

6 files changed

+557
-3
lines changed

6 files changed

+557
-3
lines changed

drivers/net/ethernet/broadcom/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,14 @@ config BNXT_SRIOV
203203
Virtualization support in the NetXtreme-C/E products. This
204204
allows for virtual function acceleration in virtual environments.
205205

206+
config BNXT_DCB
207+
bool "Data Center Bridging (DCB) Support"
208+
default n
209+
depends on BNXT && DCB
210+
---help---
211+
Say Y here if you want to use Data Center Bridging (DCB) in the
212+
driver.
213+
214+
If unsure, say N.
215+
206216
endif # NET_VENDOR_BROADCOM
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
obj-$(CONFIG_BNXT) += bnxt_en.o
22

3-
bnxt_en-y := bnxt.o bnxt_sriov.o bnxt_ethtool.o
3+
bnxt_en-y := bnxt.o bnxt_sriov.o bnxt_ethtool.o bnxt_dcb.o

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include "bnxt.h"
5555
#include "bnxt_sriov.h"
5656
#include "bnxt_ethtool.h"
57+
#include "bnxt_dcb.h"
5758

5859
#define BNXT_TX_TIMEOUT (5 * HZ)
5960

@@ -4997,7 +4998,7 @@ static void bnxt_enable_napi(struct bnxt *bp)
49974998
}
49984999
}
49995000

5000-
static void bnxt_tx_disable(struct bnxt *bp)
5001+
void bnxt_tx_disable(struct bnxt *bp)
50015002
{
50025003
int i;
50035004
struct bnxt_tx_ring_info *txr;
@@ -5015,7 +5016,7 @@ static void bnxt_tx_disable(struct bnxt *bp)
50155016
netif_carrier_off(bp->dev);
50165017
}
50175018

5018-
static void bnxt_tx_enable(struct bnxt *bp)
5019+
void bnxt_tx_enable(struct bnxt *bp)
50195020
{
50205021
int i;
50215022
struct bnxt_tx_ring_info *txr;
@@ -6686,6 +6687,7 @@ static void bnxt_remove_one(struct pci_dev *pdev)
66866687

66876688
bnxt_hwrm_func_drv_unrgtr(bp);
66886689
bnxt_free_hwrm_resources(bp);
6690+
bnxt_dcb_free(bp);
66896691
pci_iounmap(pdev, bp->bar2);
66906692
pci_iounmap(pdev, bp->bar1);
66916693
pci_iounmap(pdev, bp->bar0);
@@ -6913,6 +6915,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
69136915
dev->min_mtu = ETH_ZLEN;
69146916
dev->max_mtu = 9500;
69156917

6918+
bnxt_dcb_init(bp);
6919+
69166920
#ifdef CONFIG_BNXT_SRIOV
69176921
init_waitqueue_head(&bp->sriov_cfg_wait);
69186922
#endif

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,13 @@ struct bnxt {
10261026
struct bnxt_irq *irq_tbl;
10271027
u8 mac_addr[ETH_ALEN];
10281028

1029+
#ifdef CONFIG_BNXT_DCB
1030+
struct ieee_pfc *ieee_pfc;
1031+
struct ieee_ets *ieee_ets;
1032+
u8 dcbx_cap;
1033+
u8 default_pri;
1034+
#endif /* CONFIG_BNXT_DCB */
1035+
10291036
u32 msg_enable;
10301037

10311038
u32 hwrm_spec_code;
@@ -1221,6 +1228,8 @@ int hwrm_send_message(struct bnxt *, void *, u32, int);
12211228
int hwrm_send_message_silent(struct bnxt *, void *, u32, int);
12221229
int bnxt_hwrm_set_coal(struct bnxt *);
12231230
int bnxt_hwrm_func_qcaps(struct bnxt *);
1231+
void bnxt_tx_disable(struct bnxt *bp);
1232+
void bnxt_tx_enable(struct bnxt *bp);
12241233
int bnxt_hwrm_set_pause(struct bnxt *);
12251234
int bnxt_hwrm_set_link_setting(struct bnxt *, bool, bool);
12261235
int bnxt_hwrm_fw_set_time(struct bnxt *);

0 commit comments

Comments
 (0)