qed: Add ll2 option for dropping a tx packet
authorMichal Kalderon <Michal.Kalderon@cavium.com>
Mon, 9 Oct 2017 09:37:45 +0000 (12:37 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Oct 2017 17:21:26 +0000 (10:21 -0700)
The option of sending a packet on the ll2 and dropping it exists in
hardware and was not used until now, thus not exposed.
The iWARP unaligned MPA flow requires this functionality for
flushing the tx queue.

Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_ll2.c
include/linux/qed/qed_ll2_if.h

index 3c695da890dfd6488e9eb77a1c0798548a21f4de..ad67d36956e848dc0baa70037ae71bccadbcfdc6 100644 (file)
@@ -1597,8 +1597,20 @@ qed_ll2_prepare_tx_packet_set_bd(struct qed_hwfn *p_hwfn,
        roce_flavor = (pkt->qed_roce_flavor == QED_LL2_ROCE) ? CORE_ROCE
                                                             : CORE_RROCE;
 
-       tx_dest = (pkt->tx_dest == QED_LL2_TX_DEST_NW) ? CORE_TX_DEST_NW
-                                                      : CORE_TX_DEST_LB;
+       switch (pkt->tx_dest) {
+       case QED_LL2_TX_DEST_NW:
+               tx_dest = CORE_TX_DEST_NW;
+               break;
+       case QED_LL2_TX_DEST_LB:
+               tx_dest = CORE_TX_DEST_LB;
+               break;
+       case QED_LL2_TX_DEST_DROP:
+               tx_dest = CORE_TX_DEST_DROP;
+               break;
+       default:
+               tx_dest = CORE_TX_DEST_LB;
+               break;
+       }
 
        start_bd = (struct core_tx_bd *)qed_chain_produce(p_tx_chain);
        start_bd->nw_vlan_or_lb_echo = cpu_to_le16(pkt->vlan);
index d7cca590b743f726d8abb17ed4380c13716ac29f..95fdf02a3bbe43ea2d4e75d4d85ef9eabf011120 100644 (file)
@@ -64,6 +64,7 @@ enum qed_ll2_roce_flavor_type {
 enum qed_ll2_tx_dest {
        QED_LL2_TX_DEST_NW, /* Light L2 TX Destination to the Network */
        QED_LL2_TX_DEST_LB, /* Light L2 TX Destination to the Loopback */
+       QED_LL2_TX_DEST_DROP, /* Light L2 Drop the TX packet */
        QED_LL2_TX_DEST_MAX
 };