Skip to content

Commit b9d2956

Browse files
spikehdavem330
authored andcommitted
bnxt_en: stop packet flow during bnxt_queue_stop/start
The current implementation when resetting a queue while packets are flowing puts the queue into an inconsistent state. There needs to be some synchronisation with the FW. Add calls to bnxt_hwrm_vnic_update() to set the MRU for both the default and ntuple vnic during queue start/stop. When the MRU is set to 0, flow is stopped. Each Rx queue belongs to either the default or the ntuple vnic. With calling bnxt_hwrm_vnic_update() the calls to napi_enable() and napi_disable() must be removed for reset to work on a queue that has active traffic flowing e.g. iperf3. Co-developed-by: Somnath Kotur <[email protected]> Signed-off-by: Somnath Kotur <[email protected]> Signed-off-by: David Wei <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d41575f commit b9d2956

File tree

1 file changed

+18
-4
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+18
-4
lines changed

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15177,7 +15177,8 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
1517715177
struct bnxt *bp = netdev_priv(dev);
1517815178
struct bnxt_rx_ring_info *rxr, *clone;
1517915179
struct bnxt_cp_ring_info *cpr;
15180-
int rc;
15180+
struct bnxt_vnic_info *vnic;
15181+
int i, rc;
1518115182

1518215183
rxr = &bp->rx_ring[idx];
1518315184
clone = qmem;
@@ -15202,11 +15203,16 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
1520215203
if (bp->flags & BNXT_FLAG_AGG_RINGS)
1520315204
bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod);
1520415205

15205-
napi_enable(&rxr->bnapi->napi);
15206-
1520715206
cpr = &rxr->bnapi->cp_ring;
1520815207
cpr->sw_stats->rx.rx_resets++;
1520915208

15209+
for (i = 0; i <= BNXT_VNIC_NTUPLE; i++) {
15210+
vnic = &bp->vnic_info[i];
15211+
vnic->mru = bp->dev->mtu + ETH_HLEN + VLAN_HLEN;
15212+
bnxt_hwrm_vnic_update(bp, vnic,
15213+
VNIC_UPDATE_REQ_ENABLES_MRU_VALID);
15214+
}
15215+
1521015216
return 0;
1521115217

1521215218
err_free_hwrm_rx_ring:
@@ -15218,9 +15224,17 @@ static int bnxt_queue_stop(struct net_device *dev, void *qmem, int idx)
1521815224
{
1521915225
struct bnxt *bp = netdev_priv(dev);
1522015226
struct bnxt_rx_ring_info *rxr;
15227+
struct bnxt_vnic_info *vnic;
15228+
int i;
15229+
15230+
for (i = 0; i <= BNXT_VNIC_NTUPLE; i++) {
15231+
vnic = &bp->vnic_info[i];
15232+
vnic->mru = 0;
15233+
bnxt_hwrm_vnic_update(bp, vnic,
15234+
VNIC_UPDATE_REQ_ENABLES_MRU_VALID);
15235+
}
1522115236

1522215237
rxr = &bp->rx_ring[idx];
15223-
napi_disable(&rxr->bnapi->napi);
1522415238
bnxt_hwrm_rx_ring_free(bp, rxr, false);
1522515239
bnxt_hwrm_rx_agg_ring_free(bp, rxr, false);
1522615240
rxr->rx_next_cons = 0;

0 commit comments

Comments
 (0)