Skip to content

Commit d5fbda6

Browse files
arjunvynipadathdavem330
authored andcommitted
cxgb4: Add support for FW_ETH_TX_PKT_VM_WR
The present TX workrequest(FW_ETH_TX_PKT_WR) cant be used for host->vf communication, since it doesn't loopback the outgoing packets to virtual interfaces on the same port. This can be done using FW_ETH_TX_PKT_VM_WR. This fix depends on ethtool_flags to determine what WR to use for TX path. Support for setting this flags by user is added in next commit. Based on the original work by : Casey Leedom <[email protected]> Signed-off-by: Casey Leedom <[email protected]> Signed-off-by: Arjun Vynipadath <[email protected]> Signed-off-by: Ganesh Goudar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b0e9a2f commit d5fbda6

File tree

3 files changed

+383
-4
lines changed

3 files changed

+383
-4
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,15 @@ enum {
522522
MAX_INGQ = MAX_ETH_QSETS + INGQ_EXTRAS,
523523
};
524524

525+
enum {
526+
PRIV_FLAG_PORT_TX_VM_BIT,
527+
};
528+
529+
#define PRIV_FLAG_PORT_TX_VM BIT(PRIV_FLAG_PORT_TX_VM_BIT)
530+
531+
#define PRIV_FLAGS_ADAP 0
532+
#define PRIV_FLAGS_PORT PRIV_FLAG_PORT_TX_VM
533+
525534
struct adapter;
526535
struct sge_rspq;
527536

@@ -558,6 +567,7 @@ struct port_info {
558567
struct hwtstamp_config tstamp_config;
559568
bool ptp_enable;
560569
struct sched_table *sched_tbl;
570+
u32 eth_flags;
561571
};
562572

563573
struct dentry;
@@ -868,6 +878,7 @@ struct adapter {
868878
unsigned int flags;
869879
unsigned int adap_idx;
870880
enum chip_type chip;
881+
u32 eth_flags;
871882

872883
int msg_enable;
873884
__be16 vxlan_port;
@@ -1335,7 +1346,7 @@ void t4_os_link_changed(struct adapter *adap, int port_id, int link_stat);
13351346
void t4_free_sge_resources(struct adapter *adap);
13361347
void t4_free_ofld_rxqs(struct adapter *adap, int n, struct sge_ofld_rxq *q);
13371348
irq_handler_t t4_intr_handler(struct adapter *adap);
1338-
netdev_tx_t t4_eth_xmit(struct sk_buff *skb, struct net_device *dev);
1349+
netdev_tx_t t4_start_xmit(struct sk_buff *skb, struct net_device *dev);
13391350
int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
13401351
const struct pkt_gl *gl);
13411352
int t4_mgmt_tx(struct adapter *adap, struct sk_buff *skb);

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3217,7 +3217,7 @@ static netdev_features_t cxgb_fix_features(struct net_device *dev,
32173217
static const struct net_device_ops cxgb4_netdev_ops = {
32183218
.ndo_open = cxgb_open,
32193219
.ndo_stop = cxgb_close,
3220-
.ndo_start_xmit = t4_eth_xmit,
3220+
.ndo_start_xmit = t4_start_xmit,
32213221
.ndo_select_queue = cxgb_select_queue,
32223222
.ndo_get_stats64 = cxgb_get_stats,
32233223
.ndo_set_rx_mode = cxgb_set_rxmode,

0 commit comments

Comments
 (0)