| 241 | } |
| 242 | |
| 243 | static inline void ring_fl_db(struct adapter *adap, struct sge_fl *q) |
| 244 | { |
| 245 | if (q->pend_cred >= 64) { |
| 246 | u32 val = adap->params.arch.sge_fl_db; |
| 247 | |
| 248 | if (is_t4(adap->params.chip)) |
| 249 | val |= V_PIDX(q->pend_cred / 8); |
| 250 | else |
| 251 | val |= V_PIDX_T5(q->pend_cred / 8); |
| 252 | |
| 253 | /* |
| 254 | * Make sure all memory writes to the Free List queue are |
| 255 | * committed before we tell the hardware about them. |
| 256 | */ |
| 257 | wmb(); |
| 258 | |
| 259 | /* |
| 260 | * If we don't have access to the new User Doorbell (T5+), use |
| 261 | * the old doorbell mechanism; otherwise use the new BAR2 |
| 262 | * mechanism. |
| 263 | */ |
| 264 | if (unlikely(!q->bar2_addr)) { |
| 265 | u32 reg = is_pf4(adap) ? MYPF_REG(A_SGE_PF_KDOORBELL) : |
| 266 | T4VF_SGE_BASE_ADDR + |
| 267 | A_SGE_VF_KDOORBELL; |
| 268 | |
| 269 | t4_write_reg_relaxed(adap, reg, |
| 270 | val | V_QID(q->cntxt_id)); |
| 271 | } else { |
| 272 | writel_relaxed(val | V_QID(q->bar2_qid), |
| 273 | (void *)((uintptr_t)q->bar2_addr + |
| 274 | SGE_UDB_KDOORBELL)); |
| 275 | |
| 276 | /* |
| 277 | * This Write memory Barrier will force the write to |
| 278 | * the User Doorbell area to be flushed. |
| 279 | */ |
| 280 | wmb(); |
| 281 | } |
| 282 | q->pend_cred &= 7; |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | static inline void set_rx_sw_desc(struct rx_sw_desc *sd, void *buf, |
| 287 | dma_addr_t mapping) |
no test coverage detected